Skip to content

Commit 4bcdc24

Browse files
feat: [batch] Add tags field in Job's AllocationPolicy field in v1alpha (#10206)
* feat: Add `tags` field in Job's AllocationPolicy field in v1alpha feat: add a run_as_non_root field and deprecate enable_oslogin for non-root execution docs: updated comments PiperOrigin-RevId: 596742590 Source-Link: googleapis/googleapis@09b78e2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d5d869942aafdf9446c274380b7348c1591c156d Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZDVkODY5OTQyYWFmZGY5NDQ2YzI3NDM4MGI3MzQ4YzE1OTFjMTU2ZCJ9 * 🦉 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 96c4cd6 commit 4bcdc24

File tree

8 files changed

+661
-95
lines changed

8 files changed

+661
-95
lines changed

java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java

Lines changed: 329 additions & 0 deletions
Large diffs are not rendered by default.

java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,4 +565,71 @@ java.lang.String getLabelsOrDefault(
565565
* <code>.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy placement = 10;</code>
566566
*/
567567
com.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicyOrBuilder getPlacementOrBuilder();
568+
569+
/**
570+
*
571+
*
572+
* <pre>
573+
* Optional. Tags applied to the VM instances.
574+
*
575+
* The tags identify valid sources or targets for network firewalls.
576+
* Each tag must be 1-63 characters long, and comply with
577+
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
578+
* </pre>
579+
*
580+
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
581+
*
582+
* @return A list containing the tags.
583+
*/
584+
java.util.List<java.lang.String> getTagsList();
585+
/**
586+
*
587+
*
588+
* <pre>
589+
* Optional. Tags applied to the VM instances.
590+
*
591+
* The tags identify valid sources or targets for network firewalls.
592+
* Each tag must be 1-63 characters long, and comply with
593+
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
594+
* </pre>
595+
*
596+
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
597+
*
598+
* @return The count of tags.
599+
*/
600+
int getTagsCount();
601+
/**
602+
*
603+
*
604+
* <pre>
605+
* Optional. Tags applied to the VM instances.
606+
*
607+
* The tags identify valid sources or targets for network firewalls.
608+
* Each tag must be 1-63 characters long, and comply with
609+
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
610+
* </pre>
611+
*
612+
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
613+
*
614+
* @param index The index of the element to return.
615+
* @return The tags at the given index.
616+
*/
617+
java.lang.String getTags(int index);
618+
/**
619+
*
620+
*
621+
* <pre>
622+
* Optional. Tags applied to the VM instances.
623+
*
624+
* The tags identify valid sources or targets for network firewalls.
625+
* Each tag must be 1-63 characters long, and comply with
626+
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
627+
* </pre>
628+
*
629+
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
630+
*
631+
* @param index The index of the value to return.
632+
* @return The bytes of the tags at the given index.
633+
*/
634+
com.google.protobuf.ByteString getTagsBytes(int index);
568635
}

java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java

