Skip to content

Commit a7ee700

Browse files
Google APIscopybara-github
Google APIs
authored andcommitted
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
1 parent 760ee22 commit a7ee700

File tree

2 files changed

+58
-27
lines changed

2 files changed

+58
-27
lines changed

google/cloud/batch/v1/job.proto

+19-26
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

google/cloud/batch/v1/task.proto

+39-1
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.

0 commit comments

Comments
 (0)