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
  • Live Contexts
  • env context
  • flow context
  • project context
  • images context
  • multi context
  • params context
  • tags context
  • volumes context
  • git context

Was this helpful?

  1. Workflow syntax
  2. Live workflow syntax

Live contexts

PreviousLive workflow syntaxNextBatch workflow syntax

Last updated 7 months ago

Was this helpful?

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

Live Contexts

Context name
Description

env

flow

project

images

multi

params

tags

volumes

git

env context

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

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.

flow context

The flow context 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

images context

Property name
Type
Description

images.<image-id>.id

str

images.<image-id>.ref

str

images.<image-id>.context

LocalPath or None

The context directory used for building the image or None if the context is not set. The path is relative to the flow's root (flow.workspace property).

images.<image-id>.full_context_path

LocalPath or None

The absolute path, pointing to the context folder if set.

images.<image-id>.dockerfile

LocalPathor None

A path to Dockerfile or None if not set.

images.<image-id>.full_dockerfile_path

LocalPath or None

Full version of the dockerfile attribute.

images.<image-id>.build_args

list[str]

A sequence of additional build arguments.

images.<image-id>.env

dict[str, str]

Environment variables passed to the image builder.

images.<image-id>.volumes

list[str]

A sequence of volume definitions passed to the image builder.

multi context

The additional arguments passed to multi-job.

Property name
Type
Description

multi.args

str

Additional command line arguments passed to multi-job. The command line run defines the field as apolo-flow run <job-id> -- <args>.

multi.suffix

str

params context

Property name
Type
Description

params.<param-name>

str

The value of a specific parameter.

Supported parameter values: project, flow, env, tags, volumes, images.

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

LocalPathor None

A path in the workspace folder to synchronize with remote Apolo storage or None if not set.

volumes.<volume-id>.full_local_path

LocalPath or None

Full version of local property.

volumes.<volume-id>.ref

str

The value is assembled from 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.

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.

Contains environment variables set in a workflow or a job. For more information, see .

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

Information about the project. See for details.

Contains a mapping of images on the Apolo registry. See for details.

Multi-job context. For more information, see .

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

A set of job tags set in a workflow or a job. See for details.

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

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

The workflow's ID. It's automatically generated based on the workflow's YAML filename with a dropped suffix (this will always 'live' in live mode). 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 title. Set the attribute to override the auto-generated 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.

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

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

The image reference. For more information, see attribute.

For more information, see .

For more information, see .

For more information, see .

For more information, see .

For more information, see

multi.args is mainly used for passing args to command line parameters accepted by multi-job, see for details.

multi-job suffix added to .

Parameter described in the and available for substitution - for example, in calculation.

Tags are combined from system tags (project:<project-id>, job:<job-id>), flow default tags (see ), and job-specific tags (see jobs.<job-id>.tags attribute).

Contains information about volumes defined in the of a live 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 .

For more information, see .

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

env context
flow context
project context
images context
multi context
params context
tags context
volumes context
git context
the project configuration
the project configuration
project.id
project.id
the project configuration
project.project_name
live workflow
Live workflow syntax
images section
jobs.<job-id>.params attribute
jobs.<job-id>.cmd
defaults.tags attribute
volumes section
flow.id
flow.title
images.<image-id>
images.<image-id>.ref
images.<image-id>.context attribute
images.<image-id>.dockerfile attribute
images.<image-id>.build_args attribute
images.<image-id>.env attribute
images.<image-id>.volumes attribute.
jobs.<job-id>.cmd
jobs.<job-id>
volumes.<volume-id> section
volumes.<volume-id>.remote attribute
volumes.<volume-id>.mount attribute
volumes.<volume-id>.read_only attribute
volumes.<volume-id>.local attribute
jobs.<job-id>.volumes item