Skip to content

Commit 00975ce

Browse files
feat: Adds named reservation to InstancePolicy (#3672)
* 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: googleapis/googleapis-gen@5b3d3a5 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI1YjNkM2E1NTAwMTVlOTM2N2FkMTNlZTVmOWZlYmUwYzNmODRjZjMzIn0= * 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: googleapis/googleapis-gen@fcc564e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJmY2M1NjRlZjA2NGM3ZGZmMzFkNzk3MGUxMjMxOGFkMDg0NzAzYWM2In0= * docs: fix minor docstring formatting PiperOrigin-RevId: 490003354 Source-Link: googleapis/googleapis@9afb89b Source-Link: googleapis/googleapis-gen@c51774c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJjNTE3NzRjZDhkZDU4MDRkNWVjNmYzMzViMTg1NWMyOGQxMTcxYTU2In0= * 🦉 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> Co-authored-by: sofisl <[email protected]>
1 parent a7b5c73 commit 00975ce

15 files changed

Lines changed: 111 additions & 63 deletions

packages/google-cloud-batch/protos/google/cloud/batch/v1/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
//

packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ message AllocationPolicy {
263263
string disk_interface = 6;
264264
}
265265

266-
// A new or an existing persistent disk or a local ssd attached to a VM
266+
// A new or an existing persistent disk (PD) or a local ssd attached to a VM
267267
// instance.
268268
message AttachedDisk {
269269
oneof attached {
@@ -280,7 +280,7 @@ message AllocationPolicy {
280280
string device_name = 3;
281281
}
282282

283-
// Accelerator describes Compute Engine accelerators to be attached to VMs.
283+
// Accelerator describes Compute Engine accelerators to be attached to the VM.
284284
message Accelerator {
285285
// The accelerator type. For example, "nvidia-tesla-t4".
286286
// See `gcloud compute accelerator-types list`.
@@ -309,11 +309,10 @@ message AllocationPolicy {
309309
ProvisioningModel provisioning_model = 4;
310310

311311
// The accelerators attached to each VM instance.
312-
// Not yet implemented.
313312
repeated Accelerator accelerators = 5;
314313

315314
// Non-boot disks to be attached for each VM created by this InstancePolicy.
316-
// New disks will be deleted when the attached VM is deleted.
315+
// New disks will be deleted when the VM is deleted.
317316
repeated AttachedDisk disks = 6;
318317
}
319318

packages/google-cloud-batch/protos/google/cloud/batch/v1/volume.proto

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,46 +25,50 @@ option objc_class_prefix = "GCB";
2525
option php_namespace = "Google\\Cloud\\Batch\\V1";
2626
option ruby_package = "Google::Cloud::Batch::V1";
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 Google Cloud Storage source for the volume.
36+
// A Google Cloud Storage (GCS) volume.
3837
GCS gcs = 3;
3938

40-
// Device name of an attached disk
39+
// Device name of an attached disk volume, which should align with a
40+
// device_name specified by
41+
// job.allocation_policy.instances[0].policy.disks[i].device_name or
42+
// defined by the given instance template in
43+
// job.allocation_policy.instances[0].instance_template.
4144
string device_name = 6;
4245
}
4346

44-
// Mount path for the volume, e.g. /mnt/share
47+
// The mount path for the volume, e.g. /mnt/disks/share.
4548
string mount_path = 4;
4649

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

58-
// Represents an NFS server and remote path: <server>:<remote_path>
62+
// Represents an NFS volume.
5963
message NFS {
60-
// URI of the NFS server, e.g. an IP address.
64+
// The IP address of the NFS.
6165
string server = 1;
6266

63-
// Remote source path exported from NFS, e.g., "/share".
67+
// Remote source path exported from the NFS, e.g., "/share".
6468
string remote_path = 2;
6569
}
6670

67-
// Represents a Google Cloud Storage volume source config.
71+
// Represents a Google Cloud Storage volume.
6872
message GCS {
6973
// Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
7074
// bucket_name, bucket_name/subdirectory/

packages/google-cloud-batch/protos/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
//

packages/google-cloud-batch/protos/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.

packages/google-cloud-batch/protos/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/

packages/google-cloud-batch/protos/protos.d.ts

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-batch/protos/protos.js

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-batch/protos/protos.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ function main(parent, job) {
3535
// const parent = 'abc123'
3636
/**
3737
* ID used to uniquely identify the Job within its parent scope.
38-
* This field should contain at most 63 characters.
39-
* Only alphanumeric characters or '-' are accepted.
38+
* This field should contain at most 63 characters and must start with
39+
* lowercase characters.
40+
* Only lowercase characters, numbers and '-' are accepted.
4041
* The '-' character cannot be the first or the last one.
4142
* A system generated ID will be used if the field is not set.
4243
* The job.name field in the request will be ignored and the created resource

0 commit comments

Comments
 (0)