Reference documentation and code samples for the Google Cloud Batch V1 Client class TaskSpec.
Spec of a task
Generated from protobuf message google.cloud.batch.v1.TaskSpec
Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ runnables
array< Google\Cloud\Batch\V1\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
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
array< Google\Cloud\Batch\V1\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
array|Google\Protobuf\Internal\MapField
Environment variables to set before running the Task. You can set up to 100 environments.
↳ volumes
↳ environment
getRunnables
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.
Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8;
Google\Protobuf\Internal\RepeatedField
setRunnables
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.
Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8;
$this
getComputeResource
ComputeResource requirements.
Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3;
hasComputeResource
clearComputeResource
setComputeResource
ComputeResource requirements.
Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3;
$this
getMaxRunDuration
Maximum duration the task should run.
The task will be killed and marked as FAILED if over this limit.
Generated from protobuf field .google.protobuf.Duration max_run_duration = 4;
Google\Protobuf\Duration|null
hasMaxRunDuration
clearMaxRunDuration
setMaxRunDuration
Maximum duration the task should run.
The task will be killed and marked as FAILED if over this limit.
Generated from protobuf field .google.protobuf.Duration max_run_duration = 4;
var
Google\Protobuf\Duration
$this
getMaxRetryCount
Maximum number of retries on failures.
The default, 0, which means never retry. The valid value range is [0, 10].
Generated from protobuf field int32 max_retry_count = 5;
int
setMaxRetryCount
Maximum number of retries on failures.
The default, 0, which means never retry. The valid value range is [0, 10].
Generated from protobuf field int32 max_retry_count = 5;
var
int
$this
getLifecyclePolicies
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.
Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9;
Google\Protobuf\Internal\RepeatedField
setLifecyclePolicies
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.
Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9;
$this
getEnvironments
Environment variables to set before running the Task.
You can set up to 100 environments.
Generated from protobuf field map<string, string> environments = 6 [deprecated = true];
Google\Protobuf\Internal\MapField
setEnvironments
Environment variables to set before running the Task.
You can set up to 100 environments.
Generated from protobuf field map<string, string> environments = 6 [deprecated = true];
var
array|Google\Protobuf\Internal\MapField
$this
getVolumes
Volumes to mount before running Tasks using this TaskSpec.
Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7;
Google\Protobuf\Internal\RepeatedField
setVolumes
Volumes to mount before running Tasks using this TaskSpec.
Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7;
$this
getEnvironment
Environment variables to set before running the Task.
Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10;
hasEnvironment
clearEnvironment
setEnvironment
Environment variables to set before running the Task.
Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10;
$this