Google Cloud Batch V1 Client - Class Runnable (1.1.2)

Reference documentation and code samples for the Google Cloud Batch V1 Client class Runnable.

Runnable describes instructions for executing a specific script or container as part of a Task.

Generated from protobuf message google.cloud.batch.v1.Runnable

Namespace

Google \ Cloud \ Batch \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ container Google\Cloud\Batch\V1\Runnable\Container

Container runnable.

↳ script Google\Cloud\Batch\V1\Runnable\Script

Script runnable.

↳ barrier Google\Cloud\Batch\V1\Runnable\Barrier

Barrier runnable.

↳ 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.

↳ ignore_exit_status bool

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.

↳ background bool

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.

↳ always_run bool

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.

↳ environment Google\Cloud\Batch\V1\Environment

Environment variables for this Runnable (overrides variables set for the whole Task or TaskGroup).

↳ timeout Google\Protobuf\Duration

Timeout for this Runnable.

↳ labels array|Google\Protobuf\Internal\MapField

Labels for this Runnable.

getContainer

Container runnable.

Returns
Type Description
Google\Cloud\Batch\V1\Runnable\Container|null

hasContainer

setContainer

Container runnable.

Parameter
Name Description
var Google\Cloud\Batch\V1\Runnable\Container
Returns
Type Description
$this

getScript

Script runnable.

Returns
Type Description
Google\Cloud\Batch\V1\Runnable\Script|null

hasScript

setScript

Script runnable.

Parameter
Name Description
var Google\Cloud\Batch\V1\Runnable\Script
Returns
Type Description
$this

getBarrier

Barrier runnable.

Returns
Type Description
Google\Cloud\Batch\V1\Runnable\Barrier|null

hasBarrier

setBarrier

Barrier runnable.

Parameter
Name Description
var Google\Cloud\Batch\V1\Runnable\Barrier
Returns
Type Description
$this

getDisplayName

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.

Returns
Type Description
string

setDisplayName

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.

Parameter
Name Description
var string
Returns
Type Description
$this

getIgnoreExitStatus

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.

Returns
Type Description
bool

setIgnoreExitStatus

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.

Parameter
Name Description
var bool
Returns
Type Description
$this

getBackground

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.

Returns
Type Description
bool

setBackground

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.

Parameter
Name Description
var bool
Returns
Type Description
$this

getAlwaysRun

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.

Returns
Type Description
bool

setAlwaysRun

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.

Parameter
Name Description
var bool
Returns
Type Description
$this

getEnvironment

Environment variables for this Runnable (overrides variables set for the whole Task or TaskGroup).

Returns
Type Description
Google\Cloud\Batch\V1\Environment|null

hasEnvironment

clearEnvironment

setEnvironment

Environment variables for this Runnable (overrides variables set for the whole Task or TaskGroup).

Parameter
Name Description
var Google\Cloud\Batch\V1\Environment
Returns
Type Description
$this

getTimeout

Timeout for this Runnable.

Returns
Type Description
Google\Protobuf\Duration|null

hasTimeout

clearTimeout

setTimeout

Timeout for this Runnable.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

getLabels

Labels for this Runnable.

Returns
Type Description
Google\Protobuf\Internal\MapField

setLabels

Labels for this Runnable.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getExecutable

Returns
Type Description
string