TaskSpec(mapping=None, *, ignore_unknown_fields=False, **kwargs)
Spec of a task
Attributes
Name | Description |
runnables |
Sequence[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 |
google.cloud.batch_v1.types.ComputeResource
ComputeResource requirements. |
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 |
Sequence[google.cloud.batch_v1.types.LifecyclePolicy]
Lifecycle management schema when any task in a task group is failed. The valid size of lifecycle policies are [0, 10]. For each lifecycle policy, when the condition is met, the action in that policy will execute. If there are multiple policies that the task execution result matches, we use the action from the first matched policy. If task execution result does not meet with any of 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 |
Mapping[str, str]
Environment variables to set before running the Task. You can set up to 100 environments. |
volumes |
Sequence[google.cloud.batch_v1.types.Volume]
Volumes to mount before running Tasks using this TaskSpec. |
environment |
google.cloud.batch_v1.types.Environment
Environment variables to set before running the Task. |
Inheritance
builtins.object > proto.message.Message > TaskSpecClasses
EnvironmentsEntry
EnvironmentsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)
The abstract base class for a message.
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 |