Class: Google::Apis::BatchV1::Runnable

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Runnable

Returns a new instance of Runnable.



1928
1929
1930
# File 'lib/google/apis/batch_v1/classes.rb', line 1928

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#always_runBoolean 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

Returns:

  • (Boolean)


1879
1880
1881
# File 'lib/google/apis/batch_v1/classes.rb', line 1879

def always_run
  @always_run
end

#backgroundBoolean Also known as: background?

This flag allows a Runnable to continue running in the background while the Task executes subsequent Runnables. This is useful to provide services to other Runnables (or to provide debugging support tools like SSH servers). Corresponds to the JSON property background

Returns:

  • (Boolean)


1887
1888
1889
# File 'lib/google/apis/batch_v1/classes.rb', line 1887

def background
  @background
end

#barrierGoogle::Apis::BatchV1::Barrier

Barrier runnable blocks until all tasks in a taskgroup reach it. Corresponds to the JSON property barrier



1893
1894
1895
# File 'lib/google/apis/batch_v1/classes.rb', line 1893

def barrier
  @barrier
end

#containerGoogle::Apis::BatchV1::Container

Container runnable. Corresponds to the JSON property container



1898
1899
1900
# File 'lib/google/apis/batch_v1/classes.rb', line 1898

def container
  @container
end

#environmentGoogle::Apis::BatchV1::Environment

An Environment describes a collection of environment variables to set when executing Tasks. Corresponds to the JSON property environment



1904
1905
1906
# File 'lib/google/apis/batch_v1/classes.rb', line 1904

def environment
  @environment
end

#ignore_exit_statusBoolean Also known as: ignore_exit_status?

Normally, a non-zero exit status causes the Task to fail. This flag allows execution of other Runnables to continue instead. Corresponds to the JSON property ignoreExitStatus

Returns:

  • (Boolean)


1910
1911
1912
# File 'lib/google/apis/batch_v1/classes.rb', line 1910

def ignore_exit_status
  @ignore_exit_status
end

#labelsHash<String,String>

Labels for this Runnable. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


1916
1917
1918
# File 'lib/google/apis/batch_v1/classes.rb', line 1916

def labels
  @labels
end

#scriptGoogle::Apis::BatchV1::Script

Script runnable. Corresponds to the JSON property script



1921
1922
1923
# File 'lib/google/apis/batch_v1/classes.rb', line 1921

def script
  @script
end

#timeoutString

Timeout for this Runnable. Corresponds to the JSON property timeout

Returns:

  • (String)


1926
1927
1928
# File 'lib/google/apis/batch_v1/classes.rb', line 1926

def timeout
  @timeout
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
# File 'lib/google/apis/batch_v1/classes.rb', line 1933

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)
  @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