-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grab bag of bug fixes and improvements #419
Open
tsibley
wants to merge
13
commits into
master
Choose a base branch
from
trs/grab-bag
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4a4e500
dev: Goodbye, Mypy!
tsibley c97da1d
dev: Set NEXTSTRAIN_HOME to a controlled directory in tests
tsibley 42a9dd1
dev: Support for cram tests and example test file
tsibley 2fcb8b4
version: Emit prose name ("Nextstrain CLI") rather than package name …
tsibley 932e705
version: Add prominent indication if this is a standalone version (i.…
tsibley d7cd538
dev: Fix open_browser() tests to really, truly, actually not pop a br…
tsibley 146ce76
util: Disable colored() under NO_COLOR and when stdout is not a TTY
tsibley 4b29a98
errors: Describe intention of UserError in docstring
tsibley 74589d7
argparse: Emit blank lines between arguments in --help output
tsibley 9067893
authn: Correctly handle OpenID authorization endpoints with a query part
tsibley f8798ce
runner.{docker,singularity}: Use mount_point() in more places that ha…
tsibley 44df1d4
runner.aws_batch: Restore times on actually-extracted path…
tsibley b333842
runner.aws_batch: Support overlay volumes (e.g. --augur)
tsibley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[cram] | ||
shell = bash | ||
indent = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ | |
from ..argparse import add_extended_help_flags, AppendOverwriteDefault, SKIP_AUTO_DEFAULT_IN_HELP | ||
from ..debug import debug | ||
from ..errors import UsageError, UserError | ||
from ..runner import docker, singularity | ||
from ..util import byte_quantity, runner_name, warn | ||
from ..runner import docker, singularity, aws_batch | ||
from ..util import byte_quantity, runner_name, split_image_name, warn | ||
from ..volume import NamedVolume | ||
|
||
|
||
|
@@ -306,10 +306,31 @@ def assert_overlay_volumes_support(opts): | |
""" | ||
overlay_volumes = opts.volumes | ||
|
||
if overlay_volumes and opts.__runner__ not in {docker, singularity}: | ||
if not overlay_volumes: | ||
return | ||
|
||
if opts.__runner__ not in {docker, singularity, aws_batch}: | ||
raise UserError(f""" | ||
The {runner_name(opts.__runner__)} runtime does not support overlays (e.g. of {overlay_volumes[0].name}). | ||
Use the Docker or Singularity runtimes (via --docker or --singularity) if overlays are necessary. | ||
Use the Docker, Singularity, or AWS Batch runtimes (via --docker, | ||
--singularity, or --aws-batch) if overlays are necessary. | ||
""") | ||
|
||
if opts.__runner__ is aws_batch and not docker.image_supports(docker.IMAGE_FEATURE.aws_batch_overlays, opts.image): | ||
raise UserError(f""" | ||
The Nextstrain runtime image version in use | ||
|
||
{opts.image} | ||
|
||
is too old to support overlays (e.g. of {overlay_volumes[0].name}) with AWS Batch. | ||
|
||
If overlays are necessary, please update the runtime image to at | ||
least version | ||
|
||
{split_image_name(opts.image)[0]}:{docker.IMAGE_FEATURE.aws_batch_overlays.value} | ||
|
||
using `nextstrain update docker`. Alternatively, use the Docker or | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seeing Maybe include |
||
Singularity runtime (via --docker or --singularity) instead. | ||
""") | ||
|
||
|
||
|
@@ -395,7 +416,7 @@ def pathogen_volumes(directory: Path) -> Tuple[NamedVolume, NamedVolume]: | |
debug(f"Using {working_volume.src} as working ({working_volume.name}) volume") | ||
|
||
assert build_volume.src <= working_volume.src | ||
assert docker.mount_point(build_volume) <= docker.mount_point(working_volume) # type: ignore[attr-defined] # for mypy | ||
assert docker.mount_point(build_volume) <= docker.mount_point(working_volume) | ||
|
||
return build_volume, working_volume | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've wanted this! Awesome that it's happening
This'll be a nightmare to debug if it ever occurs. If I understand the code (I don't spend much time in this codebase) the behaviour of
--augur
is going to differ if it's run locally in docker (which swaps the entireaugur
out) vs aws-batch (which overlays any zipped up../augur
contents), right? Since--augur
is already special cased I think it'd be sensible to remove the (containers original)augur
directory if we see../augur
in the zip file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\o/
Your understanding is correct. I think "nightmare" is overstating it—a stack trace, for example, will implicate a file that shouldn't be there—but yes, it'd certainly be aggravating.
Note that
--augur
is just one example of these development overlays, although probably the most useful one. There's also--auspice
,--fauna
, and (ha)--sacra
. (I've personally used--augur
and--auspice
about evenly.)Additional handling of these overlays in the AWS Batch entrypoint is possible, like I noted, but I don't really want to spend more time on those bits now. The overlay options have other caveats that present tripping hazards too, e.g. for Augur, it's just source code that's overlaid, not dependencies; and for Auspice you need to make sure to build it locally first. So a bit of "here be dragons" isn't unprecedented, and these are (AFAIK) rarely-used options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if anything comes from this discussion we should at least remove
--sacra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a little background, it's very very rare I run a workflow using the release version of augur + the
master/main
repo branch, as that's what we have the automated stuff for in my eyes. Almost every time I'm running workflows it's because i've modified the workflow, or modified augur, or (surprisingly often) both. If we can getnextstrain run ...
working as I hope so I can farm out a job to AWS with my modified augur code & modified repo and then download the assets as a separate siloed working directory I'd save a whole lot of build time and my laptop would be happier. Is #407 at the point where this can be done / tested out?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good reminder that although I often focus on the expected/anticipated external users of
nextstrain run
, we have internal uses for it that have different focuses. Internally we care mainly about the workdir isolation and mechanics in combination with offloading the work to AWS Batch, not the pathogen source/version management.You can totally test out #407 for your purposes!
There is not currently a supported way to use
nextstrain setup
to make an "editable install" (to use Python/Pip's lingo) of a self-managed local pathogen repo. It's on the list, but I wasn't focusing on it at first. Sounds like it should be soon/next up. In the meantime, a workaround is to do something like this:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this'll always be a tension in the group - imaging a "happy path" for "most people" vs the way some of us run things. For this work I don't mind symlinking things.
P.S.
base32
not available on MacOS out of the box.