Lines changed: 68 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
229229
+ "\016new_task_state\030\003 \001(\0162,.google.cloud.bat"
230230
+ "ch.v1alpha.TaskStatus.State\"K\n\004Type\022\024\n\020T"
231231
+ "YPE_UNSPECIFIED\020\000\022\025\n\021JOB_STATE_CHANGED\020\001"
232-
+ "\022\026\n\022TASK_STATE_CHANGED\020\002\"\240\021\n\020AllocationP"
232+
+ "\022\026\n\022TASK_STATE_CHANGED\020\002\"\264\021\n\020AllocationP"
233233
+ "olicy\022M\n\010location\030\001 \001(\0132;.google.cloud.b"
234234
+ "atch.v1alpha.AllocationPolicy.LocationPo"
235235
+ "licy\022Q\n\010instance\030\002 \001(\0132;.google.cloud.ba"
@@ -248,70 +248,71 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
248248
+ "ch.v1alpha.AllocationPolicy.NetworkPolic"
249249
+ "y\022O\n\tplacement\030\n \001(\0132<.google.cloud.batc"
250250
+ "h.v1alpha.AllocationPolicy.PlacementPoli"
251-
+ "cy\032E\n\016LocationPolicy\022\031\n\021allowed_location"
252-
+ "s\030\001 \003(\t\022\030\n\020denied_locations\030\002 \003(\t\032q\n\004Dis"
253-
+ "k\022\017\n\005image\030\004 \001(\tH\000\022\022\n\010snapshot\030\005 \001(\tH\000\022\014"
254-
+ "\n\004type\030\001 \001(\t\022\017\n\007size_gb\030\002 \001(\003\022\026\n\016disk_in"
255-
+ "terface\030\006 \001(\tB\r\n\013data_source\032\217\001\n\014Attache"
256-
+ "dDisk\022E\n\010new_disk\030\001 \001(\01321.google.cloud.b"
257-
+ "atch.v1alpha.AllocationPolicy.DiskH\000\022\027\n\r"
258-
+ "existing_disk\030\002 \001(\tH\000\022\023\n\013device_name\030\003 \001"
259-
+ "(\tB\n\n\010attached\032i\n\013Accelerator\022\014\n\004type\030\001 "
260-
+ "\001(\t\022\r\n\005count\030\002 \001(\003\022\037\n\023install_gpu_driver"
261-
+ "s\030\003 \001(\010B\002\030\001\022\034\n\016driver_version\030\004 \001(\tB\004\342A\001"
262-
+ "\001\032\272\003\n\016InstancePolicy\022!\n\025allowed_machine_"
263-
+ "types\030\001 \003(\tB\002\030\001\022\024\n\014machine_type\030\002 \001(\t\022\030\n"
264-
+ "\020min_cpu_platform\030\003 \001(\t\022Z\n\022provisioning_"
265-
+ "model\030\004 \001(\0162>.google.cloud.batch.v1alpha"
266-
+ ".AllocationPolicy.ProvisioningModel\022N\n\014a"
267-
+ "ccelerators\030\005 \003(\01328.google.cloud.batch.v"
268-
+ "1alpha.AllocationPolicy.Accelerator\022D\n\tb"
269-
+ "oot_disk\030\010 \001(\01321.google.cloud.batch.v1al"
270-
+ "pha.AllocationPolicy.Disk\022H\n\005disks\030\006 \003(\013"
271-
+ "29.google.cloud.batch.v1alpha.Allocation"
272-
+ "Policy.AttachedDisk\022\031\n\013reservation\030\007 \001(\t"
273-
+ "B\004\342A\001\001\032\266\001\n\030InstancePolicyOrTemplate\022M\n\006p"
274-
+ "olicy\030\001 \001(\0132;.google.cloud.batch.v1alpha"
275-
+ ".AllocationPolicy.InstancePolicyH\000\022\033\n\021in"
276-
+ "stance_template\030\002 \001(\tH\000\022\033\n\023install_gpu_d"
277-
+ "rivers\030\003 \001(\010B\021\n\017policy_template\032W\n\020Netwo"
278-
+ "rkInterface\022\017\n\007network\030\001 \001(\t\022\022\n\nsubnetwo"
279-
+ "rk\030\002 \001(\t\022\036\n\026no_external_ip_address\030\003 \001(\010"
280-
+ "\032j\n\rNetworkPolicy\022Y\n\022network_interfaces\030"
281-
+ "\001 \003(\0132=.google.cloud.batch.v1alpha.Alloc"
282-
+ "ationPolicy.NetworkInterface\032<\n\017Placemen"
283-
+ "tPolicy\022\023\n\013collocation\030\001 \001(\t\022\024\n\014max_dist"
284-
+ "ance\030\002 \001(\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r"
285-
+ "\n\005value\030\002 \001(\t:\0028\001\"`\n\021ProvisioningModel\022\""
286-
+ "\n\036PROVISIONING_MODEL_UNSPECIFIED\020\000\022\014\n\010ST"
287-
+ "ANDARD\020\001\022\010\n\004SPOT\020\002\022\017\n\013PREEMPTIBLE\020\003\"\227\006\n\t"
288-
+ "TaskGroup\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022=\n\ttask_sp"
289-
+ "ec\030\003 \001(\0132$.google.cloud.batch.v1alpha.Ta"
290-
+ "skSpecB\004\342A\001\002\022\022\n\ntask_count\030\004 \001(\003\022\023\n\013para"
291-
+ "llelism\030\005 \001(\003\022Q\n\021scheduling_policy\030\006 \001(\016"
292-
+ "26.google.cloud.batch.v1alpha.TaskGroup."
293-
+ "SchedulingPolicy\022G\n\021allocation_policy\030\007 "
294-
+ "\001(\0132,.google.cloud.batch.v1alpha.Allocat"
295-
+ "ionPolicy\022A\n\006labels\030\010 \003(\01321.google.cloud"
296-
+ ".batch.v1alpha.TaskGroup.LabelsEntry\022B\n\021"
297-
+ "task_environments\030\t \003(\0132\'.google.cloud.b"
298-
+ "atch.v1alpha.Environment\022\033\n\023task_count_p"
299-
+ "er_node\030\n \001(\003\022\032\n\022require_hosts_file\030\013 \001("
300-
+ "\010\022\026\n\016permissive_ssh\030\014 \001(\010\022\034\n\016enable_oslo"
301-
+ "gin\030\r \001(\010B\004\342A\001\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 "
302-
+ "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\\\n\020SchedulingPoli"
303-
+ "cy\022!\n\035SCHEDULING_POLICY_UNSPECIFIED\020\000\022\027\n"
304-
+ "\023AS_SOON_AS_POSSIBLE\020\001\022\014\n\010IN_ORDER\020\002:o\352A"
305-
+ "l\n\036batch.googleapis.com/TaskGroup\022Jproje"
306-
+ "cts/{project}/locations/{location}/jobs/"
307-
+ "{job}/taskGroups/{task_group}\"/\n\016Service"
308-
+ "Account\022\r\n\005email\030\001 \001(\t\022\016\n\006scopes\030\002 \003(\tB\302"
309-
+ "\001\n\036com.google.cloud.batch.v1alphaB\010JobPr"
310-
+ "otoP\001Z4cloud.google.com/go/batch/apiv1al"
311-
+ "pha/batchpb;batchpb\242\002\003GCB\252\002\032Google.Cloud"
312-
+ ".Batch.V1Alpha\312\002\032Google\\Cloud\\Batch\\V1al"
313-
+ "pha\352\002\035Google::Cloud::Batch::V1alphab\006pro"
314-
+ "to3"
251+
+ "cy\022\022\n\004tags\030\013 \003(\tB\004\342A\001\001\032E\n\016LocationPolicy"
252+
+ "\022\031\n\021allowed_locations\030\001 \003(\t\022\030\n\020denied_lo"
253+
+ "cations\030\002 \003(\t\032q\n\004Disk\022\017\n\005image\030\004 \001(\tH\000\022\022"
254+
+ "\n\010snapshot\030\005 \001(\tH\000\022\014\n\004type\030\001 \001(\t\022\017\n\007size"
255+
+ "_gb\030\002 \001(\003\022\026\n\016disk_interface\030\006 \001(\tB\r\n\013dat"
256+
+ "a_source\032\217\001\n\014AttachedDisk\022E\n\010new_disk\030\001 "
257+
+ "\001(\01321.google.cloud.batch.v1alpha.Allocat"
258+
+ "ionPolicy.DiskH\000\022\027\n\rexisting_disk\030\002 \001(\tH"
259+
+ "\000\022\023\n\013device_name\030\003 \001(\tB\n\n\010attached\032i\n\013Ac"
260+
+ "celerator\022\014\n\004type\030\001 \001(\t\022\r\n\005count\030\002 \001(\003\022\037"
261+
+ "\n\023install_gpu_drivers\030\003 \001(\010B\002\030\001\022\034\n\016drive"
262+
+ "r_version\030\004 \001(\tB\004\342A\001\001\032\272\003\n\016InstancePolicy"
263+
+ "\022!\n\025allowed_machine_types\030\001 \003(\tB\002\030\001\022\024\n\014m"
264+
+ "achine_type\030\002 \001(\t\022\030\n\020min_cpu_platform\030\003 "
265+
+ "\001(\t\022Z\n\022provisioning_model\030\004 \001(\0162>.google"
266+
+ ".cloud.batch.v1alpha.AllocationPolicy.Pr"
267+
+ "ovisioningModel\022N\n\014accelerators\030\005 \003(\01328."
268+
+ "google.cloud.batch.v1alpha.AllocationPol"
269+
+ "icy.Accelerator\022D\n\tboot_disk\030\010 \001(\01321.goo"
270+
+ "gle.cloud.batch.v1alpha.AllocationPolicy"
271+
+ ".Disk\022H\n\005disks\030\006 \003(\01329.google.cloud.batc"
272+
+ "h.v1alpha.AllocationPolicy.AttachedDisk\022"
273+
+ "\031\n\013reservation\030\007 \001(\tB\004\342A\001\001\032\266\001\n\030InstanceP"
274+
+ "olicyOrTemplate\022M\n\006policy\030\001 \001(\0132;.google"
275+
+ ".cloud.batch.v1alpha.AllocationPolicy.In"
276+
+ "stancePolicyH\000\022\033\n\021instance_template\030\002 \001("
277+
+ "\tH\000\022\033\n\023install_gpu_drivers\030\003 \001(\010B\021\n\017poli"
278+
+ "cy_template\032W\n\020NetworkInterface\022\017\n\007netwo"
279+
+ "rk\030\001 \001(\t\022\022\n\nsubnetwork\030\002 \001(\t\022\036\n\026no_exter"
280+
+ "nal_ip_address\030\003 \001(\010\032j\n\rNetworkPolicy\022Y\n"
281+
+ "\022network_interfaces\030\001 \003(\0132=.google.cloud"
282+
+ ".batch.v1alpha.AllocationPolicy.NetworkI"
283+
+ "nterface\032<\n\017PlacementPolicy\022\023\n\013collocati"
284+
+ "on\030\001 \001(\t\022\024\n\014max_distance\030\002 \001(\003\032-\n\013Labels"
285+
+ "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n"
286+
+ "\021ProvisioningModel\022\"\n\036PROVISIONING_MODEL"
287+
+ "_UNSPECIFIED\020\000\022\014\n\010STANDARD\020\001\022\010\n\004SPOT\020\002\022\017"
288+
+ "\n\013PREEMPTIBLE\020\003\"\270\006\n\tTaskGroup\022\022\n\004name\030\001 "
289+
+ "\001(\tB\004\342A\001\003\022=\n\ttask_spec\030\003 \001(\0132$.google.cl"
290+
+ "oud.batch.v1alpha.TaskSpecB\004\342A\001\002\022\022\n\ntask"
291+
+ "_count\030\004 \001(\003\022\023\n\013parallelism\030\005 \001(\003\022Q\n\021sch"
292+
+ "eduling_policy\030\006 \001(\01626.google.cloud.batc"
293+
+ "h.v1alpha.TaskGroup.SchedulingPolicy\022G\n\021"
294+
+ "allocation_policy\030\007 \001(\0132,.google.cloud.b"
295+
+ "atch.v1alpha.AllocationPolicy\022A\n\006labels\030"
296+
+ "\010 \003(\01321.google.cloud.batch.v1alpha.TaskG"
297+
+ "roup.LabelsEntry\022B\n\021task_environments\030\t "
298+
+ "\003(\0132\'.google.cloud.batch.v1alpha.Environ"
299+
+ "ment\022\033\n\023task_count_per_node\030\n \001(\003\022\032\n\022req"
300+
+ "uire_hosts_file\030\013 \001(\010\022\026\n\016permissive_ssh\030"
301+
+ "\014 \001(\010\022\036\n\016enable_oslogin\030\r \001(\010B\006\030\001\342A\001\001\022\035\n"
302+
+ "\017run_as_non_root\030\016 \001(\010B\004\342A\001\001\032-\n\013LabelsEn"
303+
+ "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\\\n\020S"
304+
+ "chedulingPolicy\022!\n\035SCHEDULING_POLICY_UNS"
305+
+ "PECIFIED\020\000\022\027\n\023AS_SOON_AS_POSSIBLE\020\001\022\014\n\010I"
306+
+ "N_ORDER\020\002:o\352Al\n\036batch.googleapis.com/Tas"
307+
+ "kGroup\022Jprojects/{project}/locations/{lo"
308+
+ "cation}/jobs/{job}/taskGroups/{task_grou"
309+
+ "p}\"/\n\016ServiceAccount\022\r\n\005email\030\001 \001(\t\022\016\n\006s"
310+
+ "copes\030\002 \003(\tB\302\001\n\036com.google.cloud.batch.v"
311+
+ "1alphaB\010JobProtoP\001Z4cloud.google.com/go/"
312+
+ "batch/apiv1alpha/batchpb;batchpb\242\002\003GCB\252\002"
313+
+ "\032Google.Cloud.Batch.V1Alpha\312\002\032Google\\Clo"
314+
+ "ud\\Batch\\V1alpha\352\002\035Google::Cloud::Batch:"
315+
+ ":V1alphab\006proto3"
315316
};
316317
descriptor =
317318
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -468,6 +469,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
468469
"Labels",
469470
"Network",
470471
"Placement",
472+
"Tags",
471473
});
472474
internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_descriptor =
473475
internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor
@@ -594,6 +596,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
594596
"RequireHostsFile",
595597
"PermissiveSsh",
596598
"EnableOslogin",
599+
"RunAsNonRoot",
597600
});
598601
internal_static_google_cloud_batch_v1alpha_TaskGroup_LabelsEntry_descriptor =
599602
internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor.getNestedTypes().get(0);

