Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 9414457

Browse files
docs: fix minor docstring formatting (#72)
* feat: Adds named reservation to InstancePolicy --- docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs --- docs: update the job id format requirement PiperOrigin-RevId: 489501779 Source-Link: googleapis/googleapis@488a4bd Source-Link: https://github.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Adds named reservation to InstancePolicy --- docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs --- docs: update the job id format requirement PiperOrigin-RevId: 489502315 Source-Link: googleapis/googleapis@db1cc11 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fcc564ef064c7dff31d7970e12318ad084703ac6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: fix minor docstring formatting PiperOrigin-RevId: 490003354 Source-Link: googleapis/googleapis@9afb89b Source-Link: https://github.com/googleapis/googleapis-gen/commit/c51774cd8dd5804d5ec6f335b1855c28d1171a56 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzUxNzc0Y2Q4ZGQ1ODA0ZDVlYzZmMzM1YjE4NTVjMjhkMTE3MWE1NiJ9 * 🦉 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 69b44bf commit 9414457

File tree

11 files changed

+112
-81
lines changed

11 files changed

+112
-81
lines changed

google/cloud/batch_v1/services/batch_service/async_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@ async def sample_create_job():
285285
should not be set.
286286
job_id (:class:`str`):
287287
ID used to uniquely identify the Job within its parent
288-
scope. This field should contain at most 63 characters.
289-
Only alphanumeric characters or '-' are accepted. The
290-
'-' character cannot be the first or the last one. A
291-
system generated ID will be used if the field is not
292-
set.
288+
scope. This field should contain at most 63 characters
289+
and must start with lowercase characters. Only lowercase
290+
characters, numbers and '-' are accepted. The '-'
291+
character cannot be the first or the last one. A system
292+
generated ID will be used if the field is not set.
293293
294294
The job.name field in the request will be ignored and
295295
the created resource name of the Job will be

google/cloud/batch_v1/services/batch_service/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,11 @@ def sample_create_job():
565565
should not be set.
566566
job_id (str):
567567
ID used to uniquely identify the Job within its parent
568-
scope. This field should contain at most 63 characters.
569-
Only alphanumeric characters or '-' are accepted. The
570-
'-' character cannot be the first or the last one. A
571-
system generated ID will be used if the field is not
572-
set.
568+
scope. This field should contain at most 63 characters
569+
and must start with lowercase characters. Only lowercase
570+
characters, numbers and '-' are accepted. The '-'
571+
character cannot be the first or the last one. A system
572+
generated ID will be used if the field is not set.
573573
574574
The job.name field in the request will be ignored and
575575
the created resource name of the Job will be

google/cloud/batch_v1/types/batch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ class CreateJobRequest(proto.Message):
4747
"projects/{project}/locations/{location}".
4848
job_id (str):
4949
ID used to uniquely identify the Job within its parent
50-
scope. This field should contain at most 63 characters. Only
51-
alphanumeric characters or '-' are accepted. The '-'
52-
character cannot be the first or the last one. A system
53-
generated ID will be used if the field is not set.
50+
scope. This field should contain at most 63 characters and
51+
must start with lowercase characters. Only lowercase
52+
characters, numbers and '-' are accepted. The '-' character
53+
cannot be the first or the last one. A system generated ID
54+
will be used if the field is not set.
5455
5556
The job.name field in the request will be ignored and the
5657
created resource name of the Job will be

google/cloud/batch_v1/types/job.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ class Disk(proto.Message):
445445
)
446446

447447
class AttachedDisk(proto.Message):
448-
r"""A new or an existing persistent disk or a local ssd attached
449-
to a VM instance.
448+
r"""A new or an existing persistent disk (PD) or a local ssd
449+
attached to a VM instance.
450450
451451
This message has `oneof`_ fields (mutually exclusive fields).
452452
For each oneof, at most one member field can be set at the same time.
@@ -488,7 +488,7 @@ class AttachedDisk(proto.Message):
488488

