Class: Google::Apis::LifesciencesV2beta::Action
- Inherits:
-
Object
- Object
- Google::Apis::LifesciencesV2beta::Action
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/lifesciences_v2beta/classes.rb,
lib/google/apis/lifesciences_v2beta/representations.rb,
lib/google/apis/lifesciences_v2beta/representations.rb
Overview
Specifies a single action that runs a Docker container.
Instance Attribute Summary collapse
-
#always_run ⇒ Boolean
(also: #always_run?)
By default, after an action fails, no further actions are run.
-
#block_external_network ⇒ Boolean
(also: #block_external_network?)
Prevents the container from accessing the external network.
-
#commands ⇒ Array<String>
If specified, overrides the
CMD
specified in the container. -
#container_name ⇒ String
An optional name for the container.
-
#credentials ⇒ Google::Apis::LifesciencesV2beta::Secret
Holds encrypted information that is only decrypted and stored in RAM by the worker VM when running the pipeline.
-
#disable_image_prefetch ⇒ Boolean
(also: #disable_image_prefetch?)
All container images are typically downloaded before any actions are executed.
-
#disable_standard_error_capture ⇒ Boolean
(also: #disable_standard_error_capture?)
A small portion of the container's standard error stream is typically captured and returned inside the
ContainerStoppedEvent
. -
#enable_fuse ⇒ Boolean
(also: #enable_fuse?)
Enable access to the FUSE device for this action.
-
#encrypted_environment ⇒ Google::Apis::LifesciencesV2beta::Secret
Holds encrypted information that is only decrypted and stored in RAM by the worker VM when running the pipeline.
-
#entrypoint ⇒ String
If specified, overrides the
ENTRYPOINT
specified in the container. -
#environment ⇒ Hash<String,String>
The environment to pass into the container.
-
#ignore_exit_status ⇒ Boolean
(also: #ignore_exit_status?)
Normally, a non-zero exit status causes the pipeline to fail.
-
#image_uri ⇒ String
Required.
-
#labels ⇒ Hash<String,String>
Labels to associate with the action.
-
#mounts ⇒ Array<Google::Apis::LifesciencesV2beta::Mount>
A list of mounts to make available to the action.
-
#pid_namespace ⇒ String
An optional identifier for a PID namespace to run the action inside.
-
#port_mappings ⇒ Hash<String,Fixnum>
A map of containers to host port mappings for this container.
-
#publish_exposed_ports ⇒ Boolean
(also: #publish_exposed_ports?)
Exposes all ports specified by
EXPOSE
statements in the container. -
#run_in_background ⇒ Boolean
(also: #run_in_background?)
This flag allows an action to continue running in the background while executing subsequent actions.
-
#timeout ⇒ String
The maximum amount of time to give the action to complete.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Action
constructor
A new instance of Action.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Action
Returns a new instance of Action.
231 232 233 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 231 def initialize(**args) update!(**args) end |
Instance Attribute Details
#always_run ⇒ Boolean Also known as: always_run?
By default, after an action fails, no further actions are run. This flag
indicates that this action must be run even if the pipeline has already failed.
This is useful for actions that copy output files off of the VM or for
debugging. Note that no actions will be run if image prefetching fails.
Corresponds to the JSON property alwaysRun
65 66 67 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 65 def always_run @always_run end |
#block_external_network ⇒ Boolean Also known as: block_external_network?
Prevents the container from accessing the external network.
Corresponds to the JSON property blockExternalNetwork
71 72 73 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 71 def block_external_network @block_external_network end |
#commands ⇒ Array<String>
If specified, overrides the CMD
specified in the container. If the container
also has an ENTRYPOINT
the values are used as entrypoint arguments.
Otherwise, they are used as a command and arguments to run inside the
container.
Corresponds to the JSON property commands
80 81 82 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 80 def commands @commands end |
#container_name ⇒ String
An optional name for the container. The container hostname will be set to this
name, making it useful for inter-container communication. The name must
contain only upper and lowercase alphanumeric characters and hyphens and
cannot start with a hyphen.
Corresponds to the JSON property containerName
88 89 90 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 88 def container_name @container_name end |
#credentials ⇒ Google::Apis::LifesciencesV2beta::Secret
Holds encrypted information that is only decrypted and stored in RAM by the
worker VM when running the pipeline.
Corresponds to the JSON property credentials
94 95 96 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 94 def credentials @credentials end |
#disable_image_prefetch ⇒ Boolean Also known as: disable_image_prefetch?
All container images are typically downloaded before any actions are executed.
This helps prevent typos in URIs or issues like lack of disk space from
wasting large amounts of compute resources. If set, this flag prevents the
worker from downloading the image until just before the action is executed.
Corresponds to the JSON property disableImagePrefetch
102 103 104 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 102 def disable_image_prefetch @disable_image_prefetch end |
#disable_standard_error_capture ⇒ Boolean Also known as: disable_standard_error_capture?
A small portion of the container's standard error stream is typically captured
and returned inside the ContainerStoppedEvent
. Setting this flag disables
this functionality.
Corresponds to the JSON property disableStandardErrorCapture
110 111 112 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 110 def disable_standard_error_capture @disable_standard_error_capture end |
#enable_fuse ⇒ Boolean Also known as: enable_fuse?
Enable access to the FUSE device for this action. Filesystems can then be
mounted into disks shared with other actions. The other actions do not need
the enable_fuse
flag to access the mounted filesystem. This has the effect
of causing the container to be executed with CAP_SYS_ADMIN
and exposes /dev/
fuse
to the container, so use it only for containers you trust.
Corresponds to the JSON property enableFuse
120 121 122 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 120 def enable_fuse @enable_fuse end |
#encrypted_environment ⇒ Google::Apis::LifesciencesV2beta::Secret
Holds encrypted information that is only decrypted and stored in RAM by the
worker VM when running the pipeline.
Corresponds to the JSON property encryptedEnvironment
127 128 129 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 127 def encrypted_environment @encrypted_environment end |
#entrypoint ⇒ String
If specified, overrides the ENTRYPOINT
specified in the container.
Corresponds to the JSON property entrypoint
132 133 134 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 132 def entrypoint @entrypoint end |
#environment ⇒ Hash<String,String>
The environment to pass into the container. This environment is merged with
values specified in the google.cloud.lifesciences.v2beta.Pipeline message,
overwriting any duplicate values. In addition to the values passed here, a few
other values are automatically injected into the environment. These cannot be
hidden or overwritten. GOOGLE_PIPELINE_FAILED
will be set to "1" if the
pipeline failed because an action has exited with a non-zero status (and did
not have the IGNORE_EXIT_STATUS
flag set). This can be used to determine if
additional debug or logging actions should execute. GOOGLE_LAST_EXIT_STATUS
will be set to the exit status of the last non-background action that executed.
This can be used by workflow engine authors to determine whether an
individual action has succeeded or failed.
Corresponds to the JSON property environment
147 148 149 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 147 def environment @environment end |
#ignore_exit_status ⇒ Boolean Also known as: ignore_exit_status?
Normally, a non-zero exit status causes the pipeline to fail. This flag allows
execution of other actions to continue instead.
Corresponds to the JSON property ignoreExitStatus
153 154 155 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 153 def ignore_exit_status @ignore_exit_status end |
#image_uri ⇒ String
Required. The URI to pull the container image from. Note that all images
referenced by actions in the pipeline are pulled before the first action runs.
If multiple actions reference the same image, it is only pulled once, ensuring
that the same image is used for all actions in a single pipeline. The image
URI can be either a complete host and image specification (e.g., quay.io/
biocontainers/samtools), a library and image name (e.g., google/cloud-sdk) or
a bare image name ('bash') to pull from the default library. No schema is
required in any of these cases. If the specified image is not public, the
service account specified for the Virtual Machine must have access to pull the
images from GCR, or appropriate credentials must be specified in the google.
cloud.lifesciences.v2beta.Action.credentials field.
Corresponds to the JSON property imageUri
169 170 171 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 169 def image_uri @image_uri end |
#labels ⇒ Hash<String,String>
Labels to associate with the action. This field is provided to assist workflow
engine authors in identifying actions (for example, to indicate what sort of
action they perform, such as localization or debugging). They are returned in
the operation metadata, but are otherwise ignored.
Corresponds to the JSON property labels
177 178 179 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 177 def labels @labels end |
#mounts ⇒ Array<Google::Apis::LifesciencesV2beta::Mount>
A list of mounts to make available to the action. In addition to the values
specified here, every action has a special virtual disk mounted under /google
that contains log files and other operational components. - /google/logs All
logs written during the pipeline execution. - /google/logs/output The combined
standard output and standard error of all actions run as part of the pipeline
execution. - /google/logs/action//stdout The complete contents of each
individual action's standard output. - /google/logs/action//stderr The
complete contents of each individual action's standard error output.
Corresponds to the JSON property mounts
189 190 191 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 189 def mounts @mounts end |
#pid_namespace ⇒ String
An optional identifier for a PID namespace to run the action inside. Multiple
actions should use the same string to share a namespace. If unspecified, a
separate isolated namespace is used.
Corresponds to the JSON property pidNamespace
196 197 198 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 196 def pid_namespace @pid_namespace end |
#port_mappings ⇒ Hash<String,Fixnum>
A map of containers to host port mappings for this container. If the container
already specifies exposed ports, use the PUBLISH_EXPOSED_PORTS
flag instead.
The host port number must be less than 65536. If it is zero, an unused random
port is assigned. To determine the resulting port number, consult the
ContainerStartedEvent
in the operation metadata.
Corresponds to the JSON property portMappings
205 206 207 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 205 def port_mappings @port_mappings end |
#publish_exposed_ports ⇒ Boolean Also known as: publish_exposed_ports?
Exposes all ports specified by EXPOSE
statements in the container. To
discover the host side port numbers, consult the ACTION_STARTED
event in the
operation metadata.
Corresponds to the JSON property publishExposedPorts
212 213 214 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 212 def publish_exposed_ports @publish_exposed_ports end |
#run_in_background ⇒ Boolean Also known as: run_in_background?
This flag allows an action to continue running in the background while
executing subsequent actions. This is useful to provide services to other
actions (or to provide debugging support tools like SSH servers).
Corresponds to the JSON property runInBackground
220 221 222 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 220 def run_in_background @run_in_background end |
#timeout ⇒ String
The maximum amount of time to give the action to complete. If the action fails
to complete before the timeout, it will be terminated and the exit status will
be non-zero. The pipeline will continue or terminate based on the rules
defined by the ALWAYS_RUN
and IGNORE_EXIT_STATUS
flags.
Corresponds to the JSON property timeout
229 230 231 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 229 def timeout @timeout end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/google/apis/lifesciences_v2beta/classes.rb', line 236 def update!(**args) @always_run = args[:always_run] if args.key?(:always_run) @block_external_network = args[:block_external_network] if args.key?(:block_external_network) @commands = args[:commands] if args.key?(:commands) @container_name = args[:container_name] if args.key?(:container_name) @credentials = args[:credentials] if args.key?(:credentials) @disable_image_prefetch = args[:disable_image_prefetch] if args.key?(:disable_image_prefetch) @disable_standard_error_capture = args[:disable_standard_error_capture] if args.key?(:disable_standard_error_capture) @enable_fuse = args[:enable_fuse] if args.key?(:enable_fuse) @encrypted_environment = args[:encrypted_environment] if args.key?(:encrypted_environment) @entrypoint = args[:entrypoint] if args.key?(:entrypoint) @environment = args[:environment] if args.key?(:environment) @ignore_exit_status = args[:ignore_exit_status] if args.key?(:ignore_exit_status) @image_uri = args[:image_uri] if args.key?(:image_uri) @labels = args[:labels] if args.key?(:labels) @mounts = args[:mounts] if args.key?(:mounts) @pid_namespace = args[:pid_namespace] if args.key?(:pid_namespace) @port_mappings = args[:port_mappings] if args.key?(:port_mappings) @publish_exposed_ports = args[:publish_exposed_ports] if args.key?(:publish_exposed_ports) @run_in_background = args[:run_in_background] if args.key?(:run_in_background) @timeout = args[:timeout] if args.key?(:timeout) end |