CommandsRun
run
Usage: polyaxon run [OPTIONS]
Run polyaxonfile specification.
Symlink handling: /docs/iterative-process/iterate-with-cli-local-code/#directory-upload-symlinks
Examples:
$ polyaxon run -f file -f file_override ...
Run and set description and tags for this run
$ polyaxon run -f file --description="Description of the current run" --tags="foo, bar, moo"
Run and set a unique name for this run
polyaxon run --name=foo
Run for a specific project
$ polyaxon run -p project1 -f file.yaml
Run with updated params
$ polyaxon run -p project1 -f file.yaml -P param1=234.2 -P param2=relu
Flags such as -P and --queue apply after the files and inline options
$ polyaxon run -f file.yaml -f override.yaml -P lr=0.1 --queue gpu-b
Run an image without a polyaxonfile
$ polyaxon run --image busybox:1.36 --cmd 'echo "$MESSAGE"' --env MESSAGE=hello --cpu 500m..1 --memory 512Mi..1Gi
Change the resources of a polyaxonfile, inline options apply after the files
$ polyaxon run -f file.yaml --cpu 2 --memory 4Gi
Start a sandbox service, or enable the sandbox on a service polyaxonfile
$ polyaxon run --sandbox --image python:3.12
$ polyaxon run -f service.yaml --sandbox
If a python file contains a component main, you can run that component
$ polyaxon run -pm path/to/my-component.py
If a python file contains more than one component, you can specify the
component to run
$ polyaxon run -pm path/to/my-component.py:componentA
Uploading current folder to the default uploads path
$ polyaxon run ... -u
Uploading from a subfolder to a custom path
$ polyaxon run ... -u -u-from ./code -u-to code
Uploading the contents of symlinks whose targets are inside the upload
directory
$ polyaxon run ... -u --symlink-mode resolve-safe
Mounting multiple paths using -m
$ polyaxon run ... -m ./src:code -m ./data:datasets -m ./models
Options:
-p, --project TEXT The project name, e.g. 'mnist' or
'acme/mnist'.
-f, --file PATH The polyaxonfiles to run.
-pm, --python-module TEXT The python module containing the
polyaxonfile to run.
--url TEXT The url containing the polyaxonfile to run.
--hub TEXT The Component Hub name containing the
polyaxonfile to run.
--image TEXT The image to run, shortcut for `container:
{image: ...}`. Without -f/-pm/--url/--hub,
the run is defined inline and the default
polyaxonfile is not read; use `-f
polyaxonfile.yaml --image ...` to change its
image. Inline options apply after the files.
--cmd TEXT A shell line to run, shortcut for `cmd`. Can
be specified multiple times; the lines run
as one /bin/sh script with `set -e`.
--env NAME=VALUE An environment variable of the main
container, shortcut for `env`. Can be
specified multiple times.
--cpu TEXT CPU request, or request..limit, shortcut for
`resources.cpu`, e.g. `500m..1`.
--memory TEXT Memory request, or request..limit, shortcut
for `resources.memory`, e.g. `512Mi..1Gi`.
--gpu TEXT GPU count, or request..limit, shortcut for
`resources.gpu`, e.g. `1`.
--port, --ports TEXT Ports to expose, shortcut for
`service.ports`; a run without a runtime
becomes a service. Comma-separated values,
can be specified multiple times, e.g.
`--ports 80,443`.
--sandbox Enable `plugins.sandbox` (exec, filesystem
and PTY API) on a service run. Without
-f/-pm/--url/--hub or a default
polyaxonfile, the inline run is a service;
other kinds and matrix runs are rejected,
never converted. It does not change which
polyaxonfile is read.
-n, --name TEXT Name to give to this run, must be unique
within the project, could be none.
--tags TEXT Tags of this run (comma separated values).
--description TEXT The description to give to this run.
-s, --shell To start a shell session after scheduling
the run.
-l, --log, --logs To start logging after scheduling the run.
-u, --upload Upload the current working directory to
run's artifacts path as an init context
before scheduling the run. Uploads to
'uploads/' by default.
-m, --mount TEXT Mount local paths to run artifacts. Syntax:
'./src:dest' or './src' (defaults to
'uploads/' destination). Can be specified
multiple times. Examples: -m ./code -m
./data:datasets -m ./models:models
-u-from, --upload-from TEXT The path to upload from relative the current
location (or absolute path), Note that this
must be a valid path, or the CLI will raise
an error. Defaults to the current path.
-u-to, --upload-to TEXT The path to upload to relative the run's
root context.To upload to root path you can
use `/`, otherwise the values should start
without the separator, e.g. `uploads`,
`code`, `dataset/images/values`, ...
--symlink-mode [resolve-safe|skip|error|resolve-all]
Directory uploads via --upload or mounts:
skip omits links; resolve-safe uploads
internal target contents; resolve-all also
includes external targets; error rejects
links. Skipped links are reported in a
warning. [default: skip]
--symlink-report-limit INTEGER RANGE
Maximum symlinks listed per directory
upload. Use 0 for totals only. [default:
20; x>=0]
-w, --watch To start statuses watch loop after
scheduling the run.
--local To start the run locally, with `docker`
environment as default.
-exc, --executor TEXT The local executor to use, possible values
are: docker, k8s, process.
-P, --params, --param NAME=VALUE
A parameter to override the default params
of the run, form `-P name=value` or `--param
name=value`.
--strict-params / --no-strict-params
Set the operation's strict parameter policy.
Strict mode requires undeclared params to
set contextOnly: true. Defaults to the
specification's policy; a strict component
remains strict.
-HP, --hparams, --hparam NAME=VALUE
A hyper-parameter to override the default
params of the run, form: -HP
name='range:start:stop:step' or -HP
name='range:[start,stop,step]' or -HP
name='choice:[v1,v2,v3,...]'
--matrix-kind TEXT Matrix kind if hparams are provided, default
grid.
--matrix-concurrency INTEGER Matrix concurrency if hparams are provided,
default 1.
--matrix-num-runs INTEGER Matrix maximum number of runs to create,
default all.
--presets TEXT Name of the presets to use for this run.
-q, --queue TEXT Name of the queue to use for this run. If
the name is not namespaced by the agent name
the default agent is used: queue-name or
agent-name/queue-name
-ns, --namespace TEXT Namespace to use for this run. By default it
will use the agent's namespace.
--nocache [DEPRECATED] Please use '--cache=f' instead.
Disable cache check before starting this
operation.
--cache TEXT To enable/disable cache check before
starting this operation, similar to 'cache:
{disable: true/false}'. Can be used with
yes/no, y/n, false/true, f/t, 1/0. e.g. '--
cache=1', '--cache=yes', '--cache=false', '
--cache=t', ...
-ap, --approved TEXT To enable/disable human in the loop
validation without changing the
polyaxonfile, similar to 'isApproved:
true/false'. Can be used with yes/no, y/n,
false/true, f/t, 1/0. e.g. '--approved=1', '
--approved=yes', '--approved=false', '--
approved=t', ...
-aa, --approve-after INTEGER To delay or automatically approve a run
after a certain number of seconds.
--git-preset A flag to enable automatic injection of a
git initializer as a preset using the
initialized git connection.
--git-revision TEXT If provided, Polyaxon will use this git
revision instead of trying to detected and
use the latest commit. The git revision
could be a commit or a branch or any valid
tree-ish. This flag is only used when the
repo is initialized with: `polyaxon init
[--git-connection] [--git-url]`
--ignore-template If provided, Polyaxon will ignore template
definition and submit the manifest to be
checked by the API.
-o, --output TEXT Optional flag to print the response as a
json object or store the response as json
file.Example `-o json` or `-o
path=./data.json`
--help Show this message and exit.