-
-
Notifications
You must be signed in to change notification settings - Fork 214
ci: Custom GitHub Runners for Nix Builds #1745
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
Open
yvan-sraka
wants to merge
46
commits into
develop
Choose a base branch
from
custom-github-runners
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+783
−119
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8b61ad4 to
76aa79b
Compare
hunleyd
approved these changes
Aug 22, 2025
76aa79b to
c75bf58
Compare
1eb74b8 to
db1e5e4
Compare
003d671 to
840005b
Compare
Refactor GitHub Actions workflow to run build checks in parallel across different architectures (aarch64-linux, aarch64-darwin) with separate job matrices.
Create a single nix-eval job to determine packages to build, removing redundant extension and check matrices.
This reverts commit e2db368.
When building a postgres extension, the build matrix may include multiple time the same extension for different PostgreSQL versions. This change makes it easier to identify which job corresponds to which PostgreSQL version in the workflow runs.
treefmt is already included in the pre-commit hooks check.
Dynamically assign larger runners (32vcpu) for Rust and PostGIS extensions while using smaller runners (8vcpu) for standard packages.
Add pytest tests for the package Add nix-eval-jobs in path for the package
The matrix job returns the type of runner, so we can configure the nix installation step accordingly.
Our changes were merged upstream, so we can now track the original repository again.
…default - Replace DeterminateSystems/nix-installer-action with custom nix-install-ephemeral action across all workflows - Change default push-to-cache from 'true' to 'false' to prevent unnecessary nix/aws configurations - Explicitly enable push-to-cache only for nix-build and nix-eval workflows where caching is beneficial
We might not need the full 8vcpu for aarch64-linux builds, so this change reduces the runner size to 4vcpu to wait less for available blacksmith runners.
21a9736 to
aa4b344
Compare
samrose
requested changes
Nov 19, 2025
Collaborator
samrose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t see any reason we can’t merge reviewing code. Just need to generate images and test
Collaborator
|
Added request change just to block merge until we test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a migration from GitHub's standard runners to a hybrid infrastructure combining self-hosted and ephemeral Blacksmith runners for building Nix packages.
The implementation includes runner selection, dynamic build matrix generation, and optimized caching strategies to improve build performance and cost efficiency.
Problem Statement
The previous CI implementation had several limitations:
Solution Architecture
High-Level Design
Architecture Components
Nix Evaluation Phase (
nix-eval.yml):nix-eval-jobsBuild Phases (separate jobs per architecture):
Runner Selection Logic:
Key Components
1. Dynamic Matrix Generation (
github-matrixPackage)Location:
nix/packages/github-matrix/Core Responsibilities:
nix-eval-jobs(https://github.com/nix-community/nix-eval-jobs)Package Size Detection:
requiredSystemFeatures = ["big-parallel"]in package definitionsOutput Format:
{ "aarch64_linux": { "include": [ { "attr": "checks.aarch64-linux.pg_graphql_15", "name": "pg_graphql-15.7", "system": "aarch64-linux", "runs_on": {"labels": ["blacksmith-32vcpu-ubuntu-2404-arm"]}, "postgresql_version": "15" } ] }, "x86_64_linux": {...}, "aarch64_darwin": {...} }2. Custom Nix Installation Actions
Unify Nix installation across different runner types with two reusable GitHub Actions.
Ephemeral Runners (
nix-install-ephemeral)Location:
.github/actions/nix-install-ephemeral/Purpose: Set up Nix on fresh Blacksmith runners where Nix is not pre-installed
Features:
Configuration:
Cache Upload Mechanism:
/etc/nix/upload-to-cache.shSelf-Hosted Runners (
nix-install-self-hosted)Location:
.github/actions/nix-install-self-hosted/Purpose: Configure AWS credentials on persistent self-hosted runners where Nix is pre-installed
Features:
/etc/nix/aws/nix-aws-credentials3. Reusable Nix Eval Workflow
Location:
.github/workflows/nix-eval.ymlPurpose: Shared workflow for matrix generation
Features:
workflow_call4. Restructured Build Workflow
Location:
.github/workflows/nix-build.ymlNew Structure:
Key Improvements:
!cancelled()with success/skip conditionsRelated PRs
nix-github-actions#1742: Base work for custom runners (this PR builds on top of it)