Skip to content

Commit 2845078

Browse files
Google APIscopybara-github
authored andcommitted
feat: support order_by in ListJobs and ListTasks requests
--- feat: add support for placement policies --- feat: per-Runnable labels PiperOrigin-RevId: 531181280
1 parent d8990aa commit 2845078

3 files changed

Lines changed: 34 additions & 59 deletions

File tree

google/cloud/batch/v1/batch_v1.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ types:
1313

1414
documentation:
1515
summary: An API to manage the running of batch jobs on Google Cloud Platform.
16-
overview: '(include == google/cloud/batch/doc/overview.md ==)'
16+
overview: '(== google/cloud/batch/doc/overview.md ==)'
1717
rules:
1818
- selector: google.cloud.location.Locations.GetLocation
1919
description: Gets information about a location.
@@ -38,6 +38,11 @@ http:
3838
get: '/v1/{name=projects/*/locations/*}'
3939
- selector: google.cloud.location.Locations.ListLocations
4040
get: '/v1/{name=projects/*}/locations'
41+
- selector: google.longrunning.Operations.CancelOperation
42+
post: '/v1/{name=projects/*/locations/*/operations/*}:cancel'
43+
body: '*'
44+
- selector: google.longrunning.Operations.DeleteOperation
45+
delete: '/v1/{name=projects/*/locations/*/operations/*}'
4146
- selector: google.longrunning.Operations.GetOperation
4247
get: '/v1/{name=projects/*/locations/*/operations/*}'
4348
- selector: google.longrunning.Operations.ListOperations
@@ -61,3 +66,13 @@ authentication:
6166
oauth:
6267
canonical_scopes: |-
6368
https://www.googleapis.com/auth/cloud-platform
69+
70+
publishing:
71+
organization: CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED
72+
new_issue_uri: ''
73+
documentation_uri: ''
74+
api_short_name: ''
75+
github_label: ''
76+
doc_tag_prefix: ''
77+
codeowner_github_teams:
78+
library_settings:

