oxidecomputer / oxidecomputer/omicron

convert `tools/install_prerequisites.sh` to an xtask

Open
#3,939 4 comments 2 reactions 1 assignee View on GitHub

@jordanhendricks is already working on this.

Since Aug 23, 2023.

build development
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

A critical part of the development experience to build and run omicron involves ensuring the system in question has necessary packages (per the OS + distro's local package manager) and dependencies (binaries downloaded directly into the local workspace, such as clickhouse or cockroachdb).

Currently, packages and dependencies are installed by a pair of bash scripts, tools/install_{builder,runner}_prerequisites.sh, with the former being for a machine to build omicron (and run it with the simulated sled agent), and the latter to run it (with the real sled agent). The script tools/install_prerequisites.sh runs both of these scripts, if you want to both build and run omicron on the same machine.

There is some notion of supported OSes in these tools (namely, macOS, linux, and helios), but there are limitations in that they assume a particular package manager, which forces folks to work around things by commenting out lines of the script or running bits manually.

I am going to take a stab at converting these tools into a single xtask command, if nothing else to get these scripts into rust and give us the many benefits related to better error handling, type safety, and ease of logging there. Some additional goals/features I have in mind are:

  • the ability to inspect a system to determine whether it has the dependencies and packages needed already
  • dry run options so that I can run the tool and know what it will install/do before I do it
  • move dependency definitions (and maybe package definitions) into a TOML file so that changes to deps/packages are modifying a configuration file instead of code

There are several paper cuts I've learned of when researching this topic, including:

  • #3938
  • #2181
  • #3941
  • #3944
  • having to hack around the tool to use a different package manager for non-debian like linux distros (the scripts assume apt)
  • #4094
  • #4333

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.