Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wicket] command-line interface to mupdate (#4062)
## Overview Implement a command-line interface to mupdates, with an eye to using this in CI. To achieve this, add two commands to wicket: ### `rack-update start` This command starts mupdates on one or more components. The help looks like: ``` Start one or more running updates Usage: wicket rack-update start [OPTIONS] Options: -h, --help Print help (see more with '--help') Component selectors: --sled <SLED> The sleds to operate on --switch <SWITCH> The switches to operate on --psc <PSC> The PSCs to operate on Update options: --force-update-rot Force update the RoT even if the version is the same --force-update-sp Force update the SP even if the version is the same -d, --detach Detach after starting the update Global options: --color <COLOR> Color output [default: auto] [possible values: auto, always, never] ``` ### `rack-update attach` This command attaches to any existing mupdates on one or more components. The help looks like: ``` Attach to one or more running updates Usage: wicket rack-update attach [OPTIONS] Options: -h, --help Print help (see more with '--help') Component selectors: --sled <SLED> The sleds to operate on --switch <SWITCH> The switches to operate on --psc <PSC> The PSCs to operate on Global options: --color <COLOR> Color output [default: auto] [possible values: auto, always, never] ``` ### What does this look like? Here's a screenshot: ![image](https://github.com/oxidecomputer/omicron/assets/180618/11cad6ec-cc29-48d8-ba74-c0b3e63adc9d) Buildomat doesn't yet support ANSI escape codes (oxidecomputer/buildomat#40), but if we add support for them then we'd get full color support. Otherwise, it'll look like this without colors. ## Implementation This is a somewhat large PR but almost all added code. The bulk of added code is in the update-engine, which has two new displayers: ### 1. Line display This displayer shows events line by line. Since this is meant to be used in CI, we have a hard constraint that we can't go back and change old lines. ### 2. Group display This displayer shows events across several possible executions. This is just a slightly more involved version of the line display, and shares most of its code (via `line_display_shared.rs`). The rest of this PR: * Hooks up a group displayer to wicket, which is pretty straightforward. * Adds some more to the `update-engine-basic` example. ## Testing this The wicket side can be tested with: ``` SSH_ORIGINAL_COMMAND='rack-update start --sled 1' cargo run -p wicket ``` For a more comprehensive example, run `cargo run --example update-engine-basic -- --display-style group`. Depends on #4429 (and a number of other PRs that have already landed.) ## Future work One bit of work that hasn't been done yet is doing an integration test with wicketd, wicket, MGS and sp-sim. One issue is that currently, we don't generate machine-readable output from wicket (maybe we should!), and given that that's not the case we only know how to exit with either the exit code 0 (success) or 1 (failure).
- Loading branch information