public sealed class TaskSpec : IMessage<TaskSpec>, IEquatable<TaskSpec>, IDeepCloneable<TaskSpec>, IBufferMessage, IMessage
Reference documentation and code samples for the Batch v1 API class TaskSpec.
Spec of a task
Implements
IMessage<TaskSpec>, IEquatable<TaskSpec>, IDeepCloneable<TaskSpec>, IBufferMessage, IMessageNamespace
Google.Cloud.Batch.V1Assembly
Google.Cloud.Batch.V1.dll
Constructors
TaskSpec()
public TaskSpec()
TaskSpec(TaskSpec)
public TaskSpec(TaskSpec other)
Parameter | |
---|---|
Name | Description |
other | TaskSpec |
Properties
ComputeResource
public ComputeResource ComputeResource { get; set; }
ComputeResource requirements.
Property Value | |
---|---|
Type | Description |
ComputeResource |
Environment
public Environment Environment { get; set; }
Environment variables to set before running the Task.
Property Value | |
---|---|
Type | Description |
Environment |
Environments
[Obsolete]
public MapField<string, string> Environments { get; }
Deprecated: please use environment(non-plural) instead.
Property Value | |
---|---|
Type | Description |
MapField<String, String> |
LifecyclePolicies
public RepeatedField<LifecyclePolicy> LifecyclePolicies { get; }
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.
Property Value | |
---|---|
Type | Description |
RepeatedField<LifecyclePolicy> |
MaxRetryCount
public int MaxRetryCount { get; set; }
Maximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10].
Property Value | |
---|---|
Type | Description |
Int32 |
MaxRunDuration
public Duration MaxRunDuration { get; set; }
Maximum duration the task should run. The task will be killed and marked as FAILED if over this limit.
Property Value | |
---|---|
Type | Description |
Duration |
Runnables
public RepeatedField<Runnable> Runnables { get; }
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.
Property Value | |
---|---|
Type | Description |
RepeatedField<Runnable> |
Volumes
public RepeatedField<Volume> Volumes { get; }
Volumes to mount before running Tasks using this TaskSpec.
Property Value | |
---|---|
Type | Description |
RepeatedField<Volume> |