pub struct TaskGroup {
pub name: String,
pub task_spec: Option<TaskSpec>,
pub task_count: i64,
pub parallelism: i64,
pub scheduling_policy: i32,
pub task_environments: Vec<Environment>,
pub task_count_per_node: i64,
pub require_hosts_file: bool,
pub permissive_ssh: bool,
}Expand description
A TaskGroup defines one or more Tasks that all share the same TaskSpec.
Fields§
§name: StringOutput only. TaskGroup name. The system generates this field based on parent Job name. For example: “projects/123456/locations/us-west1/jobs/job01/taskGroups/group01”.
task_spec: Option<TaskSpec>Required. Tasks in the group share the same task spec.
task_count: i64Number of Tasks in the TaskGroup. Default is 1.
parallelism: i64Max number of tasks that can run in parallel. Default to min(task_count, 1000). Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
scheduling_policy: i32Scheduling policy for Tasks in the TaskGroup. The default value is AS_SOON_AS_POSSIBLE.
task_environments: Vec<Environment>An array of environment variable mappings, which are passed to Tasks with 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 the length of task_environments.
Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in 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 index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
task_count_per_node: i64Max number of tasks that can be run on a VM at the same time. If not specified, the system will decide a value based on available compute resources on a VM and task requirements.
require_hosts_file: boolWhen true, Batch will populate a file with a list of all VMs assigned to the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path of that file. Defaults to false.
permissive_ssh: boolWhen true, Batch will configure SSH to allow passwordless login between VMs running the Batch tasks in the same TaskGroup.
Implementations§
Source§impl TaskGroup
impl TaskGroup
Sourcepub fn scheduling_policy(&self) -> SchedulingPolicy
pub fn scheduling_policy(&self) -> SchedulingPolicy
Returns the enum value of scheduling_policy, or the default if the field is set to an invalid enum value.
Sourcepub fn set_scheduling_policy(&mut self, value: SchedulingPolicy)
pub fn set_scheduling_policy(&mut self, value: SchedulingPolicy)
Sets scheduling_policy to the provided enum value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskGroup
impl<'de> Deserialize<'de> for TaskGroup
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for TaskGroup
impl Message for TaskGroup
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.