Change to `WORKDIR` before running commands in cloud project experiments. (#10918)

Mitigates the known issue where we don't automatically change to the
`WORKDIR` defined in `Dockerfile` when running cloud experiments.

Question:
Would it be preferred if I introduce a flag for this?
(e.g., `--use_workdir` or `--workdir=/src/<project>`)
While this gives more flexibility, I feel `cd` to `WORKDIR` should
always be preferred if we want the cloud experiments to behave the same
as local ones.
This commit is contained in:
Dongge Liu 2023-09-14 21:05:18 +10:00 committed by GitHub
parent d81e44f16c
commit 4b21830e20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -72,11 +72,12 @@ def run_experiment(project_name, command, output_path, experiment_name):
]
},
{
'name': project.image,
'name':
project.image,
'args': [
'bash',
'-c',
command,
f'(cd "/src"; cd {project.workdir}; {command})',
]
},
{