pub struct TaskGroup {Show 13 fields
pub name: String,
pub task_spec: Option<TaskSpec>,
pub task_count: i64,
pub parallelism: i64,
pub scheduling_policy: i32,
pub allocation_policy: Option<AllocationPolicy>,
pub labels: BTreeMap<String, String>,
pub task_environments: Vec<Environment>,
pub task_count_per_node: i64,
pub require_hosts_file: bool,
pub permissive_ssh: bool,
pub run_as_non_root: bool,
pub service_account: Option<ServiceAccount>,
}
Expand description
A TaskGroup defines one or more Tasks that all share the same TaskSpec.
Fields§
§name: String
Output 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: i64
Number of Tasks in the TaskGroup. Default is 1.
parallelism: i64
Max number of tasks that can run in parallel. Default to min(task_count, parallel tasks per job limit). See: Job Limits. Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
scheduling_policy: i32
Scheduling policy for Tasks in the TaskGroup. The default value is AS_SOON_AS_POSSIBLE.
allocation_policy: Option<AllocationPolicy>
Compute resource allocation for the TaskGroup. If specified, it overrides resources in Job.
labels: BTreeMap<String, String>
Labels for the TaskGroup. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with “goog-” or “google-” are reserved.
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: i64
Max 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: bool
When 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. The host file supports up to 1000 VMs.
permissive_ssh: bool
When true, Batch will configure SSH to allow passwordless login between VMs running the Batch tasks in the same TaskGroup.
run_as_non_root: bool
Optional. If not set or set to false, Batch uses the root user to execute runnables. If set to true, Batch runs the runnables using a non-root user. Currently, the non-root user Batch used is generated by OS Login. For more information, see About OS Login.
service_account: Option<ServiceAccount>
Optional. ServiceAccount used by tasks within the task group for the access
to other Cloud resources. This allows tasks to operate with permissions
distinct from the service account for the VM set at AllocationPolicy
. Use
this field when tasks require different access rights than those of the VM.
Specify the service account’s email
field. Ensure scopes
include any necessary permissions for tasks, in addition to the default
‘cloud-platform’ scope.
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 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
.source§impl PartialEq for TaskGroup
impl PartialEq for TaskGroup
impl StructuralPartialEq for TaskGroup
Auto Trait Implementations§
impl Freeze for TaskGroup
impl RefUnwindSafe for TaskGroup
impl Send for TaskGroup
impl Sync for TaskGroup
impl Unpin for TaskGroup
impl UnwindSafe for TaskGroup
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request