cosmos-runThe one command an experimenter needs. Everything it does could be done with a long ansible-playbook invocation; the point is that nobody should have to know that invocation, or know Ansible at all, to run an experiment.
usage: cosmos-run [-h] [--version] [-i INVENTORY] [--resolve-only] [--check]
[--skip-reservation-check] [--detach] [--status [RUN_ID]]
[--tail N] [-e EXTRA_VARS] [--vault-password-file VAULT]
[--ask-vault-pass] [-v]
[description]
The positional argument is either a path, or a name relative to the experiment directories — the short form is what the tutorials use:
cosmos-run sdr/ofdm-ber-sb5.description.yml # packaged, or your own copy
cosmos-run ocudu-soft # a tutorial package's description, by name
cosmos-run ./my-experiment.yml # a path, anywhere
A name is looked up in these directories, nearest first, and the first match wins:
| Order | Directory |
|---|---|
| 1 | each directory in $COSMOS_EXPERIMENTS_PATH (colon-separated, optional) |
| 2 | the current directory |
| 3 | ~/cosmos-experiments |
| 4 | /usr/share/cosmos-experiments (the installed packages) |
In each directory four spellings are tried: the name as given, <name>.description.yml, <name>/<name>.description.yml and <name>/<name>.yml (the last three only when the name does not already end in .yml). Your copy therefore wins, which is how you edit an experiment without root. When your copy differs from the packaged one, cosmos-run prints a warning naming both files, because a forgotten copy keeps winning after the package is fixed. A name that matches nothing is reported with every directory listed. cosmos-tutorial list shows every description the packages install, under DESCRIPTION (run: cosmos-run <name>).
| Option | What it does |
|---|---|
--resolve-only |
Answer "could this run here, and on which nodes" and stop. Reads only the inventory, touches no hardware, and needs no reservation. |
--check |
Dry run. Reports what each step would do without doing it. Destructive steps — imaging above all — never execute. |
--skip-reservation-check |
Start without asking the scheduler whether you may run here (see Reservations). |
--detach |
Start the run in its own session and return the prompt. The experiment survives logging out. |
--status [RUN_ID] |
List recorded runs and their state, or show one in detail with the tail of its log. Starts nothing, needs no reservation. |
--tail N |
Lines of log to show with --status RUN_ID (default 40). |
-e, --extra-vars |
Override a parameter. Repeatable. -e sub=qpsk, or JSON for structure. A name the description does not declare is refused. |
-i, --inventory |
Use a different inventory config. Rarely needed. |
--version |
Print the version and the path in use — see below. |
--vault-password-file, --ask-vault-pass |
Supply a vault password for encrypted values. |
-v |
More output. Repeat for more still. |
-- |
Everything after it goes to ansible-playbook. Put it first after the description (cosmos-run x.yml -- --limit node1-1): if a cosmos-run option such as --check comes before it, the -- itself is passed on too and ansible-playbook rejects it (unrecognized arguments: --). |
That last one matters: the wrapper is a convenience, not a cage. When you need something it does not expose, it is still ansible-playbook underneath.
--detach, then --statusA sweep can run for hours, and a foreground cosmos-run dies with your SSH session — a closed laptop or a dropped VPN takes the experiment with it. Anything longer than a coffee break should be detached:
cosmos-run fr3/ofdm-ber.description.yml --detach
It prints three lines, in this form (the ID is from a real grid run):
detached: grid-20261101T050212Z-h9s7a3
log /home/seskar/cosmos-runs/ofdm-drive-probe-grid-x310/grid-20261101T050212Z-h9s7a3/console.log
status cosmos-run --status grid-20261101T050212Z-h9s7a3
The run ID is <domain>-<UTC time>-<six random characters>: where the run was started, when, and a random part that keeps two runs started in the same second on two consoles apart. Come back whenever — and from whichever console you happen to reach, because ~/cosmos-runs is in your home directory, which every console shares:
cosmos-run --status
RUN STATE ELAPSED WHERE
grid-20261101T050212Z-h9s7a3 succeeded 0:03:42 console.grid.cosmos-lab.org
grid-20261101T045940Z-65e766 failed 0:01:06 console.grid.cosmos-lab.org
ofdm-ber-fr2-20261002T231054Z succeeded 0:09:54 console.sb1.cosmos-lab.org
The last line is a detached run from before the 2026-10-30 run-ID change; those still live in ~/cosmos-artifacts/ and are still listed. The list holds detached runs only: they are the ones that write run.state.json, which is what --status reads. A foreground run never appears here.
Five states, and the last two are the ones worth understanding:
| State | Meaning |
|---|---|
running |
The recorded process is alive on this console. |
succeeded / failed |
It finished, and the exit status was recorded. |
killed |
It was terminated — normally your reservation expiring, not a crash. |
died |
It claimed to be running and its process is gone. Nothing recorded an outcome, so the stored state was stale and is reported as such. |
running? |
Started on a different console. Process IDs are per-machine, so the claim cannot be checked from here — it is not guessed at. |
cosmos-run --status <run-id> adds the detail and the tail of the log (--tail 0 for none):
cosmos-run --status grid-20261101T050212Z-h9s7a3 --tail 0
run grid-20261101T050212Z-h9s7a3
state succeeded
experiment ofdm-drive-probe-grid-x310
description /usr/share/cosmos-experiments/sdr/ofdm-drive-probe-grid-x310.description.yml
started 2026-11-01T05:02:12Z (0:03:42 elapsed)
finished 2026-11-01T05:05:55Z rc=0
host console.grid.cosmos-lab.org pid 1856856
artifacts /home/seskar/cosmos-runs/ofdm-drive-probe-grid-x310/grid-20261101T050212Z-h9s7a3
Scripting a wait? The state line has no colon: it reads
state succeeded. Test it withcosmos-run --status <id> --tail 0 | awk '/^state/{print $2}', acceptsucceeded,failed,killedanddiedas finished, and give the loop a deadline.
Do not wrap
cosmos-runinnohup … &yourself. That was the old habit;--detachreplaces it, and unlike a barenohupit records why a run stopped, hands the playbook a chance to run its teardown first, and leaves a status any console can read.
A sweep writes each measured point to its results file as it is taken, not at the end. If a run is cut short — a timeout, an interrupt, an expiring reservation — every point already measured is still there and still a valid CSV.
--resolve-only is the one to try firstIt is the cheapest possible question and the most useful early answer:
seskar@console-grid:~$ cosmos-run sdr/ofdm-ber-grid.description.yml --resolve-only
"msg": "ofdm-ber-grid on grid: tx=node18-2.grid.cosmos-lab.org; rx=node18-19.grid.cosmos-lab.org "
localhost : ok=10 changed=0 unreachable=0 failed=0 skipped=1
Because it consults only the read-only inventory, you can use it to explore what a sandbox can support before booking time on it, and to check a description you are writing without owning any hardware yet.
--check before anything destructive--check is the rehearsal. Imaging is the reason it exists: an experiment that requests an image will reimage a node, and a node's contents are not yours to assume.
cosmos-run sdr/ofdm-ber-sb4.description.yml --check
Steps that cannot be simulated are skipped and say so rather than failing — a dry run reports what would happen, so a clean --check is meaningful.
Anything under parameters: in the description. Each value is checked against the declared type, and a name the description does not declare is refused, so a typo such as -e ampltude=0.06 stops the run instead of being silently ignored. Variables starting cosmos_ or ansible_, and @file arguments, pass through to Ansible unchecked:
# simple values
cosmos-run sdr/ofdm-ber-sb5.description.yml -e sub=qpsk -e amplitude=0.06
# lists and structures need JSON
cosmos-run sdr/ofdm-drive-probe-sb4.description.yml \
-e '{"amplitudes": [0.02, 0.04, 0.06, 0.08]}'
Overriding one parameter can invalidate another. Transmit drive is per modulation, not a global setting: an amplitude that is right for BPSK will destroy a QPSK constellation, and the resulting BER sits flat near 0.1 no matter what else you change. If you change
sub, revisitamplitude— see the drive window in the OFDM laboratory.
--version prints a path on purposeThe collection can be installed twice — system-wide by the package, and per-user in ~/.ansible/collections, which comes first on the search path. So "which version is installed" is an ambiguous question, and the honest answer names the copy that will actually run:
seskar@console-grid:~$ cosmos-run --version
cosmos-run (cosmos_lab.orchestration 0.1.0)
loaded from: /usr/share/ansible/collections/ansible_collections/cosmos_lab/orchestration
ansible-playbook [core 2.16.3]
When a per-user copy is shadowing the packaged one, a shadowing: line names it. Anyone debugging "my fix did not take effect" is almost always looking at this.
Before Ansible starts, cosmos-run asks the scheduler whether you may use this console's domain now. Without a reservation it refuses and exits with status 3:
cosmos-run: refusing to start '<experiment>'. Reserve <domain> first (the portal Scheduler), or pass --skip-reservation-check if you know better.
--check and --resolve-only change no hardware, so they are never refused. (--check still mints a run ID and creates an empty ~/cosmos-runs/<experiment>/<run-id>/; only --resolve-only creates nothing.) Root, users with a wildcard host entry and sysadmins are exempt. Domains without a scheduler (osc, rrail, nebula) are not refused.
0 on success, 3 when the reservation check refused the run. Any other non-zero status means the experiment failed, the description could not be resolved onto hardware, or the description itself is invalid — the message distinguishes them, and a resolution failure names what was wanted and what was found. See resources and feasibility.
~/cosmos-runs/<experiment>/<run-id>/, containing whatever collect: named (one directory per node), run.json and a verbatim copy of the description that ran. A run started with --detach also gets console.log and run.state.json, and only those runs appear in --status; a foreground run prints to your terminal and keeps no log. If every node fails in the execute stage, run.json and the description copy are not written either (the record play never runs), so for a run you may need to debug, use --detach. Files on the nodes go under /var/tmp/cosmos/<run-id>/. The site can move the results root with runs_dir: in /etc/cosmos/cosmos.yml, and you can with $COSMOS_RUNS_DIR. See artifacts and reproducibility.
Last verified: 2026-08-03 on console.grid.cosmos-lab.org. Updated 2026-11-05 for engine 0.1.0-389 (run IDs and ~/cosmos-runs, the reservation check, checked -e, name lookup): options and --status output re-checked on console.grid; corrected the same day against the code (four name spellings, -- placement, detached-only state files, no record for a run that fails in execute); no experiment re-run.