I've had these env var-related experimental/WIP patches lingering in my local repo (and kicking around my head) since the very beginnings of the Nextstrain CLI. I've never been fond of the existing approach for passing host env thru to the containers managed by Nextstrain CLI, but on the other hand it's been Good Enough™ for a few years now and it wasn't immediately clear these patches were no-downside improvements and so it's never been a priority for me to revisit.
- Add a "write-envdir" command to facilitate setting up environment directories
- runner.docker: Pass through all
NEXTSTRAIN_*
environment variables - runner.docker: Pass through most environment variables into the container
There are other reasons too. My original plan for the nextstrain write-envdir
command was that it'd integrate with workflows which explicitly
managed env vars via envdirs (and the Python "envdir"
module),
but this stalled out because the appetite wasn't there on the workflow
authorship side. See my writeup from late July of
2018.
In
any case, when we needed better env var management for ncov-ingest than was
otherwise available, I revived the idea and implemented it manually outside of
Nextstrain CLI using a small write-envdir
shell
program
and nextstrain build
's --exec
override.
It's been on my
mind,
lingering in the background, ever since.