oxidecomputer / oxidecomputer/omicron

Add a Rust binary to the switch zone to report the local switch ID

Open
#8,976 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Good for new hires
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-apis would 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.