Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: AWS Batch with CWL: did not localize cwl.inputs.json [BA-4586] #5057

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -268,6 +268,12 @@ trait StandardAsyncExecutionActor
def cwd: Path = commandDirectory
def rcPath: Path = cwd./(jobPaths.returnCodeFilename)

/**
* Directory where workflow user commands will be executed.
* It's overridden in AwsBatchAsyncBackendJobExecutionActor in order to allow Cromwell find adHoc files.
* */
def adHocCwd: String = cwd.pathAsString

// The standard input filename can be as ephemeral as the execution: the name needs to match the expectations of
// the command, but the standard input file will never be accessed after the command completes. standard output and
// error on the other hand will be accessed and the names of those files need to be known to be delocalized and read
Expand Down Expand Up @@ -383,7 +389,7 @@ trait StandardAsyncExecutionActor
|tee $stdoutRedirection < "$$$out" &
|tee $stderrRedirection < "$$$err" >&2 &
|(
|cd $cwd
|cd $adHocCwd
|ENVIRONMENT_VARIABLES
|INSTANTIATED_COMMAND
|) $stdinRedirection > "$$$out" 2> "$$$err"
Expand Down
@@ -0,0 +1,14 @@
name: ad_hoc_file_test.aws
testFormat: workflowsuccess
backends: [ AWSBATCH ]

files {
workflow: ad_hoc_file_test/workflow.cwl
imports: [
ad_hoc_file_test/cwl-test.cwl
]
}

metadata {
status: Succeeded
}
@@ -0,0 +1,21 @@
class: CommandLineTool
cwlVersion: v1.0
baseCommand: ["sh", "example.sh"]
hints:
DockerRequirement:
dockerPull: ubuntu:latest
inputs: []

requirements:
InitialWorkDirRequirement:
listing:
- entryname: example.sh
entry: |-
PREFIX='Message is:'
MSG="\${PREFIX} Hello world!"
echo \${MSG}

outputs:
example_out:
type: stdout
stdout: output.txt
@@ -0,0 +1,10 @@
cwlVersion: v1.0
class: Workflow
inputs: []
outputs: []

steps:
test:
run: cwl-test.cwl
in: []
out: []
Expand Up @@ -345,6 +345,8 @@ class AwsBatchAsyncBackendJobExecutionActor(override val standardParams: Standar
disk.mountPoint
}

override def adHocCwd = runtimeEnvironment.outputPath

override def isTerminal(runStatus: RunStatus): Boolean = {
runStatus match {
case _: TerminalRunStatus => true
Expand Down