@@ -284,12 +284,14 @@ message JobNotification {
284
284
message AllocationPolicy {
285
285
message LocationPolicy {
286
286
// A list of allowed location names represented by internal URLs.
287
+ //
287
288
// Each location can be a region or a zone.
288
289
// Only one region or multiple zones in one region is supported now.
289
290
// For example,
290
291
// ["regions/us-central1"] allow VMs in any zones in region us-central1.
291
292
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
292
293
// in zones us-central1-a and us-central1-c.
294
+ //
293
295
// All locations end up in different regions would cause errors.
294
296
// For example,
295
297
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
@@ -305,25 +307,29 @@ message AllocationPolicy {
305
307
306
308
// A new persistent disk or a local ssd.
307
309
// A VM can only have one local SSD setting but multiple local SSD partitions.
308
- // https://cloud.google.com/compute/docs/disks#pdspecs.
310
+ // See https://cloud.google.com/compute/docs/disks#pdspecs and
309
311
// https://cloud.google.com/compute/docs/disks#localssds.
310
312
message Disk {
311
313
// A data source from which a PD will be created.
312
314
oneof data_source {
313
315
// Name of a public or custom image used as the data source.
314
316
// For example, the following are all valid URLs:
315
- // (1) Specify the image by its family name:
317
+ //
318
+ // * Specify the image by its family name:
316
319
// projects/{project}/global/images/family/{image_family}
317
- // (2) Specify the image version:
320
+ // * Specify the image version:
318
321
// projects/{project}/global/images/{image_version}
322
+ //
319
323
// You can also use Batch customized image in short names.
320
324
// The following image values are supported for a boot disk:
321
- // "batch-debian": use Batch Debian images.
322
- // "batch-centos": use Batch CentOS images.
323
- // "batch-cos": use Batch Container-Optimized images.
325
+ //
326
+ // * "batch-debian": use Batch Debian images.
327
+ // * "batch-centos": use Batch CentOS images.
328
+ // * "batch-cos": use Batch Container-Optimized images.
324
329
string image = 4 ;
325
330
326
331
// Name of a snapshot used as the data source.
332
+ // Snapshot is not supported as boot disk now.
327
333
string snapshot = 5 ;
328
334
}
329
335
@@ -334,6 +340,7 @@ message AllocationPolicy {
334
340
string type = 1 ;
335
341
336
342
// Disk size in GB.
343
+ //
337
344
// For persistent disk, this field is ignored if `data_source` is `image` or
338
345
// `snapshot`.
339
346
// For local SSD, size_gb should be a multiple of 375GB,
@@ -391,7 +398,7 @@ message AllocationPolicy {
391
398
392
399
// The minimum CPU platform.
393
400
// See
394
- // ` https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform` .
401
+ // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
395
402
// Not yet implemented.
396
403
string min_cpu_platform = 3 ;
397
404
@@ -401,15 +408,17 @@ message AllocationPolicy {
401
408
// The accelerators attached to each VM instance.
402
409
repeated Accelerator accelerators = 5 ;
403
410
404
- // Book disk to be created and attached to each VM by this InstancePolicy.
411
+ // Boot disk to be created and attached to each VM by this InstancePolicy.
405
412
// Boot disk will be deleted when the VM is deleted.
413
+ // Batch API now only supports booting from image.
406
414
Disk boot_disk = 8 ;
407
415
408
416
// Non-boot disks to be attached for each VM created by this InstancePolicy.
409
417
// New disks will be deleted when the VM is deleted.
410
418
repeated AttachedDisk disks = 6 ;
411
419
412
- // If specified, VMs will be allocated only inside the matching reservation.
420
+ // If specified, VMs will consume only the specified reservation.
421
+ // If not specified (default), VMs will consume any applicable reservation.
413
422
string reservation = 7 ;
414
423
}
415
424
@@ -436,18 +445,22 @@ message AllocationPolicy {
436
445
message NetworkInterface {
437
446
// The URL of an existing network resource.
438
447
// You can specify the network as a full or partial URL.
448
+ //
439
449
// For example, the following are all valid URLs:
440
- // https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
441
- // projects/{project}/global/networks/{network}
442
- // global/networks/{network}
450
+ //
451
+ // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
452
+ // * projects/{project}/global/networks/{network}
453
+ // * global/networks/{network}
443
454
string network = 1 ;
444
455
445
456
// The URL of an existing subnetwork resource in the network.
446
457
// You can specify the subnetwork as a full or partial URL.
458
+ //
447
459
// For example, the following are all valid URLs:
448
- // https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
449
- // projects/{project}/regions/{region}/subnetworks/{subnetwork}
450
- // regions/{region}/subnetworks/{subnetwork}
460
+ //
461
+ // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
462
+ // * projects/{project}/regions/{region}/subnetworks/{subnetwork}
463
+ // * regions/{region}/subnetworks/{subnetwork}
451
464
string subnetwork = 2 ;
452
465
453
466
// Default is false (with an external IP address). Required if
@@ -466,6 +479,23 @@ message AllocationPolicy {
466
479
repeated NetworkInterface network_interfaces = 1 ;
467
480
}
468
481
482
+ // PlacementPolicy describes a group placement policy for the VMs controlled
483
+ // by this AllocationPolicy.
484
+ message PlacementPolicy {
485
+ // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
486
+ // want VMs to be located close to each other for low network latency
487
+ // between the VMs. No placement policy will be generated when collocation
488
+ // is UNSPECIFIED.
489
+ string collocation = 1 ;
490
+
491
+ // When specified, causes the job to fail if more than max_distance logical
492
+ // switches are required between VMs. Batch uses the most compact possible
493
+ // placement of VMs even when max_distance is not specified. An explicit
494
+ // max_distance makes that level of compactness a strict requirement.
495
+ // Not yet implemented
496
+ int64 max_distance = 2 ;
497
+ }
498
+
469
499
// Compute Engine VM instance provisioning model.
470
500
enum ProvisioningModel {
471
501
// Unspecified.
@@ -519,6 +549,9 @@ message AllocationPolicy {
519
549
520
550
// The network policy.
521
551
NetworkPolicy network = 7 ;
552
+
553
+ // The placement policy.
554
+ PlacementPolicy placement = 10 ;
522
555
}
523
556
524
557
// A TaskGroup contains one or multiple Tasks that share the same
@@ -535,7 +568,15 @@ message TaskGroup {
535
568
SCHEDULING_POLICY_UNSPECIFIED = 0 ;
536
569
537
570
// Run Tasks as soon as resources are available.
571
+ //
572
+ // Tasks might be executed in parallel depending on parallelism and
573
+ // task_count values.
538
574
AS_SOON_AS_POSSIBLE = 1 ;
575
+
576
+ // Run Tasks sequentially with increased task index.
577
+ //
578
+ // Not yet implemented.
579
+ IN_ORDER = 2 ;
539
580
}
540
581
541
582
// Output only. TaskGroup name.
@@ -548,14 +589,16 @@ message TaskGroup {
548
589
TaskSpec task_spec = 3 [(google.api.field_behavior ) = REQUIRED ];
549
590
550
591
// Number of Tasks in the TaskGroup.
551
- // default is 1
592
+ // Default is 1.
552
593
int64 task_count = 4 ;
553
594
554
595
// Max number of tasks that can run in parallel.
555
596
// Default to min(task_count, 1000).
597
+ // Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
556
598
int64 parallelism = 5 ;
557
599
558
600
// Scheduling policy for Tasks in the TaskGroup.
601
+ // The default value is AS_SOON_AS_POSSIBLE.
559
602
SchedulingPolicy scheduling_policy = 6 ;
560
603
561
604
// Compute resource allocation for the TaskGroup.
0 commit comments