Skip to content
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

Inconsistent image version usage when no docker.image setting #167

Open
1 of 3 tasks
tsibley opened this issue Apr 5, 2022 · 0 comments · Fixed by #168
Open
1 of 3 tasks

Inconsistent image version usage when no docker.image setting #167

tsibley opened this issue Apr 5, 2022 · 0 comments · Fixed by #168

Comments

@tsibley
Copy link
Member

tsibley commented Apr 5, 2022

This issue is mostly documenting and describing something I noticed in the process of writing #163. I think this issue will mostly be resolved as a consequence of other related work we want to do (primarily #166, if we implement the proposed solution there), but still wanted to describe it separately for future reference.

The default image used for the Docker and AWS Batch runners (e.g. when no --image option is given) is determined by:

DEFAULT_IMAGE = os.environ.get("NEXTSTRAIN_DOCKER_IMAGE") \
or config.get("docker", "image") \
or "nextstrain/base"

The environment variable override is mostly meant for automation and development contexts and can be ignored for the purposes of this issue as anyone setting it is doing so explicitly and can be assumed to know what they want. That leaves the docker.image config setting and the final fallback default of nextstrain/base.

The docker.image setting is only set and updated in normal usage when nextstrain update is run, where it tracks the latest nextstrain/base:build-* image. This leads to a consistent image used for both the local Docker and remote AWS Batch runtimes. If nextstrain update has never been run though—we don't include it in our installation instructions for example—then docker.image will be missing and the final fallback of nextstrain/base will be used. Docker will automatically download the most recent latest tag on first nextstrain build (or view) and then use that image version for all subsequent runs, which is ok. But running on AWS Batch will always track the most recent latest tag regardless of the snapshot of latest used by local Docker or previous Batch runs.

This inconsistency would be good to iron out:

  • If not present, then set docker.image to the latest build-* tag during nextstrain check-setup --set-default. This means in most cases the user will get a consistent image version across runtimes and some version reporting will be better (because it'll report a specific build-* tag instead of a snapshot of latest). The inconsistent behaviour still exists if --set-default is not used.
  • Ultimately make Docker and AWS Batch more consistent regardless of the docker.image setting by implementing the proposed solution to Pull before build if explicitly using :latest image? #166
  • Advise nextstrain update after installation? Or have check-setup download the image (i.e. built-in update)? Though this would make the command much slower and requires some additional work to not muddy the output. Maybe not necessary.

Good solutions may be related to/integrated with the other "first time setup" topic of picking a default runner (#164).

tsibley added a commit that referenced this issue Apr 5, 2022
…default

This is called when the runner is set as the default runner by
`nextstrain check-setup --set-default`.

Partially resolves <#167>.
@tsibley tsibley reopened this Apr 5, 2022
@victorlin victorlin moved this from New to In Progress in Nextstrain planning (archived) Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant