A TaskGroup defines one or more Tasks that all share the same
TaskSpec.
Attributes
Name
Description
name
str 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".
MutableSequence[google.cloud.batch_v1.types.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
int 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
Classes
SchedulingPolicy
SchedulingPolicy(value)
How Tasks in the TaskGroup should be scheduled relative to
each other.
Tasks might be executed in parallel depending on parallelism
and task_count values.
IN_ORDER (2):
Run Tasks sequentially with increased task
index.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class TaskGroup (0.17.36)\n\nVersion latestkeyboard_arrow_down\n\n- [0.17.36 (latest)](/python/docs/reference/batch/latest/google.cloud.batch_v1.types.TaskGroup)\n- [0.17.35](/python/docs/reference/batch/0.17.35/google.cloud.batch_v1.types.TaskGroup)\n- [0.16.0](/python/docs/reference/batch/0.16.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.15.0](/python/docs/reference/batch/0.15.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.14.0](/python/docs/reference/batch/0.14.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.13.0](/python/docs/reference/batch/0.13.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.12.0](/python/docs/reference/batch/0.12.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.11.0](/python/docs/reference/batch/0.11.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.10.0](/python/docs/reference/batch/0.10.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.9.0](/python/docs/reference/batch/0.9.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.8.1](/python/docs/reference/batch/0.8.1/google.cloud.batch_v1.types.TaskGroup)\n- [0.7.0](/python/docs/reference/batch/0.7.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.6.0](/python/docs/reference/batch/0.6.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.5.0](/python/docs/reference/batch/0.5.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.4.1](/python/docs/reference/batch/0.4.1/google.cloud.batch_v1.types.TaskGroup)\n- [0.3.2](/python/docs/reference/batch/0.3.2/google.cloud.batch_v1.types.TaskGroup)\n- [0.2.0](/python/docs/reference/batch/0.2.0/google.cloud.batch_v1.types.TaskGroup)\n- [0.1.2](/python/docs/reference/batch/0.1.2/google.cloud.batch_v1.types.TaskGroup) \n\n TaskGroup(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nA TaskGroup defines one or more Tasks that all share the same\nTaskSpec.\n\nClasses\n-------\n\n### SchedulingPolicy\n\n SchedulingPolicy(value)\n\nHow Tasks in the TaskGroup should be scheduled relative to\neach other. \n\n Tasks might be executed in parallel depending on parallelism\n and task_count values.\n IN_ORDER (2):\n Run Tasks sequentially with increased task\n index."]]