@@ -65,6 +65,7 @@ def _additional_setup_taskvine(container):
6565 # Create the poncho package
6666 exit_code , output = container .exec_run (cmd = ["bash" , "-c" ,
6767 "source ~/conda/etc/profile.d/conda.sh && conda activate && poncho_package_create taskvine_poncho.json taskvine_poncho.tar.gz" ],
68+ user = "wfcommons" ,
6869 stdout = True , stderr = True )
6970 if exit_code != 0 :
7071 raise Exception ("Failed to setup TaskVine: cannot create poncho package" )
@@ -79,25 +80,27 @@ def _additional_setup_pegasus(container):
7980 # Start Condor
8081 exit_code , output = container .exec_run (cmd = ["bash" , "-c" ,
8182 "bash /home/wfcommons/start_condor.sh" ],
83+ user = "wfcommons" ,
8284 stdout = True , stderr = True )
8385 if exit_code != 0 :
8486 raise Exception ("Failed to setup Pegasus: cannot start HTCondor" )
8587 # Run pegasus script
8688 exit_code , output = container .exec_run (cmd = ["bash" , "-c" ,
8789 "python3 ./pegasus_workflow.py" ],
90+ user = "wfcommons" ,
8891 stdout = True , stderr = True )
8992 if exit_code != 0 :
9093 raise Exception ("Failed to setup Pegasus: error while running the pegasus_workflow.py script" )
9194
9295def _additional_setup_swiftt (container ):
9396 # Start a redis server in the background
9497 exit_code , output = container .exec_run (
95- cmd = ["bash" , "-c" , "redis-server" ], detach = True , stdout = True , stderr = True )
98+ cmd = ["bash" , "-c" , "redis-server" ], user = "wfcommons" , detach = True , stdout = True , stderr = True )
9699 # Note that exit_code will always be None because of detach=True.
97100
98101 # Check that the redis-server is up
99102 exit_code , output = container .exec_run (
100- cmd = ["bash" , "-c" , "redis-cli ping" ], stdout = True , stderr = True )
103+ cmd = ["bash" , "-c" , "redis-cli ping" ], user = "wfcommons" , stdout = True , stderr = True )
101104 if output .decode ().strip () != 'PONG' :
102105 raise Exception ("Failed to start redis-server..." )
103106
@@ -120,24 +123,24 @@ def _additional_setup_swiftt(container):
120123#############################################################################
121124
122125def run_workflow_dask (container , num_tasks , str_dirpath ):
123- exit_code , output = container .exec_run ("python ./dask_workflow.py" , stdout = True , stderr = True )
126+ exit_code , output = container .exec_run ("python ./dask_workflow.py" , user = "wfcommons" , stdout = True , stderr = True )
124127 # Check sanity
125128 assert (exit_code == 0 )
126129 assert (output .decode ().count ("completed!" ) == num_tasks )
127130 # TODO: Look at the (I think) generated run.json file on the container?
128131
129132def run_workflow_parsl (container , num_tasks , str_dirpath ):
130- exit_code , output = container .exec_run ("python ./parsl_workflow.py" , stdout = True , stderr = True )
131- ignored , output = container .exec_run (f"cat { str_dirpath } /runinfo/000/parsl.log" , stdout = True , stderr = True )
133+ exit_code , output = container .exec_run ("python ./parsl_workflow.py" , user = "wfcommons" , stdout = True , stderr = True )
134+ ignored , output = container .exec_run (f"cat { str_dirpath } /runinfo/000/parsl.log" , user = "wfcommons" , stdout = True , stderr = True )
132135 # Check sanity
133136 assert (exit_code == 0 )
134137 assert ("completed" in output .decode ())
135138 assert (output .decode ().count ("_complete_task" ) == num_tasks )
136139
137140def run_workflow_nextflow (container , num_tasks , str_dirpath ):
138141 # Run the workflow!
139- exit_code , output = container .exec_run (f"nextflow run ./workflow.nf --pwd ." , stdout = True , stderr = True )
140- ignored , task_exit_codes = container .exec_run ("find . -name .exitcode -exec cat {} \;" , stdout = True , stderr = True )
142+ exit_code , output = container .exec_run (f"nextflow run ./workflow.nf --pwd ." , user = "wfcommons" , stdout = True , stderr = True )
143+ ignored , task_exit_codes = container .exec_run ("find . -name .exitcode -exec cat {} \;" , user = "wfcommons" , stdout = True , stderr = True )
141144 # Check sanity
142145 assert (exit_code == 0 )
143146 assert (task_exit_codes .decode () == num_tasks * "0" )
@@ -146,29 +149,30 @@ def run_workflow_airflow(container, num_tasks, str_dirpath):
146149 # Run the workflow! (use a specific working directory)
147150 # TODO: Remove the hardcoded Blast-Benchmark as it's ugly
148151 exit_code , output = container .exec_run (cmd = ["sh" , "-c" , "cd /home/wfcommons/ && sudo /bin/bash /run_a_workflow.sh Blast-Benchmark" ],
149- stdout = True ,
150- stderr = True )
152+ user = "wfcommons" , stdout = True , stderr = True )
151153 # Check sanity
152154 assert (exit_code == 0 )
153155 assert (output .decode ().count ("completed" ) == num_tasks * 2 )
154156
155157def run_workflow_bash (container , num_tasks , str_dirpath ):
156158 # Run the workflow!
157- exit_code , output = container .exec_run (cmd = "/bin/bash ./run_workflow.sh" , stdout = True , stderr = True )
159+ exit_code , output = container .exec_run (cmd = "/bin/bash ./run_workflow.sh" , user = "wfcommons" , stdout = True , stderr = True )
158160 # Check sanity
159161 assert (exit_code == 0 )
160162 assert (output .decode ().count ("completed" ) == num_tasks )
161163
162164def run_workflow_taskvine (container , num_tasks , str_dirpath ):
163165 # Run the workflow!
164- exit_code , output = container .exec_run (cmd = ["bash" , "-c" , "source ~/conda/etc/profile.d/conda.sh && conda activate && python3 ./taskvine_workflow.py" ], stdout = True , stderr = True )
166+ exit_code , output = container .exec_run (cmd = ["bash" , "-c" , "source ~/conda/etc/profile.d/conda.sh && conda activate && python3 ./taskvine_workflow.py" ],
167+ user = "wfcommons" , stdout = True , stderr = True )
165168 # Check sanity
166169 assert (exit_code == 0 )
167170 assert (output .decode ().count ("completed" ) == num_tasks )
168171
169172def run_workflow_makeflow (container , num_tasks , str_dirpath ):
170173 # Run the workflow (with full logging)
171- exit_code , output = container .exec_run (cmd = ["bash" , "-c" , "source ~/conda/etc/profile.d/conda.sh && conda activate && makeflow --log-verbose --monitor=./monitor_data/ ./workflow.makeflow" ], stdout = True , stderr = True )
174+ exit_code , output = container .exec_run (cmd = ["bash" , "-c" , "source ~/conda/etc/profile.d/conda.sh && conda activate && makeflow --log-verbose --monitor=./monitor_data/ ./workflow.makeflow" ],
175+ user = "wfcommons" , stdout = True , stderr = True )
172176 # Check sanity
173177 assert (exit_code == 0 )
174178 num_completed_jobs = len (re .findall (r'job \d+ completed' , output .decode ()))
@@ -177,7 +181,8 @@ def run_workflow_makeflow(container, num_tasks, str_dirpath):
177181def run_workflow_cwl (container , num_tasks , str_dirpath ):
178182 # Run the workflow!
179183 # Note that the input file is hardcoded and Blast-specific
180- exit_code , output = container .exec_run (cmd = "cwltool ./main.cwl --split_fasta_00000001_input ./data/workflow_infile_0001 " , stdout = True , stderr = True )
184+ exit_code , output = container .exec_run (cmd = "cwltool ./main.cwl --split_fasta_00000001_input ./data/workflow_infile_0001 " ,
185+ user = "wfcommons" , stdout = True , stderr = True )
181186 # Check sanity
182187 assert (exit_code == 0 )
183188 # this below is ugly (the 3 is for "workflow", "compile_output_files" and "compile_log_files",
@@ -186,14 +191,16 @@ def run_workflow_cwl(container, num_tasks, str_dirpath):
186191
187192def run_workflow_pegasus (container , num_tasks , str_dirpath ):
188193 # Run the workflow!
189- exit_code , output = container .exec_run (cmd = "bash /home/wfcommons/run_workflow.sh" , stdout = True , stderr = True )
194+ exit_code , output = container .exec_run (cmd = "bash /home/wfcommons/run_workflow.sh" ,
195+ user = "wfcommons" , stdout = True , stderr = True )
190196 # Check sanity
191197 assert (exit_code == 0 )
192198 assert ("success" in output .decode ())
193199
194200def run_workflow_swiftt (container , num_tasks , str_dirpath ):
195201 # Run the workflow!
196- exit_code , output = container .exec_run (cmd = "swift-t workflow.swift" , stdout = True , stderr = True )
202+ exit_code , output = container .exec_run (cmd = "swift-t workflow.swift" ,
203+ user = "wfcommons" , stdout = True , stderr = True )
197204 # sys.stderr.write(output.decode())
198205 # Check sanity
199206 assert (exit_code == 0 )
0 commit comments