Skip to content

Commit 6481ff4

Browse files
feat: [batch] add a install_ops_agent field to InstancePolicyOrTemplate for Ops Agent support (#5426)
* feat: add a install_ops_agent field to InstancePolicyOrTemplate for Ops Agent support --- docs: A comment for field `max_run_duration` in message `google.cloud.batch.v1alpha.TaskSpec` is changed --- docs: refine doc for the update_mask field in message `google.cloud.batch.v1alpha.UpdateJobRequest` PiperOrigin-RevId: 639906977 Source-Link: googleapis/googleapis@d5cddab Source-Link: googleapis/googleapis-gen@99fe429 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI5OWZlNDI5N2ZiYWNhZTIxNzdlMTdiMTYyMDQyNWU2NTUwM2Y1ZDZiIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent cd0e081 commit 6481ff4

9 files changed

Lines changed: 106 additions & 23 deletions

File tree

packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,26 @@ message DeleteJobRequest {
236236
// UpdateJob Request.
237237
message UpdateJobRequest {
238238
// Required. The Job to update.
239-
// Only fields specified in `update_mask` are updated.
239+
// Only fields specified in `updateMask` are updated.
240240
Job job = 1 [(google.api.field_behavior) = REQUIRED];
241241

242242
// Required. Mask of fields to update.
243243
//
244-
// UpdateJob request now only supports update on `task_count` field in a job's
245-
// first task group. Other fields will be ignored.
244+
// The `jobs.patch` method can only be used while a job is in the `QUEUED`,
245+
// `SCHEDULED`, or `RUNNING` state and currently only supports increasing the
246+
// value of the first `taskCount` field in the job's `taskGroups` field.
247+
// Therefore, you must set the value of `updateMask` to `taskGroups`. Any
248+
// other job fields in the update request will be ignored.
249+
//
250+
// For example, to update a job's `taskCount` to `2`, set `updateMask` to
251+
// `taskGroups` and use the following request body:
252+
// ```
253+
// {
254+
// "taskGroups":[{
255+
// "taskCount": 2
256+
// }]
257+
// }
258+
// ```
246259
google.protobuf.FieldMask update_mask = 2
247260
[(google.api.field_behavior) = REQUIRED];
248261

packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,9 @@ message AllocationPolicy {
486486
string instance_template = 2;
487487
}
488488

489-
// Set this field true if users want Batch to help fetch drivers from a
490-
// third party location and install them for GPUs specified in
491-
// policy.accelerators or instance_template on their behalf. Default is
489+
// Set this field true if you want Batch to help fetch drivers from a third
490+
// party location and install them for GPUs specified in
491+
// `policy.accelerators` or `instance_template` on your behalf. Default is
492492
// false.
493493
//
494494
// For Container-Optimized Image cases, Batch will install the
@@ -497,6 +497,10 @@ message AllocationPolicy {
497497
// non Container-Optimized Image cases, following
498498
// https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
499499
bool install_gpu_drivers = 3;
500+
501+
// Optional. Set this field true if you want Batch to install Ops Agent on
502+
// your behalf. Default is false.
503+
bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL];
500504
}
501505

502506
// A network interface.

packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ message TaskExecution {
113113
// due to the following reasons, the exit code will be 50000.
114114
//
115115
// Otherwise, it can be from different sources:
116-
// - Batch known failures as
116+
// * Batch known failures:
117117
// https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes.
118-
// - Batch runnable execution failures: You can rely on Batch logs for further
119-
// diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs.
120-
// If there are multiple runnables failures, Batch only exposes the first
121-
// error caught for now.
118+
// * Batch runnable execution failures; you can rely on Batch logs to further
119+
// diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If
120+
// there are multiple runnables failures, Batch only exposes the first error.
122121
int32 exit_code = 1;
123122

124123
// Optional. The tail end of any content written to standard error by the task
@@ -360,10 +359,15 @@ message TaskSpec {
360359
// ComputeResource requirements.
361360
ComputeResource compute_resource = 3;
362361

363-
// Maximum duration the task should run.
364-
// The task will be killed and marked as FAILED if over this limit.
365-
// The valid value range for max_run_duration in seconds is [0,
366-
// 315576000000.999999999],
362+
// Maximum duration the task should run before being automatically retried
363+
// (if enabled) or automatically failed. Format the value of this field
364+
// as a time limit in seconds followed by `s`&mdash;for example, `3600s`
365+
// for 1 hour. The field accepts any value between 0 and the maximum listed
366+
// for the `Duration` field type at
367+
// https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however,
368+
// the actual maximum run time for a job will be limited to the maximum run
369+
// time for a job listed at
370+
// https://cloud.google.com/batch/quotas#max-job-duration.
367371
google.protobuf.Duration max_run_duration = 4;
368372

369373
// Maximum number of retries on failures.

packages/google-cloud-batch/protos/protos.d.ts

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-batch/protos/protos.js

Lines changed: 25 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-batch/protos/protos.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_job.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,25 @@ function main(job, updateMask) {
3030
*/
3131
/**
3232
* Required. The Job to update.
33-
* Only fields specified in `update_mask` are updated.
33+
* Only fields specified in `updateMask` are updated.
3434
*/
3535
// const job = {}
3636
/**
3737
* Required. Mask of fields to update.
38-
* UpdateJob request now only supports update on `task_count` field in a job's
39-
* first task group. Other fields will be ignored.
38+
* The `jobs.patch` method can only be used while a job is in the `QUEUED`,
39+
* `SCHEDULED`, or `RUNNING` state and currently only supports increasing the
40+
* value of the first `taskCount` field in the job's `taskGroups` field.
41+
* Therefore, you must set the value of `updateMask` to `taskGroups`. Any
42+
* other job fields in the update request will be ignored.
43+
* For example, to update a job's `taskCount` to `2`, set `updateMask` to
44+
* `taskGroups` and use the following request body:
45+
* ```
46+
* {
47+
* "taskGroups":{
48+
* "taskCount": 2
49+
* }
50+
* }
51+
* ```
4052
*/
4153
// const updateMask = {}
4254
/**

packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"segments": [
163163
{
164164
"start": 25,
165-
"end": 75,
165+
"end": 87,
166166
"type": "FULL"
167167
}
168168
],

packages/google-cloud-batch/src/v1alpha/batch_service_client.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,25 @@ export class BatchServiceClient {
702702
* The request object that will be sent.
703703
* @param {google.cloud.batch.v1alpha.Job} request.job
704704
* Required. The Job to update.
705-
* Only fields specified in `update_mask` are updated.
705+
* Only fields specified in `updateMask` are updated.
706706
* @param {google.protobuf.FieldMask} request.updateMask
707707
* Required. Mask of fields to update.
708708
*
709-
* UpdateJob request now only supports update on `task_count` field in a job's
710-
* first task group. Other fields will be ignored.
709+
* The `jobs.patch` method can only be used while a job is in the `QUEUED`,
710+
* `SCHEDULED`, or `RUNNING` state and currently only supports increasing the
711+
* value of the first `taskCount` field in the job's `taskGroups` field.
712+
* Therefore, you must set the value of `updateMask` to `taskGroups`. Any
713+
* other job fields in the update request will be ignored.
714+
*
715+
* For example, to update a job's `taskCount` to `2`, set `updateMask` to
716+
* `taskGroups` and use the following request body:
717+
* ```
718+
* {
719+
* "taskGroups":[{
720+
* "taskCount": 2
721+
* }]
722+
* }
723+
* ```
711724
* @param {string} [request.requestId]
712725
* Optional. An optional request ID to identify requests. Specify a unique
713726
* request ID so that if you must retry your request, the server will know to

0 commit comments

Comments
 (0)