java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,13 @@ public interface ContainerOrBuilder
384384
*
385385
*
386386
* <pre>
387-
* Optional. Not yet implemented.
388-
* If set to true, container will run with Image streaming.
387+
* Optional. If set to true, container will run with Image streaming.
389388
* The container runtime will be changed to containerd
390389
* instead of docker. Currently, only imageUri, commands, entrypoint
391390
* and volumes are supported and any other fields will be ignored.
391+
* Please refer
392+
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
393+
* for the feature requirements and limitations.
392394
* </pre>
393395
*
394396
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -915,11 +917,13 @@ public com.google.protobuf.ByteString getPasswordBytes() {
915917
*
916918
*
917919
* <pre>
918-
* Optional. Not yet implemented.
919-
* If set to true, container will run with Image streaming.
920+
* Optional. If set to true, container will run with Image streaming.
920921
* The container runtime will be changed to containerd
921922
* instead of docker. Currently, only imageUri, commands, entrypoint
922923
* and volumes are supported and any other fields will be ignored.
924+
* Please refer
925+
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
926+
* for the feature requirements and limitations.
923927
* </pre>
924928
*
925929
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -2571,11 +2575,13 @@ public Builder setPasswordBytes(com.google.protobuf.ByteString value) {
25712575
*
25722576
*
25732577
* <pre>
2574-
* Optional. Not yet implemented.
2575-
* If set to true, container will run with Image streaming.
2578+
* Optional. If set to true, container will run with Image streaming.
25762579
* The container runtime will be changed to containerd
25772580
* instead of docker. Currently, only imageUri, commands, entrypoint
25782581
* and volumes are supported and any other fields will be ignored.
2582+
* Please refer
2583+
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
2584+
* for the feature requirements and limitations.
25792585
* </pre>
25802586
*
25812587
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -2590,11 +2596,13 @@ public boolean getEnableImageStreaming() {
25902596
*
25912597
*
25922598
* <pre>
2593-
* Optional. Not yet implemented.
2594-
* If set to true, container will run with Image streaming.
2599+
* Optional. If set to true, container will run with Image streaming.
25952600
* The container runtime will be changed to containerd
25962601
* instead of docker. Currently, only imageUri, commands, entrypoint
25972602
* and volumes are supported and any other fields will be ignored.
2603+
* Please refer
2604+
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
2605+
* for the feature requirements and limitations.
25982606
* </pre>
25992607
*
26002608
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -2613,11 +2621,13 @@ public Builder setEnableImageStreaming(boolean value) {
26132621
*
26142622
*
26152623
* <pre>
2616-
* Optional. Not yet implemented.
2617-
* If set to true, container will run with Image streaming.
2624+
* Optional. If set to true, container will run with Image streaming.
26182625
* The container runtime will be changed to containerd
26192626
* instead of docker. Currently, only imageUri, commands, entrypoint
26202627
* and volumes are supported and any other fields will be ignored.
2628+
* Please refer
2629+
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
2630+
* for the feature requirements and limitations.
26212631
* </pre>
26222632
*
26232633
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>

0 commit comments

Comments
 (0)