@@ -225,12 +225,14 @@ message JobNotification {
225
225
message AllocationPolicy {
226
226
message LocationPolicy {
227
227
// A list of allowed location names represented by internal URLs.
228
+ //
228
229
// Each location can be a region or a zone.
229
230
// Only one region or multiple zones in one region is supported now.
230
231
// For example,
231
232
// ["regions/us-central1"] allow VMs in any zones in region us-central1.
232
233
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
233
234
// in zones us-central1-a and us-central1-c.
235
+ //
234
236
// All locations end up in different regions would cause errors.
235
237
// For example,
236
238
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
@@ -241,25 +243,29 @@ message AllocationPolicy {
241
243
242
244
// A new persistent disk or a local ssd.
243
245
// A VM can only have one local SSD setting but multiple local SSD partitions.
244
- // https://cloud.google.com/compute/docs/disks#pdspecs.
246
+ // See https://cloud.google.com/compute/docs/disks#pdspecs and
245
247
// https://cloud.google.com/compute/docs/disks#localssds.
246
248
message Disk {
247
249
// A data source from which a PD will be created.
248
250
oneof data_source {
249
251
// Name of a public or custom image used as the data source.
250
252
// For example, the following are all valid URLs:
251
- // (1) Specify the image by its family name:
253
+ //
254
+ // * Specify the image by its family name:
252
255
// projects/{project}/global/images/family/{image_family}
253
- // (2) Specify the image version:
256
+ // * Specify the image version:
254
257
// projects/{project}/global/images/{image_version}
258
+ //
255
259
// You can also use Batch customized image in short names.
256
260
// The following image values are supported for a boot disk:
257
- // "batch-debian": use Batch Debian images.
258
- // "batch-centos": use Batch CentOS images.
259
- // "batch-cos": use Batch Container-Optimized images.
261
+ //
262
+ // * "batch-debian": use Batch Debian images.
263
+ // * "batch-centos": use Batch CentOS images.
264
+ // * "batch-cos": use Batch Container-Optimized images.
260
265
string image = 4 ;
261
266
262
267
// Name of a snapshot used as the data source.
268
+ // Snapshot is not supported as boot disk now.
263
269
string snapshot = 5 ;
264
270
}
265
271
@@ -270,6 +276,7 @@ message AllocationPolicy {
270
276
string type = 1 ;
271
277
272
278
// Disk size in GB.
279
+ //
273
280
// For persistent disk, this field is ignored if `data_source` is `image` or
274
281
// `snapshot`.
275
282
// For local SSD, size_gb should be a multiple of 375GB,
@@ -324,7 +331,7 @@ message AllocationPolicy {
324
331
325
332
// The minimum CPU platform.
326
333
// See
327
- // ` https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform` .
334
+ // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
328
335
// Not yet implemented.
329
336
string min_cpu_platform = 3 ;
330
337
@@ -334,8 +341,9 @@ message AllocationPolicy {
334
341
// The accelerators attached to each VM instance.
335
342
repeated Accelerator accelerators = 5 ;
336
343
337
- // Book disk to be created and attached to each VM by this InstancePolicy.
344
+ // Boot disk to be created and attached to each VM by this InstancePolicy.
338
345
// Boot disk will be deleted when the VM is deleted.
346
+ // Batch API now only supports booting from image.
339
347
Disk boot_disk = 8 ;
340
348
341
349
// Non-boot disks to be attached for each VM created by this InstancePolicy.
@@ -366,18 +374,22 @@ message AllocationPolicy {
366
374
message NetworkInterface {
367
375
// The URL of an existing network resource.
368
376
// You can specify the network as a full or partial URL.
377
+ //
369
378
// For example, the following are all valid URLs:
370
- // https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
371
- // projects/{project}/global/networks/{network}
372
- // global/networks/{network}
379
+ //
380
+ // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
381
+ // * projects/{project}/global/networks/{network}
382
+ // * global/networks/{network}
373
383
string network = 1 ;
374
384
375
385
// The URL of an existing subnetwork resource in the network.
376
386
// You can specify the subnetwork as a full or partial URL.
387
+ //
377
388
// For example, the following are all valid URLs:
378
- // https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
379
- // projects/{project}/regions/{region}/subnetworks/{subnetwork}
380
- // regions/{region}/subnetworks/{subnetwork}
389
+ //
390
+ // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
391
+ // * projects/{project}/regions/{region}/subnetworks/{subnetwork}
392
+ // * regions/{region}/subnetworks/{subnetwork}
381
393
string subnetwork = 2 ;
382
394
383
395
// Default is false (with an external IP address). Required if
@@ -396,6 +408,23 @@ message AllocationPolicy {
396
408
repeated NetworkInterface network_interfaces = 1 ;
397
409
}
398
410
411
+ // PlacementPolicy describes a group placement policy for the VMs controlled
412
+ // by this AllocationPolicy.
413
+ message PlacementPolicy {
414
+ // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
415
+ // want VMs to be located close to each other for low network latency
416
+ // between the VMs. No placement policy will be generated when collocation
417
+ // is UNSPECIFIED.
418
+ string collocation = 1 ;
419
+
420
+ // When specified, causes the job to fail if more than max_distance logical
421
+ // switches are required between VMs. Batch uses the most compact possible
422
+ // placement of VMs even when max_distance is not specified. An explicit
423
+ // max_distance makes that level of compactness a strict requirement.
424
+ // Not yet implemented
425
+ int64 max_distance = 2 ;
426
+ }
427
+
399
428
// Compute Engine VM instance provisioning model.
400
429
enum ProvisioningModel {
401
430
// Unspecified.
@@ -437,6 +466,9 @@ message AllocationPolicy {
437
466
438
467
// The network policy.
439
468
NetworkPolicy network = 7 ;
469
+
470
+ // The placement policy.
471
+ PlacementPolicy placement = 10 ;
440
472
}
441
473
442
474
// A TaskGroup contains one or multiple Tasks that share the same
@@ -457,11 +489,12 @@ message TaskGroup {
457
489
TaskSpec task_spec = 3 [(google.api.field_behavior ) = REQUIRED ];
458
490
459
491
// Number of Tasks in the TaskGroup.
460
- // default is 1
492
+ // Default is 1.
461
493
int64 task_count = 4 ;
462
494
463
495
// Max number of tasks that can run in parallel.
464
496
// Default to min(task_count, 1000).
497
+ // Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
465
498
int64 parallelism = 5 ;
466
499
467
500
// An array of environment variable mappings, which are passed to Tasks with
0 commit comments