Appearance
systemslab context monitor
| Description | Block until a context reaches a terminal state, printing a line each time one of its attached experiments finishes. |
|---|---|
| Usage | systemslab context monitor [OPTIONS] <UUID> |
Description
The systemslab context monitor command waits for a context to reach a terminal state (complete or cancelled) instead of requiring a script to poll systemslab context show in a loop. This is the right command to wait on a matrix submit (systemslab submit against a TOML matrix, or several systemslab submit --context <id> calls), where the interesting unit of completion is the whole context rather than any single experiment.
As each attached experiment finishes, it prints a line such as:
experiment my-benchmark-variant-2 (018f9c57-...): successWhen the context itself reaches a terminal state (complete or cancelled), it prints a final summary line and exits:
Context my-sweep (018f9c57-...): complete (success)<name> is whatever name the context was given at systemslab context new/submit time, and <status> is the aggregate outcome across all attached experiments: success, failure, error, cancelled, or empty (no experiments were attached).
The command exits 0 only if the context's final status is success or empty. Any other status, or the --timeout deadline elapsing first, causes it to exit non-zero -- so it can be used directly to gate a script:
bash
systemslab context monitor "$CONTEXT_ID" && echo "sweep passed"On a real terminal failure the Context ... summary line above is still printed to stdout before the non-zero exit, so a script can tell that outcome apart from a --timeout giveup, which instead prints a "timed out" error to stderr and no summary line (the context is still running -- run the command again to keep waiting).
Rather than polling on a timer, this subscribes to the same server-push channel the web UI uses and only re-checks the context when the server reports that it may have changed.
Options
| Option | Default | Description |
|---|---|---|
<UUID> | The context ID. | |
--timeout <TIMEOUT> | Wait indefinitely | Give up and exit non-zero if the context has not reached a terminal state within this many seconds. The context itself keeps running on the server -- only this command's wait gives up, and it can be run again to keep waiting. |
Common Options
| Option | Default | Description |
|---|---|---|
--systemslab-url | The URL at which to access the systemslab server. | |
--color | auto | Controls when color is used in the output. Possible values are auto, always, and never. |
--output-format | long | Output format to use when outputting messages. long will result output designed to be human-readable while short is short output meant to be used within scripts. |
Environment Variables
| Variable | Description |
|---|---|
SYSTEMSLAB_URL | Specify the URL used to contact the SystemsLab server. Equivalent to --systemslab-url. |