Skip to content

Commit 0830aaf

Browse files
Google APIscopybara-github
Google APIs
authored andcommitted
feat: add TaskStatus's new terminated state UNEXECUTED
feat: add scheduling_policy IN_ORDER enum to support sequential task executions docs: update comments on boot disk fields for clearer usage scope feat: add support for placement policies docs: update block_external_network field comment to reduce confusion docs: update disk and network field comment for better readability docs: fix `book disk` typo docs: Update reservation field API doc PiperOrigin-RevId: 524883955
1 parent 71a29b5 commit 0830aaf

File tree

3 files changed

+67
-35
lines changed

3 files changed

+67
-35
lines changed

google/cloud/batch/v1alpha/batch_v1alpha.yaml

+1-16
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: '(== google/cloud/batch/doc/overview.md ==)'
16+
overview: '(include == google/cloud/batch/doc/overview.md ==)'
1717
rules:
1818
- selector: google.cloud.location.Locations.GetLocation
1919
description: Gets information about a location.
@@ -38,11 +38,6 @@ http:
3838
get: '/v1alpha/{name=projects/*/locations/*}'
3939
- selector: google.cloud.location.Locations.ListLocations
4040
get: '/v1alpha/{name=projects/*}/locations'
41-
- selector: google.longrunning.Operations.CancelOperation
42-
post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel'
43-
body: '*'
44-
- selector: google.longrunning.Operations.DeleteOperation
45-
delete: '/v1alpha/{name=projects/*/locations/*/operations/*}'
4641
- selector: google.longrunning.Operations.GetOperation
4742
get: '/v1alpha/{name=projects/*/locations/*/operations/*}'
4843
- selector: google.longrunning.Operations.ListOperations
@@ -66,13 +61,3 @@ authentication:
6661
oauth:
6762
canonical_scopes: |-
6863
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/v1alpha/job.proto

