Skip to content

Commit ac8ed03

Browse files
committed
run setup script before post eval
1 parent a10acd3 commit ac8ed03

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/srtctl/cli/do_sweep.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,22 @@ def _run_post_eval(self, stop_event: threading.Event) -> int:
274274
env_to_set["EVAL_CONC"] = str(max(conc_list))
275275
logger.info("Eval concurrency (max of %s): %s", conc_list, env_to_set["EVAL_CONC"])
276276

277+
bash_preamble = None
278+
if self.config.setup_script:
279+
script_path = f"/configs/{self.config.setup_script}"
280+
bash_preamble = (
281+
f"echo 'Running setup script: {script_path}' && "
282+
f"if [ -f '{script_path}' ]; then bash '{script_path}'; else echo 'WARNING: {script_path} not found'; fi"
283+
)
284+
277285
proc = start_srun_process(
278286
command=cmd,
279287
nodelist=[self.runtime.nodes.head],
280288
output=str(eval_log),
281289
container_image=str(self.runtime.container_image),
282290
container_mounts=self.runtime.container_mounts,
283291
env_to_set=env_to_set,
292+
bash_preamble=bash_preamble,
284293
)
285294

286295
while proc.poll() is None:

0 commit comments

Comments
 (0)