Skip to content

Commit

Permalink
feat: [batch] add a install_ops_agent field to InstancePolicyOrTempla…
Browse files Browse the repository at this point in the history
…te 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jun 4, 2024
1 parent cd0e081 commit 6481ff4
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,26 @@ message DeleteJobRequest {
// UpdateJob Request.
message UpdateJobRequest {
// Required. The Job to update.
// Only fields specified in `update_mask` are updated.
// Only fields specified in `updateMask` are updated.
Job job = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Mask of fields to update.
//
// UpdateJob request now only supports update on `task_count` field in a job's
// first task group. Other fields will be ignored.
// The `jobs.patch` method can only be used while a job is in the `QUEUED`,
// `SCHEDULED`, or `RUNNING` state and currently only supports increasing the
// value of the first `taskCount` field in the job's `taskGroups` field.
// Therefore, you must set the value of `updateMask` to `taskGroups`. Any
// other job fields in the update request will be ignored.
//
// For example, to update a job's `taskCount` to `2`, set `updateMask` to
// `taskGroups` and use the following request body:
// ```
// {
// "taskGroups":[{
// "taskCount": 2
// }]
// }
// ```
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,9 @@ message AllocationPolicy {
string instance_template = 2;
}

// Set this field true if users want Batch to help fetch drivers from a
// third party location and install them for GPUs specified in
// policy.accelerators or instance_template on their behalf. Default is
// Set this field true if you want Batch to help fetch drivers from a third
// party location and install them for GPUs specified in
// `policy.accelerators` or `instance_template` on your behalf. Default is
// false.
//
// For Container-Optimized Image cases, Batch will install the
Expand All @@ -497,6 +497,10 @@ message AllocationPolicy {
// non Container-Optimized Image cases, following
// https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
bool install_gpu_drivers = 3;

// Optional. Set this field true if you want Batch to install Ops Agent on
// your behalf. Default is false.
bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL];
}

// A network interface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,11 @@ message TaskExecution {
// due to the following reasons, the exit code will be 50000.
//
// Otherwise, it can be from different sources:
// - Batch known failures as
// * Batch known failures:
// https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes.
// - Batch runnable execution failures: You can rely on Batch logs for further
// diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs.
// If there are multiple runnables failures, Batch only exposes the first
// error caught for now.
// * Batch runnable execution failures; you can rely on Batch logs to further
// diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If
// there are multiple runnables failures, Batch only exposes the first error.
int32 exit_code = 1;

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

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

// Maximum number of retries on failures.
Expand Down
6 changes: 6 additions & 0 deletions packages/google-cloud-batch/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 25 additions & 1 deletion packages/google-cloud-batch/protos/protos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/google-cloud-batch/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,25 @@ function main(job, updateMask) {
*/
/**
* Required. The Job to update.
* Only fields specified in `update_mask` are updated.
* Only fields specified in `updateMask` are updated.
*/
// const job = {}
/**
* Required. Mask of fields to update.
* UpdateJob request now only supports update on `task_count` field in a job's
* first task group. Other fields will be ignored.
* The `jobs.patch` method can only be used while a job is in the `QUEUED`,
* `SCHEDULED`, or `RUNNING` state and currently only supports increasing the
* value of the first `taskCount` field in the job's `taskGroups` field.
* Therefore, you must set the value of `updateMask` to `taskGroups`. Any
* other job fields in the update request will be ignored.
* For example, to update a job's `taskCount` to `2`, set `updateMask` to
* `taskGroups` and use the following request body:
* ```
* {
* "taskGroups":{
* "taskCount": 2
* }
* }
* ```
*/
// const updateMask = {}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"segments": [
{
"start": 25,
"end": 75,
"end": 87,
"type": "FULL"
}
],
Expand Down
19 changes: 16 additions & 3 deletions packages/google-cloud-batch/src/v1alpha/batch_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,25 @@ export class BatchServiceClient {
* The request object that will be sent.
* @param {google.cloud.batch.v1alpha.Job} request.job
* Required. The Job to update.
* Only fields specified in `update_mask` are updated.
* Only fields specified in `updateMask` are updated.
* @param {google.protobuf.FieldMask} request.updateMask
* Required. Mask of fields to update.
*
* UpdateJob request now only supports update on `task_count` field in a job's
* first task group. Other fields will be ignored.
* The `jobs.patch` method can only be used while a job is in the `QUEUED`,
* `SCHEDULED`, or `RUNNING` state and currently only supports increasing the
* value of the first `taskCount` field in the job's `taskGroups` field.
* Therefore, you must set the value of `updateMask` to `taskGroups`. Any
* other job fields in the update request will be ignored.
*
* For example, to update a job's `taskCount` to `2`, set `updateMask` to
* `taskGroups` and use the following request body:
* ```
* {
* "taskGroups":[{
* "taskCount": 2
* }]
* }
* ```
* @param {string} [request.requestId]
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
Expand Down

0 comments on commit 6481ff4

Please sign in to comment.