+59-16
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,14 @@ message JobNotification {
284284
message AllocationPolicy {
285285
message LocationPolicy {
286286
// A list of allowed location names represented by internal URLs.
287+
//
287288
// Each location can be a region or a zone.
288289
// Only one region or multiple zones in one region is supported now.
289290
// For example,
290291
// ["regions/us-central1"] allow VMs in any zones in region us-central1.
291292
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
292293
// in zones us-central1-a and us-central1-c.
294+
//
293295
// All locations end up in different regions would cause errors.
294296
// For example,
295297
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
@@ -305,25 +307,29 @@ message AllocationPolicy {
305307

306308
// A new persistent disk or a local ssd.
307309
// A VM can only have one local SSD setting but multiple local SSD partitions.
308-
// https://cloud.google.com/compute/docs/disks#pdspecs.
310+
// See https://cloud.google.com/compute/docs/disks#pdspecs and
309311
// https://cloud.google.com/compute/docs/disks#localssds.
310312
message Disk {
311313
// A data source from which a PD will be created.
312314
oneof data_source {
313315
// Name of a public or custom image used as the data source.
314316
// For example, the following are all valid URLs:
315-
// (1) Specify the image by its family name:
317+
//
318+
// * Specify the image by its family name:
316319
// projects/{project}/global/images/family/{image_family}
317-
// (2) Specify the image version:
320+
// * Specify the image version:
318321
// projects/{project}/global/images/{image_version}
322+
//
319323
// You can also use Batch customized image in short names.
320324
// The following image values are supported for a boot disk:
321-
// "batch-debian": use Batch Debian images.
322-
// "batch-centos": use Batch CentOS images.
323-
// "batch-cos": use Batch Container-Optimized images.
325+
//
326+
// * "batch-debian": use Batch Debian images.
327+
// * "batch-centos": use Batch CentOS images.
328+
// * "batch-cos": use Batch Container-Optimized images.
324329
string image = 4;
325330

326331
// Name of a snapshot used as the data source.
332+
// Snapshot is not supported as boot disk now.
327333
string snapshot = 5;
328334
}
329335

@@ -334,6 +340,7 @@ message AllocationPolicy {
334340
string type = 1;
335341

336342
// Disk size in GB.
343+
//
337344
// For persistent disk, this field is ignored if `data_source` is `image` or
338345
// `snapshot`.
339346
// For local SSD, size_gb should be a multiple of 375GB,
@@ -391,7 +398,7 @@ message AllocationPolicy {
391398

392399
// The minimum CPU platform.
393400
// See
394-
// `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
401+
// https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
395402
// Not yet implemented.
396403
string min_cpu_platform = 3;
397404

@@ -401,15 +408,17 @@ message AllocationPolicy {
401408
// The accelerators attached to each VM instance.
402409
repeated Accelerator accelerators = 5;
403410

404-
// Book disk to be created and attached to each VM by this InstancePolicy.
411+
// Boot disk to be created and attached to each VM by this InstancePolicy.
405412
// Boot disk will be deleted when the VM is deleted.
413+
// Batch API now only supports booting from image.
406414
Disk boot_disk = 8;
407415

408416
// Non-boot disks to be attached for each VM created by this InstancePolicy.
409417
// New disks will be deleted when the VM is deleted.
410418
repeated AttachedDisk disks = 6;
411419

412-
// If specified, VMs will be allocated only inside the matching reservation.
420+
// If specified, VMs will consume only the specified reservation.
421+
// If not specified (default), VMs will consume any applicable reservation.
413422
string reservation = 7;
414423
}
415424

@@ -436,18 +445,22 @@ message AllocationPolicy {
436445
message NetworkInterface {
437446
// The URL of an existing network resource.
438447
// You can specify the network as a full or partial URL.
448+
//
439449
// For example, the following are all valid URLs:
440-
// https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
441-
// projects/{project}/global/networks/{network}
442-
// global/networks/{network}
450+
//
451+
// * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
452+
// * projects/{project}/global/networks/{network}
453+
// * global/networks/{network}
443454
string network = 1;
444455

445456
// The URL of an existing subnetwork resource in the network.
446457
// You can specify the subnetwork as a full or partial URL.
458+
//
447459
// For example, the following are all valid URLs:
448-
// https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
449-
// projects/{project}/regions/{region}/subnetworks/{subnetwork}
450-
// regions/{region}/subnetworks/{subnetwork}
460+
//
461+
// * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
462+
// * projects/{project}/regions/{region}/subnetworks/{subnetwork}
463+
// * regions/{region}/subnetworks/{subnetwork}
451464
string subnetwork = 2;
452465

453466
// Default is false (with an external IP address). Required if
@@ -466,6 +479,23 @@ message AllocationPolicy {
466479
repeated NetworkInterface network_interfaces = 1;
467480
}
468481

482+
// PlacementPolicy describes a group placement policy for the VMs controlled
483+
// by this AllocationPolicy.
484+
message PlacementPolicy {
485+
// UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
486+
// want VMs to be located close to each other for low network latency
487+
// between the VMs. No placement policy will be generated when collocation
488+
// is UNSPECIFIED.
489+
string collocation = 1;
490+
491+
// When specified, causes the job to fail if more than max_distance logical
492+
// switches are required between VMs. Batch uses the most compact possible
493+
// placement of VMs even when max_distance is not specified. An explicit
494+
// max_distance makes that level of compactness a strict requirement.
495+
// Not yet implemented
496+
int64 max_distance = 2;
497+
}
498+
469499
// Compute Engine VM instance provisioning model.
470500
enum ProvisioningModel {
471501
// Unspecified.
@@ -519,6 +549,9 @@ message AllocationPolicy {
519549

520550
// The network policy.
521551
NetworkPolicy network = 7;
552+
553+
// The placement policy.
554+
PlacementPolicy placement = 10;
522555
}
523556

524557
// A TaskGroup contains one or multiple Tasks that share the same
@@ -535,7 +568,15 @@ message TaskGroup {
535568
SCHEDULING_POLICY_UNSPECIFIED = 0;
536569

537570
// Run Tasks as soon as resources are available.
571+
//
572+
// Tasks might be executed in parallel depending on parallelism and
573+
// task_count values.
538574
AS_SOON_AS_POSSIBLE = 1;
575+
576+
// Run Tasks sequentially with increased task index.
577+
//
578+
// Not yet implemented.
579+
IN_ORDER = 2;
539580
}
540581

541582
// Output only. TaskGroup name.
@@ -548,14 +589,16 @@ message TaskGroup {
548589
TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED];
549590

550591
// Number of Tasks in the TaskGroup.
551-
// default is 1
592+
// Default is 1.
552593
int64 task_count = 4;
553594

554595
// Max number of tasks that can run in parallel.
555596
// Default to min(task_count, 1000).
597+
// Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
556598
int64 parallelism = 5;
557599

558600
// Scheduling policy for Tasks in the TaskGroup.
601+
// The default value is AS_SOON_AS_POSSIBLE.
559602
SchedulingPolicy scheduling_policy = 6;
560603

561604
// Compute resource allocation for the TaskGroup.

google/cloud/batch/v1alpha/task.proto

+7-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ message TaskExecution {
7777
message TaskStatus {
7878
// Task states.
7979
enum State {
80-
// unknown state
80+
// Unknown state.
8181
STATE_UNSPECIFIED = 0;
8282

8383
// The Task is created and waiting for resources.
@@ -94,6 +94,9 @@ message TaskStatus {
9494

9595
// The Task has succeeded.
9696
SUCCEEDED = 5;
97+
98+
// The Task has not been executed when the Job finishes.
99+
UNEXECUTED = 6;
97100
}
98101

99102
// Task state
@@ -139,8 +142,9 @@ message Runnable {
139142
string options = 8;
140143

141144
// If set to true, external network access to and from container will be
142-
// blocked. The container will use the default internal network
143-
// 'goog-internal'.
145+
// blocked, containers that are with block_external_network as true can
146+
// still communicate with each other, network cannot be specified in the
147+
// `container.options` field.
144148
bool block_external_network = 9;
145149

146150
// Optional username for logging in to a docker registry. If username

0 commit comments

Comments
 (0)