@@ -515,6 +515,8 @@ class AllocationPolicy(proto.Message):
515515 reserved.
516516 network (google.cloud.batch_v1alpha.types.AllocationPolicy.NetworkPolicy):
517517 The network policy.
518+ placement (google.cloud.batch_v1alpha.types.AllocationPolicy.PlacementPolicy):
519+ The placement policy.
518520 """
519521
520522 class ProvisioningModel (proto .Enum ):
@@ -547,13 +549,16 @@ class LocationPolicy(proto.Message):
547549 Attributes:
548550 allowed_locations (MutableSequence[str]):
549551 A list of allowed location names represented by internal
550- URLs. Each location can be a region or a zone. Only one
551- region or multiple zones in one region is supported now. For
552- example, ["regions/us-central1"] allow VMs in any zones in
553- region us-central1. ["zones/us-central1-a",
554- "zones/us-central1-c"] only allow VMs in zones us-central1-a
555- and us-central1-c. All locations end up in different regions
556- would cause errors. For example, ["regions/us-central1",
552+ URLs.
553+
554+ Each location can be a region or a zone. Only one region or
555+ multiple zones in one region is supported now. For example,
556+ ["regions/us-central1"] allow VMs in any zones in region
557+ us-central1. ["zones/us-central1-a", "zones/us-central1-c"]
558+ only allow VMs in zones us-central1-a and us-central1-c.
559+
560+ All locations end up in different regions would cause
561+ errors. For example, ["regions/us-central1",
557562 "zones/us-central1-a", "zones/us-central1-b",
558563 "zones/us-west1-a"] contains 2 regions "us-central1" and
559564 "us-west1". An error is expected in this case.
@@ -574,7 +579,8 @@ class LocationPolicy(proto.Message):
574579 class Disk (proto .Message ):
575580 r"""A new persistent disk or a local ssd.
576581 A VM can only have one local SSD setting but multiple local SSD
577- partitions. https://cloud.google.com/compute/docs/disks#pdspecs.
582+ partitions. See
583+ https://cloud.google.com/compute/docs/disks#pdspecs and
578584 https://cloud.google.com/compute/docs/disks#localssds.
579585
580586 This message has `oneof`_ fields (mutually exclusive fields).
@@ -587,20 +593,24 @@ class Disk(proto.Message):
587593 Attributes:
588594 image (str):
589595 Name of a public or custom image used as the data source.
590- For example, the following are all valid URLs: (1) Specify
591- the image by its family name:
592- projects/{project}/global/images/family/{image_family} (2)
593- Specify the image version:
594- projects/{project}/global/images/{image_version} You can
595- also use Batch customized image in short names. The
596+ For example, the following are all valid URLs:
597+
598+ - Specify the image by its family name:
599+ projects/{project}/global/images/family/{image_family}
600+ - Specify the image version:
601+ projects/{project}/global/images/{image_version}
602+
603+ You can also use Batch customized image in short names. The
596604 following image values are supported for a boot disk:
597- "batch-debian": use Batch Debian images. "batch-centos": use
598- Batch CentOS images. "batch-cos": use Batch
599- Container-Optimized images.
605+
606+ - "batch-debian": use Batch Debian images.
607+ - "batch-centos": use Batch CentOS images.
608+ - "batch-cos": use Batch Container-Optimized images.
600609
601610 This field is a member of `oneof`_ ``data_source``.
602611 snapshot (str):
603612 Name of a snapshot used as the data source.
613+ Snapshot is not supported as boot disk now.
604614
605615 This field is a member of `oneof`_ ``data_source``.
606616 type_ (str):
@@ -609,11 +619,13 @@ class Disk(proto.Message):
609619 disks and boot disks use "pd-balanced", "pd-extreme",
610620 "pd-ssd" or "pd-standard".
611621 size_gb (int):
612- Disk size in GB. For persistent disk, this field is ignored
613- if ``data_source`` is ``image`` or ``snapshot``. For local
614- SSD, size_gb should be a multiple of 375GB, otherwise, the
615- final size will be the next greater multiple of 375 GB. For
616- boot disk, Batch will calculate the boot disk size based on
622+ Disk size in GB.
623+
624+ For persistent disk, this field is ignored if
625+ ``data_source`` is ``image`` or ``snapshot``. For local SSD,
626+ size_gb should be a multiple of 375GB, otherwise, the final
627+ size will be the next greater multiple of 375 GB. For boot
628+ disk, Batch will calculate the boot disk size based on
617629 source image and task requirements if you do not speicify
618630 the size. If both this field and the boot_disk_mib field in
619631 task spec's compute_resource are defined, Batch will only
@@ -728,25 +740,29 @@ class InstancePolicy(proto.Message):
728740 machine_type (str):
729741 The Compute Engine machine type.
730742 min_cpu_platform (str):
731- The minimum CPU platform. See
732- ``https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform``.
743+ The minimum CPU platform.
744+ See
745+ https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
733746 Not yet implemented.
734747 provisioning_model (google.cloud.batch_v1alpha.types.AllocationPolicy.ProvisioningModel):
735748 The provisioning model.
736749 accelerators (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.Accelerator]):
737750 The accelerators attached to each VM
738751 instance.
739752 boot_disk (google.cloud.batch_v1alpha.types.AllocationPolicy.Disk):
740- Book disk to be created and attached to each
753+ Boot disk to be created and attached to each
741754 VM by this InstancePolicy. Boot disk will be
742- deleted when the VM is deleted.
755+ deleted when the VM is deleted. Batch API now
756+ only supports booting from image.
743757 disks (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.AttachedDisk]):
744758 Non-boot disks to be attached for each VM
745759 created by this InstancePolicy. New disks will
746760 be deleted when the VM is deleted.
747761 reservation (str):
748- If specified, VMs will be allocated only
749- inside the matching reservation.
762+ If specified, VMs will consume only the
763+ specified reservation. If not specified
764+ (default), VMs will consume any applicable
765+ reservation.
750766 """
751767
752768 allowed_machine_types : MutableSequence [str ] = proto .RepeatedField (
@@ -837,21 +853,23 @@ class NetworkInterface(proto.Message):
837853
838854 Attributes:
839855 network (str):
840- The URL of an existing network resource.
841- You can specify the network as a full or partial
842- URL. For example, the following are all valid
843- URLs:
844- https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
845- projects/{project}/global/networks/{network}
846- global/networks/{network}
856+ The URL of an existing network resource. You can specify the
857+ network as a full or partial URL.
858+
859+ For example, the following are all valid URLs:
860+
861+ - https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
862+ - projects/{project}/global/networks/{network}
863+ - global/networks/{network}
847864 subnetwork (str):
848- The URL of an existing subnetwork resource in
849- the network. You can specify the subnetwork as a
850- full or partial URL. For example, the following
851- are all valid URLs:
852- https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
853- projects/{project}/regions/{region}/subnetworks/{subnetwork}
854- regions/{region}/subnetworks/{subnetwork}
865+ The URL of an existing subnetwork resource in the network.
866+ You can specify the subnetwork as a full or partial URL.
867+
868+ For example, the following are all valid URLs:
869+
870+ - https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
871+ - projects/{project}/regions/{region}/subnetworks/{subnetwork}
872+ - regions/{region}/subnetworks/{subnetwork}
855873 no_external_ip_address (bool):
856874 Default is false (with an external IP
857875 address). Required if no external public IP
@@ -894,6 +912,36 @@ class NetworkPolicy(proto.Message):
894912 message = "AllocationPolicy.NetworkInterface" ,
895913 )
896914
915+ class PlacementPolicy (proto .Message ):
916+ r"""PlacementPolicy describes a group placement policy for the
917+ VMs controlled by this AllocationPolicy.
918+
919+ Attributes:
920+ collocation (str):
921+ UNSPECIFIED vs. COLLOCATED (default
922+ UNSPECIFIED). Use COLLOCATED when you want VMs
923+ to be located close to each other for low
924+ network latency between the VMs. No placement
925+ policy will be generated when collocation is
926+ UNSPECIFIED.
927+ max_distance (int):
928+ When specified, causes the job to fail if more than
929+ max_distance logical switches are required between VMs.
930+ Batch uses the most compact possible placement of VMs even
931+ when max_distance is not specified. An explicit max_distance
932+ makes that level of compactness a strict requirement. Not
933+ yet implemented
934+ """
935+
936+ collocation : str = proto .Field (
937+ proto .STRING ,
938+ number = 1 ,
939+ )
940+ max_distance : int = proto .Field (
941+ proto .INT64 ,
942+ number = 2 ,
943+ )
944+
897945 location : LocationPolicy = proto .Field (
898946 proto .MESSAGE ,
899947 number = 1 ,
@@ -937,6 +985,11 @@ class NetworkPolicy(proto.Message):
937985 number = 7 ,
938986 message = NetworkPolicy ,
939987 )
988+ placement : PlacementPolicy = proto .Field (
989+ proto .MESSAGE ,
990+ number = 10 ,
991+ message = PlacementPolicy ,
992+ )
940993
941994
942995class TaskGroup (proto .Message ):
@@ -954,12 +1007,14 @@ class TaskGroup(proto.Message):
9541007 task spec.
9551008 task_count (int):
9561009 Number of Tasks in the TaskGroup.
957- default is 1
1010+ Default is 1.
9581011 parallelism (int):
9591012 Max number of tasks that can run in parallel. Default to
960- min(task_count, 1000).
1013+ min(task_count, 1000). Field parallelism must be 1 if the
1014+ scheduling_policy is IN_ORDER.
9611015 scheduling_policy (google.cloud.batch_v1alpha.types.TaskGroup.SchedulingPolicy):
962- Scheduling policy for Tasks in the TaskGroup.
1016+ Scheduling policy for Tasks in the TaskGroup. The default
1017+ value is AS_SOON_AS_POSSIBLE.
9631018 allocation_policy (google.cloud.batch_v1alpha.types.AllocationPolicy):
9641019 Compute resource allocation for the
9651020 TaskGroup. If specified, it overrides resources
@@ -1011,9 +1066,17 @@ class SchedulingPolicy(proto.Enum):
10111066 Unspecified.
10121067 AS_SOON_AS_POSSIBLE (1):
10131068 Run Tasks as soon as resources are available.
1069+
1070+ Tasks might be executed in parallel depending on parallelism
1071+ and task_count values.
1072+ IN_ORDER (2):
1073+ Run Tasks sequentially with increased task
1074+ index.
1075+ Not yet implemented.
10141076 """
10151077 SCHEDULING_POLICY_UNSPECIFIED = 0
10161078 AS_SOON_AS_POSSIBLE = 1
1079+ IN_ORDER = 2
10171080
10181081 name : str = proto .Field (
10191082 proto .STRING ,
0 commit comments