Open twinfees opened 5 months ago
I like this idea. Would you imagine this just replacing the binary wherever it happens to be installed? I would suggest we do something like this:
oxide version update
-- queries the API server for its current version (somehow), figures out the latest binary that's compatible with that version, prompts the user (Are you sure? [Y/n]
), downloads the binary, replaces at the current location.oxide version update --yes
-- Same as above, but without the confirmationoxide version update --no-profile [--yes]
-- Doesn't query the API server, just gets the latest release binary which may or may not be compatible with what's running on the server.oxide version list
-- List available CLI versions--this might be a long list, maybe we want to show the most recent 5 or so?oxide version update --target <version_num> [--yes]
-- Update to the specific version number--do we want to check for compatibility with the API server?How would we / do we want to handle the situation where a customer has 2 racks / AZs that might potentially be running different versions of the Oxide software (i.e. incompatible / non-matching API versions)? This situation isn't immediate, but it's probably not too far into the future. Perhaps we can ignore that for the moment and anticipate greater API / CLI stability by the time that becomes a significant issue.
I think we should punt given that it's not happening any time soon, and in a dire situation the customer can deal with it by having two different binaries around. I don't see us getting much more sophisticated than that any time soon even in the best case.
And now to bikeshed on command names: I've seen a convention oxide self ...
that I kind of like. Nextest does this:
$ cargo nextest self update -h
Download and install updates to nextest
Usage: cargo nextest self update [OPTIONS]
Options:
--version <VERSION> Version or version range to download [default: latest]
-n, --check Check for updates rather than downloading them
-v, --verbose Verbose output [env: NEXTEST_VERBOSE=]
--color <WHEN> Produce color output: auto, always, never [env: CARGO_TERM_COLOR=] [default: auto]
-y, --yes Do not prompt for confirmation
-f, --force Force downgrades and reinstalls
--releases-url <RELEASES_URL> URL or path to fetch releases.json from
-h, --help Print help (see more with '--help')
Manifest options:
--manifest-path <PATH> Path to Cargo.toml
Config options:
--config-file <PATH>
Config file [default: workspace-root/.config/nextest.toml]
--tool-config-file <TOOL:ABS_PATH>
Tool-specific config files
--override-version-check
Override checks for the minimum version defined in nextest's config
To cater for anyone that happens to deliver the CLI as an OS package with whatever package manager, should we provide an option for them to compile this out to prevent users shooting themselves in the foot?
Great idea. Maybe a compilation option to display a message like 'use brew update, idiot!'
On macOS we'll need to notarize our binaries to avoid having the user needing to manually trust the binary after each update: https://github.com/oxidecomputer/oxide.rs/issues/280
Target component
Overview
Looking at the list of command options with the oxide CLI, it doesn't look like there's a way to update in-place:
And no subcommand option to do so either with the
version
command:Implementation details
While it's easy enough to grab the latest release from https://github.com/oxidecomputer/oxide.rs/releases, it might be nice to be able to do something like
oxide version update --latest
oroxide version list
to see a list of versions available wherein one could then specify the version they want to go to (including downgrading if needed), e.g.oxide version update --target <version_num>
.Anything else you would like to add?
No response