Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions google/cloud/batch_v1/services/batch_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ async def sample_create_job():
should not be set.
job_id (:class:`str`):
ID used to uniquely identify the Job within its parent
scope. This field should contain at most 63 characters.
Only alphanumeric characters or '-' are accepted. The
'-' character cannot be the first or the last one. A
system generated ID will be used if the field is not
set.
scope. This field should contain at most 63 characters
and must start with lowercase characters. Only lowercase
characters, numbers and '-' are accepted. The '-'
character cannot be the first or the last one. A system
generated ID will be used if the field is not set.

The job.name field in the request will be ignored and
the created resource name of the Job will be
Expand Down
10 changes: 5 additions & 5 deletions google/cloud/batch_v1/services/batch_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,11 @@ def sample_create_job():
should not be set.
job_id (str):
ID used to uniquely identify the Job within its parent
scope. This field should contain at most 63 characters.
Only alphanumeric characters or '-' are accepted. The
'-' character cannot be the first or the last one. A
system generated ID will be used if the field is not
set.
scope. This field should contain at most 63 characters
and must start with lowercase characters. Only lowercase
characters, numbers and '-' are accepted. The '-'
character cannot be the first or the last one. A system
generated ID will be used if the field is not set.

The job.name field in the request will be ignored and
the created resource name of the Job will be
Expand Down
9 changes: 5 additions & 4 deletions google/cloud/batch_v1/types/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ class CreateJobRequest(proto.Message):
"projects/{project}/locations/{location}".
job_id (str):
ID used to uniquely identify the Job within its parent
scope. This field should contain at most 63 characters. Only
alphanumeric characters or '-' are accepted. The '-'
character cannot be the first or the last one. A system
generated ID will be used if the field is not set.
scope. This field should contain at most 63 characters and
must start with lowercase characters. Only lowercase
characters, numbers and '-' are accepted. The '-' character
cannot be the first or the last one. A system generated ID
will be used if the field is not set.

The job.name field in the request will be ignored and the
created resource name of the Job will be
Expand Down
10 changes: 5 additions & 5 deletions google/cloud/batch_v1/types/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ class Disk(proto.Message):
)

class AttachedDisk(proto.Message):
r"""A new or an existing persistent disk or a local ssd attached
to a VM instance.
r"""A new or an existing persistent disk (PD) or a local ssd
attached to a VM instance.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Expand Down Expand Up @@ -488,7 +488,7 @@ class AttachedDisk(proto.Message):

class Accelerator(proto.Message):
r"""Accelerator describes Compute Engine accelerators to be
attached to VMs.
attached to the VM.

Attributes:
type_ (str):
Expand Down Expand Up @@ -529,11 +529,11 @@ class InstancePolicy(proto.Message):
The provisioning model.
accelerators (MutableSequence[google.cloud.batch_v1.types.AllocationPolicy.Accelerator]):
The accelerators attached to each VM
instance. Not yet implemented.
instance.
disks (MutableSequence[google.cloud.batch_v1.types.AllocationPolicy.AttachedDisk]):
Non-boot disks to be attached for each VM
created by this InstancePolicy. New disks will
be deleted when the attached VM is deleted.
be deleted when the VM is deleted.
"""

