TaskSpec
(
mapping
=
None
,
*
,
ignore_unknown_fields
=
False
,
**
kwargs
)
Spec of a task
Attributes
Name
Description
runnables
MutableSequence[ google.cloud.batch_v1.types.Runnable
]
The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.
compute_resource
max_run_duration
google.protobuf.duration_pb2.Duration
Maximum duration the task should run. The task will be killed and marked as FAILED if over this limit.
max_retry_count
int
Maximum 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
Classes
EnvironmentsEntry
EnvironmentsEntry
(
mapping
=
None
,
*
,
ignore_unknown_fields
=
False
,
**
kwargs
)
The abstract base class for a message.
Parameters
Name
Description
kwargs
dict
Keys and values corresponding to the fields of the message.
mapping
Union[dict, .Message
]
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 mapping
is a mapping type or there are keyword parameters.