Class: Google::Apis::BatchV1::Runnable
- Inherits:
-
Object
- Object
- Google::Apis::BatchV1::Runnable
- 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
Runnable describes instructions for executing a specific script or container as part of a Task.
Instance Attribute Summary collapse
-
#always_run ⇒ Boolean
(also: #always_run?)
By default, after a Runnable fails, no further Runnable are executed.
-
#background ⇒ Boolean
(also: #background?)
Normally, a runnable that doesn't exit causes its task to fail.
-
#barrier ⇒ Google::Apis::BatchV1::Barrier
A barrier runnable automatically blocks the execution of subsequent runnables until all the tasks in the task group reach the barrier.
-
#container ⇒ Google::Apis::BatchV1::Container
Container runnable.
-
#display_name ⇒ String
Optional.
-
#environment ⇒ Google::Apis::BatchV1::Environment
An Environment describes a collection of environment variables to set when executing Tasks.
-
#ignore_exit_status ⇒ Boolean
(also: #ignore_exit_status?)
Normally, a runnable that returns a non-zero exit status fails and causes the task to fail.
-
#labels ⇒ Hash<String,String>
Labels for this Runnable.
-
#script ⇒ Google::Apis::BatchV1::Script
Script runnable.
-
#timeout ⇒ String
Timeout for this Runnable.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Runnable
constructor
A new instance of Runnable.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Runnable
Returns a new instance of Runnable.
2149 2150 2151 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2149 def initialize(**args) update!(**args) end |
Instance Attribute Details
#always_run ⇒ Boolean Also known as: always_run?
By default, after a Runnable fails, no further Runnable are executed. This
flag indicates that this Runnable must be run even if the Task has already
failed. This is useful for Runnables that copy output files off of the VM or
for debugging. The always_run flag does not override the Task's overall
max_run_duration. If the max_run_duration has expired then no further
Runnables will execute, not even always_run Runnables.
Corresponds to the JSON property alwaysRun
2083 2084 2085 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2083 def always_run @always_run end |
#background ⇒ Boolean Also known as: background?
Normally, a runnable that doesn't exit causes its task to fail. However, you
can set this field to true to configure a background runnable. Background
runnables are allowed continue running in the background while the task
executes subsequent runnables. For example, background runnables are useful
for providing services to other runnables or providing debugging-support tools
like SSH servers. Specifically, 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 background
2098 2099 2100 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2098 def background @background end |
#barrier ⇒ Google::Apis::BatchV1::Barrier
A barrier runnable automatically blocks the execution of subsequent runnables
until all the tasks in the task group reach the barrier.
Corresponds to the JSON property barrier
2105 2106 2107 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2105 def @barrier end |
#container ⇒ Google::Apis::BatchV1::Container
Container runnable.
Corresponds to the JSON property container
2110 2111 2112 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2110 def container @container end |
#display_name ⇒ String
Optional. DisplayName is an optional field that can be provided by the caller.
If provided, it will be used in logs and other outputs to identify the script,
making it easier for users to understand the logs. If not provided the index
of the runnable will be used for outputs.
Corresponds to the JSON property displayName
2118 2119 2120 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2118 def display_name @display_name 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
2124 2125 2126 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2124 def environment @environment end |
#ignore_exit_status ⇒ Boolean Also known as: ignore_exit_status?
Normally, a runnable that returns a non-zero exit status fails and causes the
task to fail. However, you can set this field to true to allow the task to
continue executing its other runnables even if this runnable fails.
Corresponds to the JSON property ignoreExitStatus
2131 2132 2133 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2131 def ignore_exit_status @ignore_exit_status end |
#labels ⇒ Hash<String,String>
Labels for this Runnable.
Corresponds to the JSON property labels
2137 2138 2139 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2137 def labels @labels end |
#script ⇒ Google::Apis::BatchV1::Script
Script runnable.
Corresponds to the JSON property script
2142 2143 2144 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2142 def script @script end |
#timeout ⇒ String
Timeout for this Runnable.
Corresponds to the JSON property timeout
2147 2148 2149 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2147 def timeout @timeout end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2154 def update!(**args) @always_run = args[:always_run] if args.key?(:always_run) @background = args[:background] if args.key?(:background) @barrier = args[:barrier] if args.key?(:barrier) @container = args[:container] if args.key?(:container) @display_name = args[:display_name] if args.key?(:display_name) @environment = args[:environment] if args.key?(:environment) @ignore_exit_status = args[:ignore_exit_status] if args.key?(:ignore_exit_status) @labels = args[:labels] if args.key?(:labels) @script = args[:script] if args.key?(:script) @timeout = args[:timeout] if args.key?(:timeout) end |