machine_type: str = proto.Field(
Expand Down
50 changes: 30 additions & 20 deletions google/cloud/batch_v1/types/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@


class Volume(proto.Message):
r"""Volume and mount parameters to be associated with a TaskSpec.
A TaskSpec might describe zero, one, or multiple volumes to be
mounted as part of the task.
r"""Volume describes a volume and parameters for it to be mounted
to a VM.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Expand All @@ -41,28 +40,39 @@ class Volume(proto.Message):

Attributes:
nfs (google.cloud.batch_v1.types.NFS):
An NFS source for the volume (could be a
Filestore, for example).
A Network File System (NFS) volume. For
example, a Filestore file share.

This field is a member of `oneof`_ ``source``.
gcs (google.cloud.batch_v1.types.GCS):
A Google Cloud Storage source for the volume.
A Google Cloud Storage (GCS) volume.

This field is a member of `oneof`_ ``source``.
device_name (str):
Device name of an attached disk
Device name of an attached disk volume, which should align
with a device_name specified by
job.allocation_policy.instances[0].policy.disks[i].device_name
or defined by the given instance template in
job.allocation_policy.instances[0].instance_template.

This field is a member of `oneof`_ ``source``.
mount_path (str):
Mount path for the volume, e.g. /mnt/share
The mount path for the volume, e.g.
/mnt/disks/share.
mount_options (MutableSequence[str]):
Mount options For Google Cloud Storage, mount options are
the global options supported by gcsfuse tool. Batch will use
them to mount the volume with the following command:
"gcsfuse [global options] bucket mountpoint". For PD, NFS,
mount options are these supported by /etc/fstab. Batch will
use Fstab to mount such volumes.
https://help.ubuntu.com/community/Fstab
For Google Cloud Storage (GCS), mount options
are the options supported by the gcsfuse tool
(https://github.com/GoogleCloudPlatform/gcsfuse).
For existing persistent disks, mount options
provided by the mount command
(https://man7.org/linux/man-pages/man8/mount.8.html)
except writing are supported. This is due to
restrictions of multi-writer mode
(https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).
For other attached disks and Network File System
(NFS), mount options are these supported by the
mount command
(https://man7.org/linux/man-pages/man8/mount.8.html).
"""

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


class NFS(proto.Message):
r"""Represents an NFS server and remote path: :<remote_path>
r"""Represents an NFS volume.

Attributes:
server (str):
URI of the NFS server, e.g. an IP address.
The IP address of the NFS.
remote_path (str):
Remote source path exported from NFS, e.g.,
"/share".
Remote source path exported from the NFS,
e.g., "/share".
"""

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


class GCS(proto.Message):
r"""Represents a Google Cloud Storage volume source config.
r"""Represents a Google Cloud Storage volume.

Attributes:
remote_path (str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ async def sample_create_job():
should not be set.
job_id (:class:`str`):
ID used to uniquely identify the Job within its parent
scope. This field should contain at most 63 characters.
Only alphanumeric characters or '-' are accepted. The
'-' character cannot be the first or the last one. A
system generated ID will be used if the field is not
set.
scope. This field should contain at most 63 characters
and must start with lowercase characters. Only lowercase
characters, numbers and '-' are accepted. The '-'
character cannot be the first or the last one. A system
generated ID will be used if the field is not set.

The job.name field in the request will be ignored and
the created resource name of the Job will be
Expand Down
10 changes: 5 additions & 5 deletions google/cloud/batch_v1alpha/services/batch_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,11 @@ def sample_create_job():
should not be set.
job_id (str):
ID used to uniquely identify the Job within its parent
scope. This field should contain at most 63 characters.
Only alphanumeric characters or '-' are accepted. The
'-' character cannot be the first or the last one. A
system generated ID will be used if the field is not
set.
scope. This field should contain at most 63 characters
and must start with lowercase characters. Only lowercase
characters, numbers and '-' are accepted. The '-'
character cannot be the first or the last one. A system
generated ID will be used if the field is not set.

The job.name field in the request will be ignored and
the created resource name of the Job will be
Expand Down
9 changes: 5 additions & 4 deletions google/cloud/batch_v1alpha/types/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ class CreateJobRequest(proto.Message):
"projects/{project}/locations/{location}".
job_id (str):
ID used to uniquely identify the Job within its parent
scope. This field should contain at most 63 characters. Only
alphanumeric characters or '-' are accepted. The '-'
character cannot be the first or the last one. A system
generated ID will be used if the field is not set.
scope. This field should contain at most 63 characters and
must start with lowercase characters. Only lowercase
characters, numbers and '-' are accepted. The '-' character
cannot be the first or the last one. A system generated ID
will be used if the field is not set.

The job.name field in the request will be ignored and the
created resource name of the Job will be
Expand Down
19 changes: 13 additions & 6 deletions google/cloud/batch_v1alpha/types/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class AllocationPolicy(proto.Message):
Deprecated: please use instances[0].template instead.
provisioning_models (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.ProvisioningModel]):
Deprecated: please use
instances[i].policy.provisioning_model instead.
instances[0].policy.provisioning_model instead.
service_account_email (str):
Deprecated: please use service_account instead.
service_account (google.cloud.batch_v1alpha.types.ServiceAccount):
Expand Down Expand Up @@ -525,8 +525,8 @@ class Disk(proto.Message):
)

class AttachedDisk(proto.Message):
r"""A new or an existing persistent disk or a local ssd attached
to a VM instance.
r"""A new or an existing persistent disk (PD) or a local ssd
attached to a VM instance.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Expand Down Expand Up @@ -568,7 +568,7 @@ class AttachedDisk(proto.Message):

class Accelerator(proto.Message):
r"""Accelerator describes Compute Engine accelerators to be
attached to VMs.
attached to the VM.

Attributes:
type_ (str):
Expand Down Expand Up @@ -611,11 +611,14 @@ class InstancePolicy(proto.Message):
The provisioning model.
accelerators (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.Accelerator]):
The accelerators attached to each VM
instance. Not yet implemented.
instance.
disks (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.AttachedDisk]):
Non-boot disks to be attached for each VM
created by this InstancePolicy. New disks will
be deleted when the attached VM is deleted.
be deleted when the VM is deleted.
reservation (str):
If specified, VMs will be allocated only
inside the matching reservation.
"""

allowed_machine_types: MutableSequence[str] = proto.RepeatedField(
Expand Down Expand Up @@ -647,6 +650,10 @@ class InstancePolicy(proto.Message):
number=6,
message="AllocationPolicy.AttachedDisk",
)
reservation: str = proto.Field(
proto.STRING,
number=7,
)

class InstancePolicyOrTemplate(proto.Message):
r"""Either an InstancePolicy or an instance template.
Expand Down
54 changes: 32 additions & 22 deletions google/cloud/batch_v1alpha/types/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@


class Volume(proto.Message):
r"""Volume and mount parameters to be associated with a TaskSpec.
A TaskSpec might describe zero, one, or multiple volumes to be
mounted as part of the task.
r"""Volume describes a volume and parameters for it to be mounted
to a VM.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Expand All @@ -42,32 +41,43 @@ class Volume(proto.Message):

Attributes:
nfs (google.cloud.batch_v1alpha.types.NFS):
An NFS source for the volume (could be a
Filestore, for example).
A Network File System (NFS) volume. For
example, a Filestore file share.

This field is a member of `oneof`_ ``source``.
pd (google.cloud.batch_v1alpha.types.PD):
A persistent disk source for the volume.
Deprecated: please use device_name instead.

This field is a member of `oneof`_ ``source``.
gcs (google.cloud.batch_v1alpha.types.GCS):
A Google Cloud Storage source for the volume.
A Google Cloud Storage (GCS) volume.

This field is a member of `oneof`_ ``source``.
device_name (str):
Device name of an attached disk
Device name of an attached disk volume, which should align
with a device_name specified by
job.allocation_policy.instances[0].policy.disks[i].device_name
or defined by the given instance template in
job.allocation_policy.instances[0].instance_template.

This field is a member of `oneof`_ ``source``.
mount_path (str):
Mount path for the volume, e.g. /mnt/share
The mount path for the volume, e.g.
/mnt/disks/share.
mount_options (MutableSequence[str]):
Mount options For Google Cloud Storage, mount options are
the global options supported by gcsfuse tool. Batch will use
them to mount the volume with the following command:
"gcsfuse [global options] bucket mountpoint". For PD, NFS,
mount options are these supported by /etc/fstab. Batch will
use Fstab to mount such volumes.
https://help.ubuntu.com/community/Fstab
For Google Cloud Storage (GCS), mount options
are the options supported by the gcsfuse tool
(https://github.com/GoogleCloudPlatform/gcsfuse).
For existing persistent disks, mount options
provided by the mount command
(https://man7.org/linux/man-pages/man8/mount.8.html)
except writing are supported. This is due to
restrictions of multi-writer mode
(https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).
For other attached disks and Network File System
(NFS), mount options are these supported by the
mount command
(https://man7.org/linux/man-pages/man8/mount.8.html).
"""

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


class NFS(proto.Message):
r"""Represents an NFS server and remote path: :<remote_path>
r"""Represents an NFS volume.

Attributes:
server (str):
URI of the NFS server, e.g. an IP address.
The IP address of the NFS.
remote_path (str):
Remote source path exported from NFS, e.g.,
"/share".
Remote source path exported from the NFS,
e.g., "/share".
"""

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


class PD(proto.Message):
r"""Represents a GCP persistent disk
r"""Deprecated: please use device_name instead.

Attributes:
disk (str):
Expand Down Expand Up @@ -155,7 +165,7 @@ class PD(proto.Message):


class GCS(proto.Message):
r"""Represents a Google Cloud Storage volume source config.
r"""Represents a Google Cloud Storage volume.

Attributes:
remote_path (str):
Expand Down
Loading