Apolo
HomeConsoleGitHub
  • Apolo concepts
  • CLI Reference
  • Examples/Use Cases
  • Flow CLI
  • Actions Reference
  • Apolo Extras CLI
  • Python SDK
  • Workflows
  • Workflow syntax
    • Expression syntax
    • Live workflow syntax
      • Live contexts
    • Batch workflow syntax
      • Batch contexts
      • Batch workflow commands
    • Project configuration syntax
    • Actions syntax
      • Actions contexts
  • CLI reference
  • Expression functions
  • Mixins
  • Modules
Powered by GitBook
On this page
  • Batch Contexts
  • flow context
  • project context
  • params context
  • env context
  • tags context
  • volumes context
  • images context
  • strategy context
  • matrix context
  • needs context
  • git context

Was this helpful?

  1. Workflow syntax
  2. Batch workflow syntax

Batch contexts

PreviousBatch workflow syntaxNextBatch workflow commands

Last updated 7 months ago

Was this helpful?

This page describes contexts the can use in expressions for calculating YAML attribute values.

Batch Contexts

Context name
Description

flow

project

params

env

tags

volumes

images

strategy

matrix

needs

git

flow context

The flowcontext contains information about the workflow: its ID, title, etc.

Property name
Type
Description

flow.flow_id

str

flow.project_id

str

flow.workspace

LocalPath

A path to the workspace (the root folder of the flow).

flow.title

str

flow.username

str

Name of user who executed the workflow run.

project context

The projectcontext contains information about the project: its ID, owner, etc.

Property name
Type
Description

project.id

str

project.owner

str

project.project_name

str

params context

Property name
Type
Description

params.<param-name>

str

The value of a specific parameter.

env context

The env context syntax allows you to use the value of an environment variable in your workflow file. If you want to use the value of an environment variable inside a job, use your operating system's standard method for reading environment variables.

Property name
Type
Description

env.<env-name>

str

The value of a specific environment variable.

tags context

A set of job tags.

Property name
Type
Description

tags

set[str]

This context changes for each job. You can access this context from any job.

volumes context

Property name
Type
Description

volumes.<volume-id>.id

str

volumes.<volume-id>.remote

URL

volumes.<volume-id>.mount

RemotePath

The path inside a job by which the volume should be mounted.

volumes.<volume-id>.read_only

bool

True if the volume is mounted in read-only mode, False otherwise.

volumes.<volume-id>.local

None

In batch workflows, this property is always None.

volumes.<volume-id>.full_local_path

LocalPath or None

Full version of local property.

volumes.<volume-id>.ref

str

The value is assembled from the remote, mount, and read_only properties.

volumes.<volume-id>.ref_ro

str

Like ref but read-only mode is enforced.

volumes.<volume-id>.ref_rw

str

Like ref but read-write mode is enforced.

images context

Property name
Type
Description

images.<image-id>.id

str

images.<image-id>.ref

str

images.<image-id>.context

None

In batch workflows, this property is always None.

images.<image-id>.full_context_path

None

In batch workflows, this property is always None.

images.<image-id>.dockerfile

None

In batch workflows, this property is always None.

images.<image-id>.full_dockerfile_path

None

In batch workflows, this property is always None.

images.<image-id>.build_args

list[str]

In batch workflows, this property is always [](empty list).

images.<image-id>.env

dict[str, str]

In batch workflows, this property is always {}(empty dict).

images.<image-id>.volumes

list[str]

In batch workflows, this property is always [](empty list).

strategy context

Property name
Type
Description

strategy.fail_fast

bool

strategy.max_parallel

int

matrix context

Property name
Type
Description

matrix.<param-name>

bool or int or float or str or None

The matrix parameter value for the current combination.

needs context

Property name
Type
Description

needs.<task-id>.result

str

State of the completed task <task-id>. Can be one of the following: "succedded", "failed", "cancelled", "skipped".

needs.<task-id>.outputs.<output-name>

str

The value of the <output-name> output produced by the <task-id> task.

git context

The git context contains a mapping of your flow's workspace to a git repository.

This context can only be used if the flow's workspace is inside some git repository.

Property name
Type
Description

git.sha

str

SHA of the current commit.

git.branch

str

Name of the current branch.

git.tags

list[str]

List of tags that point to the current commit.

Information about the main workflow settings, defaults, etc. See for details.

Information about the project. See for details.

A mapping of global workflow parameters. For more information, see

Contains environment variables set in workflow defaults. For more information, see .

A set of job tags set in workflow defaults. See for details.

Contains a mapping of volume definitions. For more information, see .

Contains a mapping of docker images from . See for details.

Contains information about strategies from . See for details.

Contains combination data generated by the . See for details.

Contains outputs generated by tasks from . See for details.

A mapping of the flow's workspace to a git repository. For more information, see .

The workflow's ID. It is automatically generated based on the workflow's YAML filename with a dropped suffix. You can override the property by setting the attribute.

The project's ID. It is automatically generated based on the name of the flow folder. You can override it using attribute. Check for details.

The workflow's title. Set the attribute to override the auto-calculated value.

The project's ID. It is automatically generated based on the name of the flow folder. You can override it using attribute. Check for details. This context property is an alias to flow.project_id .

The project's owner. See also: .

The platform project name. Set the attribute to override the auto-calculated value.

Parameter described in the .

The env context contains environment variables that have been set in the . For more information about setting environment variables in your workflow, see "."

Tags available in this context are combined from system tags (project:<project-id>, flow:<flow-id>, task:<task-id>), and flow default tags (see ).

Contains information about volumes defined in the of a batch workflow.

The volume definition identifier. For more information, see .

Remote volume URI, e.g. storage:path/to. For more information, see .

For more information, see .

For more information, see .

A volume reference that can be used as a . The calculated value looks like storage:path/to:/mnt/path:rw.

Contains information about images defined in the of a batch workflow.

The image definition identifier. For more information, see section.

The image reference. For more information, see attribute.

Contains information about some strategies of execution set in the .

Task failure processing strategy. For more information, see attribute.

The maximum number of tasks that can be executed at the same time. For more information, see attribute.

Contains parameters from a combination generated by the attribute.

Contains outputs generated by tasks that were specified in the attribute. Refer to the reference to learn how to generate outputs.

Batch workflow
flow context
project context
params context.
env context
tags context
volumes context
git context
the project configuration
the project configuration
images context
strategy context
matrix context
needs context
project.id
project.id
the project configuration
project.project_name
defaults.tags attribute
set-output command
params attribute
workflow defaults
Batch workflow syntax
volumes section
images section
flow defaults
tasks.strategy.matrix
tasks.needs
workflow config
flow defaults
tasks.strategy.matrix
tasks.needs
flow.id
flow.title
volumes.<volume-id> section
volumes.<volume-id>.remote attribute
volumes.<volume-id>.mount attribute
volumes.<volume-id>.read_only attribute
task.volumes item
images.<image-id>
images.<image-id>.ref
defaults.fail_fast
defaults.max_parallel