Skip to content

Commit 9d6497f

Browse files
Google APIscopybara-github
authored andcommitted
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
1 parent 12b32ef commit 9d6497f

2 files changed

Lines changed: 32 additions & 6 deletions

File tree

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";

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
}

0 commit comments

Comments
 (0)