feat(v1): Add support for scheduling_policy

docs(v1): Minor clarifications for TaskGroup and min_cpu_platform

PiperOrigin-RevId: 540265821
gce-action-fix
Google APIs 2 years ago committed by Copybara-Service
parent 854b6a9e7f
commit 71856b9fcb
  1. 25
      google/cloud/batch/v1/job.proto

@ -332,7 +332,6 @@ message AllocationPolicy {
// The minimum CPU platform. // The minimum CPU platform.
// See // See
// https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
// Not yet implemented.
string min_cpu_platform = 3; string min_cpu_platform = 3;
// The provisioning model. // The provisioning model.
@ -471,14 +470,28 @@ message AllocationPolicy {
PlacementPolicy placement = 10; PlacementPolicy placement = 10;
} }
// A TaskGroup contains one or multiple Tasks that share the same // A TaskGroup defines one or more Tasks that all share the same TaskSpec.
// Runnable but with different runtime parameters.
message TaskGroup { message TaskGroup {
option (google.api.resource) = { option (google.api.resource) = {
type: "batch.googleapis.com/TaskGroup" type: "batch.googleapis.com/TaskGroup"
pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
}; };
// How Tasks in the TaskGroup should be scheduled relative to each other.
enum SchedulingPolicy {
// Unspecified.
SCHEDULING_POLICY_UNSPECIFIED = 0;
// Run Tasks as soon as resources are available.
//
// Tasks might be executed in parallel depending on parallelism and
// task_count values.
AS_SOON_AS_POSSIBLE = 1;
// Run Tasks sequentially with increased task index.
IN_ORDER = 2;
}
// Output only. TaskGroup name. // Output only. TaskGroup name.
// The system generates this field based on parent Job name. // The system generates this field based on parent Job name.
// For example: // For example:
@ -497,6 +510,10 @@ message TaskGroup {
// Field parallelism must be 1 if the scheduling_policy is IN_ORDER. // Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
int64 parallelism = 5; int64 parallelism = 5;
// Scheduling policy for Tasks in the TaskGroup.
// The default value is AS_SOON_AS_POSSIBLE.
SchedulingPolicy scheduling_policy = 6;
// An array of environment variable mappings, which are passed to Tasks with // An array of environment variable mappings, which are passed to Tasks with
// matching indices. If task_environments is used then task_count should // matching indices. If task_environments is used then task_count should
// not be specified in the request (and will be ignored). Task count will be // not be specified in the request (and will be ignored). Task count will be
@ -506,8 +523,6 @@ message TaskGroup {
// addition to any environment variables set in task_environments, specifying // addition to any environment variables set in task_environments, specifying
// the number of Tasks in the Task's parent TaskGroup, and the specific Task's // the number of Tasks in the Task's parent TaskGroup, and the specific Task's
// index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
//
// task_environments supports up to 200 entries.
repeated Environment task_environments = 9; repeated Environment task_environments = 9;
// Max number of tasks that can be run on a VM at the same time. // Max number of tasks that can be run on a VM at the same time.

Loading…
Cancel
Save