Skip to content

Commit 9ece2b7

Browse files
gcf-owl-bot[bot]ddelgrosso1sofisl
authored
feat: [batch] add support for placement policies (#4182)
* 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 Source-Link: googleapis/googleapis@0830aaf Source-Link: googleapis/googleapis-gen@a294b7e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJhMjk0YjdlODlhY2YwOWM0ODAxYjY3MmQzNmFhMTcxZjliZDY5NDAzIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support order_by in ListJobs and ListTasks requests --- feat: add support for placement policies --- feat: per-Runnable labels PiperOrigin-RevId: 530747589 Source-Link: googleapis/googleapis@d944931 Source-Link: googleapis/googleapis-gen@96b4871 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI5NmI0ODcxZTViYjk2NjUxMjE0NWQ0MTk5NTYzZTE2ZTZlM2QzYmFhIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support order_by in ListJobs and ListTasks requests (#21) PiperOrigin-RevId: 530949397 Source-Link: googleapis/googleapis-gen@50f5709 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI1MGY1NzA5YzkxNjI5NGE5MDBiZTBlN2Y1MTVkY2EzOWFhMmJhNzFjIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support order_by in ListJobs and ListTasks requests --- feat: add support for placement policies --- feat: per-Runnable labels PiperOrigin-RevId: 531181280 Source-Link: googleapis/googleapis@2845078 Source-Link: googleapis/googleapis-gen@f09a853 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJmMDlhODUzYWQ4MDgwY2ZlZmRmYzYxYjY0MzRkNzYyYzhiZmQ2ZWI3In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: override HTTP URLs for LRO cancel/delete operations PiperOrigin-RevId: 532357846 Source-Link: googleapis/googleapis@5cfe30b Source-Link: googleapis/googleapis-gen@0e1e293 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIwZTFlMjkzYWQ5NTliZTI2NjQwZDU5M2I5NzhjYWI3ZmJhN2NlZDk3In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add support for placement policies feat: per-Runnable labels PiperOrigin-RevId: 532437427 Source-Link: googleapis/googleapis@288aa7f Source-Link: googleapis/googleapis-gen@615d60f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI2MTVkNjBmOGU5OGVmMTIwYTc5NDEwYzAyOWI0YzcyNDQ4YjUzYmRlIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Denis DelGrosso <[email protected]> Co-authored-by: sofisl <[email protected]>
1 parent 40edfc5 commit 9ece2b7

File tree

15 files changed

+1165
-82
lines changed

15 files changed

+1165
-82
lines changed

packages/google-cloud-batch/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[//]: # "To regenerate it, use `python -m synthtool`."
33
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
44

5-
# [Batch: Node.js Client](https://github.com/googleapis/google-cloud-node)
5+
# [Batch: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-batch)
66

77
[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
88
[![npm version](https://img.shields.io/npm/v/@google-cloud/batch.svg)](https://www.npmjs.org/package/@google-cloud/batch)
@@ -107,24 +107,23 @@ callListJobs();
107107

108108
## Samples
109109

110-
Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
110+
Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-batch/samples) directory. Each sample's `README.md` has instructions for running its sample.
111111

112112
| Sample | Source Code | Try it |
113113
| --------------------------- | --------------------------------- | ------ |
114-
| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js,samples/README.md) |
115-
| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js,samples/README.md) |
116-
| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js,samples/README.md) |
117-
| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js,samples/README.md) |
118-
| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js,samples/README.md) |
119-
| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js,samples/README.md) |
120-
| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js,samples/README.md) |
121-
| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js,samples/README.md) |
122-
| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js,samples/README.md) |
123-
| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js,samples/README.md) |
124-
| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js,samples/README.md) |
125-
| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js,samples/README.md) |
126-
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/quickstart.js,samples/README.md) |
127-
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/test/quickstart.js,samples/README.md) |
114+
| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js,packages/google-cloud-batch/samples/README.md) |
115+
| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js,packages/google-cloud-batch/samples/README.md) |
116+
| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js,packages/google-cloud-batch/samples/README.md) |
117+
| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js,packages/google-cloud-batch/samples/README.md) |
118+
| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js,packages/google-cloud-batch/samples/README.md) |
119+
| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js,packages/google-cloud-batch/samples/README.md) |
120+
| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js,packages/google-cloud-batch/samples/README.md) |
121+
| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js,packages/google-cloud-batch/samples/README.md) |
122+
| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js,packages/google-cloud-batch/samples/README.md) |
123+
| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js,packages/google-cloud-batch/samples/README.md) |
124+
| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js,packages/google-cloud-batch/samples/README.md) |
125+
| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js,packages/google-cloud-batch/samples/README.md) |
126+
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/quickstart.js,packages/google-cloud-batch/samples/README.md) |
128127

129128

130129

packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto

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

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

262267
// Name of a snapshot used as the data source.
268+
// Snapshot is not supported as boot disk now.
263269
string snapshot = 5;
264270
}
265271

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

272278
// Disk size in GB.
279+
//
273280
// For persistent disk, this field is ignored if `data_source` is `image` or
274281
// `snapshot`.
275282
// For local SSD, size_gb should be a multiple of 375GB,
@@ -324,7 +331,7 @@ message AllocationPolicy {
324331

325332
// The minimum CPU platform.
326333
// See
327-
// `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
334+
// https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
328335
// Not yet implemented.
329336
string min_cpu_platform = 3;
330337

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

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

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

375385
// The URL of an existing subnetwork resource in the network.
376386
// You can specify the subnetwork as a full or partial URL.
387+
//
377388
// For example, the following are all valid URLs:
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}
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}
381393
string subnetwork = 2;
382394

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

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+
399428
// Compute Engine VM instance provisioning model.
400429
enum ProvisioningModel {
401430
// Unspecified.
@@ -437,6 +466,9 @@ message AllocationPolicy {
437466

438467
// The network policy.
439468
NetworkPolicy network = 7;
469+
470+
// The placement policy.
471+
PlacementPolicy placement = 10;
440472
}
441473

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

459491
// Number of Tasks in the TaskGroup.
460-
// default is 1
492+
// Default is 1.
461493
int64 task_count = 4;
462494

463495
// Max number of tasks that can run in parallel.
464496
// Default to min(task_count, 1000).
497+
// Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
465498
int64 parallelism = 5;
466499

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

0 commit comments

Comments
 (0)