489489
class Accelerator(proto.Message):
490490
r"""Accelerator describes Compute Engine accelerators to be
491-
attached to VMs.
491+
attached to the VM.
492492
493493
Attributes:
494494
type_ (str):
@@ -529,11 +529,11 @@ class InstancePolicy(proto.Message):
529529
The provisioning model.
530530
accelerators (MutableSequence[google.cloud.batch_v1.types.AllocationPolicy.Accelerator]):
531531
The accelerators attached to each VM
532-
instance. Not yet implemented.
532+
instance.
533533
disks (MutableSequence[google.cloud.batch_v1.types.AllocationPolicy.AttachedDisk]):
534534
Non-boot disks to be attached for each VM
535535
created by this InstancePolicy. New disks will
536-
be deleted when the attached VM is deleted.
536+
be deleted when the VM is deleted.
537537
"""
538538

539539
machine_type: str = proto.Field(

google/cloud/batch_v1/types/volume.py

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828

2929

3030
class Volume(proto.Message):
31-
r"""Volume and mount parameters to be associated with a TaskSpec.
32-
A TaskSpec might describe zero, one, or multiple volumes to be
33-
mounted as part of the task.
31+
r"""Volume describes a volume and parameters for it to be mounted
32+
to a VM.
3433
3534
This message has `oneof`_ fields (mutually exclusive fields).
3635
For each oneof, at most one member field can be set at the same time.
@@ -41,28 +40,39 @@ class Volume(proto.Message):
4140
4241
Attributes:
4342
nfs (google.cloud.batch_v1.types.NFS):
44-
An NFS source for the volume (could be a
45-
Filestore, for example).
43+
A Network File System (NFS) volume. For
44+
example, a Filestore file share.
4645
4746
This field is a member of `oneof`_ ``source``.
4847
gcs (google.cloud.batch_v1.types.GCS):
49-
A Google Cloud Storage source for the volume.
48+
A Google Cloud Storage (GCS) volume.
5049
5150
This field is a member of `oneof`_ ``source``.
5251
device_name (str):
53-
Device name of an attached disk
52+
Device name of an attached disk volume, which should align
53+
with a device_name specified by
54+
job.allocation_policy.instances[0].policy.disks[i].device_name
55+
or defined by the given instance template in
56+
job.allocation_policy.instances[0].instance_template.
5457
5558
This field is a member of `oneof`_ ``source``.
5659
mount_path (str):
57-
Mount path for the volume, e.g. /mnt/share
60+
The mount path for the volume, e.g.
61+
/mnt/disks/share.
5862
mount_options (MutableSequence[str]):
59-
Mount options For Google Cloud Storage, mount options are
60-
the global options supported by gcsfuse tool. Batch will use
61-
them to mount the volume with the following command:
62-
"gcsfuse [global options] bucket mountpoint". For PD, NFS,
63-
mount options are these supported by /etc/fstab. Batch will
64-
use Fstab to mount such volumes.
65-
https://help.ubuntu.com/community/Fstab
63+
For Google Cloud Storage (GCS), mount options
64+
are the options supported by the gcsfuse tool
65+
(https://github.com/GoogleCloudPlatform/gcsfuse).
66+
For existing persistent disks, mount options
67+
provided by the mount command
68+
(https://man7.org/linux/man-pages/man8/mount.8.html)
69+
except writing are supported. This is due to
70+
restrictions of multi-writer mode
71+
(https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).
72+
For other attached disks and Network File System
73+
(NFS), mount options are these supported by the
74+
mount command
75+
(https://man7.org/linux/man-pages/man8/mount.8.html).
6676
"""
6777

6878
nfs: "NFS" = proto.Field(
@@ -93,14 +103,14 @@ class Volume(proto.Message):
93103

94104

95105
class NFS(proto.Message):
96-
r"""Represents an NFS server and remote path: :<remote_path>
106+
r"""Represents an NFS volume.
97107
98108
Attributes:
99109
server (str):
100-
URI of the NFS server, e.g. an IP address.
110+
The IP address of the NFS.
101111
remote_path (str):
102-
Remote source path exported from NFS, e.g.,
103-
"/share".
112+
Remote source path exported from the NFS,
113+
e.g., "/share".
104114
"""
105115

106116
server: str = proto.Field(
@@ -114,7 +124,7 @@ class NFS(proto.Message):
114124

115125

116126
class GCS(proto.Message):
117-
r"""Represents a Google Cloud Storage volume source config.
127+
r"""Represents a Google Cloud Storage volume.
118128
119129
Attributes:
120130
remote_path (str):

google/cloud/batch_v1alpha/services/batch_service/async_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@ async def sample_create_job():
285285
should not be set.
286286
job_id (:class:`str`):
287287
ID used to uniquely identify the Job within its parent
288-
scope. This field should contain at most 63 characters.
289-
Only alphanumeric characters or '-' are accepted. The
290-
'-' character cannot be the first or the last one. A
291-
system generated ID will be used if the field is not
292-
set.
288+
scope. This field should contain at most 63 characters
289+
and must start with lowercase characters. Only lowercase
290+
characters, numbers and '-' are accepted. The '-'
291+
character cannot be the first or the last one. A system
292+
generated ID will be used if the field is not set.
293293
294294
The job.name field in the request will be ignored and
295295
the created resource name of the Job will be

google/cloud/batch_v1alpha/services/batch_service/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,11 @@ def sample_create_job():
565565
should not be set.
566566
job_id (str):
567567
ID used to uniquely identify the Job within its parent
568-
scope. This field should contain at most 63 characters.
569-
Only alphanumeric characters or '-' are accepted. The
570-
'-' character cannot be the first or the last one. A
571-
system generated ID will be used if the field is not
572-
set.
568+
scope. This field should contain at most 63 characters
569+
and must start with lowercase characters. Only lowercase
570+
characters, numbers and '-' are accepted. The '-'
571+
character cannot be the first or the last one. A system
572+
generated ID will be used if the field is not set.
573573
574574
The job.name field in the request will be ignored and
575575
the created resource name of the Job will be

google/cloud/batch_v1alpha/types/batch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ class CreateJobRequest(proto.Message):
4747
"projects/{project}/locations/{location}".
4848
job_id (str):
4949
ID used to uniquely identify the Job within its parent
50-
scope. This field should contain at most 63 characters. Only
51-
alphanumeric characters or '-' are accepted. The '-'
52-
character cannot be the first or the last one. A system
53-
generated ID will be used if the field is not set.
50+
scope. This field should contain at most 63 characters and
51+
must start with lowercase characters. Only lowercase
52+
characters, numbers and '-' are accepted. The '-' character
53+
cannot be the first or the last one. A system generated ID
54+
will be used if the field is not set.
5455
5556
The job.name field in the request will be ignored and the
5657
created resource name of the Job will be

google/cloud/batch_v1alpha/types/job.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ class AllocationPolicy(proto.Message):
408408
Deprecated: please use instances[0].template instead.
409409
provisioning_models (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.ProvisioningModel]):
410410
Deprecated: please use
411-
instances[i].policy.provisioning_model instead.
411+
instances[0].policy.provisioning_model instead.
412412
service_account_email (str):
413413
Deprecated: please use service_account instead.
414414
service_account (google.cloud.batch_v1alpha.types.ServiceAccount):
@@ -525,8 +525,8 @@ class Disk(proto.Message):
525525
)
526526

527527
class AttachedDisk(proto.Message):
528-
r"""A new or an existing persistent disk or a local ssd attached
529-
to a VM instance.
528+
r"""A new or an existing persistent disk (PD) or a local ssd
529+
attached to a VM instance.
530530
531531
This message has `oneof`_ fields (mutually exclusive fields).
532532
For each oneof, at most one member field can be set at the same time.
@@ -568,7 +568,7 @@ class AttachedDisk(proto.Message):
568568

569569
class Accelerator(proto.Message):
570570
r"""Accelerator describes Compute Engine accelerators to be
571-
attached to VMs.
571+
attached to the VM.
572572
573573
Attributes:
574574
type_ (str):
@@ -611,11 +611,14 @@ class InstancePolicy(proto.Message):
611611
The provisioning model.
612612
accelerators (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.Accelerator]):
613613
The accelerators attached to each VM
614-
instance. Not yet implemented.
614+
instance.
615615
disks (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.AttachedDisk]):
616616
Non-boot disks to be attached for each VM
617617
created by this InstancePolicy. New disks will
618-
be deleted when the attached VM is deleted.
618+
be deleted when the VM is deleted.
619+
reservation (str):
620+
If specified, VMs will be allocated only
621+
inside the matching reservation.
619622
"""
620623

621624
allowed_machine_types: MutableSequence[str] = proto.RepeatedField(
@@ -647,6 +650,10 @@ class InstancePolicy(proto.Message):
647650
number=6,
648651
message="AllocationPolicy.AttachedDisk",
649652
)
653+
reservation: str = proto.Field(
654+
proto.STRING,
655+
number=7,
656+
)
650657

651658
class InstancePolicyOrTemplate(proto.Message):
652659
r"""Either an InstancePolicy or an instance template.

google/cloud/batch_v1alpha/types/volume.py

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929

3030

3131
class Volume(proto.Message):
32-
r"""Volume and mount parameters to be associated with a TaskSpec.
33-
A TaskSpec might describe zero, one, or multiple volumes to be
34-
mounted as part of the task.
32+
r"""Volume describes a volume and parameters for it to be mounted
33+
to a VM.
3534
3635
This message has `oneof`_ fields (mutually exclusive fields).
3736
For each oneof, at most one member field can be set at the same time.
@@ -42,32 +41,43 @@ class Volume(proto.Message):
4241
4342
Attributes:
4443
nfs (google.cloud.batch_v1alpha.types.NFS):
45-
An NFS source for the volume (could be a
46-
Filestore, for example).
44+
A Network File System (NFS) volume. For
45+
example, a Filestore file share.
4746
4847
This field is a member of `oneof`_ ``source``.
4948
pd (google.cloud.batch_v1alpha.types.PD):
50-
A persistent disk source for the volume.
49+
Deprecated: please use device_name instead.
5150
5251
This field is a member of `oneof`_ ``source``.
5352
gcs (google.cloud.batch_v1alpha.types.GCS):
54-
A Google Cloud Storage source for the volume.
53+
A Google Cloud Storage (GCS) volume.
5554
5655
This field is a member of `oneof`_ ``source``.
5756
device_name (str):
58-
Device name of an attached disk
57+
Device name of an attached disk volume, which should align
58+
with a device_name specified by
59+
job.allocation_policy.instances[0].policy.disks[i].device_name
60+
or defined by the given instance template in
61+
job.allocation_policy.instances[0].instance_template.
5962
6063
This field is a member of `oneof`_ ``source``.
6164
mount_path (str):
62-
Mount path for the volume, e.g. /mnt/share
65+
The mount path for the volume, e.g.
66+
/mnt/disks/share.
6367
mount_options (MutableSequence[str]):
64-
Mount options For Google Cloud Storage, mount options are
65-
the global options supported by gcsfuse tool. Batch will use
66-
them to mount the volume with the following command:
67-
"gcsfuse [global options] bucket mountpoint". For PD, NFS,
68-
mount options are these supported by /etc/fstab. Batch will
69-
use Fstab to mount such volumes.
70-
https://help.ubuntu.com/community/Fstab
68+
For Google Cloud Storage (GCS), mount options
69+
are the options supported by the gcsfuse tool
70+
(https://github.com/GoogleCloudPlatform/gcsfuse).
71+
For existing persistent disks, mount options
72+
provided by the mount command
73+
(https://man7.org/linux/man-pages/man8/mount.8.html)
74+
except writing are supported. This is due to
75+
restrictions of multi-writer mode
76+
(https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).
77+
For other attached disks and Network File System
78+
(NFS), mount options are these supported by the
79+
mount command
80+
(https://man7.org/linux/man-pages/man8/mount.8.html).
7181
"""
7282

7383
nfs: "NFS" = proto.Field(
@@ -104,14 +114,14 @@ class Volume(proto.Message):
104114

105115

106116
class NFS(proto.Message):
107-
r"""Represents an NFS server and remote path: :<remote_path>
117+
r"""Represents an NFS volume.
108118
109119
Attributes:
110120
server (str):
111-
URI of the NFS server, e.g. an IP address.
121+
The IP address of the NFS.
112122
remote_path (str):
113-
Remote source path exported from NFS, e.g.,
114-
"/share".
123+
Remote source path exported from the NFS,
124+
e.g., "/share".
115125
"""
116126

117127
server: str = proto.Field(
@@ -125,7 +135,7 @@ class NFS(proto.Message):
125135

126136

127137
class PD(proto.Message):
128-
r"""Represents a GCP persistent disk
138+
r"""Deprecated: please use device_name instead.
129139
130140
Attributes:
131141
disk (str):
@@ -155,7 +165,7 @@ class PD(proto.Message):
155165

156166

157167
class GCS(proto.Message):
158-
r"""Represents a Google Cloud Storage volume source config.
168+
r"""Represents a Google Cloud Storage volume.
159169
160170
Attributes:
161171
remote_path (str):

0 commit comments

Comments
 (0)