Batch v1 API - Class TaskSpec (2.1.0)

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

Inheritance

object > TaskSpec

Namespace

Google.Cloud.Batch.V1

Assembly

Google.Cloud.Batch.V1.dll

Constructors

TaskSpec()

public TaskSpec()

TaskSpec(TaskSpec)

public TaskSpec(TaskSpec other)
Parameter
NameDescription
otherTaskSpec

Properties

ComputeResource

public ComputeResource ComputeResource { get; set; }

ComputeResource requirements.

Property Value
TypeDescription
ComputeResource

Environment

public Environment Environment { get; set; }

Environment variables to set before running the Task.

Property Value
TypeDescription
Environment

Environments

[Obsolete]
public MapField<string, string> Environments { get; }

Deprecated: please use environment(non-plural) instead.

Property Value
TypeDescription
MapFieldstringstring

LifecyclePolicies

public RepeatedField<LifecyclePolicy> LifecyclePolicies { get; }

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.

Property Value
TypeDescription
RepeatedFieldLifecyclePolicy

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
TypeDescription
int

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
TypeDescription
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
TypeDescription
RepeatedFieldRunnable

Volumes

public RepeatedField<Volume> Volumes { get; }

Volumes to mount before running Tasks using this TaskSpec.

Property Value
TypeDescription
RepeatedFieldVolume