Skip to content

Commit f30b899

Browse files
feat: [batch] add support for placement policies (#9439)
* fix: override HTTP URLs for LRO cancel/delete operations PiperOrigin-RevId: 532357846 Source-Link: googleapis/googleapis@5cfe30b Source-Link: https://github.com/googleapis/googleapis-gen/commit/0e1e293ad959be26640d593b978cab7fba7ced97 Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiMGUxZTI5M2FkOTU5YmUyNjY0MGQ1OTNiOTc4Y2FiN2ZiYTdjZWQ5NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add support for placement policies feat: per-Runnable labels PiperOrigin-RevId: 532437427 Source-Link: googleapis/googleapis@288aa7f Source-Link: https://github.com/googleapis/googleapis-gen/commit/615d60f8e98ef120a79410c029b4c72448b53bde Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNjE1ZDYwZjhlOThlZjEyMGE3OTQxMGMwMjliNGM3MjQ0OGI1M2JkZSJ9 * 🦉 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 eea5883 commit f30b899

File tree

13 files changed

+1933
-290
lines changed

13 files changed

+1933
-290
lines changed

java-batch/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2323
<dependency>
2424
<groupId>com.google.cloud</groupId>
2525
<artifactId>libraries-bom</artifactId>
26-
<version>26.14.0</version>
26+
<version>26.15.0</version>
2727
<type>pom</type>
2828
<scope>import</scope>
2929
</dependency>

java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/HttpJsonBatchServiceStub.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ protected HttpJsonBatchServiceStub(
425425
callableFactory,
426426
typeRegistry,
427427
ImmutableMap.<String, HttpRule>builder()
428+
.put(
429+
"google.longrunning.Operations.CancelOperation",
430+
HttpRule.newBuilder()
431+
.setPost("/v1alpha/{name=projects/*/locations/*/operations/*}:cancel")
432+
.build())
433+
.put(
434+
"google.longrunning.Operations.DeleteOperation",
435+
HttpRule.newBuilder()
436+
.setDelete("/v1alpha/{name=projects/*/locations/*/operations/*}")
437+
.build())
428438
.put(
429439
"google.longrunning.Operations.GetOperation",
430440
HttpRule.newBuilder()

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

Lines changed: 1249 additions & 145 deletions
Large diffs are not rendered by default.

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,39 @@ java.lang.String getLabelsOrDefault(
280280
* <code>.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;</code>
281281
*/
282282
com.google.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder getNetworkOrBuilder();
283+
284+
/**
285+
*
286+
*
287+
* <pre>
288+
* The placement policy.
289+
* </pre>
290+
*
291+
* <code>.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;</code>
292+
*
293+
* @return Whether the placement field is set.
294+
*/
295+
boolean hasPlacement();
296+
/**
297+
*
298+
*
299+
* <pre>
300+
* The placement policy.
301+
* </pre>
302+
*
303+
* <code>.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;</code>
304+
*
305+
* @return The placement.
306+
*/
307+
com.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy getPlacement();
308+
/**
309+
*
310+
*
311+
* <pre>
312+
* The placement policy.
313+
* </pre>
314+
*
315+
* <code>.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;</code>
316+
*/
317+
com.google.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder getPlacementOrBuilder();
283318
}

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

Lines changed: 67 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
103103
internal_static_google_cloud_batch_v1_AllocationPolicy_NetworkPolicy_descriptor;
104104
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
105105
internal_static_google_cloud_batch_v1_AllocationPolicy_NetworkPolicy_fieldAccessorTable;
106+
static final com.google.protobuf.Descriptors.Descriptor
107+
internal_static_google_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor;
108+
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
109+
internal_static_google_cloud_batch_v1_AllocationPolicy_PlacementPolicy_fieldAccessorTable;
106110
static final com.google.protobuf.Descriptors.Descriptor
107111
internal_static_google_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor;
108112
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
@@ -182,7 +186,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
182186
+ "k_state\030\003 \001(\0162\'.google.cloud.batch.v1.Ta"
183187
+ "skStatus.State\"K\n\004Type\022\024\n\020TYPE_UNSPECIFI"
184188
+ "ED\020\000\022\025\n\021JOB_STATE_CHANGED\020\001\022\026\n\022TASK_STAT"
185-
+ "E_CHANGED\020\002\"\350\014\n\020AllocationPolicy\022H\n\010loca"
189+
+ "E_CHANGED\020\002\"\362\r\n\020AllocationPolicy\022H\n\010loca"
186190
+ "tion\030\001 \001(\01326.google.cloud.batch.v1.Alloc"
187191
+ "ationPolicy.LocationPolicy\022S\n\tinstances\030"
188192
+ "\010 \003(\013[email protected]"
@@ -191,54 +195,58 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
191195
+ ".ServiceAccount\022C\n\006labels\030\006 \003(\01323.google"
192196
+ ".cloud.batch.v1.AllocationPolicy.LabelsE"
193197
+ "ntry\022F\n\007network\030\007 \001(\01325.google.cloud.bat"
194-
+ "ch.v1.AllocationPolicy.NetworkPolicy\032+\n\016"
195-
+ "LocationPolicy\022\031\n\021allowed_locations\030\001 \003("
196-
+ "\t\032q\n\004Disk\022\017\n\005image\030\004 \001(\tH\000\022\022\n\010snapshot\030\005"
197-
+ " \001(\tH\000\022\014\n\004type\030\001 \001(\t\022\017\n\007size_gb\030\002 \001(\003\022\026\n"
198-
+ "\016disk_interface\030\006 \001(\tB\r\n\013data_source\032\212\001\n"
199-
+ "\014AttachedDisk\022@\n\010new_disk\030\001 \001(\0132,.google"
200-
+ ".cloud.batch.v1.AllocationPolicy.DiskH\000\022"
201-
+ "\027\n\rexisting_disk\030\002 \001(\tH\000\022\023\n\013device_name\030"
202-
+ "\003 \001(\tB\n\n\010attached\032K\n\013Accelerator\022\014\n\004type"
203-
+ "\030\001 \001(\t\022\r\n\005count\030\002 \001(\003\022\037\n\023install_gpu_dri"
204-
+ "vers\030\003 \001(\010B\002\030\001\032\350\002\n\016InstancePolicy\022\024\n\014mac"
205-
+ "hine_type\030\002 \001(\t\022\030\n\020min_cpu_platform\030\003 \001("
206-
+ "\t\022U\n\022provisioning_model\030\004 \001(\01629.google.c"
207-
+ "loud.batch.v1.AllocationPolicy.Provision"
208-
+ "ingModel\022I\n\014accelerators\030\005 \003(\01323.google."
209-
+ "cloud.batch.v1.AllocationPolicy.Accelera"
210-
+ "tor\022?\n\tboot_disk\030\010 \001(\0132,.google.cloud.ba"
211-
+ "tch.v1.AllocationPolicy.Disk\022C\n\005disks\030\006 "
212-
+ "\003(\01324.google.cloud.batch.v1.AllocationPo"
213-
+ "licy.AttachedDisk\032\261\001\n\030InstancePolicyOrTe"
214-
+ "mplate\022H\n\006policy\030\001 \001(\01326.google.cloud.ba"
215-
+ "tch.v1.AllocationPolicy.InstancePolicyH\000"
216-
+ "\022\033\n\021instance_template\030\002 \001(\tH\000\022\033\n\023install"
217-
+ "_gpu_drivers\030\003 \001(\010B\021\n\017policy_template\032W\n"
218-
+ "\020NetworkInterface\022\017\n\007network\030\001 \001(\t\022\022\n\nsu"
219-
+ "bnetwork\030\002 \001(\t\022\036\n\026no_external_ip_address"
220-
+ "\030\003 \001(\010\032e\n\rNetworkPolicy\022T\n\022network_inter"
221-
+ "faces\030\001 \003(\01328.google.cloud.batch.v1.Allo"
222-
+ "cationPolicy.NetworkInterface\032-\n\013LabelsE"
223-
+ "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n\021"
224-
+ "ProvisioningModel\022\"\n\036PROVISIONING_MODEL_"
225-
+ "UNSPECIFIED\020\000\022\014\n\010STANDARD\020\001\022\010\n\004SPOT\020\002\022\017\n"
226-
+ "\013PREEMPTIBLE\020\003\"\201\003\n\tTaskGroup\022\021\n\004name\030\001 \001"
227-
+ "(\tB\003\340A\003\0227\n\ttask_spec\030\003 \001(\0132\037.google.clou"
228-
+ "d.batch.v1.TaskSpecB\003\340A\002\022\022\n\ntask_count\030\004"
229-
+ " \001(\003\022\023\n\013parallelism\030\005 \001(\003\022=\n\021task_enviro"
230-
+ "nments\030\t \003(\0132\".google.cloud.batch.v1.Env"
231-
+ "ironment\022\033\n\023task_count_per_node\030\n \001(\003\022\032\n"
232-
+ "\022require_hosts_file\030\013 \001(\010\022\026\n\016permissive_"
233-
+ "ssh\030\014 \001(\010:o\352Al\n\036batch.googleapis.com/Tas"
234-
+ "kGroup\022Jprojects/{project}/locations/{lo"
235-
+ "cation}/jobs/{job}/taskGroups/{task_grou"
236-
+ "p}\"/\n\016ServiceAccount\022\r\n\005email\030\001 \001(\t\022\016\n\006s"
237-
+ "copes\030\002 \003(\tB\251\001\n\031com.google.cloud.batch.v"
238-
+ "1B\010JobProtoP\001Z/cloud.google.com/go/batch"
239-
+ "/apiv1/batchpb;batchpb\242\002\003GCB\252\002\025Google.Cl"
240-
+ "oud.Batch.V1\312\002\025Google\\Cloud\\Batch\\V1\352\002\030G"
241-
+ "oogle::Cloud::Batch::V1b\006proto3"
198+
+ "ch.v1.AllocationPolicy.NetworkPolicy\022J\n\t"
199+
+ "placement\030\n \001(\01327.google.cloud.batch.v1."
200+
+ "AllocationPolicy.PlacementPolicy\032+\n\016Loca"
201+
+ "tionPolicy\022\031\n\021allowed_locations\030\001 \003(\t\032q\n"
202+
+ "\004Disk\022\017\n\005image\030\004 \001(\tH\000\022\022\n\010snapshot\030\005 \001(\t"
203+
+ "H\000\022\014\n\004type\030\001 \001(\t\022\017\n\007size_gb\030\002 \001(\003\022\026\n\016dis"
204+
+ "k_interface\030\006 \001(\tB\r\n\013data_source\032\212\001\n\014Att"
205+
+ "achedDisk\022@\n\010new_disk\030\001 \001(\0132,.google.clo"
206+
+ "ud.batch.v1.AllocationPolicy.DiskH\000\022\027\n\re"
207+
+ "xisting_disk\030\002 \001(\tH\000\022\023\n\013device_name\030\003 \001("
208+
+ "\tB\n\n\010attached\032K\n\013Accelerator\022\014\n\004type\030\001 \001"
209+
+ "(\t\022\r\n\005count\030\002 \001(\003\022\037\n\023install_gpu_drivers"
210+
+ "\030\003 \001(\010B\002\030\001\032\350\002\n\016InstancePolicy\022\024\n\014machine"
211+
+ "_type\030\002 \001(\t\022\030\n\020min_cpu_platform\030\003 \001(\t\022U\n"
212+
+ "\022provisioning_model\030\004 \001(\01629.google.cloud"
213+
+ ".batch.v1.AllocationPolicy.ProvisioningM"
214+
+ "odel\022I\n\014accelerators\030\005 \003(\01323.google.clou"
215+
+ "d.batch.v1.AllocationPolicy.Accelerator\022"
216+
+ "?\n\tboot_disk\030\010 \001(\0132,.google.cloud.batch."
217+
+ "v1.AllocationPolicy.Disk\022C\n\005disks\030\006 \003(\0132"
218+
+ "4.google.cloud.batch.v1.AllocationPolicy"
219+
+ ".AttachedDisk\032\261\001\n\030InstancePolicyOrTempla"
220+
+ "te\022H\n\006policy\030\001 \001(\01326.google.cloud.batch."
221+
+ "v1.AllocationPolicy.InstancePolicyH\000\022\033\n\021"
222+
+ "instance_template\030\002 \001(\tH\000\022\033\n\023install_gpu"
223+
+ "_drivers\030\003 \001(\010B\021\n\017policy_template\032W\n\020Net"
224+
+ "workInterface\022\017\n\007network\030\001 \001(\t\022\022\n\nsubnet"
225+
+ "work\030\002 \001(\t\022\036\n\026no_external_ip_address\030\003 \001"
226+
+ "(\010\032e\n\rNetworkPolicy\022T\n\022network_interface"
227+
+ "s\030\001 \003(\01328.google.cloud.batch.v1.Allocati"
228+
+ "onPolicy.NetworkInterface\032<\n\017PlacementPo"
229+
+ "licy\022\023\n\013collocation\030\001 \001(\t\022\024\n\014max_distanc"
230+
+ "e\030\002 \001(\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v"
231+
+ "alue\030\002 \001(\t:\0028\001\"`\n\021ProvisioningModel\022\"\n\036P"
232+
+ "ROVISIONING_MODEL_UNSPECIFIED\020\000\022\014\n\010STAND"
233+
+ "ARD\020\001\022\010\n\004SPOT\020\002\022\017\n\013PREEMPTIBLE\020\003\"\201\003\n\tTas"
234+
+ "kGroup\022\021\n\004name\030\001 \001(\tB\003\340A\003\0227\n\ttask_spec\030\003"
235+
+ " \001(\0132\037.google.cloud.batch.v1.TaskSpecB\003\340"
236+
+ "A\002\022\022\n\ntask_count\030\004 \001(\003\022\023\n\013parallelism\030\005 "
237+
+ "\001(\003\022=\n\021task_environments\030\t \003(\0132\".google."
238+
+ "cloud.batch.v1.Environment\022\033\n\023task_count"
239+
+ "_per_node\030\n \001(\003\022\032\n\022require_hosts_file\030\013 "
240+
+ "\001(\010\022\026\n\016permissive_ssh\030\014 \001(\010:o\352Al\n\036batch."
241+
+ "googleapis.com/TaskGroup\022Jprojects/{proj"
242+
+ "ect}/locations/{location}/jobs/{job}/tas"
243+
+ "kGroups/{task_group}\"/\n\016ServiceAccount\022\r"
244+
+ "\n\005email\030\001 \001(\t\022\016\n\006scopes\030\002 \003(\tB\251\001\n\031com.go"
245+
+ "ogle.cloud.batch.v1B\010JobProtoP\001Z/cloud.g"
246+
+ "oogle.com/go/batch/apiv1/batchpb;batchpb"
247+
+ "\242\002\003GCB\252\002\025Google.Cloud.Batch.V1\312\002\025Google\\"
248+
+ "Cloud\\Batch\\V1\352\002\030Google::Cloud::Batch::V"
249+
+ "1b\006proto3"
242250
};
243251
descriptor =
244252
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -347,7 +355,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
347355
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
348356
internal_static_google_cloud_batch_v1_AllocationPolicy_descriptor,
349357
new java.lang.String[] {
350-
"Location", "Instances", "ServiceAccount", "Labels", "Network",
358+
"Location", "Instances", "ServiceAccount", "Labels", "Network", "Placement",
351359
});
352360
internal_static_google_cloud_batch_v1_AllocationPolicy_LocationPolicy_descriptor =
353361
internal_static_google_cloud_batch_v1_AllocationPolicy_descriptor.getNestedTypes().get(0);
@@ -418,8 +426,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
418426
new java.lang.String[] {
419427
"NetworkInterfaces",
420428
});
421-
internal_static_google_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor =
429+
internal_static_google_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor =
422430
internal_static_google_cloud_batch_v1_AllocationPolicy_descriptor.getNestedTypes().get(8);
431+
internal_static_google_cloud_batch_v1_AllocationPolicy_PlacementPolicy_fieldAccessorTable =
432+
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
433+
internal_static_google_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor,
434+
new java.lang.String[] {
435+
"Collocation", "MaxDistance",
436+
});
437+
internal_static_google_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor =
438+
internal_static_google_cloud_batch_v1_AllocationPolicy_descriptor.getNestedTypes().get(9);
423439
internal_static_google_cloud_batch_v1_AllocationPolicy_LabelsEntry_fieldAccessorTable =
424440
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
425441
internal_static_google_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor,

0 commit comments

Comments
 (0)