Fix vault environment variable integration

This commit is contained in:
allegroai 2021-12-29 23:06:58 +02:00
parent ff8d97f347
commit a5792ed82a

View File

@ -632,6 +632,8 @@ def setup_user_env(param, task):
param.get("default_docker", "").strip() or env.get('CLEARML_DOCKER_IMAGE', '')))
for k, v in vault_environment.items():
os.system("echo 'export {}=\"{}\"' >> ~/.profile".format(k, v))
os.system("echo 'export {}=\"{}\"' >> ~/.bashrc".format(k, v))
env[k] = str(v) if v else ""
env['CLEARML_API_ACCESS_KEY'] = param.get("user_key")
env['CLEARML_API_SECRET_KEY'] = param.get("user_secret")
# set default folder for user