Gradient Actions
Last updated
Last updated
Gradient Actions are composable building blocks for creating reproducible machine learning Workflows. Actions use the uses
and with
syntax to specify how a job step executes.
The Gradient Action called container@v1
allows you to use an arbitrary Docker container image (in this case the lightweight bash
container image) and pass arguments directly to it.
If you want to run multiple commands, the script@v1
action allows you to pass a script
in a denoted by |-
. The pipe character will preserve newlines and the dash will remove extra newlines after the block.
Note: The image you provide will need to have bash
available in its PATH.
In this example, the Gradient Action git-checkout@v1
clones the public GitHub URL https://github.com/user/my-public-repo
at ref 46aa...
into a volume named repo
. The cloned files are accessible at /outputs/<output-name>
(in this case, /outputs/repo
), and subsequent jobs that specify the checkout job's volume as an input can also access the repository files as read-only at /inputs/<input-name>
.
You can also use path
to pick an output target:
The s3-download@v1
Gradient Action copies the contents of an Amazon S3 bucket into an output (in this example, the volume is named s3
). Subsequent jobs that specify an input that reference the s3-download
job's volume output can access the downloaded files within that job at /inputs/<input-name>
.
Note: To clone a private repository, add your username as a parameter, with a value, and add a password parameter:
Note: access-key
and secret-access-key
are required parameters, and the latter must be a . Optional parameters include region
(for AWS buckets), endpoint
(for non-AWS buckets), and path
(to disambiguate target outputs or to download to a subfolder).
In this example, the create-model@v1
action takes a dataset input named model
and outputs a string ID (named model-id
) that references a . With this reference, the created model can be tested, edited, or deployed in future jobs.