Overview
Polyaxonfiles can have names, descriptions, and tags both on the component level and on the operation level to override the component values. When scheduling files with Polyaxon CLI, whether they contain a component or an operation, users might want to schedule a run with different names, descriptions and/or tags. Instead of manually opening the file and changing the values, saving the file, closing the file, and then executing the run command, users can pass those values directly via the CLI.
Passing custom name, description, and tags
In order to provide a custom name
polyaxon run -f ... --name new-runpolyaxon run -f ... --name new-run --description adding-some-changes -u -lpolyaxon run -f ... --name another-name --description run-with-custom-connection --tags tests,debugNames from params
A Polyaxonfile name can reference params:
name: train-{{ optimizer }}-{{ lr }}
params:
optimizer: {value: adam}
lr: {value: 0.01}
component:
inputs:
- {name: optimizer, type: str}
- {name: lr, type: float}
run: ...This run is named train-adam-0_01. Polyaxon renders the name once, when the run is created:
- The name can use params with literal values and input defaults.
- The name can also use the globals that are set when the run is created, such as the project name, the username, the run uuid and the creation date:
name: "{{ globals.project_name }}-{{ globals.created_at.strftime('%Y%m%d') }}-{{ lr }}". - Nothing else is available, including values from another run, a join or the matrix, params whose value is itself a template, and globals that are set later such as
globals.namespace. Creating the run fails with an error that names the variable. - Each run of characters other than letters, digits,
_and-becomes one_, and leading or trailing_and-are removed. Creating the run fails if nothing is left. A result longer than 128 characters is cut to fit and ends in--. - Quote the name when it starts with a template:
name: "{{ lr }}-train". --nametakes precedence and is used as is.- Restart, copy, and resume keep the name, even when params change. Pass
--nameto rename the run. - Scheduled runs take the parent's name, including any uuid or date rendered in it.
- Matrix runs take the parent's name followed by a suffix: a short id by default, or your own with
matrix.nameSuffix. - Operation names inside a DAG can use params too, including values the operation gets from the DAG's inputs. Other operations reference it by its name as written, see DAG operations.
Default names
When neither the CLI nor the Polyaxonfile sets a name, Polyaxon generates a two-word name such as curious-otter.
Generated names can repeat; the run's UUID identifies it.
For more details about this command please run
polyaxon run --help, or check the command reference