Skip to content

Commit

Permalink
Change to WORKDIR before running commands in cloud project experime…
Browse files Browse the repository at this point in the history
…nts. (google#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.
  • Loading branch information
DonggeLiu authored Sep 14, 2023
1 parent d81e44f commit 4b21830
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions infra/build/functions/project_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})',
]
},
{
Expand Down

0 comments on commit 4b21830

Please sign in to comment.