From 029cbeaedc3e75a07ded74bdbbb07df0908e91db Mon Sep 17 00:00:00 2001 From: JaimeSeqLabs Date: Fri, 22 Sep 2023 15:29:46 +0200 Subject: [PATCH] add nvme storage option for AWS batch forge --- .../commands/computeenvs/platforms/AwsBatchForgePlatform.java | 4 ++++ .../cli/computeenvs/platforms/AwsBatchForgePlatformTest.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/seqera/tower/cli/commands/computeenvs/platforms/AwsBatchForgePlatform.java b/src/main/java/io/seqera/tower/cli/commands/computeenvs/platforms/AwsBatchForgePlatform.java index 53ae98bc..e367c679 100644 --- a/src/main/java/io/seqera/tower/cli/commands/computeenvs/platforms/AwsBatchForgePlatform.java +++ b/src/main/java/io/seqera/tower/cli/commands/computeenvs/platforms/AwsBatchForgePlatform.java @@ -47,6 +47,9 @@ public class AwsBatchForgePlatform extends AbstractPlatform { @Option(names = {"--wave"}, description = "Allow access to private container repositories and the provisioning of containers in your Nextflow pipelines via the Wave containers service.") public boolean wave; + @Option(names = {"--fast-storage"}, description = "Allow the use of NVMe instance storage to speed up I/O and disk access operations (requires Fusion v2).") + public boolean fastStorage; + @Option(names = {"--fargate"}, description = "Run the Nextflow head job using the Fargate container service (requires Fusion v2 and Spot provisioning model).") public boolean fargate; @@ -93,6 +96,7 @@ public AwsBatchConfig computeConfig() throws ApiException, IOException { .region(region) .fusion2Enabled(fusionV2) .waveEnabled(wave) + .nvnmeStorageEnabled(fastStorage) // Forge .forge(buildForge()) diff --git a/src/test/java/io/seqera/tower/cli/computeenvs/platforms/AwsBatchForgePlatformTest.java b/src/test/java/io/seqera/tower/cli/computeenvs/platforms/AwsBatchForgePlatformTest.java index 1b27b3d9..8111c9c7 100644 --- a/src/test/java/io/seqera/tower/cli/computeenvs/platforms/AwsBatchForgePlatformTest.java +++ b/src/test/java/io/seqera/tower/cli/computeenvs/platforms/AwsBatchForgePlatformTest.java @@ -109,12 +109,12 @@ void testAddWithAdvanced(MockServerClient mock) { mock.when( request().withMethod("POST").withPath("/compute-envs") - .withBody(JsonBody.json("{\"computeEnv\":{\"name\":\"demo\",\"platform\":\"aws-batch\",\"config\":{\"region\":\"eu-west-1\",\"fusion2Enabled\":true,\"waveEnabled\":false,\"cliPath\":\"/bin/aws\",\"workDir\":\"s3://nextflow-ci/jordeu\",\"forge\":{\"type\":\"SPOT\",\"minCpus\":8,\"maxCpus\":123,\"gpuEnabled\":false,\"ebsAutoScale\":true,\"disposeOnDeletion\":true,\"allowBuckets\":[\"bkt1\",\"bkt2\"],\"fargateHeadEnabled\": false}},\"credentialsId\":\"6g0ER59L4ZoE5zpOmUP48D\"}}")), exactly(1) + .withBody(JsonBody.json("{\"computeEnv\":{\"name\":\"demo\",\"platform\":\"aws-batch\",\"config\":{\"region\":\"eu-west-1\",\"fusion2Enabled\":true,\"waveEnabled\":false,\"nvnmeStorageEnabled\":true,\"cliPath\":\"/bin/aws\",\"workDir\":\"s3://nextflow-ci/jordeu\",\"forge\":{\"type\":\"SPOT\",\"minCpus\":8,\"maxCpus\":123,\"gpuEnabled\":false,\"ebsAutoScale\":true,\"disposeOnDeletion\":true,\"allowBuckets\":[\"bkt1\",\"bkt2\"],\"fargateHeadEnabled\": false}},\"credentialsId\":\"6g0ER59L4ZoE5zpOmUP48D\"}}")), exactly(1) ).respond( response().withStatusCode(200).withBody("{\"computeEnvId\":\"isnEDBLvHDAIteOEF44ow\"}").withContentType(MediaType.APPLICATION_JSON) ); - ExecOut out = exec(mock, "compute-envs", "add", "aws-batch", "forge", "-n", "demo", "-r", "eu-west-1", "--work-dir", "s3://nextflow-ci/jordeu", "--max-cpus=123", "--fusion-v2", "--cli-path=/bin/aws", "--min-cpus=8", "--allow-buckets=bkt1,bkt2"); + ExecOut out = exec(mock, "compute-envs", "add", "aws-batch", "forge", "-n", "demo", "-r", "eu-west-1", "--work-dir", "s3://nextflow-ci/jordeu", "--max-cpus=123", "--fusion-v2", "--fast-storage", "--cli-path=/bin/aws", "--min-cpus=8", "--allow-buckets=bkt1,bkt2"); assertEquals("", out.stdErr); assertEquals(new ComputeEnvAdded("aws-batch", "isnEDBLvHDAIteOEF44ow", "demo", null, USER_WORKSPACE_NAME).toString(), out.stdOut);