Skip to content

Commit 97fa02d

Browse files
Google APIscopybara-github
authored andcommitted
feat: environment variables, disk interfaces
PiperOrigin-RevId: 469790533
1 parent 10d4b86 commit 97fa02d

3 files changed

Lines changed: 78 additions & 10 deletions

File tree

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

google/cloud/batch/v1/job.proto

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,25 @@ message JobNotification {
218218
// resources should be allocated for the Job.
219219
message AllocationPolicy {
220220
message LocationPolicy {
221-
// A list of allowed location names represented by internal URLs,
222-
// First location in the list must be a region.
223-
// for example,
224-
// ["regions/us-central1"] allow VMs in region us-central1,
225-
// ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
226-
// us-central1-a.
221+
// A list of allowed location names represented by internal URLs.
222+
// Each location can be a region or a zone.
223+
// Only one region or multiple zones in one region is supported now.
224+
// For example,
225+
// ["regions/us-central1"] allow VMs in any zones in region us-central1.
226+
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
227+
// in zones us-central1-a and us-central1-c.
228+
// All locations end up in different regions would cause errors.
229+
// For example,
230+
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
231+
// "zones/us-west1-a"] contains 2 regions "us-central1" and
232+
// "us-west1". An error is expected in this case.
227233
repeated string allowed_locations = 1;
228234
}
229235

230-
// A new persistent disk.
236+
// A new persistent disk or a local ssd.
237+
// A VM can only have one local SSD setting but multiple local SSD partitions.
238+
// https://cloud.google.com/compute/docs/disks#pdspecs.
239+
// https://cloud.google.com/compute/docs/disks#localssds.
231240
message Disk {
232241
// A data source from which a PD will be created.
233242
oneof data_source {
@@ -239,15 +248,23 @@ message AllocationPolicy {
239248
}
240249

241250
// Disk type as shown in `gcloud compute disk-types list`
242-
// For example, "pd-ssd", "pd-standard", "pd-balanced".
251+
// For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
243252
string type = 1;
244253

245254
// Disk size in GB.
246255
// This field is ignored if `data_source` is `disk` or `image`.
256+
// If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
257+
// otherwise, the final size will be the next greater multiple of 375 GB.
247258
int64 size_gb = 2;
259+
260+
// Local SSDs are available through both "SCSI" and "NVMe" interfaces.
261+
// If not indicated, "NVMe" will be the default one for local ssds.
262+
// We only support "SCSI" for persistent disks now.
263+
string disk_interface = 6;
248264
}
249265

250-
// A new or an existing persistent disk attached to a VM instance.
266+
// A new or an existing persistent disk or a local ssd attached to a VM
267+
// instance.
251268
message AttachedDisk {
252269
oneof attached {
253270
Disk new_disk = 1;
@@ -269,6 +286,10 @@ message AllocationPolicy {
269286

270287
// The number of accelerators of this type.
271288
int64 count = 2;
289+
290+
// When true, Batch will install the GPU drivers.
291+
// This field will be ignored if specified.
292+
bool install_gpu_drivers = 3 [deprecated = true];
272293
}
273294

274295
// InstancePolicy describes an instance type and resources attached to each VM

google/cloud/batch/v1/task.proto

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ message Runnable {
184184
// If the max_run_duration has expired then no further Runnables will execute,
185185
// not even always_run Runnables.
186186
bool always_run = 5;
187+
188+
// Environment variables for this Runnable (overrides variables set for the
189+
// whole Task or TaskGroup).
190+
Environment environment = 7;
191+
192+
// Timeout for this Runnable.
193+
google.protobuf.Duration timeout = 8;
187194
}
188195

189196
// Spec of a task
@@ -225,10 +232,13 @@ message TaskSpec {
225232

226233
// Environment variables to set before running the Task.
227234
// You can set up to 100 environments.
228-
map<string, string> environments = 6;
235+
map<string, string> environments = 6 [deprecated = true];
229236

230237
// Volumes to mount before running Tasks using this TaskSpec.
231238
repeated Volume volumes = 7;
239+
240+
// Environment variables to set before running the Task.
241+
Environment environment = 10;
232242
}
233243

234244
// LifecyclePolicy describes how to deal with task failures

0 commit comments

Comments
 (0)