google/cloud/batch/v1/job.proto

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,12 @@ message JobNotification {
225225
message AllocationPolicy {
226226
message LocationPolicy {
227227
// A list of allowed location names represented by internal URLs.
228-
//
229228
// Each location can be a region or a zone.
230229
// Only one region or multiple zones in one region is supported now.
231230
// For example,
232231
// ["regions/us-central1"] allow VMs in any zones in region us-central1.
233232
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
234233
// in zones us-central1-a and us-central1-c.
235-
//
236234
// All locations end up in different regions would cause errors.
237235
// For example,
238236
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
@@ -243,29 +241,25 @@ message AllocationPolicy {
243241

244242
// A new persistent disk or a local ssd.
245243
// A VM can only have one local SSD setting but multiple local SSD partitions.
246-
// See https://cloud.google.com/compute/docs/disks#pdspecs and
244+
// https://cloud.google.com/compute/docs/disks#pdspecs.
247245
// https://cloud.google.com/compute/docs/disks#localssds.
248246
message Disk {
249247
// A data source from which a PD will be created.
250248
oneof data_source {
251249
// Name of a public or custom image used as the data source.
252250
// For example, the following are all valid URLs:
253-
//
254-
// * Specify the image by its family name:
251+
// (1) Specify the image by its family name:
255252
// projects/{project}/global/images/family/{image_family}
256-
// * Specify the image version:
253+
// (2) Specify the image version:
257254
// projects/{project}/global/images/{image_version}
258-
//
259255
// You can also use Batch customized image in short names.
260256
// The following image values are supported for a boot disk:
261-
//
262-
// * "batch-debian": use Batch Debian images.
263-
// * "batch-centos": use Batch CentOS images.
264-
// * "batch-cos": use Batch Container-Optimized images.
257+
// "batch-debian": use Batch Debian images.
258+
// "batch-centos": use Batch CentOS images.
259+
// "batch-cos": use Batch Container-Optimized images.
265260
string image = 4;
266261

267262
// Name of a snapshot used as the data source.
268-
// Snapshot is not supported as boot disk now.
269263
string snapshot = 5;
270264
}
271265

@@ -276,7 +270,6 @@ message AllocationPolicy {
276270
string type = 1;
277271

278272
// Disk size in GB.
279-
//
280273
// For persistent disk, this field is ignored if `data_source` is `image` or
281274
// `snapshot`.
282275
// For local SSD, size_gb should be a multiple of 375GB,
@@ -331,7 +324,7 @@ message AllocationPolicy {
331324

332325
// The minimum CPU platform.
333326
// See
334-
// https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
327+
// `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
335328
// Not yet implemented.
336329
string min_cpu_platform = 3;
337330

@@ -341,9 +334,8 @@ message AllocationPolicy {
341334
// The accelerators attached to each VM instance.
342335
repeated Accelerator accelerators = 5;
343336

344-
// Boot disk to be created and attached to each VM by this InstancePolicy.
337+
// Book disk to be created and attached to each VM by this InstancePolicy.
345338
// Boot disk will be deleted when the VM is deleted.
346-
// Batch API now only supports booting from image.
347339
Disk boot_disk = 8;
348340

349341
// Non-boot disks to be attached for each VM created by this InstancePolicy.
@@ -374,22 +366,18 @@ message AllocationPolicy {
374366
message NetworkInterface {
375367
// The URL of an existing network resource.
376368
// You can specify the network as a full or partial URL.
377-
//
378369
// For example, the following are all valid URLs:
379-
//
380-
// * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
381-
// * projects/{project}/global/networks/{network}
382-
// * global/networks/{network}
370+
// https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
371+
// projects/{project}/global/networks/{network}
372+
// global/networks/{network}
383373
string network = 1;
384374

385375
// The URL of an existing subnetwork resource in the network.
386376
// You can specify the subnetwork as a full or partial URL.
387-
//
388377
// For example, the following are all valid URLs:
389-
//
390-
// * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
391-
// * projects/{project}/regions/{region}/subnetworks/{subnetwork}
392-
// * regions/{region}/subnetworks/{subnetwork}
378+
// https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
379+
// projects/{project}/regions/{region}/subnetworks/{subnetwork}
380+
// regions/{region}/subnetworks/{subnetwork}
393381
string subnetwork = 2;
394382

395383
// Default is false (with an external IP address). Required if
@@ -408,23 +396,6 @@ message AllocationPolicy {
408396
repeated NetworkInterface network_interfaces = 1;
409397
}
410398

411-
// PlacementPolicy describes a group placement policy for the VMs controlled
412-
// by this AllocationPolicy.
413-
message PlacementPolicy {
414-
// UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
415-
// want VMs to be located close to each other for low network latency
416-
// between the VMs. No placement policy will be generated when collocation
417-
// is UNSPECIFIED.
418-
string collocation = 1;
419-
420-
// When specified, causes the job to fail if more than max_distance logical
421-
// switches are required between VMs. Batch uses the most compact possible
422-
// placement of VMs even when max_distance is not specified. An explicit
423-
// max_distance makes that level of compactness a strict requirement.
424-
// Not yet implemented
425-
int64 max_distance = 2;
426-
}
427-
428399
// Compute Engine VM instance provisioning model.
429400
enum ProvisioningModel {
430401
// Unspecified.
@@ -466,9 +437,6 @@ message AllocationPolicy {
466437

467438
// The network policy.
468439
NetworkPolicy network = 7;
469-
470-
// The placement policy.
471-
PlacementPolicy placement = 10;
472440
}
473441

474442
// A TaskGroup contains one or multiple Tasks that share the same
@@ -489,12 +457,11 @@ message TaskGroup {
489457
TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED];
490458

491459
// Number of Tasks in the TaskGroup.
492-
// Default is 1.
460+
// default is 1
493461
int64 task_count = 4;
494462

495463
// Max number of tasks that can run in parallel.
496464
// Default to min(task_count, 1000).
497-
// Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
498465
int64 parallelism = 5;
499466

500467
// An array of environment variable mappings, which are passed to Tasks with

google/cloud/batch/v1/task.proto

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ message TaskExecution {
7272
message TaskStatus {
7373
// Task states.
7474
enum State {
75-
// Unknown state.
75+
// unknown state
7676
STATE_UNSPECIFIED = 0;
7777

7878
// The Task is created and waiting for resources.
@@ -89,9 +89,6 @@ message TaskStatus {
8989

9090
// The Task has succeeded.
9191
SUCCEEDED = 5;
92-
93-
// The Task has not been executed when the Job finishes.
94-
UNEXECUTED = 6;
9592
}
9693

9794
// Task state
@@ -127,9 +124,8 @@ message Runnable {
127124
string options = 8;
128125

129126
// If set to true, external network access to and from container will be
130-
// blocked, containers that are with block_external_network as true can
131-
// still communicate with each other, network cannot be specified in the
132-
// `container.options` field.
127+
// blocked. The container will use the default internal network
128+
// 'goog-internal'.
133129
bool block_external_network = 9;
134130

135131
// Optional username for logging in to a docker registry. If username
@@ -212,9 +208,6 @@ message Runnable {
212208

213209
// Timeout for this Runnable.
214210
google.protobuf.Duration timeout = 8;
215-
216-
// Labels for this Runnable.
217-
map<string, string> labels = 9;
218211
}
219212

220213
// Spec of a task

0 commit comments

Comments
 (0)