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

add --env & config option to set values in all task environments #517

Merged
merged 8 commits into from
Jul 26, 2021

Conversation

mlin
Copy link
Collaborator

@mlin mlin commented Jul 24, 2021

@jgadling building on your much-appreciated #516, I extended it to work just like docker run --env:

  • --env X to pass through environment variable X, skipping if X is undefined
  • --env X=foo to set X outright
  • supply --env multiple times with different variables

Let me know if you have any concerns with this variation on it!

While hacking on this, I remembered how miniwdl passes AWS credentials to its internal S3 downloader: it generates a temporary script file defining the necessary environment variables, then sources that script at the start of a task that needs it. The advantages of this approach are (i) it's concise yet explicit that the task needs this information supplied and (ii) miniwdl is careful never to dump file contents into its log in case they contain sensitive information. Just another concept to consider, however, I also support this passthrough feature.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1062207074

  • 15 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 96.51%

Files with Coverage Reduction New Missed Lines %
WDL/runtime/task.py 1 95.22%
Totals Coverage Status
Change from base Build 1061778500: 0.02%
Covered Lines: 6720
Relevant Lines: 6963

💛 - Coveralls

Copy link
Contributor

@jgadling jgadling left a comment

Choose a reason for hiding this comment

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

Awesome, I like the extra functionality!

@mlin mlin merged commit e484c24 into main Jul 26, 2021
@mlin mlin deleted the mlin/env-override branch July 26, 2021 20:47
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