feat(workflows/eval): Try to build and upload in one fell swoop
Some checks failed
build configuration / build_web01 (push) Has been cancelled
build configuration / build_rescue01 (push) Has been cancelled
build configuration / build_storage01 (push) Has been cancelled
build configuration / build_compute01 (push) Has been cancelled
build configuration / build_geo01 (push) Has been cancelled
build configuration / build_web02 (push) Has been cancelled
build configuration / build_vault01 (push) Has been cancelled
build configuration / build_geo02 (push) Has been cancelled
build configuration / build_bridge01 (push) Has been cancelled
build configuration / push_to_cache_krz01 (push) Has been cancelled
build configuration / push_to_cache_compute01 (push) Has been cancelled
build configuration / push_to_cache_storage01 (push) Has been cancelled
build configuration / push_to_cache_rescue01 (push) Has been cancelled
build configuration / push_to_cache_geo01 (push) Has been cancelled
build configuration / push_to_cache_geo02 (push) Has been cancelled
build configuration / push_to_cache_vault01 (push) Has been cancelled
build configuration / push_to_cache_web01 (push) Has been cancelled
build configuration / push_to_cache_web02 (push) Has been cancelled
build configuration / push_to_cache_bridge01 (push) Has been cancelled
lint / check (push) Successful in 25s

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
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:
runs-on: nix
steps:
@ -117,12 +107,12 @@ jobs:
- uses: actions/checkout@v3
- name: Push to cache
run: nix-shell --run push-to-nix-cache
run: nix-shell --run cache-node
env:
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
STORE_USER: "admin"
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
NODES: '[ "krz01" ]'
BUILD_NODE: "krz01"
- uses: actions/upload-artifact@v3
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 = [
"cache-node"
"check-deployment"
"launch-vm"
"list-nodes"