Skip to content

Commit f72de27

Browse files
feat: [batch] support custom scopes for service account in v1 (#3950)
* feat: support custom scopes for service account in v1 --- feat: Add boot disk field in InstanceStatus --- feat: Add boot disk and image source fields to v1 InstancePolicy PiperOrigin-RevId: 507014714 Source-Link: googleapis/googleapis@12b32ef Source-Link: googleapis/googleapis-gen@547061f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI1NDcwNjFmOTBiYzdlNjcwNjM5NWFlMzcyZTBmNjEwMTBiYjQ5NDllIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support custom scopes for service account in v1 --- feat: Add boot disk field in InstanceStatus --- feat: Add boot disk and image source fields to v1 InstancePolicy PiperOrigin-RevId: 507014772 Source-Link: googleapis/googleapis@9d6497f Source-Link: googleapis/googleapis-gen@13ef8a3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIxM2VmOGEzYjdlZmViNDU4NjZlYmNlYTM4MGRmZDZhNDNlZTVkNDg2In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(gitignore): only ignore folders in the top level PiperOrigin-RevId: 507603203 Source-Link: googleapis/googleapis@a4f2de4 Source-Link: googleapis/googleapis-gen@dcf8821 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJkY2Y4ODIxNTRlN2M3MTBlY2YyYTFhYmM3N2IzNWM5NWY5MDYyMzcxIn0= * 🦉 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 b12d776 commit f72de27

8 files changed

Lines changed: 44349 additions & 44140 deletions

File tree

packages/google-cloud-batch/.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
**/*.log
22
**/node_modules
3-
.coverage
4-
coverage
5-
.nyc_output
6-
docs/
7-
out/
8-
build/
3+
/.coverage
4+
/coverage
5+
/.nyc_output
6+
/docs/
7+
/out/
8+
/build/
99
system-test/secrets.js
1010
system-test/*key.json
1111
*.lock

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ syntax = "proto3";
1616

1717
package google.cloud.batch.v1;
1818

19-
import public "google/protobuf/empty.proto";
20-
2119
import "google/api/annotations.proto";
2220
import "google/api/client.proto";
2321
import "google/api/field_behavior.proto";

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

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ message JobStatus {
123123

124124
// The max number of tasks can be assigned to this instance type.
125125
int64 task_pack = 3;
126+
127+
// The VM boot disk.
128+
AllocationPolicy.Disk boot_disk = 4;
126129
}
127130

128131
// Aggregated task status for a TaskGroup.
@@ -243,20 +246,37 @@ message AllocationPolicy {
243246
// A data source from which a PD will be created.
244247
oneof data_source {
245248
// Name of a public or custom image used as the data source.
249+
// For example, the following are all valid URLs:
250+
// (1) Specify the image by its family name:
251+
// projects/{project}/global/images/family/{image_family}
252+
// (2) Specify the image version:
253+
// projects/{project}/global/images/{image_version}
254+
// You can also use Batch customized image in short names.
255+
// The following image values are supported for a boot disk:
256+
// "batch-debian": use Batch Debian images.
257+
// "batch-centos": use Batch CentOS images.
258+
// "batch-cos": use Batch Container-Optimized images.
246259
string image = 4;
247260

248261
// Name of a snapshot used as the data source.
249262
string snapshot = 5;
250263
}
251264

252-
// Disk type as shown in `gcloud compute disk-types list`
253-
// For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
265+
// Disk type as shown in `gcloud compute disk-types list`.
266+
// For example, local SSD uses type "local-ssd".
267+
// Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
268+
// or "pd-standard".
254269
string type = 1;
255270

256271
// Disk size in GB.
257-
// This field is ignored if `data_source` is `disk` or `image`.
258-
// If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
272+
// For persistent disk, this field is ignored if `data_source` is `image` or
273+
// `snapshot`.
274+
// For local SSD, size_gb should be a multiple of 375GB,
259275
// otherwise, the final size will be the next greater multiple of 375 GB.
276+
// For boot disk, Batch will calculate the boot disk size based on source
277+
// image and task requirements if you do not speicify the size.
278+
// If both this field and the boot_disk_mib field in task spec's
279+
// compute_resource are defined, Batch will only honor this field.
260280
int64 size_gb = 2;
261281

262282
// Local SSDs are available through both "SCSI" and "NVMe" interfaces.
@@ -313,6 +333,10 @@ message AllocationPolicy {
313333
// The accelerators attached to each VM instance.
314334
repeated Accelerator accelerators = 5;
315335

336+
// Book disk to be created and attached to each VM by this InstancePolicy.
337+
// Boot disk will be deleted when the VM is deleted.
338+
Disk boot_disk = 8;
339+
316340
// Non-boot disks to be attached for each VM created by this InstancePolicy.
317341
// New disks will be deleted when the VM is deleted.
318342
repeated AttachedDisk disks = 6;
@@ -474,4 +498,8 @@ message ServiceAccount {
474498
// template is being used, the service account has to be specified in the
475499
// instance template and it has to match the email field here.
476500
string email = 1;
501+
502+
// List of scopes to be enabled for this service account on the VM, in
503+
// addition to the cloud-platform API scope that will be added by default.
504+
repeated string scopes = 2;
477505
}

packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ syntax = "proto3";
1616

1717
package google.cloud.batch.v1alpha;
1818

19-
import public "google/protobuf/empty.proto";
20-
2119
import "google/api/annotations.proto";
2220
import "google/api/client.proto";
2321
import "google/api/field_behavior.proto";

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ message JobStatus {
173173

174174
// The max number of tasks can be assigned to this instance type.
175175
int64 task_pack = 3;
176+
177+
// The VM boot disk.
178+
AllocationPolicy.Disk boot_disk = 4;
176179
}
177180

178181
// Aggregated task status for a TaskGroup.
@@ -298,20 +301,37 @@ message AllocationPolicy {
298301
// A data source from which a PD will be created.
299302
oneof data_source {
300303
// Name of a public or custom image used as the data source.
304+
// For example, the following are all valid URLs:
305+
// (1) Specify the image by its family name:
306+
// projects/{project}/global/images/family/{image_family}
307+
// (2) Specify the image version:
308+
// projects/{project}/global/images/{image_version}
309+
// You can also use Batch customized image in short names.
310+
// The following image values are supported for a boot disk:
311+
// "batch-debian": use Batch Debian images.
312+
// "batch-centos": use Batch CentOS images.
313+
// "batch-cos": use Batch Container-Optimized images.
301314
string image = 4;
302315

303316
// Name of a snapshot used as the data source.
304317
string snapshot = 5;
305318
}
306319

307-
// Disk type as shown in `gcloud compute disk-types list`
308-
// For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
320+
// Disk type as shown in `gcloud compute disk-types list`.
321+
// For example, local SSD uses type "local-ssd".
322+
// Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
323+
// or "pd-standard".
309324
string type = 1;
310325

311326
// Disk size in GB.
312-
// This field is ignored if `data_source` is `disk` or `image`.
313-
// If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
327+
// For persistent disk, this field is ignored if `data_source` is `image` or
328+
// `snapshot`.
329+
// For local SSD, size_gb should be a multiple of 375GB,
314330
// otherwise, the final size will be the next greater multiple of 375 GB.
331+
// For boot disk, Batch will calculate the boot disk size based on source
332+
// image and task requirements if you do not speicify the size.
333+
// If both this field and the boot_disk_mib field in task spec's
334+
// compute_resource are defined, Batch will only honor this field.
315335
int64 size_gb = 2;
316336

317337
// Local SSDs are available through both "SCSI" and "NVMe" interfaces.

0 commit comments

Comments
 (0)