@@ -128,12 +128,12 @@ cleanup() {
128128 update_state " failed"
129129 fi
130130
131- output_files=" $( ls -A " $home /output/" ) "
131+ output_files=" $( ls -A " ${ home} /output/" ) "
132132 if [[ -n ${output_files} ]]; then
133133 echo " Uploading results..."
134- s3cmd put -r " $home /output/*" " s3://${BUCKET_NAME} /job-${JOB_ID} /output/"
134+ s3cmd put -r " ${ home} " /output/* " s3://${BUCKET_NAME} /job-${JOB_ID} /output/"
135135 else
136- echo " Skipping results upload, no files found in $home /ouput"
136+ echo " Skipping results upload, no files found in ${ home} /ouput"
137137 fi
138138
139139 if [[ -s ${stdout_log} ]]; then
@@ -201,20 +201,20 @@ trap cleanup EXIT SIGHUP SIGINT SIGTERM
201201# Job-specific setup
202202
203203echo " Running setup..."
204- mkdir -p " $home /output"
204+ mkdir -p " ${ home} /output"
205205eval " ${SETUP_COMMANDS} "
206206
207207echo " Downloading input archive..."
208- s3cmd get -r " s3://${BUCKET_NAME} /job-${JOB_ID} /input.zip" " $home /"
209- if [[ ! -s " $home /input.zip" ]]; then
208+ s3cmd get -r " s3://${BUCKET_NAME} /job-${JOB_ID} /input.zip" " ${ home} /"
209+ if [[ ! -s " ${ home} /input.zip" ]]; then
210210 echo " Error: Failed to download input archive"
211211 exit 1
212212fi
213213
214214echo " Unzipping input archive..."
215- unzip " $home /input.zip" -d " $home /"
215+ unzip " ${ home} /input.zip" -d " ${ home} /"
216216
217- source " $home /venv/bin/activate"
217+ source " ${ home} /venv/bin/activate"
218218
219219# Update state to running
220220update_state " running"
@@ -226,15 +226,16 @@ exit_code_flag="/tmp/cloudexec-exit-code"
226226# Execute Job
227227
228228# Use Ctrl-C to detach from the tmux session
229- echo " bind-key -n C-c detach" > " $ home /.tmux.conf"
229+ echo " bind-key -n C-c detach" > " ${ home} /.tmux.conf"
230230# Run the tmux command in the background
231231echo " Attach to the tmux session with 'cloudexec attach'"
232232tmux_session=" cloudexec"
233233wrapped_run_command=" $(
234234 cat << -EOF
235235 set_exit_code() { echo \$ ? > ${exit_code_flag} ; };
236236 trap set_exit_code EXIT;
237- cd $home /${INPUT_DIRECTORY}
237+ cd ${home} /${INPUT_DIRECTORY}
238+ echo running workload from: ${home} /${INPUT_DIRECTORY}
238239 ( ${RUN_COMMAND} ) > >(tee -a ${stdout_log} ) 2> >(tee -a ${stderr_log} >&2);
239240 EOF
240241) "
0 commit comments