Skip to content

Commit 71856b9

Browse files
Google APIscopybara-github
authored andcommitted
feat(v1): Add support for scheduling_policy
docs(v1): Minor clarifications for TaskGroup and min_cpu_platform PiperOrigin-RevId: 540265821
1 parent 854b6a9 commit 71856b9

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

google/cloud/batch/v1/job.proto

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ message AllocationPolicy {
332332
// The minimum CPU platform.
333333
// See
334334
// https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
335-
// Not yet implemented.
336335
string min_cpu_platform = 3;
337336

338337
// The provisioning model.
@@ -471,14 +470,28 @@ message AllocationPolicy {
471470
PlacementPolicy placement = 10;
472471
}
473472

474-
// A TaskGroup contains one or multiple Tasks that share the same
475-
// Runnable but with different runtime parameters.
473+
// A TaskGroup defines one or more Tasks that all share the same TaskSpec.
476474
message TaskGroup {
477475
option (google.api.resource) = {
478476
type: "batch.googleapis.com/TaskGroup"
479477
pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
480478
};
481479

480+
// How Tasks in the TaskGroup should be scheduled relative to each other.
481+
enum SchedulingPolicy {
482+
// Unspecified.
483+
SCHEDULING_POLICY_UNSPECIFIED = 0;
484+
485+
// Run Tasks as soon as resources are available.
486+
//
487+
// Tasks might be executed in parallel depending on parallelism and
488+
// task_count values.
489+
AS_SOON_AS_POSSIBLE = 1;
490+
491+
// Run Tasks sequentially with increased task index.
492+
IN_ORDER = 2;
493+
}
494+
482495
// Output only. TaskGroup name.
483496
// The system generates this field based on parent Job name.
484497
// For example:
@@ -497,6 +510,10 @@ message TaskGroup {
497510
// Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
498511
int64 parallelism = 5;
499512

513+
// Scheduling policy for Tasks in the TaskGroup.
514+
// The default value is AS_SOON_AS_POSSIBLE.
515+
SchedulingPolicy scheduling_policy = 6;
516+
500517
// An array of environment variable mappings, which are passed to Tasks with
501518
// matching indices. If task_environments is used then task_count should
502519
// not be specified in the request (and will be ignored). Task count will be
@@ -506,8 +523,6 @@ message TaskGroup {
506523
// addition to any environment variables set in task_environments, specifying
507524
// the number of Tasks in the Task's parent TaskGroup, and the specific Task's
508525
// index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
509-
//
510-
// task_environments supports up to 200 entries.
511526
repeated Environment task_environments = 9;
512527

513528
// Max number of tasks that can be run on a VM at the same time.

0 commit comments

Comments
 (0)