Skip to content

Commit fbae423

Browse files
feat: [batch] add stderr_snippet to indicate the real stderr output by runnables to the execution field of status event (#4570)
* docs: Revert HTML formats in comments docs: Expand compute resource API docs to match with VM's machine type field docs: Clarify Batch API proto doc about pubsub notifications PiperOrigin-RevId: 558940776 Source-Link: googleapis/googleapis@a7ee700 Source-Link: googleapis/googleapis-gen@4f3a485 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI0ZjNhNDg1ZjNjZWIxM2I2N2UwNTIyYjc0YTdmZDljY2RlMmFhNmExIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add stderr_snippet to indicate the real stderr output by runnables to the execution field of status event docs: update comments PiperOrigin-RevId: 559249641 Source-Link: googleapis/googleapis@83585eb Source-Link: googleapis/googleapis-gen@411a8e3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI0MTFhOGUzM2UwZjE0NzRjMzZhZWVjZmFkZGRmY2NiODY2MDU1MjhmIn0= * 🦉 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>
1 parent fb59e44 commit fbae423

7 files changed

Lines changed: 155 additions & 54 deletions

File tree

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

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,14 @@ message AllocationPolicy {
253253
message Disk {
254254
// A data source from which a PD will be created.
255255
oneof data_source {
256-
// Name of an image used as the data source.
256+
// URL for a VM image to use as the data source for this disk.
257257
// For example, the following are all valid URLs:
258258
//
259259
// * Specify the image by its family name:
260-
// <pre><code>projects/<var
261-
// class="apiparam">project</var>/global/images/family/<var
262-
// class="apiparam">image_family</var></code></pre>
260+
// projects/{project}/global/images/family/{image_family}
263261
// * Specify the image version:
264-
// <pre>projects/<var
265-
// class="apiparam">project</var>/global/images/<var
266-
// class="apiparam">image_version</var></code></pre>
262+
// projects/{project}/global/images/{image_version}
263+
//
267264
// You can also use Batch customized image in short names.
268265
// The following image values are supported for a boot disk:
269266
//
@@ -365,10 +362,16 @@ message AllocationPolicy {
365362

366363
// Non-boot disks to be attached for each VM created by this InstancePolicy.
367364
// New disks will be deleted when the VM is deleted.
365+
// A non-boot disk is a disk that can be of a device with a
366+
// file system or a raw storage drive that is not ready for data
367+
// storage and accessing.
368368
repeated AttachedDisk disks = 6;
369369
}
370370

371-
// Either an InstancePolicy or an instance template.
371+
// InstancePolicyOrTemplate lets you define the type of resources to use for
372+
// this job either with an InstancePolicy or an instance template.
373+
// If undefined, Batch picks the type of VM to use and doesn't include
374+
// optional VM resources such as GPUs and extra disks.
372375
message InstancePolicyOrTemplate {
373376
oneof policy_template {
374377
// InstancePolicy.
@@ -399,30 +402,20 @@ message AllocationPolicy {
399402
// You can specify the network as a full or partial URL.
400403
//
401404
// For example, the following are all valid URLs:
402-
// <pre><code>https://www.googleapis.com/compute/v1/projects/<var
403-
// class="apiparam">project</var>/global/networks/<var
404-
// class="apiparam">network</var></code></pre>
405-
// <pre><code>projects/<var
406-
// class="apiparam">project</var>/global/networks/<var
407-
// class="apiparam">network</var></code></pre>
408-
// <pre><code>global/networks/<var
409-
// class="apiparam">network</var></code></pre>
405+
//
406+
// * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
407+
// * projects/{project}/global/networks/{network}
408+
// * global/networks/{network}
410409
string network = 1;
411410

412411
// The URL of an existing subnetwork resource in the network.
413412
// You can specify the subnetwork as a full or partial URL.
414413
//
415414
// For example, the following are all valid URLs:
416-
// <pre><code>https://www.googleapis.com/compute/v1/projects/<var
417-
// class="apiparam">project</var>/regions/<var
418-
// class="apiparam">region</var>/subnetworks/<var
419-
// class="apiparam">subnetwork</var></code></pre>
420-
// <pre><code>projects/<var class="apiparam">project</var>/regions/<var
421-
// class="apiparam">region</var>/subnetworks/<var
422-
// class="apiparam">subnetwork</var></code></pre>
423-
// <pre><code>regions/<var
424-
// class="apiparam">region</var>/subnetworks/<var
425-
// class="apiparam">subnetwork</var></code></pre>
415+
//
416+
// * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
417+
// * projects/{project}/regions/{region}/subnetworks/{subnetwork}
418+
// * regions/{region}/subnetworks/{subnetwork}
426419
string subnetwork = 2;
427420

428421
// Default is false (with an external IP address). Required if

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,50 @@ option objc_class_prefix = "GCB";
3131
option php_namespace = "Google\\Cloud\\Batch\\V1";
3232
option ruby_package = "Google::Cloud::Batch::V1";
3333

34-
// Compute resource requirements
34+
// Compute resource requirements.
35+
//
36+
// ComputeResource defines the amount of resources required for each task.
37+
// Make sure your tasks have enough resources to successfully run.
38+
// If you also define the types of resources for a job to use with the
39+
// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
40+
// field, make sure both fields are compatible with each other.
3541
message ComputeResource {
3642
// The milliCPU count.
43+
//
44+
// `cpuMilli` defines the amount of CPU resources per task in milliCPU units.
45+
// For example, `1000` corresponds to 1 vCPU per task. If undefined, the
46+
// default value is `2000`.
47+
//
48+
// If you also define the VM's machine type using the `machineType` in
49+
// [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
50+
// field or inside the `instanceTemplate` in the
51+
// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
52+
// field, make sure the CPU resources for both fields are compatible with each
53+
// other and with how many tasks you want to allow to run on the same VM at
54+
// the same time.
55+
//
56+
// For example, if you specify the `n2-standard-2` machine type, which has 2
57+
// vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or
58+
// you are recommended to run two tasks on the same VM if you set `cpuMilli`
59+
// to `1000` or less.
3760
int64 cpu_milli = 1;
3861

3962
// Memory in MiB.
63+
//
64+
// `memoryMib` defines the amount of memory per task in MiB units.
65+
// If undefined, the default value is `2000`.
66+
// If you also define the VM's machine type using the `machineType` in
67+
// [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
68+
// field or inside the `instanceTemplate` in the
69+
// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
70+
// field, make sure the memory resources for both fields are compatible with
71+
// each other and with how many tasks you want to allow to run on the same VM
72+
// at the same time.
73+
//
74+
// For example, if you specify the `n2-standard-2` machine type, which has 8
75+
// GiB each, you are recommended to set `memoryMib` to no more than `8192`,
76+
// or you are recommended to run two tasks on the same VM if you set
77+
// `memoryMib` to `4096` or less.
4078
int64 memory_mib = 2;
4179

4280
// Extra boot disk size in MiB for each task.

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

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -317,17 +317,14 @@ message AllocationPolicy {
317317
message Disk {
318318
// A data source from which a PD will be created.
319319
oneof data_source {
320-
// Name of an image used as the data source.
320+
// URL for a VM image to use as the data source for this disk.
321321
// For example, the following are all valid URLs:
322322
//
323323
// * Specify the image by its family name:
324-
// <pre><code>projects/<var
325-
// class="apiparam">project</var>/global/images/family/<var
326-
// class="apiparam">image_family</var></code></pre>
324+
// projects/{project}/global/images/family/{image_family}
327325
// * Specify the image version:
328-
// <pre>projects/<var
329-
// class="apiparam">project</var>/global/images/<var
330-
// class="apiparam">image_version</var></code></pre>
326+
// projects/{project}/global/images/{image_version}
327+
//
331328
// You can also use Batch customized image in short names.
332329
// The following image values are supported for a boot disk:
333330
//
@@ -432,7 +429,7 @@ message AllocationPolicy {
432429

433430
// Non-boot disks to be attached for each VM created by this InstancePolicy.
434431
// New disks will be deleted when the VM is deleted.
435-
// A non bootable disk is a disk that can be of a device with a
432+
// A non-boot disk is a disk that can be of a device with a
436433
// file system or a raw storage drive that is not ready for data
437434
// storage and accessing.
438435
repeated AttachedDisk disks = 6;
@@ -476,30 +473,20 @@ message AllocationPolicy {
476473
// You can specify the network as a full or partial URL.
477474
//
478475
// For example, the following are all valid URLs:
479-
// <pre><code>https://www.googleapis.com/compute/v1/projects/<var
480-
// class="apiparam">project</var>/global/networks/<var
481-
// class="apiparam">network</var></code></pre>
482-
// <pre><code>projects/<var
483-
// class="apiparam">project</var>/global/networks/<var
484-
// class="apiparam">network</var></code></pre>
485-
// <pre><code>global/networks/<var
486-
// class="apiparam">network</var></code></pre>
476+
//
477+
// * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
478+
// * projects/{project}/global/networks/{network}
479+
// * global/networks/{network}
487480
string network = 1;
488481

489482
// The URL of an existing subnetwork resource in the network.
490483
// You can specify the subnetwork as a full or partial URL.
491484
//
492485
// For example, the following are all valid URLs:
493-
// <pre><code>https://www.googleapis.com/compute/v1/projects/<var
494-
// class="apiparam">project</var>/regions/<var
495-
// class="apiparam">region</var>/subnetworks/<var
496-
// class="apiparam">subnetwork</var></code></pre>
497-
// <pre><code>projects/<var class="apiparam">project</var>/regions/<var
498-
// class="apiparam">region</var>/subnetworks/<var
499-
// class="apiparam">subnetwork</var></code></pre>
500-
// <pre><code>regions/<var
501-
// class="apiparam">region</var>/subnetworks/<var
502-
// class="apiparam">subnetwork</var></code></pre>
486+
//
487+
// * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
488+
// * projects/{project}/regions/{region}/subnetworks/{subnetwork}
489+
// * regions/{region}/subnetworks/{subnetwork}
503490
string subnetwork = 2;
504491

505492
// Default is false (with an external IP address). Required if

packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ message TaskExecution {
110110
// When task is completed as the status of FAILED or SUCCEEDED,
111111
// exit code is for one task execution result, default is 0 as success.
112112
int32 exit_code = 1;
113+
114+
// Optional. The tail end of any content written to standard error by the task
115+
// execution. This field will be populated only when the execution failed.
116+
string stderr_snippet = 2 [(google.api.field_behavior) = OPTIONAL];
113117
}
114118

115119
// Status of a task
@@ -248,6 +252,12 @@ message Runnable {
248252
Barrier barrier = 6;
249253
}
250254

255+
// Optional. DisplayName is an optional field that can be provided by the
256+
// caller. If provided, it will be used in logs and other outputs to identify
257+
// the script, making it easier for users to understand the logs. If not
258+
// provided the index of the runnable will be used for outputs.
259+
string display_name = 10 [(google.api.field_behavior) = OPTIONAL];
260+
251261
// Normally, a non-zero exit status causes the Task to fail. This flag allows
252262
// execution of other Runnables to continue instead.
253263
bool ignore_exit_status = 3;

packages/google-cloud-batch/protos/protos.d.ts

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)