Skip to content

Commit

Permalink
integration test and possible fix added
Browse files Browse the repository at this point in the history
  • Loading branch information
MiazinNikita authored and MiazinNikita committed Jul 8, 2019
1 parent 4f19570 commit f7fd7af
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
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

0 comments on commit f7fd7af

Please sign in to comment.