Skip to content

Commit

Permalink
Merge pull request #374 from Nix-QChem/fix-release
Browse files Browse the repository at this point in the history
release: add all-pkgs to have an all-green criteria
  • Loading branch information
markuskowa authored Nov 17, 2023
2 parents 1c234fd + 65f5838 commit 09f5269
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 20 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/nix-rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
steps:
# Install Nix on the runner
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
# Pull from the cachix cache
Expand All @@ -63,12 +65,12 @@ jobs:
- name: Rebuild python3 packages
run: |
if [ -n "$(jq '.python3[]' chDerivs.json)" ]; then
nix build --accept-flake-config --print-build-logs $(for p in $(jq '.python3[]' chDerivs.json | tr -d "\""); do echo ".#python3.pkgs.${p}"; done)
nix build --extra-substituters https://nix-qchem.cachix.org --print-build-logs -f release.nix $(for p in $(jq '.python3[]' chDerivs.json | tr -d "\""); do echo "qchem.python3.${p}"; done)
fi
- name: Rebuild all top-level packages
run: |
if [ -n "$(jq '.topLevel[]' chDerivs.json)" ]; then
nix build --accept-flake-config --print-build-logs $(for p in $(jq '.topLevel[]' chDerivs.json | tr -d "\""); do echo ".#${p}"; done)
nix build --extra-substituters https://nix-qchem.cachix.org --print-build-logs -f release.nix $(for p in $(jq 'del(.topLevel[] | select(. == "release-barrier")) | .topLevel[]' chDerivs.json | tr -d "\""); do echo "qchem.${p}"; done)
fi
# Rebuild changed derivations as if merged
Expand All @@ -79,6 +81,8 @@ jobs:
steps:
# Install Nix on the runner
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
# Pull from the cachix cache
Expand All @@ -94,10 +98,10 @@ jobs:
- name: Rebuild all changed python3 packages
run: |
if [ -n "$(jq '.python3[]' chDerivs.json)" ]; then
nix build --accept-flake-config --print-build-logs $(for p in $(jq '.python3[]' chDerivs.json | tr -d "\""); do echo ".#python3.pkgs.${p}"; done)
nix build --extra-substituters https://nix-qchem.cachix.org --print-build-logs -f release.nix $(for p in $(jq '.python3[]' chDerivs.json | tr -d "\""); do echo "qchem.python3.${p}"; done)
fi
- name: Rebuild all changed top-level packages
run: |
if [ -n "$(jq '.topLevel[]' chDerivs.json)" ]; then
nix build --accept-flake-config --print-build-logs $(for p in $(jq '.topLevel[]' chDerivs.json | tr -d "\""); do echo ".#${p}"; done)
nix build --extra-substituters https://nix-qchem.cachix.org --print-build-logs -f release.nix $(for p in $(jq 'del(.topLevel[] | select(. == "release-barrier")) | .topLevel[]' chDerivs.json | tr -d "\""); do echo "qchem.${p}"; done)
fi
48 changes: 32 additions & 16 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,29 +127,45 @@ let

in pkgsClean;

in {
"${cfg.prefix}" = pkgs config (self: super: {});

} # Extra variants for testing purposes
// (if buildVariants then {
"${cfg.prefix}-mpich" = pkgs config (self: super: { mpi = super.mpich; });
# Aggregate all packages job
# Use as all-green-criteria
# Note that the aggregate contains the derivations!
allJobs = prefix: jobs: let
aggrJob = (nixpkgs-final {}).releaseTools.aggregate {
name = "all-packages";
constituents = with lib;
let
a2l = mapAttrsToList (_: path: if (lib.isAttrs path && !isDerivation path) then a2l path else path);
pnames =
mapAttrsRecursiveCond
(as: !(as ? "type" && as.type == "derivation"))
(path: v: v)
jobs
;
in a2l pnames;
};
in {
"${prefix}" = jobs // { release-barrier = aggrJob; };
};

"${cfg.prefix}-mvapich" = pkgs config (self: super: { mpi = self.mvapich; });
in
(allJobs cfg.prefix (pkgs config (self: super: {})))

"${cfg.prefix}-mkl" = pkgs config (self: super: {
# Variant builds
// (if buildVariants then
(allJobs "${cfg.prefix}-mpich" (pkgs config (self: super: { mpi = super.mpich; }))) //
(allJobs "${cfg.prefix}-mvapich" (pkgs config (self: super: { mpi = super.mvapich; }))) //
(allJobs "${cfg.prefix}-mkl" (pkgs config (self: super: {
blas = super.blas.override { blasProvider = super.mkl; };
lapack = super.lapack.override { lapackProvider = super.mkl; };
});

"${cfg.prefix}-netlib" = pkgs config (self: super: {
}))) //
(allJobs "${cfg.prefix}-netlib" (pkgs config (self: super: {
blas = super.blas.override { blasProvider = super.lapack-reference; };
lapack = super.lapack.override { lapackProvider = super.lapack-reference; };
});

"${cfg.prefix}-amd" = pkgs config (self: super: {
}))) //
(allJobs "${cfg.prefix}-amd" (pkgs config (self: super: {
blas = super.blas.override { blasProvider = super.amd-blis; };
fftw = self.qchem.amd-fftw;
scalapack = self.qchem.amd-scalapack;
});
}
})))
else {})

0 comments on commit 09f5269

Please sign in to comment.