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

[AWS Batch] Support overriding the container image used #82

Merged
merged 3 commits into from
Jun 1, 2020

Conversation

tsibley
Copy link
Member

@tsibley tsibley commented May 22, 2020

Job definitions are dynamically created as needed based on the base
definition specified by --aws-batch-job. This is necessary to allow
runtime-configurable images since, unlike CPUs, memory, env vars, etc, a
submitted job may not directly override the container image set in the
job definition.

Resolves #57. Implementation originally started as PR #73.

Co-authored-by: Julien BORDELLIER

tsibley and others added 3 commits May 21, 2020 16:50
In preparation for re-using it in the AWS Batch runner.
Shows the behaviour of the function better with regard to the implicit
"latest" tag and will serve as automated tests once another topic branch
adding doctesting is merged.
Job definitions are dynamically created as needed based on the base
definition specified by --aws-batch-job.  This is necessary to allow
runtime-configurable images since, unlike CPUs, memory, env vars, etc, a
submitted job may not directly override the container image set in the
job definition.

Resolves #57.  Implementation originally started as PR #73.

Co-authored-by: Julien BORDELLIER <git@julienbordellier.com>
Comment on lines +296 to +298
"Expected job definition «%s», derived from «%s», to use image «%s», "
"but it uses «%s» instead"
% (derived_definition_name, base_definition_name, image, derived_image))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why use %s instead of .format()? (Looks like %s is used for string formatting for most of this repo)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astute observation! I find .format() slightly clunkier than printf-style most of the time, so tend not to use it. Just pure preference! I prefer f-strings the most, but those aren't supported until Python 3.6 and this project currently documents support for 3.5. Python 3.5 was still somewhat common on Linux computers when I was first starting this project in 2018. When this project moves to 3.6 or higher as a minimum Python version, I'd like to move to f-strings.

@tsibley tsibley merged commit 326c9ab into master Jun 1, 2020
@tsibley tsibley deleted the aws-batch-images branch July 18, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants