Skip to content

Commit

Permalink
Fix interactive session on virtual environment agent changing .bashrc…
Browse files Browse the repository at this point in the history
…/.profile
  • Loading branch information
allegroai committed Jan 17, 2021
1 parent a458157 commit 7e2c435
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clearml_session/interactive_session_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,13 @@ def setup_ssh_server(hostname, hostnames, param, task):

def setup_user_env(param, task):
env = setup_os_env(param)
# do not change user bash/profile
if os.geteuid() != 0:
if param.get("user_key") and param.get("user_secret"):
env['TRAINS_API_ACCESS_KEY'] = param.get("user_key")
env['TRAINS_API_SECRET_KEY'] = param.get("user_secret")
return env

# create symbolic link to the venv
environment = os.path.expanduser('~/environment')
# noinspection PyBroadException
Expand Down

0 comments on commit 7e2c435

Please sign in to comment.