Skip to content

Commit 4527adf

Browse files
feat: [batch] Add run_as_non_root field to allow user's runnable be executed as non root (#4982)
* feat: Add `run_as_non_root` field to allow user's runnable be executed as non root --- feat: Add `tags` field in Job's AllocationPolicy field in v1 --- feat: add Batch Image Streaming support for v1 --- docs: Polish the field descriptions for enableImageStreaming and CloudLoggingOptions PiperOrigin-RevId: 600866696 Source-Link: googleapis/googleapis@78acac9 Source-Link: googleapis/googleapis-gen@61e7a27 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI2MWU3YTI3MDRlNTk5MjE3MTUxYWNiOTc5OGNhNzdmMjliYzUwNzEwIn0= * 🦉 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 7bfa392 commit 4527adf

6 files changed

Lines changed: 222 additions & 10 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.cloud.batch.v1;
1919
import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
22+
import "google/api/field_info.proto";
2223
import "google/api/resource.proto";
2324
import "google/cloud/batch/v1/job.proto";
2425
import "google/cloud/batch/v1/task.proto";

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

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,20 @@ message Job {
9191
// LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
9292
// preserved.
9393
message LogsPolicy {
94-
// CloudLoggingOption contains additional settings for cloud logging generated
95-
// by Batch job.
96-
message CloudLoggingOption {}
94+
// `CloudLoggingOption` contains additional settings for Cloud Logging logs
95+
// generated by Batch job.
96+
message CloudLoggingOption {
97+
// Optional. Set this flag to true to change the [monitored resource
98+
// type](https://cloud.google.com/monitoring/api/resources) for
99+
// Cloud Logging logs generated by this Batch job from
100+
// the
101+
// [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job)
102+
// type to the formerly used
103+
// [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task)
104+
// type.
105+
bool use_generic_task_monitored_resource = 1
106+
[(google.api.field_behavior) = OPTIONAL];
107+
}
97108

98109
// The destination (if any) for logs.
99110
enum Destination {
@@ -116,7 +127,7 @@ message LogsPolicy {
116127
string logs_path = 2;
117128

118129
// Optional. Additional settings for Cloud Logging. It will only take effect
119-
// when the destination of LogsPolicy is set to CLOUD_LOGGING.
130+
// when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
120131
CloudLoggingOption cloud_logging_option = 3
121132
[(google.api.field_behavior) = OPTIONAL];
122133
}
@@ -517,13 +528,20 @@ message AllocationPolicy {
517528

518529
// The network policy.
519530
//
520-
// If you define an instance template in the InstancePolicyOrTemplate field,
531+
// If you define an instance template in the `InstancePolicyOrTemplate` field,
521532
// Batch will use the network settings in the instance template instead of
522533
// this field.
523534
NetworkPolicy network = 7;
524535

525536
// The placement policy.
526537
PlacementPolicy placement = 10;
538+
539+
// Optional. Tags applied to the VM instances.
540+
//
541+
// The tags identify valid sources or targets for network firewalls.
542+
// Each tag must be 1-63 characters long, and comply with
543+
// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
544+
repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL];
527545
}
528546

529547
// A TaskGroup defines one or more Tasks that all share the same TaskSpec.
@@ -595,6 +613,12 @@ message TaskGroup {
595613
// When true, Batch will configure SSH to allow passwordless login between
596614
// VMs running the Batch tasks in the same TaskGroup.
597615
bool permissive_ssh = 12;
616+
617+
// Optional. If not set or set to false, Batch will use root user to execute
618+
// runnables. If set to true, Batch will make sure to run the runnables using
619+
// non-root user. Currently, the non-root user Batch used is generated by OS
620+
// login. Reference: https://cloud.google.com/compute/docs/oslogin
621+
bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL];
598622
}
599623

600624
// Carries information about a Google Cloud service account.

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,25 @@ message Runnable {
188188
// matches `projects/*/secrets/*/versions/*` then Batch will read the
189189
// password from the Secret Manager;
190190
string password = 11;
191+
192+
// Optional. If set to true, this container runnable uses Image streaming.
193+
//
194+
// Use Image streaming to allow the runnable to initialize without
195+
// waiting for the entire container image to download, which can
196+
// significantly reduce startup time for large container images.
197+
//
198+
// When `enableImageStreaming` is set to true, the container
199+
// runtime is [containerd](https://containerd.io/) instead of Docker.
200+
// Additionally, this container runnable only supports the following
201+
// `container` subfields: `imageUri`,
202+
// `commands[]`, `entrypoint`, and
203+
// `volumes[]`; any other `container` subfields are ignored.
204+
//
205+
// For more information about the requirements and limitations for using
206+
// Image streaming with Batch, see the [`image-streaming`
207+
// sample on
208+
// GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming).
209+
bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL];
191210
}
192211

193212
// Script runnable.

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

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

0 commit comments

Comments
 (0)