CLI tracking
Track shell commands and log results from existing scripts.
Use the embedl-hub CLI to record results from shell scripts or track an
existing command as a run. It works with the same projects as the Python client.
Complete SDK setup first.
ehub is a shorter name for the same command. Use --help on any command to see
its options.
Start and finish a run#
embedl-hub run start --type eval --name "Evaluate classifier" --use
embedl-hub log param model_id classifier_int8_v1
embedl-hub log tag sample_data true
embedl-hub log metric accuracy 0.92 --step 1
embedl-hub run finish
embedl-hub run url --use selects the new run in your workspace, so the commands that
follow apply to it without naming it. The run stays open until you finish it,
and stays selected until you select another run or deselect it with embedl-hub use clear run. The values are illustrative; replace them with
measurements from your own work.
A script that tracks several runs at once can name each run instead. run start prints the new run’s ID; store it and pass it to the commands for that run:
run=$(embedl-hub run start --type eval --name "Evaluate classifier")
embedl-hub log metric --run "$run" accuracy 0.92 --step 1 run finish finishes the run selected with --use or embedl-hub use run,
unless you pass it an explicit run ID, as in run finish "$run". Add --failed or --killed when the work did not complete:
embedl-hub run finish --failed Wrap an existing command#
embedl-hub exec --type eval COMMAND Replace COMMAND with the command you already run, such as python evaluate.py or ./evaluate.sh. exec starts a run, runs the command,
and finishes the run based on the command’s outcome.
If the command is a Python script, the script picks up the run with client.use_context_run() and logs to it, instead of starting a second run. A
shell script logs to the run with embedl-hub log. In both cases exec remains responsible for finishing the run. It passes the run and its project to
the command through EMBEDL_HUB_RUN and EMBEDL_HUB_PROJECT.
exec --safe is the CLI’s only safe-mode switch. See Safe integration for its
behavior and how to handle logging inside the command.
A job can run with a key of the team’s service account rather than a person’s. A
pending run created by a person and adopted with --use-pending-run still
names the person; a run the job creates names the service account.
Queue log entries#
Use a batch to collect log entries locally and send them together. Create a run and select it before starting a batch:
embedl-hub run start --type eval --use
embedl-hub batch start --name "Evaluation metrics" --use
embedl-hub log metric accuracy 0.92 --step 1
embedl-hub log param dataset validation_v1
embedl-hub batch show
embedl-hub batch send
embedl-hub run finish Batch entries stay on the local machine until sent successfully. Starting and
finishing a run still requires a connection. Use batch list to find local
queues and batch discard to remove one you no longer need.
Inspect recorded work#
embedl-hub run list
embedl-hub run show RUN_ID
embedl-hub run url RUN_ID run list shows running, pending, and finished runs by default, and reports
when failed or killed runs are hidden. Use --failed for only failed and killed
runs, or --all for every status. run list and run show support --json.
A run ID is enough to find a run, whichever project or directory you are in.
With --project, the command also confirms that the run is in that project.
To correct a run afterward, for example to link it to the run it builds on or
to describe what changed, use run update:
embedl-hub run update RUN_ID --parent PARENT_RUN_ID
embedl-hub run update RUN_ID --description "Retrained on validation_v2" --no-parent removes the parent link, and an empty --description clears the
description.
Command groups#
| Command | Purpose |
|---|---|
| init | Create a workspace. |
| auth | Store the API key for a Hub. |
| use | Choose the Hub, project, run, or batch to work with. |
| status | Show what is in use and where it comes from. |
| run | Create, finish, inspect, and update runs. |
| exec | Wrap an existing command in a run. |
| log | Record metrics, parameters, tags, links, artifacts, and dashboards. |
| batch | Queue and send log entries. |
Next steps#
- Explore results to inspect the runs you recorded.