File tree Expand file tree Collapse file tree 5 files changed +19
-1
lines changed
main/nextflow/cloud/google/batch
test/nextflow/cloud/google/batch Expand file tree Collapse file tree 5 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -923,6 +923,9 @@ The following settings are available:
923923 :::
924924: List of custom mount options for ` gcsfuse ` (default: ` ['-o rw', '-implicit-dirs'] ` ).
925925
926+ ` google.batch.installOpsAgent `
927+ : Enable the installation of the Ops Agent on Google Batch instances for enhanced monitoring and logging (default: ` false ` ).
928+
926929` google.batch.logsPath `
927930: :::{versionadded} 25.11.0-edge
928931 :::
Original file line number Diff line number Diff line change @@ -410,6 +410,9 @@ class GoogleBatchTaskHandler extends TaskHandler implements FusionAwareTask {
410410 instancePolicyOrTemplate. setPolicy( instancePolicy )
411411 }
412412
413+ if ( batchConfig. installOpsAgent )
414+ instancePolicyOrTemplate. setInstallOpsAgent( true )
415+
413416 allocationPolicy. addInstances(instancePolicyOrTemplate)
414417
415418 // network policy
Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ class BatchConfig implements ConfigScope {
8484 """ )
8585 final boolean installGpuDrivers
8686
87+ @ConfigOption
88+ @Description ("""
89+ Enable the installation of the Ops Agent on Google Batch instances for enhanced monitoring and logging (default: `false`).
90+ """ )
91+ final boolean installOpsAgent
92+
8793 @ConfigOption
8894 @Description ("""
8995 The Google Cloud Storage path where job logs should be stored, e.g. `gs://my-logs-bucket/logs`.
@@ -147,6 +153,7 @@ class BatchConfig implements ConfigScope {
147153 cpuPlatform = opts. cpuPlatform
148154 gcsfuseOptions = opts. gcsfuseOptions as List<String > ?: DEFAULT_GCSFUSE_OPTS
149155 installGpuDrivers = opts. installGpuDrivers as boolean
156+ installOpsAgent = opts. installOpsAgent as boolean
150157 logsPath = opts. logsPath
151158 maxSpotAttempts = opts. maxSpotAttempts != null ? opts. maxSpotAttempts as int : DEFAULT_MAX_SPOT_ATTEMPTS
152159 network = opts. network
Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ class GoogleBatchTaskHandlerTest extends Specification {
158158 getServiceAccountEmail() >> ' foo@bar.baz'
159159 getSubnetwork() >> ' subnet-1'
160160 usePrivateAddress >> true
161+ installOpsAgent >> true
161162 logsPath() >> LOGS_PATH
162163 }
163164 }
@@ -224,6 +225,7 @@ class GoogleBatchTaskHandlerTest extends Specification {
224225 allocationPolicy. getLocation(). getAllowedLocations(0 ) == ' zones/us-central1-a'
225226 allocationPolicy. getLocation(). getAllowedLocations(1 ) == ' zones/us-central1-c'
226227 allocationPolicy. getInstances(0 ). getInstallGpuDrivers() == true
228+ allocationPolicy. getInstances(0 ). getInstallOpsAgent() == true
227229 allocationPolicy. getLabelsMap() == [foo : ' bar' ]
228230 allocationPolicy. getServiceAccount(). getEmail() == ' foo@bar.baz'
229231 allocationPolicy. getTagsList() == [' tag1' , ' tag2' ]
Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ class BatchConfigTest extends Specification {
4949 retryPolicy : [maxAttempts : 10 ],
5050 bootDiskImage : ' batch-foo' ,
5151 bootDiskSize : ' 100GB' ,
52- logsPath : ' gs://my-logs-bucket/logs'
52+ logsPath : ' gs://my-logs-bucket/logs' ,
53+ installOpsAgent : true
5354 ]
5455
5556 when :
@@ -65,6 +66,8 @@ class BatchConfigTest extends Specification {
6566 config. bootDiskSize == MemoryUnit . of(' 100GB' )
6667 and :
6768 config. logsPath == ' gs://my-logs-bucket/logs'
69+ and :
70+ config. installOpsAgent == true
6871 }
6972
7073}
You can’t perform that action at this time.
0 commit comments