Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,13 @@ The following settings are available:
:::
: List of custom mount options for `gcsfuse` (default: `['-o rw', '-implicit-dirs']`).

`google.batch.installOpsAgent`
: Enable the installation of the Ops Agent on Google Batch instances for enhanced monitoring and logging (default: `false`).

: :::{note}
The Ops Agent requires a compatible boot disk image. For Google Batch, use [Batch-debian images](https://docs.cloud.google.com/batch/docs/vm-os-environment-overview#vm-os-image-options) (e.g., `batch-debian`) with `google.batch.bootDiskImage`. The default Container-Optimized OS (`batch-cos`) is not compatible with the Ops Agent.
:::

`google.batch.logsPath`
: :::{versionadded} 25.11.0-edge
:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ class GoogleBatchTaskHandler extends TaskHandler implements FusionAwareTask {
instancePolicyOrTemplate.setPolicy( instancePolicy )
}

if( batchConfig.installOpsAgent )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it check if the boot disk image is compatible with the Ops Agent?

instancePolicyOrTemplate.setInstallOpsAgent( true )

allocationPolicy.addInstances(instancePolicyOrTemplate)

// network policy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ class BatchConfig implements ConfigScope {
""")
final boolean installGpuDrivers

@ConfigOption
@Description("""
Enable the installation of the Ops Agent on Google Batch instances for enhanced monitoring and logging (default: `false`).
""")
final boolean installOpsAgent

@ConfigOption
@Description("""
The Google Cloud Storage path where job logs should be stored, e.g. `gs://my-logs-bucket/logs`.
Expand Down Expand Up @@ -147,6 +153,7 @@ class BatchConfig implements ConfigScope {
cpuPlatform = opts.cpuPlatform
gcsfuseOptions = opts.gcsfuseOptions as List<String> ?: DEFAULT_GCSFUSE_OPTS
installGpuDrivers = opts.installGpuDrivers as boolean
installOpsAgent = opts.installOpsAgent as boolean
logsPath = opts.logsPath
maxSpotAttempts = opts.maxSpotAttempts != null ? opts.maxSpotAttempts as int : DEFAULT_MAX_SPOT_ATTEMPTS
network = opts.network
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class GoogleBatchTaskHandlerTest extends Specification {
getServiceAccountEmail() >> 'foo@bar.baz'
getSubnetwork() >> 'subnet-1'
usePrivateAddress >> true
installOpsAgent >> true
logsPath() >> LOGS_PATH
}
}
Expand Down Expand Up @@ -224,6 +225,7 @@ class GoogleBatchTaskHandlerTest extends Specification {
allocationPolicy.getLocation().getAllowedLocations(0) == 'zones/us-central1-a'
allocationPolicy.getLocation().getAllowedLocations(1) == 'zones/us-central1-c'
allocationPolicy.getInstances(0).getInstallGpuDrivers() == true
allocationPolicy.getInstances(0).getInstallOpsAgent() == true
allocationPolicy.getLabelsMap() == [foo: 'bar']
allocationPolicy.getServiceAccount().getEmail() == 'foo@bar.baz'
allocationPolicy.getTagsList() == ['tag1', 'tag2']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class BatchConfigTest extends Specification {
retryPolicy: [maxAttempts: 10],
bootDiskImage: 'batch-foo',
bootDiskSize: '100GB',
logsPath: 'gs://my-logs-bucket/logs'
logsPath: 'gs://my-logs-bucket/logs',
installOpsAgent: true
]

when:
Expand All @@ -65,6 +66,8 @@ class BatchConfigTest extends Specification {
config.bootDiskSize == MemoryUnit.of('100GB')
and:
config.logsPath == 'gs://my-logs-bucket/logs'
and:
config.installOpsAgent == true
}

}
Loading