@@ -403,6 +403,8 @@ class AllocationPolicy(proto.Message):
403
403
reserved.
404
404
network (google.cloud.batch_v1.types.AllocationPolicy.NetworkPolicy):
405
405
The network policy.
406
+ placement (google.cloud.batch_v1.types.AllocationPolicy.PlacementPolicy):
407
+ The placement policy.
406
408
"""
407
409
408
410
class ProvisioningModel (proto .Enum ):
@@ -435,13 +437,16 @@ class LocationPolicy(proto.Message):
435
437
Attributes:
436
438
allowed_locations (MutableSequence[str]):
437
439
A list of allowed location names represented by internal
438
- URLs. Each location can be a region or a zone. Only one
439
- region or multiple zones in one region is supported now. For
440
- example, ["regions/us-central1"] allow VMs in any zones in
441
- region us-central1. ["zones/us-central1-a",
442
- "zones/us-central1-c"] only allow VMs in zones us-central1-a
443
- and us-central1-c. All locations end up in different regions
444
- would cause errors. For example, ["regions/us-central1",
440
+ URLs.
441
+
442
+ Each location can be a region or a zone. Only one region or
443
+ multiple zones in one region is supported now. For example,
444
+ ["regions/us-central1"] allow VMs in any zones in region
445
+ us-central1. ["zones/us-central1-a", "zones/us-central1-c"]
446
+ only allow VMs in zones us-central1-a and us-central1-c.
447
+
448
+ All locations end up in different regions would cause
449
+ errors. For example, ["regions/us-central1",
445
450
"zones/us-central1-a", "zones/us-central1-b",
446
451
"zones/us-west1-a"] contains 2 regions "us-central1" and
447
452
"us-west1". An error is expected in this case.
@@ -455,7 +460,8 @@ class LocationPolicy(proto.Message):
455
460
class Disk (proto .Message ):
456
461
r"""A new persistent disk or a local ssd.
457
462
A VM can only have one local SSD setting but multiple local SSD
458
- partitions. https://cloud.google.com/compute/docs/disks#pdspecs.
463
+ partitions. See
464
+ https://cloud.google.com/compute/docs/disks#pdspecs and
459
465
https://cloud.google.com/compute/docs/disks#localssds.
460
466
461
467
This message has `oneof`_ fields (mutually exclusive fields).
@@ -468,20 +474,24 @@ class Disk(proto.Message):
468
474
Attributes:
469
475
image (str):
470
476
Name of a public or custom image used as the data source.
471
- For example, the following are all valid URLs: (1) Specify
472
- the image by its family name:
473
- projects/{project}/global/images/family/{image_family} (2)
474
- Specify the image version:
475
- projects/{project}/global/images/{image_version} You can
476
- also use Batch customized image in short names. The
477
+ For example, the following are all valid URLs:
478
+
479
+ - Specify the image by its family name:
480
+ projects/{project}/global/images/family/{image_family}
481
+ - Specify the image version:
482
+ projects/{project}/global/images/{image_version}
483
+
484
+ You can also use Batch customized image in short names. The
477
485
following image values are supported for a boot disk:
478
- "batch-debian": use Batch Debian images. "batch-centos": use
479
- Batch CentOS images. "batch-cos": use Batch
480
- Container-Optimized images.
486
+
487
+ - "batch-debian": use Batch Debian images.
488
+ - "batch-centos": use Batch CentOS images.
489
+ - "batch-cos": use Batch Container-Optimized images.
481
490
482
491
This field is a member of `oneof`_ ``data_source``.
483
492
snapshot (str):
484
493
Name of a snapshot used as the data source.
494
+ Snapshot is not supported as boot disk now.
485
495
486
496
This field is a member of `oneof`_ ``data_source``.
487
497
type_ (str):
@@ -490,11 +500,13 @@ class Disk(proto.Message):
490
500
disks and boot disks use "pd-balanced", "pd-extreme",
491
501
"pd-ssd" or "pd-standard".
492
502
size_gb (int):
493
- Disk size in GB. For persistent disk, this field is ignored
494
- if ``data_source`` is ``image`` or ``snapshot``. For local
495
- SSD, size_gb should be a multiple of 375GB, otherwise, the
496
- final size will be the next greater multiple of 375 GB. For
497
- boot disk, Batch will calculate the boot disk size based on
503
+ Disk size in GB.
504
+
505
+ For persistent disk, this field is ignored if
506
+ ``data_source`` is ``image`` or ``snapshot``. For local SSD,
507
+ size_gb should be a multiple of 375GB, otherwise, the final
508
+ size will be the next greater multiple of 375 GB. For boot
509
+ disk, Batch will calculate the boot disk size based on
498
510
source image and task requirements if you do not speicify
499
511
the size. If both this field and the boot_disk_mib field in
500
512
task spec's compute_resource are defined, Batch will only
@@ -607,18 +619,20 @@ class InstancePolicy(proto.Message):
607
619
machine_type (str):
608
620
The Compute Engine machine type.
609
621
min_cpu_platform (str):
610
- The minimum CPU platform. See
611
- ``https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform``.
622
+ The minimum CPU platform.
623
+ See
624
+ https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
612
625
Not yet implemented.
613
626
provisioning_model (google.cloud.batch_v1.types.AllocationPolicy.ProvisioningModel):
614
627
The provisioning model.
615
628
accelerators (MutableSequence[google.cloud.batch_v1.types.AllocationPolicy.Accelerator]):
616
629
The accelerators attached to each VM
617
630
instance.
618
631
boot_disk (google.cloud.batch_v1.types.AllocationPolicy.Disk):
619
- Book disk to be created and attached to each
632
+ Boot disk to be created and attached to each
620
633
VM by this InstancePolicy. Boot disk will be
621
- deleted when the VM is deleted.
634
+ deleted when the VM is deleted. Batch API now
635
+ only supports booting from image.
622
636
disks (MutableSequence[google.cloud.batch_v1.types.AllocationPolicy.AttachedDisk]):
623
637
Non-boot disks to be attached for each VM
624
638
created by this InstancePolicy. New disks will
@@ -705,21 +719,23 @@ class NetworkInterface(proto.Message):
705
719
706
720
Attributes:
707
721
network (str):
708
- The URL of an existing network resource.
709
- You can specify the network as a full or partial
710
- URL. For example, the following are all valid
711
- URLs:
712
- https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
713
- projects/{project}/global/networks/{network}
714
- global/networks/{network}
722
+ The URL of an existing network resource. You can specify the
723
+ network as a full or partial URL.
724
+
725
+ For example, the following are all valid URLs:
726
+
727
+ - https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
728
+ - projects/{project}/global/networks/{network}
729
+ - global/networks/{network}
715
730
subnetwork (str):
716
- The URL of an existing subnetwork resource in
717
- the network. You can specify the subnetwork as a
718
- full or partial URL. For example, the following
719
- are all valid URLs:
720
- https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
721
- projects/{project}/regions/{region}/subnetworks/{subnetwork}
722
- regions/{region}/subnetworks/{subnetwork}
731
+ The URL of an existing subnetwork resource in the network.
732
+ You can specify the subnetwork as a full or partial URL.
733
+
734
+ For example, the following are all valid URLs:
735
+
736
+ - https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
737
+ - projects/{project}/regions/{region}/subnetworks/{subnetwork}
738
+ - regions/{region}/subnetworks/{subnetwork}
723
739
no_external_ip_address (bool):
724
740
Default is false (with an external IP
725
741
address). Required if no external public IP
@@ -762,6 +778,36 @@ class NetworkPolicy(proto.Message):
762
778
message = "AllocationPolicy.NetworkInterface" ,
763
779
)
764
780
781
+ class PlacementPolicy (proto .Message ):
782
+ r"""PlacementPolicy describes a group placement policy for the
783
+ VMs controlled by this AllocationPolicy.
784
+
785
+ Attributes:
786
+ collocation (str):
787
+ UNSPECIFIED vs. COLLOCATED (default
788
+ UNSPECIFIED). Use COLLOCATED when you want VMs
789
+ to be located close to each other for low
790
+ network latency between the VMs. No placement
791
+ policy will be generated when collocation is
792
+ UNSPECIFIED.
793
+ max_distance (int):
794
+ When specified, causes the job to fail if more than
795
+ max_distance logical switches are required between VMs.
796
+ Batch uses the most compact possible placement of VMs even
797
+ when max_distance is not specified. An explicit max_distance
798
+ makes that level of compactness a strict requirement. Not
799
+ yet implemented
800
+ """
801
+
802
+ collocation : str = proto .Field (
803
+ proto .STRING ,
804
+ number = 1 ,
805
+ )
806
+ max_distance : int = proto .Field (
807
+ proto .INT64 ,
808
+ number = 2 ,
809
+ )
810
+
765
811
location : LocationPolicy = proto .Field (
766
812
proto .MESSAGE ,
767
813
number = 1 ,
@@ -787,6 +833,11 @@ class NetworkPolicy(proto.Message):
787
833
number = 7 ,
788
834
message = NetworkPolicy ,
789
835
)
836
+ placement : PlacementPolicy = proto .Field (
837
+ proto .MESSAGE ,
838
+ number = 10 ,
839
+ message = PlacementPolicy ,
840
+ )
790
841
791
842
792
843
class TaskGroup (proto .Message ):
@@ -804,10 +855,11 @@ class TaskGroup(proto.Message):
804
855
task spec.
805
856
task_count (int):
806
857
Number of Tasks in the TaskGroup.
807
- default is 1
858
+ Default is 1.
808
859
parallelism (int):
809
860
Max number of tasks that can run in parallel. Default to
810
- min(task_count, 1000).
861
+ min(task_count, 1000). Field parallelism must be 1 if the
862
+ scheduling_policy is IN_ORDER.
811
863
task_environments (MutableSequence[google.cloud.batch_v1.types.Environment]):
812
864
An array of environment variable mappings, which are passed
813
865
to Tasks with matching indices. If task_environments is used
0 commit comments