Skip to content

Commit 3f2f85a

Browse files
committed
Upload Google Batch log on task exit (#6226) [ci fast]
Signed-off-by: Paolo Di Tommaso <[email protected]>
1 parent 91514b8 commit 3f2f85a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugins/nf-google/src/main/nextflow/cloud/google/batch/GoogleBatchScriptLauncher.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class GoogleBatchScriptLauncher extends BashWrapperBuilder implements GoogleBatc
204204
}
205205

206206
static String launchCommand( String workDir ) {
207-
"trap \"{ cp ${TaskRun.CMD_LOG} ${workDir}/${TaskRun.CMD_LOG}; }\" ERR; /bin/bash ${workDir}/${TaskRun.CMD_RUN} 2>&1 | tee ${TaskRun.CMD_LOG}"
207+
"trap \"{ cp ${TaskRun.CMD_LOG} ${workDir}/${TaskRun.CMD_LOG}; }\" EXIT; /bin/bash ${workDir}/${TaskRun.CMD_RUN} 2>&1 | tee ${TaskRun.CMD_LOG}"
208208
}
209209

210210
static String containerMountPath(CloudStoragePath path) {

plugins/nf-google/src/test/nextflow/cloud/google/batch/GoogleBatchExecutorTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class GoogleBatchExecutorTest extends Specification {
126126

127127
where:
128128
FUSION | DEFAULT_FS | TASK_DIR | EXPECTED
129-
false | false | 'gs://foo/work/dir' | '/bin/bash -o pipefail -c \'trap "{ cp .command.log gs://foo/work/dir/.command.log; }" ERR; /bin/bash gs://foo/work/dir/.command.run 2>&1 | tee .command.log\''
129+
false | false | 'gs://foo/work/dir' | '/bin/bash -o pipefail -c \'trap "{ cp .command.log gs://foo/work/dir/.command.log; }" EXIT; /bin/bash gs://foo/work/dir/.command.run 2>&1 | tee .command.log\''
130130
true | false | '/fusion/work/dir' | 'bash /fusion/work/dir/.command.run'
131131
false | true | '/nfs/work/dir' | 'bash /nfs/work/dir/.command.run 2>&1 > /nfs/work/dir/.command.log'
132132
}

0 commit comments

Comments
 (0)