From 316a9ff0bd49190256611ecf1e06dc80865c40f4 Mon Sep 17 00:00:00 2001 From: Krishna Chilleri <149612138+kchilleri@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:10:50 -0600 Subject: [PATCH] enable shell option on flux worker (#866) * Enable script option to flux worker --- beeflow/common/worker/flux_worker.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/beeflow/common/worker/flux_worker.py b/beeflow/common/worker/flux_worker.py index 29f4ff41b..98624f052 100644 --- a/beeflow/common/worker/flux_worker.py +++ b/beeflow/common/worker/flux_worker.py @@ -43,12 +43,15 @@ def build_jobspec(self, task): """Build the job spec for a task.""" # TODO: This has a lot of code in common with the other worker's build_text crt_res = self.crt.run_text(task) + shell = task.get_requirement('beeflow:ScriptRequirement', 'shell', default='/bin/bash') script = [ - '#!/bin/bash', - 'set -e', - crt_res.env_code, + f'#!{shell}', ] + if shell == "/bin/bash": + script.append('set -e') + script.append(crt_res.env_code) + # TODO: Should this entire model, saving stdout and stderr to files, be # redone for Flux? It seems to provide some sort of KVS for storing # output but I don't quite understand it.