From ccc31b7b99939fe6dd8bcb4c0c78692b25723e99 Mon Sep 17 00:00:00 2001 From: Ivkovic Date: Mon, 1 Apr 2019 17:05:46 -0400 Subject: [PATCH 1/3] ability to configure and mount working dir as volume --- .../aws/batch/AwsBatchTaskHandler.groovy | 29 +++++++++++++++++-- .../cloud/aws/batch/AwsOptions.groovy | 11 +++++++ .../aws/batch/AwsBatchTaskHandlerTest.groovy | 26 ++++++++++++----- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy b/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy index 9aa2c50fb0..ecb546381d 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy @@ -128,6 +128,7 @@ class AwsBatchTaskHandler extends TaskHandler implements BatchHandler() + def volumes = new LinkedList() + def mountPointName = 'mount' + def mountWorkDir = new MountPoint() + .withSourceVolume(mountPointName) + .withContainerPath(mountPointPath) + .withReadOnly(false) + mounts.add(mountWorkDir) + def volumeWorkDir = new Volume() + .withName(mountPointName) + .withHost(new Host() + .withSourcePath(mountPointPath)) + volumes.add(volumeWorkDir) + if( awscli ) { def mountName = 'aws-cli' def path = Paths.get(awscli).parent.parent.toString() @@ -391,14 +413,17 @@ class AwsBatchTaskHandler extends TaskHandler implements BatchHandler> JOB_NAME - 1 * handler.getAwsOptions() >> new AwsOptions() + 2 * handler.getAwsOptions() >> new AwsOptions() result.jobDefinitionName == JOB_NAME result.type == 'container' result.parameters.'nf-token' == 'fdb5ef295f566138a43252b2ea272282' - !result.containerProperties.mountPoints + result.containerProperties.mountPoints[0].sourceVolume == 'mount' + !result.containerProperties.mountPoints[0].readOnly when: result = handler.makeJobDefRequest(IMAGE) then: 1 * handler.normalizeJobDefinitionName(IMAGE) >> JOB_NAME - 1 * handler.getAwsOptions() >> new AwsOptions(cliPath: '/home/conda/bin/aws') + 2 * handler.getAwsOptions() >> new AwsOptions(cliPath: '/home/conda/bin/aws', mountPoint: '/tmp') result.jobDefinitionName == JOB_NAME result.type == 'container' result.parameters.'nf-token' == '9c56fd073d32e0c29f51f12afdfe4750' - result.containerProperties.mountPoints[0].sourceVolume == 'aws-cli' - result.containerProperties.mountPoints[0].containerPath == '/home/conda' - result.containerProperties.mountPoints[0].readOnly - result.containerProperties.volumes[0].host.sourcePath == '/home/conda' - result.containerProperties.volumes[0].name == 'aws-cli' + result.containerProperties.mountPoints[0].sourceVolume == 'mount' + result.containerProperties.mountPoints[0].containerPath == '/tmp' + !result.containerProperties.mountPoints[0].readOnly + result.containerProperties.volumes[0].host.sourcePath == '/tmp' + result.containerProperties.volumes[0].name == 'mount' + + result.containerProperties.mountPoints[1].sourceVolume == 'aws-cli' + result.containerProperties.mountPoints[1].containerPath == '/home/conda' + result.containerProperties.mountPoints[1].readOnly + result.containerProperties.volumes[1].host.sourcePath == '/home/conda' + result.containerProperties.volumes[1].name == 'aws-cli' + + result.containerProperties.environment[0].name == "TMPDIR" + result.containerProperties.environment[0].value == "/tmp" } From cf3b8d61ce3d3e9045dbe5cd71353db22ff6dccd Mon Sep 17 00:00:00 2001 From: Ivkovic Date: Mon, 1 Apr 2019 17:15:29 -0400 Subject: [PATCH 2/3] fix generating uuid --- .../groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy b/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy index ecb546381d..3893071249 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy @@ -427,7 +427,7 @@ class AwsBatchTaskHandler extends TaskHandler implements BatchHandler Date: Fri, 5 Apr 2019 15:30:40 -0400 Subject: [PATCH 3/3] remove export of TMPDIR. should use scratch in process to change workdir --- .../nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy b/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy index 3893071249..f387c605d1 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cloud/aws/batch/AwsBatchTaskHandler.groovy @@ -378,9 +378,6 @@ class AwsBatchTaskHandler extends TaskHandler implements BatchHandler() @@ -427,7 +423,7 @@ class AwsBatchTaskHandler extends TaskHandler implements BatchHandler