This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from vib-singlecell-nf/develop
Develop for v0.22.0 Former-commit-id: bf6f7c4
- Loading branch information
Showing
24 changed files
with
288 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
process.afterScript = { | ||
// Source: https://github.com/nextflow-io/nextflow/issues/1166#issuecomment-502467562 | ||
process { | ||
afterScript = { | ||
// Source: https://github.com/nextflow-io/nextflow/issues/1166#issuecomment-502467562 | ||
logMainDir = params.logDir | ||
|
||
logMainDir = params.logDir | ||
// Check whether log dir is located in S3 if using awsbatch and is a local directory otherwise | ||
if (workflow.profile == "aws") { | ||
if (!logMainDir.matches("^s3://.*")) logMainDir = "s3:/" + workflow.workDir.toString() + "/log" | ||
} else { | ||
logMainDir = workflow.launchDir.resolve(logMainDir).toString() | ||
if (!logMainDir.matches("^/.*")) logMainDir = workflow.launchDir.toString() + "/log" | ||
} | ||
|
||
// Check whether log dir is located in S3 if using awsbatch and is a local directory otherwise | ||
if (workflow.profile == "aws") { | ||
if (!logMainDir.matches("^s3://.*")) logMainDir = "s3:/" + workflow.workDir.toString() + "/log" | ||
} else { | ||
logMainDir = workflow.launchDir.resolve(logMainDir).toString() | ||
if (!logMainDir.matches("^/.*")) logMainDir = workflow.launchDir.toString() + "/log" | ||
} | ||
// Build log directory path based on task name | ||
logSubDir = task.name.replace(" (null)", "").replace(" ", "/").replaceAll(" ", "_").replaceAll("[()]", "") | ||
logDir = logMainDir + "/" + logSubDir | ||
|
||
// Build log directory path based on task name | ||
logSubDir = task.name.replace(" (null)", "").replace(" ", "/").replaceAll(" ", "_").replaceAll("[()]", "") | ||
logDir = logMainDir + "/" + logSubDir | ||
// Define command to copy log files | ||
cpLogCmd = workflow.profile == "aws" ? | ||
"nxf_s3_upload '*.txt' ${logDir}; " : | ||
"mkdir -p ${logDir}; cp -a *.txt ${logDir}; " | ||
|
||
// Define command to copy log files | ||
cpLogCmd = workflow.profile == "aws" ? | ||
"nxf_s3_upload '*.txt' ${logDir}; " : | ||
"mkdir -p ${logDir}; cp -a *.txt ${logDir}; " | ||
|
||
// Assemble final command | ||
cmd = "ls -alR --full-time > .command.ls; " | ||
cmd += "mkdir nxf_log; " | ||
cmd += "for file in .command.*; do cp -a \${file} nxf_log/\${file#.}.txt; done; " | ||
cmd += "cd nxf_log; " | ||
cmd += cpLogCmd | ||
cmd += "cd ..;" | ||
cmd | ||
// Assemble final command | ||
cmd = "ls -alR --full-time > .command.ls; " | ||
cmd += "mkdir nxf_log; " | ||
cmd += "for file in .command.*; do cp -a \${file} nxf_log/\${file#.}.txt; done; " | ||
cmd += "cd nxf_log; " | ||
cmd += cpLogCmd | ||
cmd += "cd ..;" | ||
cmd | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.