Skip to content

Commit

Permalink
feat: support custom scopes for service account in v1
Browse files Browse the repository at this point in the history
---
feat: Add boot disk field in InstanceStatus

---
feat: Add boot disk and image source fields to v1 InstancePolicy
PiperOrigin-RevId: 507014772
  • Loading branch information
Google APIs authored and copybara-github committed Feb 3, 2023
1 parent 12b32ef commit 9d6497f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
2 changes: 0 additions & 2 deletions google/cloud/batch/v1/batch.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ syntax = "proto3";

package google.cloud.batch.v1;

import public "google/protobuf/empty.proto";

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
Expand Down
36 changes: 32 additions & 4 deletions google/cloud/batch/v1/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ message JobStatus {

// The max number of tasks can be assigned to this instance type.
int64 task_pack = 3;

// The VM boot disk.
AllocationPolicy.Disk boot_disk = 4;
}

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

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

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

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

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

// Book disk to be created and attached to each VM by this InstancePolicy.
// Boot disk will be deleted when the VM is deleted.
Disk boot_disk = 8;

// Non-boot disks to be attached for each VM created by this InstancePolicy.
// New disks will be deleted when the VM is deleted.
repeated AttachedDisk disks = 6;
Expand Down Expand Up @@ -474,4 +498,8 @@ message ServiceAccount {
// template is being used, the service account has to be specified in the
// instance template and it has to match the email field here.
string email = 1;

// List of scopes to be enabled for this service account on the VM, in
// addition to the cloud-platform API scope that will be added by default.
repeated string scopes = 2;
}

0 comments on commit 9d6497f

Please sign in to comment.