From b7b3c0a49f24914d00f8c41ef5afba3ac4a64e7f Mon Sep 17 00:00:00 2001 From: Cedric Zhuang Date: Wed, 11 Sep 2024 14:28:23 -0700 Subject: [PATCH] [GH-89] Use default disk size of MMC When user does not specify a disk size and the (total input size * 5) is smaller than 6 GB, we should not hard code the disk size to 6 GB. Instead, we should allow MMC to calculate the disk size. --- .../main/com/memverge/nextflow/FloatGridExecutor.groovy | 9 ++++++--- .../src/test/com/memverge/nextflow/FloatBaseTest.groovy | 3 +-- .../com/memverge/nextflow/FloatGridExecutorTest.groovy | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy b/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy index c8f6143..f03ad0f 100644 --- a/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy +++ b/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy @@ -439,15 +439,18 @@ class FloatGridExecutor extends AbstractGridExecutor { if (disk) { size = Math.max(size, disk.toGiga()) } - if (isFusionEnabled()) { + final fusionEnabled = isFusionEnabled() + if (fusionEnabled) { size = Math.max(size, FUSION_MIN_VOL_SIZE) } - if (task.scratch) { + if (task.scratch || fusionEnabled) { double inputSizeGB = (double) (getInputFileSize(task)) / 1024 / 1024 / 1024 long minDiskSizeBasedOnInput = Math.round(inputSizeGB * DISK_INPUT_FACTOR) size = Math.max(size, minDiskSizeBasedOnInput) } - cmd << '--imageVolSize' << size.toString() + if (size > FloatConf.MIN_VOL_SIZE) { + cmd << '--imageVolSize' << size.toString() + } } /** diff --git a/plugins/nf-float/src/test/com/memverge/nextflow/FloatBaseTest.groovy b/plugins/nf-float/src/test/com/memverge/nextflow/FloatBaseTest.groovy index cfc58a8..31b5e07 100644 --- a/plugins/nf-float/src/test/com/memverge/nextflow/FloatBaseTest.groovy +++ b/plugins/nf-float/src/test/com/memverge/nextflow/FloatBaseTest.groovy @@ -121,7 +121,6 @@ class FloatBaseTest extends BaseTest { '--customTag', "${FloatConf.NF_SESSION_ID}:uuid-$uuid", '--customTag', "${FloatConf.NF_TASK_NAME}:foo--$taskIDStr-", '--customTag', "${FloatConf.FLOAT_INPUT_SIZE}:0", - '--customTag', "${FloatConf.NF_RUN_NAME}:test-run", - '--imageVolSize', FloatConf.MIN_VOL_SIZE] + '--customTag', "${FloatConf.NF_RUN_NAME}:test-run"] } } diff --git a/plugins/nf-float/src/test/com/memverge/nextflow/FloatGridExecutorTest.groovy b/plugins/nf-float/src/test/com/memverge/nextflow/FloatGridExecutorTest.groovy index aeebcb3..0c873b4 100644 --- a/plugins/nf-float/src/test/com/memverge/nextflow/FloatGridExecutorTest.groovy +++ b/plugins/nf-float/src/test/com/memverge/nextflow/FloatGridExecutorTest.groovy @@ -714,7 +714,7 @@ class FloatGridExecutorTest extends FloatBaseTest { exec.addVolSize(cmd, task) then: - cmd.join(' ') == "--imageVolSize ${FloatConf.MIN_VOL_SIZE}" + cmd.join(' ') == "" } def "get disk size when specified in task"() { @@ -740,6 +740,7 @@ class FloatGridExecutorTest extends FloatBaseTest { exec.addVolSize(cmd, task) then: - cmd.join(' ') == "--imageVolSize ${FloatConf.MIN_VOL_SIZE}" + // do not specify size because it's smaller than min + cmd.join(' ') == "" } }