diff --git a/.forgejo/workflows/eval.yaml b/.forgejo/workflows/eval.yaml index 0fb3231..0fe36fe 100644 --- a/.forgejo/workflows/eval.yaml +++ b/.forgejo/workflows/eval.yaml @@ -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() diff --git a/scripts/cache-node.sh b/scripts/cache-node.sh new file mode 100644 index 0000000..38a2e6c --- /dev/null +++ b/scripts/cache-node.sh @@ -0,0 +1,20 @@ +set -eu -o pipefail + +cat <.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 diff --git a/scripts/default.nix b/scripts/default.nix index 4846b8c..d5096fd 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -29,6 +29,7 @@ let )); scripts = [ + "cache-node" "check-deployment" "launch-vm" "list-nodes"