Skip to content

Commit 10d4b86

Browse files
Google APIscopybara-github
authored andcommitted
feat: environment variables, disk interfaces
PiperOrigin-RevId: 469790475
1 parent 842682e commit 10d4b86

2 files changed

Lines changed: 69 additions & 9 deletions

File tree

google/cloud/batch/v1alpha/batch_v1alpha.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,43 @@ backend:
5858
- selector: 'google.longrunning.Operations.*'
5959
deadline: 60.0
6060

61+
http:
62+
rules:
63+
- selector: google.cloud.location.Locations.GetLocation
64+
get: '/v1alpha/{name=projects/*/locations/*}'
65+
- selector: google.cloud.location.Locations.ListLocations
66+
get: '/v1alpha/{name=projects/*}/locations'
67+
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
68+
get: '/v1alpha/{resource=projects/*/locations/*/jobs/*}:getIamPolicy'
69+
additional_bindings:
70+
- get: '/v1alpha/{resource=projects/*/locations/*/tasks/*}:getIamPolicy'
71+
- get: '/v1alpha/{resource=projects/*/locations/*/nodes/*}:getIamPolicy'
72+
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
73+
post: '/v1alpha/{resource=projects/*/locations/*/jobs/*}:setIamPolicy'
74+
body: '*'
75+
additional_bindings:
76+
- post: '/v1alpha/{resource=projects/*/locations/*/tasks/*}:setIamPolicy'
77+
body: '*'
78+
- post: '/v1alpha/{resource=projects/*/locations/*/nodes/*}:setIamPolicy'
79+
body: '*'
80+
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
81+
post: '/v1alpha/{resource=projects/*/locations/*/jobs/*}:testIamPermissions'
82+
body: '*'
83+
additional_bindings:
84+
- post: '/v1alpha/{resource=projects/*/locations/*/tasks/*}:testIamPermissions'
85+
body: '*'
86+
- post: '/v1alpha/{resource=projects/*/locations/*/nodes/*}:testIamPermissions'
87+
body: '*'
88+
- selector: google.longrunning.Operations.CancelOperation
89+
post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel'
90+
body: '*'
91+
- selector: google.longrunning.Operations.DeleteOperation
92+
delete: '/v1alpha/{name=projects/*/locations/*/operations/*}'
93+
- selector: google.longrunning.Operations.GetOperation
94+
get: '/v1alpha/{name=projects/*/locations/*/operations/*}'
95+
- selector: google.longrunning.Operations.ListOperations
96+
get: '/v1alpha/{name=projects/*/locations/*}/operations'
97+
6198
authentication:
6299
rules:
63100
- selector: 'google.cloud.batch.v1alpha.BatchService.*'

google/cloud/batch/v1alpha/job.proto

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,18 @@ message JobNotification {
268268
// resources should be allocated for the Job.
269269
message AllocationPolicy {
270270
message LocationPolicy {
271-
// A list of allowed location names represented by internal URLs,
272-
// First location in the list must be a region.
273-
// for example,
274-
// ["regions/us-central1"] allow VMs in region us-central1,
275-
// ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
276-
// us-central1-a.
271+
// A list of allowed location names represented by internal URLs.
272+
// Each location can be a region or a zone.
273+
// Only one region or multiple zones in one region is supported now.
274+
// For example,
275+
// ["regions/us-central1"] allow VMs in any zones in region us-central1.
276+
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
277+
// in zones us-central1-a and us-central1-c.
278+
// All locations end up in different regions would cause errors.
279+
// For example,
280+
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
281+
// "zones/us-west1-a"] contains 2 regions "us-central1" and
282+
// "us-west1". An error is expected in this case.
277283
repeated string allowed_locations = 1;
278284

279285
// A list of denied location names.
@@ -282,7 +288,10 @@ message AllocationPolicy {
282288
repeated string denied_locations = 2;
283289
}
284290

285-
// A new persistent disk.
291+
// A new persistent disk or a local ssd.
292+
// A VM can only have one local SSD setting but multiple local SSD partitions.
293+
// https://cloud.google.com/compute/docs/disks#pdspecs.
294+
// https://cloud.google.com/compute/docs/disks#localssds.
286295
message Disk {
287296
// A data source from which a PD will be created.
288297
oneof data_source {
@@ -294,15 +303,23 @@ message AllocationPolicy {
294303
}
295304

296305
// Disk type as shown in `gcloud compute disk-types list`
297-
// For example, "pd-ssd", "pd-standard", "pd-balanced".
306+
// For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
298307
string type = 1;
299308

300309
// Disk size in GB.
301310
// This field is ignored if `data_source` is `disk` or `image`.
311+
// If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
312+
// otherwise, the final size will be the next greater multiple of 375 GB.
302313
int64 size_gb = 2;
314+
315+
// Local SSDs are available through both "SCSI" and "NVMe" interfaces.
316+
// If not indicated, "NVMe" will be the default one for local ssds.
317+
// We only support "SCSI" for persistent disks now.
318+
string disk_interface = 6;
303319
}
304320

305-
// A new or an existing persistent disk attached to a VM instance.
321+
// A new or an existing persistent disk or a local ssd attached to a VM
322+
// instance.
306323
message AttachedDisk {
307324
oneof attached {
308325
Disk new_disk = 1;
@@ -324,6 +341,10 @@ message AllocationPolicy {
324341

325342
// The number of accelerators of this type.
326343
int64 count = 2;
344+
345+
// When true, Batch will install the GPU drivers.
346+
// This field will be ignored if specified.
347+
bool install_gpu_drivers = 3 [deprecated = true];
327348
}
328349

329350
// InstancePolicy describes an instance type and resources attached to each VM
@@ -363,6 +384,8 @@ message AllocationPolicy {
363384
// c++ keyword conflict.
364385
string instance_template = 2;
365386
}
387+
388+
bool install_gpu_drivers = 3;
366389
}
367390

368391
// A network interface.

0 commit comments

Comments
 (0)