Skip to content

Commit 488a4bd

Browse files
Google APIscopybara-github
authored andcommitted
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
1 parent e35c0d3 commit 488a4bd

5 files changed

Lines changed: 40 additions & 30 deletions

File tree

google/cloud/batch/v1alpha/batch.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ message CreateJobRequest {
107107
];
108108

109109
// ID used to uniquely identify the Job within its parent scope.
110-
// This field should contain at most 63 characters.
111-
// Only alphanumeric characters or '-' are accepted.
110+
// This field should contain at most 63 characters and must start with
111+
// lowercase characters.
112+
// Only lowercase characters, numbers and '-' are accepted.
112113
// The '-' character cannot be the first or the last one.
113114
// A system generated ID will be used if the field is not set.
114115
//

google/cloud/batch/v1alpha/batch_v1alpha.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,6 @@ authentication:
117117
oauth:
118118
canonical_scopes: |-
119119
https://www.googleapis.com/auth/cloud-platform
120+
121+
publishing:
122+
organization: CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED

google/cloud/batch/v1alpha/job.proto

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ message AllocationPolicy {
318318
string disk_interface = 6;
319319
}
320320

321-
// A new or an existing persistent disk or a local ssd attached to a VM
321+
// A new or an existing persistent disk (PD) or a local ssd attached to a VM
322322
// instance.
323323
message AttachedDisk {
324324
oneof attached {
@@ -335,7 +335,7 @@ message AllocationPolicy {
335335
string device_name = 3;
336336
}
337337

338-
// Accelerator describes Compute Engine accelerators to be attached to VMs.
338+
// Accelerator describes Compute Engine accelerators to be attached to the VM.
339339
message Accelerator {
340340
// The accelerator type. For example, "nvidia-tesla-t4".
341341
// See `gcloud compute accelerator-types list`.
@@ -367,12 +367,14 @@ message AllocationPolicy {
367367
ProvisioningModel provisioning_model = 4;
368368

369369
// The accelerators attached to each VM instance.
370-
// Not yet implemented.
371370
repeated Accelerator accelerators = 5;
372371

373372
// Non-boot disks to be attached for each VM created by this InstancePolicy.
374-
// New disks will be deleted when the attached VM is deleted.
373+
// New disks will be deleted when the VM is deleted.
375374
repeated AttachedDisk disks = 6;
375+
376+
// If specified, VMs will be allocated only inside the matching reservation.
377+
string reservation = 7;
376378
}
377379

378380
// Either an InstancePolicy or an instance template.
@@ -451,7 +453,7 @@ message AllocationPolicy {
451453
// Deprecated: please use instances[0].template instead.
452454
repeated string instance_templates = 3 [deprecated = true];
453455

454-
// Deprecated: please use instances[i].policy.provisioning_model instead.
456+
// Deprecated: please use instances[0].policy.provisioning_model instead.
455457
repeated ProvisioningModel provisioning_models = 4 [deprecated = true];
456458

457459
// Deprecated: please use service_account instead.

google/cloud/batch/v1alpha/task.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ message Runnable {
131131
bool block_external_network = 9;
132132

133133
// Optional username for logging in to a docker registry. If username
134-
// matches `projects/*/secrets/*/versions/*` then Batch will read the
134+
// matches "projects/*/secrets/*/versions/*" then Batch will read the
135135
// username from the Secret Manager.
136136
string username = 10;
137137

138138
// Optional password for logging in to a docker registry. If password
139-
// matches `projects/*/secrets/*/versions/*` then Batch will read the
139+
// matches "projects/*/secrets/*/versions/*" then Batch will read the
140140
// password from the Secret Manager;
141141
string password = 11;
142142
}

google/cloud/batch/v1alpha/volume.proto

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,49 +25,53 @@ option objc_class_prefix = "GCB";
2525
option php_namespace = "Google\\Cloud\\Batch\\V1alpha";
2626
option ruby_package = "Google::Cloud::Batch::V1alpha";
2727

28-
// Volume and mount parameters to be associated with a TaskSpec. A TaskSpec
29-
// might describe zero, one, or multiple volumes to be mounted as part of the
30-
// task.
28+
// Volume describes a volume and parameters for it to be mounted to a VM.
3129
message Volume {
3230
// The source for the volume.
3331
oneof source {
34-
// An NFS source for the volume (could be a Filestore, for example).
32+
// A Network File System (NFS) volume. For example, a
33+
// Filestore file share.
3534
NFS nfs = 1;
3635

37-
// A persistent disk source for the volume.
36+
// Deprecated: please use device_name instead.
3837
PD pd = 2 [deprecated = true];
3938

40-
// A Google Cloud Storage source for the volume.
39+
// A Google Cloud Storage (GCS) volume.
4140
GCS gcs = 3;
4241

43-
// Device name of an attached disk
42+
// Device name of an attached disk volume, which should align with a
43+
// device_name specified by
44+
// job.allocation_policy.instances[0].policy.disks[i].device_name or
45+
// defined by the given instance template in
46+
// job.allocation_policy.instances[0].instance_template.
4447
string device_name = 6;
4548
}
4649

47-
// Mount path for the volume, e.g. /mnt/share
50+
// The mount path for the volume, e.g. /mnt/disks/share.
4851
string mount_path = 4;
4952

50-
// Mount options
51-
// For Google Cloud Storage, mount options are the global options supported by
52-
// gcsfuse tool. Batch will use them to mount the volume with the following
53-
// command:
54-
// "gcsfuse [global options] bucket mountpoint".
55-
// For PD, NFS, mount options are these supported by /etc/fstab. Batch will
56-
// use Fstab to mount such volumes.
57-
// https://help.ubuntu.com/community/Fstab
53+
// For Google Cloud Storage (GCS), mount options are the options supported by
54+
// the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse).
55+
// For existing persistent disks, mount options provided by the
56+
// mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except
57+
// writing are supported. This is due to restrictions of multi-writer mode
58+
// (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).
59+
// For other attached disks and Network File System (NFS), mount options are
60+
// these supported by the mount command
61+
// (https://man7.org/linux/man-pages/man8/mount.8.html).
5862
repeated string mount_options = 5;
5963
}
6064

61-
// Represents an NFS server and remote path: <server>:<remote_path>
65+
// Represents an NFS volume.
6266
message NFS {
63-
// URI of the NFS server, e.g. an IP address.
67+
// The IP address of the NFS.
6468
string server = 1;
6569

66-
// Remote source path exported from NFS, e.g., "/share".
70+
// Remote source path exported from the NFS, e.g., "/share".
6771
string remote_path = 2;
6872
}
6973

70-
// Represents a GCP persistent disk
74+
// Deprecated: please use device_name instead.
7175
message PD {
7276
// PD disk name, e.g. pd-1.
7377
string disk = 1;
@@ -82,7 +86,7 @@ message PD {
8286
bool existing = 3 [deprecated = true];
8387
}
8488

85-
// Represents a Google Cloud Storage volume source config.
89+
// Represents a Google Cloud Storage volume.
8690
message GCS {
8791
// Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
8892
// bucket_name, bucket_name/subdirectory/

0 commit comments

Comments
 (0)