xref: /aosp_15_r20/external/googleapis/google/cloud/batch/v1alpha/job.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.batch.v1alpha;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/batch/v1alpha/task.proto";
22import "google/protobuf/duration.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.Batch.V1Alpha";
26option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb";
27option java_multiple_files = true;
28option java_outer_classname = "JobProto";
29option java_package = "com.google.cloud.batch.v1alpha";
30option objc_class_prefix = "GCB";
31option php_namespace = "Google\\Cloud\\Batch\\V1alpha";
32option ruby_package = "Google::Cloud::Batch::V1alpha";
33
34// The Cloud Batch Job description.
35message Job {
36  option (google.api.resource) = {
37    type: "batch.googleapis.com/Job"
38    pattern: "projects/{project}/locations/{location}/jobs/{job}"
39  };
40
41  // The order that TaskGroups are scheduled relative to each other.
42  //
43  // Not yet implemented.
44  enum SchedulingPolicy {
45    // Unspecified.
46    SCHEDULING_POLICY_UNSPECIFIED = 0;
47
48    // Run all TaskGroups as soon as possible.
49    AS_SOON_AS_POSSIBLE = 1;
50  }
51
52  // Output only. Job name.
53  // For example: "projects/123456/locations/us-central1/jobs/job01".
54  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
55
56  // Output only. A system generated unique ID for the Job.
57  string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
58
59  // Priority of the Job.
60  // The valid value range is [0, 100). Default value is 0.
61  // Higher value indicates higher priority.
62  // A job with higher priority value is more likely to run earlier if all other
63  // requirements are satisfied.
64  int64 priority = 3;
65
66  // Required. TaskGroups in the Job. Only one TaskGroup is supported now.
67  repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED];
68
69  // Scheduling policy for TaskGroups in the job.
70  SchedulingPolicy scheduling_policy = 5;
71
72  // At least one of the dependencies must be satisfied before the Job is
73  // scheduled to run.
74  // Only one JobDependency is supported now.
75  // Not yet implemented.
76  repeated JobDependency dependencies = 6;
77
78  // Compute resource allocation for all TaskGroups in the Job.
79  AllocationPolicy allocation_policy = 7;
80
81  // Labels for the Job. Labels could be user provided or system generated.
82  // For example,
83  // "labels": {
84  //    "department": "finance",
85  //    "environment": "test"
86  //  }
87  // You can assign up to 64 labels.  [Google Compute Engine label
88  // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
89  // apply.
90  // Label names that start with "goog-" or "google-" are reserved.
91  map<string, string> labels = 8;
92
93  // Output only. Job status. It is read only for users.
94  JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
95
96  // Deprecated: please use notifications instead.
97  JobNotification notification = 10 [deprecated = true];
98
99  // Output only. When the Job was created.
100  google.protobuf.Timestamp create_time = 11
101      [(google.api.field_behavior) = OUTPUT_ONLY];
102
103  // Output only. The last time the Job was updated.
104  google.protobuf.Timestamp update_time = 12
105      [(google.api.field_behavior) = OUTPUT_ONLY];
106
107  // Log preservation policy for the Job.
108  LogsPolicy logs_policy = 13;
109
110  // Notification configurations.
111  repeated JobNotification notifications = 14;
112}
113
114// LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
115// preserved.
116message LogsPolicy {
117  // `CloudLoggingOption` contains additional settings for Cloud Logging logs
118  // generated by Batch job.
119  message CloudLoggingOption {
120    // Optional. Set this flag to true to change the [monitored resource
121    // type](https://cloud.google.com/monitoring/api/resources) for
122    // Cloud Logging logs generated by this Batch job from
123    // the
124    // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job)
125    // type to the formerly used
126    // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task)
127    // type.
128    bool use_generic_task_monitored_resource = 1
129        [(google.api.field_behavior) = OPTIONAL];
130  }
131
132  // The destination (if any) for logs.
133  enum Destination {
134    // Logs are not preserved.
135    DESTINATION_UNSPECIFIED = 0;
136
137    // Logs are streamed to Cloud Logging.
138    CLOUD_LOGGING = 1;
139
140    // Logs are saved to a file path.
141    PATH = 2;
142  }
143
144  // Where logs should be saved.
145  Destination destination = 1;
146
147  // The path to which logs are saved when the destination = PATH. This can be a
148  // local file path on the VM, or under the mount point of a Persistent Disk or
149  // Filestore, or a Cloud Storage path.
150  string logs_path = 2;
151
152  // Optional. Additional settings for Cloud Logging. It will only take effect
153  // when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
154  CloudLoggingOption cloud_logging_option = 3
155      [(google.api.field_behavior) = OPTIONAL];
156}
157
158// JobDependency describes the state of other Jobs that the start of this Job
159// depends on.
160// All dependent Jobs must have been submitted in the same region.
161message JobDependency {
162  // Dependency type.
163  enum Type {
164    // Unspecified.
165    TYPE_UNSPECIFIED = 0;
166
167    // The dependent Job has succeeded.
168    SUCCEEDED = 1;
169
170    // The dependent Job has failed.
171    FAILED = 2;
172
173    // SUCCEEDED or FAILED.
174    FINISHED = 3;
175  }
176
177  // Each item maps a Job name to a Type.
178  // All items must be satisfied for the JobDependency to be satisfied (the AND
179  // operation).
180  // Once a condition for one item becomes true, it won't go back to false
181  // even the dependent Job state changes again.
182  map<string, Type> items = 1;
183}
184
185// Job status.
186message JobStatus {
187  // VM instance status.
188  message InstanceStatus {
189    // The Compute Engine machine type.
190    string machine_type = 1;
191
192    // The VM instance provisioning model.
193    AllocationPolicy.ProvisioningModel provisioning_model = 2;
194
195    // The max number of tasks can be assigned to this instance type.
196    int64 task_pack = 3;
197
198    // The VM boot disk.
199    AllocationPolicy.Disk boot_disk = 4;
200  }
201
202  // Aggregated task status for a TaskGroup.
203  message TaskGroupStatus {
204    // Count of task in each state in the TaskGroup.
205    // The map key is task state name.
206    map<string, int64> counts = 1;
207
208    // Status of instances allocated for the TaskGroup.
209    repeated InstanceStatus instances = 2;
210  }
211
212  // Valid Job states.
213  enum State {
214    // Job state unspecified.
215    STATE_UNSPECIFIED = 0;
216
217    // Job is admitted (validated and persisted) and waiting for resources.
218    QUEUED = 1;
219
220    // Job is scheduled to run as soon as resource allocation is ready.
221    // The resource allocation may happen at a later time but with a high
222    // chance to succeed.
223    SCHEDULED = 2;
224
225    // Resource allocation has been successful. At least one Task in the Job is
226    // RUNNING.
227    RUNNING = 3;
228
229    // All Tasks in the Job have finished successfully.
230    SUCCEEDED = 4;
231
232    // At least one Task in the Job has failed.
233    FAILED = 5;
234
235    // The Job will be deleted, but has not been deleted yet. Typically this is
236    // because resources used by the Job are still being cleaned up.
237    DELETION_IN_PROGRESS = 6;
238  }
239
240  // Job state
241  State state = 1;
242
243  // Job status events
244  repeated StatusEvent status_events = 2;
245
246  // Aggregated task status for each TaskGroup in the Job.
247  // The map key is TaskGroup ID.
248  map<string, TaskGroupStatus> task_groups = 4;
249
250  // The duration of time that the Job spent in status RUNNING.
251  google.protobuf.Duration run_duration = 5;
252
253  // The resource usage of the job.
254  ResourceUsage resource_usage = 6;
255}
256
257// ResourceUsage describes the resource usage of the job.
258message ResourceUsage {
259  // The CPU core hours that the job consumes.
260  double core_hours = 1;
261}
262
263// Notification configurations.
264message JobNotification {
265  // Message details.
266  // Describe the conditions under which messages will be sent.
267  // If no attribute is defined, no message will be sent by default.
268  // One message should specify either the job or the task level attributes,
269  // but not both. For example,
270  // job level: JOB_STATE_CHANGED and/or a specified new_job_state;
271  // task level: TASK_STATE_CHANGED and/or a specified new_task_state.
272  message Message {
273    // The message type.
274    Type type = 1;
275
276    // The new job state.
277    JobStatus.State new_job_state = 2;
278
279    // The new task state.
280    TaskStatus.State new_task_state = 3;
281  }
282
283  // The message type.
284  enum Type {
285    // Unspecified.
286    TYPE_UNSPECIFIED = 0;
287
288    // Notify users that the job state has changed.
289    JOB_STATE_CHANGED = 1;
290
291    // Notify users that the task state has changed.
292    TASK_STATE_CHANGED = 2;
293  }
294
295  // The Pub/Sub topic where notifications like the job state changes
296  // will be published. The topic must exist in the same project as
297  // the job and billings will be charged to this project.
298  // If not specified, no Pub/Sub messages will be sent.
299  // Topic format: `projects/{project}/topics/{topic}`.
300  string pubsub_topic = 1;
301
302  // The attribute requirements of messages to be sent to this Pub/Sub topic.
303  // Without this field, no message will be sent.
304  Message message = 2;
305}
306
307// A Job's resource allocation policy describes when, where, and how compute
308// resources should be allocated for the Job.
309message AllocationPolicy {
310  message LocationPolicy {
311    // A list of allowed location names represented by internal URLs.
312    //
313    // Each location can be a region or a zone.
314    // Only one region or multiple zones in one region is supported now.
315    // For example,
316    // ["regions/us-central1"] allow VMs in any zones in region us-central1.
317    // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
318    // in zones us-central1-a and us-central1-c.
319    //
320    // All locations end up in different regions would cause errors.
321    // For example,
322    // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
323    // "zones/us-west1-a"] contains 2 regions "us-central1" and
324    // "us-west1". An error is expected in this case.
325    repeated string allowed_locations = 1;
326
327    // A list of denied location names.
328    //
329    // Not yet implemented.
330    repeated string denied_locations = 2;
331  }
332
333  // A new persistent disk or a local ssd.
334  // A VM can only have one local SSD setting but multiple local SSD partitions.
335  // See https://cloud.google.com/compute/docs/disks#pdspecs and
336  // https://cloud.google.com/compute/docs/disks#localssds.
337  message Disk {
338    // A data source from which a PD will be created.
339    oneof data_source {
340      // URL for a VM image to use as the data source for this disk.
341      // For example, the following are all valid URLs:
342      //
343      // * Specify the image by its family name:
344      // projects/{project}/global/images/family/{image_family}
345      // * Specify the image version:
346      // projects/{project}/global/images/{image_version}
347      //
348      // You can also use Batch customized image in short names.
349      // The following image values are supported for a boot disk:
350      //
351      // * `batch-debian`: use Batch Debian images.
352      // * `batch-centos`: use Batch CentOS images.
353      // * `batch-cos`: use Batch Container-Optimized images.
354      // * `batch-hpc-centos`: use Batch HPC CentOS images.
355      // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
356      string image = 4;
357
358      // Name of a snapshot used as the data source.
359      // Snapshot is not supported as boot disk now.
360      string snapshot = 5;
361    }
362
363    // Disk type as shown in `gcloud compute disk-types list`.
364    // For example, local SSD uses type "local-ssd".
365    // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
366    // or "pd-standard".
367    string type = 1;
368
369    // Disk size in GB.
370    //
371    // **Non-Boot Disk**:
372    // If the `type` specifies a persistent disk, this field
373    // is ignored if `data_source` is set as `image` or `snapshot`.
374    // If the `type` specifies a local SSD, this field should be a multiple of
375    // 375 GB, otherwise, the final size will be the next greater multiple of
376    // 375 GB.
377    //
378    // **Boot Disk**:
379    // Batch will calculate the boot disk size based on source
380    // image and task requirements if you do not speicify the size.
381    // If both this field and the `boot_disk_mib` field in task spec's
382    // `compute_resource` are defined, Batch will only honor this field.
383    // Also, this field should be no smaller than the source disk's
384    // size when the `data_source` is set as `snapshot` or `image`.
385    // For example, if you set an image as the `data_source` field and the
386    // image's default disk size 30 GB, you can only use this field to make the
387    // disk larger or equal to 30 GB.
388    int64 size_gb = 2;
389
390    // Local SSDs are available through both "SCSI" and "NVMe" interfaces.
391    // If not indicated, "NVMe" will be the default one for local ssds.
392    // This field is ignored for persistent disks as the interface is chosen
393    // automatically. See
394    // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
395    string disk_interface = 6;
396  }
397
398  // A new or an existing persistent disk (PD) or a local ssd attached to a VM
399  // instance.
400  message AttachedDisk {
401    oneof attached {
402      Disk new_disk = 1;
403
404      // Name of an existing PD.
405      string existing_disk = 2;
406    }
407
408    // Device name that the guest operating system will see.
409    // It is used by Runnable.volumes field to mount disks. So please specify
410    // the device_name if you want Batch to help mount the disk, and it should
411    // match the device_name field in volumes.
412    string device_name = 3;
413  }
414
415  // Accelerator describes Compute Engine accelerators to be attached to the VM.
416  message Accelerator {
417    // The accelerator type. For example, "nvidia-tesla-t4".
418    // See `gcloud compute accelerator-types list`.
419    string type = 1;
420
421    // The number of accelerators of this type.
422    int64 count = 2;
423
424    // Deprecated: please use instances[0].install_gpu_drivers instead.
425    bool install_gpu_drivers = 3 [deprecated = true];
426
427    // Optional. The NVIDIA GPU driver version that should be installed for this
428    // type.
429    //
430    // You can define the specific driver version such as "470.103.01",
431    // following the driver version requirements in
432    // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
433    // Batch will install the specific accelerator driver if qualified.
434    string driver_version = 4 [(google.api.field_behavior) = OPTIONAL];
435  }
436
437  // InstancePolicy describes an instance type and resources attached to each VM
438  // created by this InstancePolicy.
439  message InstancePolicy {
440    // Deprecated: please use machine_type instead.
441    repeated string allowed_machine_types = 1 [deprecated = true];
442
443    // The Compute Engine machine type.
444    string machine_type = 2;
445
446    // The minimum CPU platform.
447    // See
448    // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
449    string min_cpu_platform = 3;
450
451    // The provisioning model.
452    ProvisioningModel provisioning_model = 4;
453
454    // The accelerators attached to each VM instance.
455    repeated Accelerator accelerators = 5;
456
457    // Boot disk to be created and attached to each VM by this InstancePolicy.
458    // Boot disk will be deleted when the VM is deleted.
459    // Batch API now only supports booting from image.
460    Disk boot_disk = 8;
461
462    // Non-boot disks to be attached for each VM created by this InstancePolicy.
463    // New disks will be deleted when the VM is deleted.
464    // A non-boot disk is a disk that can be of a device with a
465    // file system or a raw storage drive that is not ready for data
466    // storage and accessing.
467    repeated AttachedDisk disks = 6;
468
469    // Optional. If specified, VMs will consume only the specified reservation.
470    // If not specified (default), VMs will consume any applicable reservation.
471    string reservation = 7 [(google.api.field_behavior) = OPTIONAL];
472  }
473
474  // InstancePolicyOrTemplate lets you define the type of resources to use for
475  // this job either with an InstancePolicy or an instance template.
476  // If undefined, Batch picks the type of VM to use and doesn't include
477  // optional VM resources such as GPUs and extra disks.
478  message InstancePolicyOrTemplate {
479    oneof policy_template {
480      // InstancePolicy.
481      InstancePolicy policy = 1;
482
483      // Name of an instance template used to create VMs.
484      // Named the field as 'instance_template' instead of 'template' to avoid
485      // c++ keyword conflict.
486      string instance_template = 2;
487    }
488
489    // Set this field true if users want Batch to help fetch drivers from a
490    // third party location and install them for GPUs specified in
491    // policy.accelerators or instance_template on their behalf. Default is
492    // false.
493    //
494    // For Container-Optimized Image cases, Batch will install the
495    // accelerator driver following milestones of
496    // https://cloud.google.com/container-optimized-os/docs/release-notes. For
497    // non Container-Optimized Image cases, following
498    // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
499    bool install_gpu_drivers = 3;
500  }
501
502  // A network interface.
503  message NetworkInterface {
504    // The URL of an existing network resource.
505    // You can specify the network as a full or partial URL.
506    //
507    // For example, the following are all valid URLs:
508    //
509    // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
510    // * projects/{project}/global/networks/{network}
511    // * global/networks/{network}
512    string network = 1;
513
514    // The URL of an existing subnetwork resource in the network.
515    // You can specify the subnetwork as a full or partial URL.
516    //
517    // For example, the following are all valid URLs:
518    //
519    // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
520    // * projects/{project}/regions/{region}/subnetworks/{subnetwork}
521    // * regions/{region}/subnetworks/{subnetwork}
522    string subnetwork = 2;
523
524    // Default is false (with an external IP address). Required if
525    // no external public IP address is attached to the VM. If no external
526    // public IP address, additional configuration is required to allow the VM
527    // to access Google Services. See
528    // https://cloud.google.com/vpc/docs/configure-private-google-access and
529    // https://cloud.google.com/nat/docs/gce-example#create-nat for more
530    // information.
531    bool no_external_ip_address = 3;
532  }
533
534  // NetworkPolicy describes VM instance network configurations.
535  message NetworkPolicy {
536    // Network configurations.
537    repeated NetworkInterface network_interfaces = 1;
538  }
539
540  // PlacementPolicy describes a group placement policy for the VMs controlled
541  // by this AllocationPolicy.
542  message PlacementPolicy {
543    // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
544    // want VMs to be located close to each other for low network latency
545    // between the VMs. No placement policy will be generated when collocation
546    // is UNSPECIFIED.
547    string collocation = 1;
548
549    // When specified, causes the job to fail if more than max_distance logical
550    // switches are required between VMs. Batch uses the most compact possible
551    // placement of VMs even when max_distance is not specified. An explicit
552    // max_distance makes that level of compactness a strict requirement.
553    // Not yet implemented
554    int64 max_distance = 2;
555  }
556
557  // Compute Engine VM instance provisioning model.
558  enum ProvisioningModel {
559    // Unspecified.
560    PROVISIONING_MODEL_UNSPECIFIED = 0;
561
562    // Standard VM.
563    STANDARD = 1;
564
565    // SPOT VM.
566    SPOT = 2;
567
568    // Preemptible VM (PVM).
569    //
570    // Above SPOT VM is the preferable model for preemptible VM instances: the
571    // old preemptible VM model (indicated by this field) is the older model,
572    // and has been migrated to use the SPOT model as the underlying technology.
573    // This old model will still be supported.
574    PREEMPTIBLE = 3;
575  }
576
577  // Location where compute resources should be allocated for the Job.
578  LocationPolicy location = 1;
579
580  // Deprecated: please use instances[0].policy instead.
581  InstancePolicy instance = 2 [deprecated = true];
582
583  // Describe instances that can be created by this AllocationPolicy.
584  // Only instances[0] is supported now.
585  repeated InstancePolicyOrTemplate instances = 8;
586
587  // Deprecated: please use instances[0].template instead.
588  repeated string instance_templates = 3 [deprecated = true];
589
590  // Deprecated: please use instances[0].policy.provisioning_model instead.
591  repeated ProvisioningModel provisioning_models = 4 [deprecated = true];
592
593  // Deprecated: please use service_account instead.
594  string service_account_email = 5 [deprecated = true];
595
596  // Defines the service account for Batch-created VMs. If omitted, the [default
597  // Compute Engine service
598  // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account)
599  // is used. Must match the service account specified in any used instance
600  // template configured in the Batch job.
601  //
602  // Includes the following fields:
603  //  * email: The service account's email address. If not set, the default
604  //  Compute Engine service account is used.
605  //  * scopes: Additional OAuth scopes to grant the service account, beyond the
606  //  default cloud-platform scope. (list of strings)
607  ServiceAccount service_account = 9;
608
609  // Labels applied to all VM instances and other resources
610  // created by AllocationPolicy.
611  // Labels could be user provided or system generated.
612  // You can assign up to 64 labels. [Google Compute Engine label
613  // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
614  // apply.
615  // Label names that start with "goog-" or "google-" are reserved.
616  map<string, string> labels = 6;
617
618  // The network policy.
619  //
620  // If you define an instance template in the `InstancePolicyOrTemplate` field,
621  // Batch will use the network settings in the instance template instead of
622  // this field.
623  NetworkPolicy network = 7;
624
625  // The placement policy.
626  PlacementPolicy placement = 10;
627
628  // Optional. Tags applied to the VM instances.
629  //
630  // The tags identify valid sources or targets for network firewalls.
631  // Each tag must be 1-63 characters long, and comply with
632  // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
633  repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL];
634}
635
636// A TaskGroup defines one or more Tasks that all share the same TaskSpec.
637message TaskGroup {
638  option (google.api.resource) = {
639    type: "batch.googleapis.com/TaskGroup"
640    pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
641  };
642
643  // How Tasks in the TaskGroup should be scheduled relative to each other.
644  enum SchedulingPolicy {
645    // Unspecified.
646    SCHEDULING_POLICY_UNSPECIFIED = 0;
647
648    // Run Tasks as soon as resources are available.
649    //
650    // Tasks might be executed in parallel depending on parallelism and
651    // task_count values.
652    AS_SOON_AS_POSSIBLE = 1;
653
654    // Run Tasks sequentially with increased task index.
655    IN_ORDER = 2;
656  }
657
658  // Output only. TaskGroup name.
659  // The system generates this field based on parent Job name.
660  // For example:
661  // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
662  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
663
664  // Required. Tasks in the group share the same task spec.
665  TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED];
666
667  // Number of Tasks in the TaskGroup.
668  // Default is 1.
669  int64 task_count = 4;
670
671  // Max number of tasks that can run in parallel.
672  // Default to min(task_count, parallel tasks per job limit).
673  // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits).
674  // Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
675  int64 parallelism = 5;
676
677  // Scheduling policy for Tasks in the TaskGroup.
678  // The default value is AS_SOON_AS_POSSIBLE.
679  SchedulingPolicy scheduling_policy = 6;
680
681  // Compute resource allocation for the TaskGroup.
682  // If specified, it overrides resources in Job.
683  AllocationPolicy allocation_policy = 7;
684
685  // Labels for the TaskGroup.
686  // Labels could be user provided or system generated.
687  // You can assign up to 64 labels.  [Google Compute Engine label
688  // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
689  // apply.
690  // Label names that start with "goog-" or "google-" are reserved.
691  map<string, string> labels = 8;
692
693  // An array of environment variable mappings, which are passed to Tasks with
694  // matching indices. If task_environments is used then task_count should
695  // not be specified in the request (and will be ignored). Task count will be
696  // the length of task_environments.
697  //
698  // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
699  // addition to any environment variables set in task_environments, specifying
700  // the number of Tasks in the Task's parent TaskGroup, and the specific Task's
701  // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
702  repeated Environment task_environments = 9;
703
704  // Max number of tasks that can be run on a VM at the same time.
705  // If not specified, the system will decide a value based on available
706  // compute resources on a VM and task requirements.
707  int64 task_count_per_node = 10;
708
709  // When true, Batch will populate a file with a list of all VMs assigned to
710  // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path
711  // of that file. Defaults to false. The host file supports up to 1000 VMs.
712  bool require_hosts_file = 11;
713
714  // When true, Batch will configure SSH to allow passwordless login between
715  // VMs running the Batch tasks in the same TaskGroup.
716  bool permissive_ssh = 12;
717
718  // Optional. If not set or set to false, Batch uses the root user to execute
719  // runnables. If set to true, Batch runs the runnables using a non-root user.
720  // Currently, the non-root user Batch used is generated by OS Login. For more
721  // information, see [About OS
722  // Login](https://cloud.google.com/compute/docs/oslogin).
723  bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL];
724
725  // Optional. ServiceAccount used by tasks within the task group for the access
726  // to other Cloud resources. This allows tasks to operate with permissions
727  // distinct from the service account for the VM set at `AllocationPolicy`. Use
728  // this field when tasks require different access rights than those of the VM.
729  //
730  // Specify the service account's `email` field. Ensure `scopes`
731  // include any necessary permissions for tasks, in addition to the default
732  // 'cloud-platform' scope.
733  ServiceAccount service_account = 15 [(google.api.field_behavior) = OPTIONAL];
734}
735
736// Carries information about a Google Cloud service account.
737message ServiceAccount {
738  // Email address of the service account.
739  string email = 1;
740
741  // List of scopes to be enabled for this service account.
742  repeated string scopes = 2;
743}
744