Skip to content

Commit

Permalink
feat: [batch] Add tags field in Job's AllocationPolicy field in v1a…
Browse files Browse the repository at this point in the history
…lpha (#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: googleapis/googleapis-gen@d5d8699
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jan 9, 2024
1 parent 96c4cd6 commit 4bcdc24
Show file tree
Hide file tree
Showing 8 changed files with 661 additions and 95 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -565,4 +565,71 @@ java.lang.String getLabelsOrDefault(
* <code>.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy placement = 10;</code>
*/
com.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicyOrBuilder getPlacementOrBuilder();

/**
*
*
* <pre>
* Optional. Tags applied to the VM instances.
*
* The tags identify valid sources or targets for network firewalls.
* Each tag must be 1-63 characters long, and comply with
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
* </pre>
*
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return A list containing the tags.
*/
java.util.List<java.lang.String> getTagsList();
/**
*
*
* <pre>
* Optional. Tags applied to the VM instances.
*
* The tags identify valid sources or targets for network firewalls.
* Each tag must be 1-63 characters long, and comply with
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
* </pre>
*
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The count of tags.
*/
int getTagsCount();
/**
*
*
* <pre>
* Optional. Tags applied to the VM instances.
*
* The tags identify valid sources or targets for network firewalls.
* Each tag must be 1-63 characters long, and comply with
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
* </pre>
*
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the element to return.
* @return The tags at the given index.
*/
java.lang.String getTags(int index);
/**
*
*
* <pre>
* Optional. Tags applied to the VM instances.
*
* The tags identify valid sources or targets for network firewalls.
* Each tag must be 1-63 characters long, and comply with
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
* </pre>
*
* <code>repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the value to return.
* @return The bytes of the tags at the given index.
*/
com.google.protobuf.ByteString getTagsBytes(int index);
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "\016new_task_state\030\003 \001(\0162,.google.cloud.bat"
+ "ch.v1alpha.TaskStatus.State\"K\n\004Type\022\024\n\020T"
+ "YPE_UNSPECIFIED\020\000\022\025\n\021JOB_STATE_CHANGED\020\001"
+ "\022\026\n\022TASK_STATE_CHANGED\020\002\"\240\021\n\020AllocationP"
+ "\022\026\n\022TASK_STATE_CHANGED\020\002\"\264\021\n\020AllocationP"
+ "olicy\022M\n\010location\030\001 \001(\0132;.google.cloud.b"
+ "atch.v1alpha.AllocationPolicy.LocationPo"
+ "licy\022Q\n\010instance\030\002 \001(\0132;.google.cloud.ba"
Expand All @@ -248,70 +248,71 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "ch.v1alpha.AllocationPolicy.NetworkPolic"
+ "y\022O\n\tplacement\030\n \001(\0132<.google.cloud.batc"
+ "h.v1alpha.AllocationPolicy.PlacementPoli"
+ "cy\032E\n\016LocationPolicy\022\031\n\021allowed_location"
+ "s\030\001 \003(\t\022\030\n\020denied_locations\030\002 \003(\t\032q\n\004Dis"
+ "k\022\017\n\005image\030\004 \001(\tH\000\022\022\n\010snapshot\030\005 \001(\tH\000\022\014"
+ "\n\004type\030\001 \001(\t\022\017\n\007size_gb\030\002 \001(\003\022\026\n\016disk_in"
+ "terface\030\006 \001(\tB\r\n\013data_source\032\217\001\n\014Attache"
+ "dDisk\022E\n\010new_disk\030\001 \001(\01321.google.cloud.b"
+ "atch.v1alpha.AllocationPolicy.DiskH\000\022\027\n\r"
+ "existing_disk\030\002 \001(\tH\000\022\023\n\013device_name\030\003 \001"
+ "(\tB\n\n\010attached\032i\n\013Accelerator\022\014\n\004type\030\001 "
+ "\001(\t\022\r\n\005count\030\002 \001(\003\022\037\n\023install_gpu_driver"
+ "s\030\003 \001(\010B\002\030\001\022\034\n\016driver_version\030\004 \001(\tB\004\342A\001"
+ "\001\032\272\003\n\016InstancePolicy\022!\n\025allowed_machine_"
+ "types\030\001 \003(\tB\002\030\001\022\024\n\014machine_type\030\002 \001(\t\022\030\n"
+ "\020min_cpu_platform\030\003 \001(\t\022Z\n\022provisioning_"
+ "model\030\004 \001(\0162>.google.cloud.batch.v1alpha"
+ ".AllocationPolicy.ProvisioningModel\022N\n\014a"
+ "ccelerators\030\005 \003(\01328.google.cloud.batch.v"
+ "1alpha.AllocationPolicy.Accelerator\022D\n\tb"
+ "oot_disk\030\010 \001(\01321.google.cloud.batch.v1al"
+ "pha.AllocationPolicy.Disk\022H\n\005disks\030\006 \003(\013"
+ "29.google.cloud.batch.v1alpha.Allocation"
+ "Policy.AttachedDisk\022\031\n\013reservation\030\007 \001(\t"
+ "B\004\342A\001\001\032\266\001\n\030InstancePolicyOrTemplate\022M\n\006p"
+ "olicy\030\001 \001(\0132;.google.cloud.batch.v1alpha"
+ ".AllocationPolicy.InstancePolicyH\000\022\033\n\021in"
+ "stance_template\030\002 \001(\tH\000\022\033\n\023install_gpu_d"
+ "rivers\030\003 \001(\010B\021\n\017policy_template\032W\n\020Netwo"
+ "rkInterface\022\017\n\007network\030\001 \001(\t\022\022\n\nsubnetwo"
+ "rk\030\002 \001(\t\022\036\n\026no_external_ip_address\030\003 \001(\010"
+ "\032j\n\rNetworkPolicy\022Y\n\022network_interfaces\030"
+ "\001 \003(\0132=.google.cloud.batch.v1alpha.Alloc"
+ "ationPolicy.NetworkInterface\032<\n\017Placemen"
+ "tPolicy\022\023\n\013collocation\030\001 \001(\t\022\024\n\014max_dist"
+ "ance\030\002 \001(\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r"
+ "\n\005value\030\002 \001(\t:\0028\001\"`\n\021ProvisioningModel\022\""
+ "\n\036PROVISIONING_MODEL_UNSPECIFIED\020\000\022\014\n\010ST"
+ "ANDARD\020\001\022\010\n\004SPOT\020\002\022\017\n\013PREEMPTIBLE\020\003\"\227\006\n\t"
+ "TaskGroup\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022=\n\ttask_sp"
+ "ec\030\003 \001(\0132$.google.cloud.batch.v1alpha.Ta"
+ "skSpecB\004\342A\001\002\022\022\n\ntask_count\030\004 \001(\003\022\023\n\013para"
+ "llelism\030\005 \001(\003\022Q\n\021scheduling_policy\030\006 \001(\016"
+ "26.google.cloud.batch.v1alpha.TaskGroup."
+ "SchedulingPolicy\022G\n\021allocation_policy\030\007 "
+ "\001(\0132,.google.cloud.batch.v1alpha.Allocat"
+ "ionPolicy\022A\n\006labels\030\010 \003(\01321.google.cloud"
+ ".batch.v1alpha.TaskGroup.LabelsEntry\022B\n\021"
+ "task_environments\030\t \003(\0132\'.google.cloud.b"
+ "atch.v1alpha.Environment\022\033\n\023task_count_p"
+ "er_node\030\n \001(\003\022\032\n\022require_hosts_file\030\013 \001("
+ "\010\022\026\n\016permissive_ssh\030\014 \001(\010\022\034\n\016enable_oslo"
+ "gin\030\r \001(\010B\004\342A\001\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 "
+ "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\\\n\020SchedulingPoli"
+ "cy\022!\n\035SCHEDULING_POLICY_UNSPECIFIED\020\000\022\027\n"
+ "\023AS_SOON_AS_POSSIBLE\020\001\022\014\n\010IN_ORDER\020\002:o\352A"
+ "l\n\036batch.googleapis.com/TaskGroup\022Jproje"
+ "cts/{project}/locations/{location}/jobs/"
+ "{job}/taskGroups/{task_group}\"/\n\016Service"
+ "Account\022\r\n\005email\030\001 \001(\t\022\016\n\006scopes\030\002 \003(\tB\302"
+ "\001\n\036com.google.cloud.batch.v1alphaB\010JobPr"
+ "otoP\001Z4cloud.google.com/go/batch/apiv1al"
+ "pha/batchpb;batchpb\242\002\003GCB\252\002\032Google.Cloud"
+ ".Batch.V1Alpha\312\002\032Google\\Cloud\\Batch\\V1al"
+ "pha\352\002\035Google::Cloud::Batch::V1alphab\006pro"
+ "to3"
+ "cy\022\022\n\004tags\030\013 \003(\tB\004\342A\001\001\032E\n\016LocationPolicy"
+ "\022\031\n\021allowed_locations\030\001 \003(\t\022\030\n\020denied_lo"
+ "cations\030\002 \003(\t\032q\n\004Disk\022\017\n\005image\030\004 \001(\tH\000\022\022"
+ "\n\010snapshot\030\005 \001(\tH\000\022\014\n\004type\030\001 \001(\t\022\017\n\007size"
+ "_gb\030\002 \001(\003\022\026\n\016disk_interface\030\006 \001(\tB\r\n\013dat"
+ "a_source\032\217\001\n\014AttachedDisk\022E\n\010new_disk\030\001 "
+ "\001(\01321.google.cloud.batch.v1alpha.Allocat"
+ "ionPolicy.DiskH\000\022\027\n\rexisting_disk\030\002 \001(\tH"
+ "\000\022\023\n\013device_name\030\003 \001(\tB\n\n\010attached\032i\n\013Ac"
+ "celerator\022\014\n\004type\030\001 \001(\t\022\r\n\005count\030\002 \001(\003\022\037"
+ "\n\023install_gpu_drivers\030\003 \001(\010B\002\030\001\022\034\n\016drive"
+ "r_version\030\004 \001(\tB\004\342A\001\001\032\272\003\n\016InstancePolicy"
+ "\022!\n\025allowed_machine_types\030\001 \003(\tB\002\030\001\022\024\n\014m"
+ "achine_type\030\002 \001(\t\022\030\n\020min_cpu_platform\030\003 "
+ "\001(\t\022Z\n\022provisioning_model\030\004 \001(\0162>.google"
+ ".cloud.batch.v1alpha.AllocationPolicy.Pr"
+ "ovisioningModel\022N\n\014accelerators\030\005 \003(\01328."
+ "google.cloud.batch.v1alpha.AllocationPol"
+ "icy.Accelerator\022D\n\tboot_disk\030\010 \001(\01321.goo"
+ "gle.cloud.batch.v1alpha.AllocationPolicy"
+ ".Disk\022H\n\005disks\030\006 \003(\01329.google.cloud.batc"
+ "h.v1alpha.AllocationPolicy.AttachedDisk\022"
+ "\031\n\013reservation\030\007 \001(\tB\004\342A\001\001\032\266\001\n\030InstanceP"
+ "olicyOrTemplate\022M\n\006policy\030\001 \001(\0132;.google"
+ ".cloud.batch.v1alpha.AllocationPolicy.In"
+ "stancePolicyH\000\022\033\n\021instance_template\030\002 \001("
+ "\tH\000\022\033\n\023install_gpu_drivers\030\003 \001(\010B\021\n\017poli"
+ "cy_template\032W\n\020NetworkInterface\022\017\n\007netwo"
+ "rk\030\001 \001(\t\022\022\n\nsubnetwork\030\002 \001(\t\022\036\n\026no_exter"
+ "nal_ip_address\030\003 \001(\010\032j\n\rNetworkPolicy\022Y\n"
+ "\022network_interfaces\030\001 \003(\0132=.google.cloud"
+ ".batch.v1alpha.AllocationPolicy.NetworkI"
+ "nterface\032<\n\017PlacementPolicy\022\023\n\013collocati"
+ "on\030\001 \001(\t\022\024\n\014max_distance\030\002 \001(\003\032-\n\013Labels"
+ "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n"
+ "\021ProvisioningModel\022\"\n\036PROVISIONING_MODEL"
+ "_UNSPECIFIED\020\000\022\014\n\010STANDARD\020\001\022\010\n\004SPOT\020\002\022\017"
+ "\n\013PREEMPTIBLE\020\003\"\270\006\n\tTaskGroup\022\022\n\004name\030\001 "
+ "\001(\tB\004\342A\001\003\022=\n\ttask_spec\030\003 \001(\0132$.google.cl"
+ "oud.batch.v1alpha.TaskSpecB\004\342A\001\002\022\022\n\ntask"
+ "_count\030\004 \001(\003\022\023\n\013parallelism\030\005 \001(\003\022Q\n\021sch"
+ "eduling_policy\030\006 \001(\01626.google.cloud.batc"
+ "h.v1alpha.TaskGroup.SchedulingPolicy\022G\n\021"
+ "allocation_policy\030\007 \001(\0132,.google.cloud.b"
+ "atch.v1alpha.AllocationPolicy\022A\n\006labels\030"
+ "\010 \003(\01321.google.cloud.batch.v1alpha.TaskG"
+ "roup.LabelsEntry\022B\n\021task_environments\030\t "
+ "\003(\0132\'.google.cloud.batch.v1alpha.Environ"
+ "ment\022\033\n\023task_count_per_node\030\n \001(\003\022\032\n\022req"
+ "uire_hosts_file\030\013 \001(\010\022\026\n\016permissive_ssh\030"
+ "\014 \001(\010\022\036\n\016enable_oslogin\030\r \001(\010B\006\030\001\342A\001\001\022\035\n"
+ "\017run_as_non_root\030\016 \001(\010B\004\342A\001\001\032-\n\013LabelsEn"
+ "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\\\n\020S"
+ "chedulingPolicy\022!\n\035SCHEDULING_POLICY_UNS"
+ "PECIFIED\020\000\022\027\n\023AS_SOON_AS_POSSIBLE\020\001\022\014\n\010I"
+ "N_ORDER\020\002:o\352Al\n\036batch.googleapis.com/Tas"
+ "kGroup\022Jprojects/{project}/locations/{lo"
+ "cation}/jobs/{job}/taskGroups/{task_grou"
+ "p}\"/\n\016ServiceAccount\022\r\n\005email\030\001 \001(\t\022\016\n\006s"
+ "copes\030\002 \003(\tB\302\001\n\036com.google.cloud.batch.v"
+ "1alphaB\010JobProtoP\001Z4cloud.google.com/go/"
+ "batch/apiv1alpha/batchpb;batchpb\242\002\003GCB\252\002"
+ "\032Google.Cloud.Batch.V1Alpha\312\002\032Google\\Clo"
+ "ud\\Batch\\V1alpha\352\002\035Google::Cloud::Batch:"
+ ":V1alphab\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down Expand Up @@ -468,6 +469,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
"Labels",
"Network",
"Placement",
"Tags",
});
internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_descriptor =
internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor
Expand Down Expand Up @@ -594,6 +596,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
"RequireHostsFile",
"PermissiveSsh",
"EnableOslogin",
"RunAsNonRoot",
});
internal_static_google_cloud_batch_v1alpha_TaskGroup_LabelsEntry_descriptor =
internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor.getNestedTypes().get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,13 @@ public interface ContainerOrBuilder
*
*
* <pre>
* Optional. Not yet implemented.
* If set to true, container will run with Image streaming.
* Optional. If set to true, container will run with Image streaming.
* The container runtime will be changed to containerd
* instead of docker. Currently, only imageUri, commands, entrypoint
* and volumes are supported and any other fields will be ignored.
* Please refer
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
* for the feature requirements and limitations.
* </pre>
*
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand Down Expand Up @@ -915,11 +917,13 @@ public com.google.protobuf.ByteString getPasswordBytes() {
*
*
* <pre>
* Optional. Not yet implemented.
* If set to true, container will run with Image streaming.
* Optional. If set to true, container will run with Image streaming.
* The container runtime will be changed to containerd
* instead of docker. Currently, only imageUri, commands, entrypoint
* and volumes are supported and any other fields will be ignored.
* Please refer
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
* for the feature requirements and limitations.
* </pre>
*
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand Down Expand Up @@ -2571,11 +2575,13 @@ public Builder setPasswordBytes(com.google.protobuf.ByteString value) {
*
*
* <pre>
* Optional. Not yet implemented.
* If set to true, container will run with Image streaming.
* Optional. If set to true, container will run with Image streaming.
* The container runtime will be changed to containerd
* instead of docker. Currently, only imageUri, commands, entrypoint
* and volumes are supported and any other fields will be ignored.
* Please refer
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
* for the feature requirements and limitations.
* </pre>
*
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand All @@ -2590,11 +2596,13 @@ public boolean getEnableImageStreaming() {
*
*
* <pre>
* Optional. Not yet implemented.
* If set to true, container will run with Image streaming.
* Optional. If set to true, container will run with Image streaming.
* The container runtime will be changed to containerd
* instead of docker. Currently, only imageUri, commands, entrypoint
* and volumes are supported and any other fields will be ignored.
* Please refer
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
* for the feature requirements and limitations.
* </pre>
*
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand All @@ -2613,11 +2621,13 @@ public Builder setEnableImageStreaming(boolean value) {
*
*
* <pre>
* Optional. Not yet implemented.
* If set to true, container will run with Image streaming.
* Optional. If set to true, container will run with Image streaming.
* The container runtime will be changed to containerd
* instead of docker. Currently, only imageUri, commands, entrypoint
* and volumes are supported and any other fields will be ignored.
* Please refer
* [here](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming)
* for the feature requirements and limitations.
* </pre>
*
* <code>bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand Down
Loading

0 comments on commit 4bcdc24

Please sign in to comment.