Class TaskSpec (0.19.0) Stay organized with collections Save and categorize content based on your preferences.
TaskSpec(mapping=None,*,ignore_unknown_fields=False,**kwargs)Spec of a task
Attributes | |
|---|---|
| Name | Description |
runnables | MutableSequence[google.cloud.batch_v1.types.Runnable]Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions: - The runnable exited with a zero status. - The runnable didn't finish, but you enabled its background subfield. - The runnable exited with a non-zero status, but you enabled itsignore_exit_status subfield. |
compute_resource | google.cloud.batch_v1.types.ComputeResourceComputeResource requirements. |
max_run_duration | google.protobuf.duration_pb2.DurationMaximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s—for example,3600s for 1 hour. The field accepts any value between 0 and the maximum listed for theDuration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration. |
max_retry_count | intMaximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10]. |
lifecycle_policies | MutableSequence[google.cloud.batch_v1.types.LifecyclePolicy]Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count. |
environments | MutableMapping[str, str]Deprecated: please use environment(non-plural) instead. |
volumes | MutableSequence[google.cloud.batch_v1.types.Volume]Volumes to mount before running Tasks using this TaskSpec. |
environment | google.cloud.batch_v1.types.EnvironmentEnvironment variables to set before running the Task. |
Classes
EnvironmentsEntry
EnvironmentsEntry(mapping=None,*,ignore_unknown_fields=False,**kwargs)The abstract base class for a message.
| Parameters | |
|---|---|
| Name | Description |
kwargs | dictKeys and values corresponding to the fields of the message. |
mapping | Union[dict,A dictionary or message to be used to determine the values for this message. |
ignore_unknown_fields | Optional(bool)If True, do not raise errors for unknown fields. Only applied if |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-04 UTC.