Closed jperl closed 4 years ago
@jperl
You can set environment variables in your Docker container using ENV and then build the docker container.
We currently do no support dynamically setting (submit) new values for the environment variables when you submit the job via ai-plalform. My recommendation would be to rebuild the docker file with the new environment variable values and then submit the job.
This web link shows an example of using environment variables, building the docker file and then submitting to ai-platform: https://cloud.google.com/ml-engine/docs/custom-containers-training#submit_a_hyperparameter_tuning_job
@andrewferlitsch Thanks for your response.
We need to run many jobs with different environment variables, so building a container per job would take a lot of extra time. I updated our code's configuration to support flags as well, but it would be nice to dynamically pass environment variables instead.
@dizcology Could you take a look at this AI platform issue.
We resolved this by making our configuration support flags, so it is no longer an issue. But others may want to support environment variables.
Customer (jperl) has a workaround. Will keep open for present time as a placeholder for supporting environment variables.
product team aware of feature.
@andrewferlitsch Hello, is there a status/thread on this feature request?
For anyone else looking for work arounds on this, you could use the env
command within exec
to export variables before running another utility. See man env
for details.
Ref:https://stackoverflow.com/questions/22869637/setting-variables-with-executing-a-command-with-exec
Is your feature request related to a problem? Please describe. I would like to be able to provide environment variables when submitting an ai platform training job using a container.
Describe the solution you'd like -e VAR=VALUE -e FOO=BAR ...