Class: Google::Apis::BatchV1::TaskSpec
- Inherits:
-
Object
- Object
- Google::Apis::BatchV1::TaskSpec
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/batch_v1/classes.rb,
lib/google/apis/batch_v1/representations.rb,
lib/google/apis/batch_v1/representations.rb
Overview
Spec of a task
Instance Attribute Summary collapse
-
#compute_resource ⇒ Google::Apis::BatchV1::ComputeResource
Compute resource requirements Corresponds to the JSON property
computeResource. -
#environment ⇒ Google::Apis::BatchV1::Environment
An Environment describes a collection of environment variables to set when executing Tasks.
-
#environments ⇒ Hash<String,String>
Deprecated: please use environment(non-plural) instead.
-
#lifecycle_policies ⇒ Array<Google::Apis::BatchV1::LifecyclePolicy>
Lifecycle management schema when any task in a task group is failed.
-
#max_retry_count ⇒ Fixnum
Maximum number of retries on failures.
-
#max_run_duration ⇒ String
Maximum duration the task should run.
-
#runnables ⇒ Array<Google::Apis::BatchV1::Runnable>
The sequence of scripts or containers to run for this Task.
-
#volumes ⇒ Array<Google::Apis::BatchV1::Volume>
Volumes to mount before running Tasks using this TaskSpec.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TaskSpec
constructor
A new instance of TaskSpec.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ TaskSpec
Returns a new instance of TaskSpec.
1937 1938 1939 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1937 def initialize(**args) update!(**args) end |
Instance Attribute Details
#compute_resource ⇒ Google::Apis::BatchV1::ComputeResource
Compute resource requirements
Corresponds to the JSON property computeResource
1885 1886 1887 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1885 def compute_resource @compute_resource end |
#environment ⇒ Google::Apis::BatchV1::Environment
An Environment describes a collection of environment variables to set when
executing Tasks.
Corresponds to the JSON property environment
1891 1892 1893 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1891 def environment @environment end |
#environments ⇒ Hash<String,String>
Deprecated: please use environment(non-plural) instead.
Corresponds to the JSON property environments
1896 1897 1898 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1896 def environments @environments end |
#lifecycle_policies ⇒ Array<Google::Apis::BatchV1::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.
Corresponds to the JSON property lifecyclePolicies
1906 1907 1908 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1906 def lifecycle_policies @lifecycle_policies end |
#max_retry_count ⇒ Fixnum
Maximum number of retries on failures. The default, 0, which means never retry.
The valid value range is [0, 10].
Corresponds to the JSON property maxRetryCount
1912 1913 1914 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1912 def max_retry_count @max_retry_count end |
#max_run_duration ⇒ String
Maximum duration the task should run. The task will be killed and marked as
FAILED if over this limit.
Corresponds to the JSON property maxRunDuration
1918 1919 1920 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1918 def max_run_duration @max_run_duration end |
#runnables ⇒ Array<Google::Apis::BatchV1::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.
Corresponds to the JSON property runnables
1930 1931 1932 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1930 def runnables @runnables end |
#volumes ⇒ Array<Google::Apis::BatchV1::Volume>
Volumes to mount before running Tasks using this TaskSpec.
Corresponds to the JSON property volumes
1935 1936 1937 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1935 def volumes @volumes end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 |
# File 'lib/google/apis/batch_v1/classes.rb', line 1942 def update!(**args) @compute_resource = args[:compute_resource] if args.key?(:compute_resource) @environment = args[:environment] if args.key?(:environment) @environments = args[:environments] if args.key?(:environments) @lifecycle_policies = args[:lifecycle_policies] if args.key?(:lifecycle_policies) @max_retry_count = args[:max_retry_count] if args.key?(:max_retry_count) @max_run_duration = args[:max_run_duration] if args.key?(:max_run_duration) @runnables = args[:runnables] if args.key?(:runnables) @volumes = args[:volumes] if args.key?(:volumes) end |