Skip to content

Commit dcd8ccf

Browse files
feat: [batch] Add more compute resource API descriptions to match with VM's machine type field (#4564)
* feat: Add more compute resource API descriptions to match with VM's machine type field --- feat: Clarify Batch API proto doc about pubsub notifications --- feat: add Batch Managed Container support for v1alpha PiperOrigin-RevId: 557632387 Source-Link: googleapis/googleapis@f468ecf Source-Link: googleapis/googleapis-gen@0011895 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIwMDExODk1NDk3NGQ3NzQzZWJiZTMxMmY1ZWRhMzU2ZTJjYjljNzlhIn0= * 🦉 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 25d4a43 commit dcd8ccf

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,20 @@ message AllocationPolicy {
432432

433433
// Non-boot disks to be attached for each VM created by this InstancePolicy.
434434
// 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
436+
// file system or a raw storage drive that is not ready for data
437+
// storage and accessing.
435438
repeated AttachedDisk disks = 6;
436439

437440
// If specified, VMs will consume only the specified reservation.
438441
// If not specified (default), VMs will consume any applicable reservation.
439442
string reservation = 7;
440443
}
441444

442-
// Either an InstancePolicy or an instance template.
445+
// InstancePolicyOrTemplate lets you define the type of resources to use for
446+
// this job either with an InstancePolicy or an instance template.
447+
// If undefined, Batch picks the type of VM to use and doesn't include
448+
// optional VM resources such as GPUs and extra disks.
443449
message InstancePolicyOrTemplate {
444450
oneof policy_template {
445451
// InstancePolicy.

packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/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\\V1alpha";
3232
option ruby_package = "Google::Cloud::Batch::V1alpha";
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
// The GPU count.

0 commit comments

Comments
 (0)