google-deepmind / xmanager

A platform for managing machine learning experiments
Apache License 2.0
816 stars 45 forks source link

Pass the original shell environment variables to subprocess.run #10

Closed pshiko closed 2 years ago

pshiko commented 2 years ago

https://github.com/deepmind/xmanager/issues/5 is caused by overwriting environment variables in the subprocess.

When pass the env arguments to subprocess.run, the parent shell env variable will not be inherited.

example: https://wandbox.org/permlink/aYuTaAD7SAfwCGZQ

In this case, commands in /usr/local/bin such asdocker cannot be resolved because the PATH variable is lost. .. Passing the environment variable of the parent shell to subprocess.run may be a workaround for this issue. The problem with this change is that the results of docker build anddocker run can be affected by the state of the local shell. In my opinion, the effect can be acceptable.

pshiko commented 2 years ago

I'm sorry.

The project currently does not accept pull requests, but we'd be more than happy to get your feedback via issues!

I didn't see the comment above. I would like to close this PR.