Workflow Spec
Key Concepts
defaults
defaultsinputs
inputsjobs
jobsSample Workflow Spec
defaults:
# default environment variables for all jobs, can use any supported
# substitution syntax (named secrets, ephemeral secrets, etc...)
env:
HELLO: secret:hello
# default instance type for all jobs
resources:
instance-type: metal-cpu
# workflow takes two inputs, neither of which have defaults. This means that
# when the workflow is run corresponding input corresponding for these values
# are required, example:
#
# {"inputs": {"echo": {"value": "hello world"}, "data": {"id": "test-one"}}}
#
inputs:
data:
type: dataset
echo:
type: string
jobs:
job-1:
# These are inputs for the "job-1" job, they are "aliases" to the
# workflow inputs
#
# All inputs are placed in the "/inputs/<name>" path of the run
# containers. So for this job we would have the paths "/inputs/data"
# and "/inputs/echo".
inputs:
# The "/inputs/data" directory would contain the contents for the dataset
# version.
data: workflow.inputs.data
# The "/inputs/echo" file would contain the string of the workflow input
# "echo".
echo: workflow.inputs.echo
# These are outputs for the "job-1" job.
#
# All outputs are read from the "/outputs/<name>" path.
outputs:
# A directory will automatically be created for output datasets and
# any content written to that directory will be committed to a newly
# created dataset version when the jobs completes.
data2:
type: dataset
with:
id: test-two
# The container is responsible creating th file "/outputs/<name>" with the
# content being a small-ish utf-8 encoded string.
echo2:
type: string
# Set job specific environment variables
env:
FOOBAR: test
# Set action
uses: container@v1
# Set action arguments
with:
args:
- bash
- -c
- find /inputs/data > /outputs/data2/list.txt; echo ENV $HELLO $FOOBAR > /outputs/echo2
image: bash:5
job-2:
inputs:
# these inputs use job-1 outputs instead of workflow inputs, you must
# specify job-1 in the needs section to reference them here
data2: job-1.outputs.data2
echo2: job-1.outputs.echo2
outputs:
data3:
type: dataset
with:
id: test-three
# List of job-id's that must complete before this job runs
needs:
- job-1
uses: container@v1
with:
args:
- bash
- -c
- wc -l /inputs/data2/list.txt > /outputs/data3/summary.txt
image: bash:5Example Workflow Run Output
Last updated