feat(workflows/eval): Try to build and upload in one fell swoop

This commit is contained in:
Tom Hubrecht 2024-10-09 21:32:38 +02:00
parent 6c4099d369
commit 6b23df6b54
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
3 changed files with 23 additions and 12 deletions

View file

@ -9,16 +9,6 @@ on:
- main - main
jobs: jobs:
build_krz01:
runs-on: nix
steps:
- uses: actions/checkout@v3
- name: Build krz01
run: |
# Enter the shell
nix-shell --run 'colmena build --on krz01'
build_compute01: build_compute01:
runs-on: nix runs-on: nix
steps: steps:
@ -117,12 +107,12 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Push to cache - name: Push to cache
run: nix-shell --run push-to-nix-cache run: nix-shell --run cache-node
env: env:
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/" STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
STORE_USER: "admin" STORE_USER: "admin"
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
NODES: '[ "krz01" ]' BUILD_NODE: "krz01"
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: always() if: always()

20
scripts/cache-node.sh Normal file
View file

@ -0,0 +1,20 @@
set -eu -o pipefail
cat <<EOF >.netrc
default
login $STORE_USER
password $STORE_PASSWORD
EOF
drv=$("@colmena@/bin/colmena" eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.system.build.toplevel")
# Build the derivation and send it to the great beyond
nix-store --query --requisites --force-realise --include-outputs "$drv" | grep -v '.*\.drv' >paths.txt
nix copy \
--extra-experimental-features nix-command \
--to "$STORE_ENDPOINT?compression=none" \
--netrc-file .netrc \
"$(nix-store --realise "$drv")"
rm .netrc

View file

@ -29,6 +29,7 @@ let
)); ));
scripts = [ scripts = [
"cache-node"
"check-deployment" "check-deployment"
"launch-vm" "launch-vm"
"list-nodes" "list-nodes"