oxidecomputer / oxidecomputer/omicron
Add a Rust binary to the switch zone to report the local switch ID
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Today, we put the switch ID (0 or 1) in the shell prompt by asking the local MGS via curl. #8975 added a manual api-version header to this curl invocation (as required now that the MGS API is versioned), but @davepacheco pointed out several issues with this and suggested an alternative:
Maybe the switch zone should ship a Rust binary using a Progenitor client that does this? This way:
- the program would automatically pick up new changes to the API
- things would break at build-time if the API were broken
ls-apiswould see this consumer
We do already have a gateway-cli binary that presents a CLI for talking to MGS generally, but (a) it's been a long time since it got any changes and is missing many API calls, including this one and (b) it's not included in the switch zone. We could dust this off, fix it up, and start shipping it, or add a smaller binary just for this one use; I don't have a strong feeling which would be nicer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the existing gateway-cli entry point and how binaries are packaged into the switch zone. Check the MGS API call that returns the local switch ID, then determine whether gateway-cli or a smaller binary is appropriate. Done means a Rust binary is shipped in the switch zone and reports the local switch ID through the versioned API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100