Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[testing] Replace script-based tool installation with nix #3691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maru-ava
Copy link
Contributor

@maru-ava maru-ava commented Feb 1, 2025

Why this should be merged

Previously, binary tools like promtail and prometheus (enabling log and metrics collection) and kube and kind (enabling local kube clusters) were installed using bash scripts. A script-based approach, while simple, requires tedious and error-prone copying and committing to other repos (e.g. subnet-evm and hypersdk) that needed the same functionality.

Possible to rewrite the scripts to golang which allows usage via go run or go install. Simple enough if the versions never change, but still requires retrieving binaries, verifying their hashes for security, potentially dealing with tar archives. Still more complication if it becomes necessary to ensure the desired version is the one in the path.

Switching to nix, on the other hand, is an established way of solving the problem that doesn't involve maintaining code. Installing nix is a one-time operation not too different from homebrew, except that the result has more guarantees of reproducibility across linux and macos.

How this works

  • Replaces manual tool installation with a nix flake
  • Updates github actions to install nix where needed

How this was tested

CI, manually for direnv usage

Need to be documented in RELEASES.md?

N/A

@maru-ava maru-ava added testing This primarily focuses on testing ci This focuses on changes to the CI process labels Feb 1, 2025
@maru-ava maru-ava self-assigned this Feb 1, 2025
@maru-ava maru-ava force-pushed the nix branch 6 times, most recently from 3d0e9bf to b22db15 Compare February 1, 2025 23:00
Previously, binary tools like promtail and prometheus (enabling log
and metrics collection) and kube and kind (enabling local kube
clusters) were installed using bash scripts. A script-based approach,
while simple, requires tedious and error-prone copying and committing
to other repos (e.g. subnet-evm and hypersdk) that need the same
functionality.

Possible to rewrite the scripts to golang which allows usage via `go
run` or `go install`. Simple enough if the versions never change, but
still requires retrieving binaries, verifying their hashes for
security, and potentially dealing with tar archives. Still more
complicated if it becomes necessary to ensure the desired version is
the one in the path.

Switching to [nix](https://nixos.org/), on the other hand, is an
established way of solving the problem that doesn't involve
maintaining code. Installing nix is a one-time operation not too
different from homebrew, except that the result has more guarantees of
reproducibility across linux and macos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This focuses on changes to the CI process testing This primarily focuses on testing
Projects
Status: In Review 👀
Development

Successfully merging this pull request may close these issues.

2 participants