diff --git a/docs/google.rst b/docs/google.rst index d83fcef52d..907b32245f 100644 --- a/docs/google.rst +++ b/docs/google.rst @@ -106,6 +106,7 @@ google.region The Google *region* where the com google.zone The Google *zone* where the computation is executed in Compute Engine VMs. Multiple zones can be provided separating them by a comma. Do not specify if a region is provided. See `available Compute Engine regions and zones `_ google.location The Google *location* where the job executions are deployed to Cloud Life Sciences API. See `available Cloud Life Sciences API locations `_ (default: the same as the region or the zone specified). google.enableRequesterPaysBuckets When ``true`` uses the configured Google project id as the billing project for storage access. This is required when accessing data from *reqester pays enabled* buckets. See `Requester Pays on Google Cloud Storage documentation `_ (default: ``false``) +google.lifeSciences.cpuPlatform Set the minimum CPU Platform e.g `'Intel Skylake'` See `Specifying a minimum CPU Platform for VM instances `_ (default: none). google.lifeSciences.bootDiskSize Set the size of the virtual machine boot disk e.g `50.GB` (default: none). google.lifeSciences.copyImage The container image run to copy input and output files. It must include the ``gsutil`` tool (default: ``google/cloud-sdk:alpine``). google.lifeSciences.debug When ``true`` copies the `/google` debug directory in that task bucket directory (default: ``false``) diff --git a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfig.groovy b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfig.groovy index e7dfb8b006..2731e80c8f 100644 --- a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfig.groovy +++ b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfig.groovy @@ -52,6 +52,7 @@ class GoogleLifeSciencesConfig { String location boolean disableBinDir MemoryUnit bootDiskSize + String cpuPlatform boolean sshDaemon String sshImage Integer debugMode @@ -109,6 +110,7 @@ class GoogleLifeSciencesConfig { final boolean disableBinDir = config.navigate('google.lifeSciences.disableRemoteBinDir',false) final preemptible = config.navigate("google.lifeSciences.preemptible", false) as boolean final bootDiskSize = config.navigate('google.lifeSciences.bootDiskSize') as MemoryUnit + final cpuPlatform = config.navigate('google.lifeSciences.cpuPlatform') as String final sshDaemon = config.navigate('google.lifeSciences.sshDaemon', false) as boolean final sshImage = config.navigate('google.lifeSciences.sshImage', DEFAULT_SSH_IMAGE) as String final copyImage = config.navigate('google.lifeSciences.copyImage', DEFAULT_COPY_IMAGE) as String @@ -128,6 +130,7 @@ class GoogleLifeSciencesConfig { preemptible: preemptible, disableBinDir: disableBinDir, bootDiskSize: bootDiskSize, + cpuPlatform: cpuPlatform, debugMode: debugMode0(debugMode), copyImage: copyImage, sshDaemon: sshDaemon, diff --git a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelper.groovy b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelper.groovy index c8da324163..d89a1d32e3 100644 --- a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelper.groovy +++ b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelper.groovy @@ -190,6 +190,10 @@ class GoogleLifeSciencesHelper { if( req.bootDiskSizeGb ) { vm.setBootDiskSizeGb(req.bootDiskSizeGb) } + + if( req.cpuPlatform ) { + vm.setCpuPlatform(req.cpuPlatform) + } if( req.accelerator ) { final acc = new Accelerator().setType(req.accelerator.type).setCount(req.accelerator.request) diff --git a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesSubmitRequest.groovy b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesSubmitRequest.groovy index 599ebb773f..6ef77b964d 100644 --- a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesSubmitRequest.groovy +++ b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesSubmitRequest.groovy @@ -59,6 +59,8 @@ class GoogleLifeSciencesSubmitRequest { Path workDir Integer bootDiskSizeGb + + String cpuPlatform String entryPoint diff --git a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandler.groovy b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandler.groovy index 8ba3693cba..c04dad6011 100644 --- a/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandler.groovy +++ b/modules/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandler.groovy @@ -299,6 +299,7 @@ class GoogleLifeSciencesTaskHandler extends TaskHandler { req.sharedMount = configureMount(DEFAULT_DISK_NAME, task.workDir.toString()) req.accelerator = task.config.getAccelerator() req.location = executor.config.location + req.cpuPlatform = executor.config.cpuPlatform req.bootDiskSizeGb = executor.config.bootDiskSize?.toGiga() as Integer req.entryPoint = task.config.getContainerOptionsMap().getOrDefault('entrypoint', GoogleLifeSciencesConfig.DEFAULT_ENTRY_POINT) req.usePrivateAddress = executor.config.usePrivateAddress diff --git a/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfigTest.groovy b/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfigTest.groovy index e6232bc68b..ff9a1f3b24 100644 --- a/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfigTest.groovy +++ b/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesConfigTest.groovy @@ -240,5 +240,18 @@ class GoogleLifeSciencesConfigTest extends Specification { config.enableRequesterPaysBuckets == true } + + def 'should config cpuPlatform' () { + when: + def config = GoogleLifeSciencesConfig.fromSession0([google:[project:'foo', region:'x', lifeSciences: [:]]]) + then: + config.cpuPlatform == null + + when: + config = GoogleLifeSciencesConfig.fromSession0([google:[project:'foo', region:'x', lifeSciences: [cpuPlatform:'Intel Skylake']]]) + then: + config.cpuPlatform == 'Intel Skylake' + + } } diff --git a/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelperTest.groovy b/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelperTest.groovy index 8b73791506..4c6e2b50ea 100644 --- a/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelperTest.groovy +++ b/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesHelperTest.groovy @@ -189,6 +189,7 @@ class GoogleLifeSciencesHelperTest extends GoogleSpecification { preemptible: false, accelerator: acc, bootDiskSizeGb: 75, + cpuPlatform: 'Intel Skylake', usePrivateAddress: true )) then: with(resources3) { @@ -202,6 +203,7 @@ class GoogleLifeSciencesHelperTest extends GoogleSpecification { getVirtualMachine().getAccelerators()[0].getCount()==4 getVirtualMachine().getAccelerators()[0].getType()=='nvidia-tesla-k80' getVirtualMachine().getBootDiskSizeGb() == 75 + getVirtualMachine().getCpuPlatform() == 'Intel Skylake' getVirtualMachine().getNetwork().getUsePrivateAddress() } } diff --git a/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandlerTest.groovy b/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandlerTest.groovy index 71965245c2..abbd833106 100644 --- a/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandlerTest.groovy +++ b/modules/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesTaskHandlerTest.groovy @@ -178,6 +178,7 @@ class GoogleLifeSciencesTaskHandlerTest extends GoogleSpecification { req.sharedMount.getDisk() == GoogleLifeSciencesTaskHandler.DEFAULT_DISK_NAME !req.sharedMount.getReadOnly() req.bootDiskSizeGb == null + req.cpuPlatform == null req.entryPoint == GoogleLifeSciencesConfig.DEFAULT_ENTRY_POINT !req.usePrivateAddress @@ -211,6 +212,7 @@ class GoogleLifeSciencesTaskHandlerTest extends GoogleSpecification { getPreemptible() >> true getBootDiskSize() >> MemoryUnit.of('20 GB') getUsePrivateAddress() >> true + getCpuPlatform() >> 'Intel Skylake' } } } @@ -244,6 +246,7 @@ class GoogleLifeSciencesTaskHandlerTest extends GoogleSpecification { req.sharedMount.getDisk() == GoogleLifeSciencesTaskHandler.DEFAULT_DISK_NAME !req.sharedMount.getReadOnly() req.bootDiskSizeGb == 20 + req.cpuPlatform =='Intel Skylake' req.entryPoint == GoogleLifeSciencesConfig.DEFAULT_ENTRY_POINT req.usePrivateAddress