Skip to content
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

Drv (eval) store transport #24

Open
blaggacao opened this issue Jun 28, 2023 · 0 comments
Open

Drv (eval) store transport #24

blaggacao opened this issue Jun 28, 2023 · 0 comments

Comments

@blaggacao
Copy link

blaggacao commented Jun 28, 2023

Suppose I have a hydra-like evaluator action that runs first.

This action produces all necessary .drv files for my workers.

Then I want to:

nix-store --export $(nix-store --query --requisites my.drv) \
          | $compress > $GH_CACHE

And likewise on the receiving end:

$GH_CACHE > $decompress | nix-store --import &>/dev/null

Is there a way that magic-nix-cache can provide auxiliar facilities to make this manual pushing to the GH cache easy?


Workaround / Solution(?):

    - uses: actions/cache/save@v3
      id: cache
      with:
        path: ${{ runner.temp }}/eval-store
        key: drv-pack-${{ runner.os }}-${{ runner.arch }}
  mkdir -p "$EVALSTORE_EXPORT"
  # nix >= 2.6.1 for the --stdin flag to avoid "too many arguments"
  nix-store --query --requisites "$drv" | nix-store --stdin --export | zstd > "$EVALSTORE_EXPORT/$(basename $drv).zst"

and then

    - uses: actions/cache/restore@v3
      id: cache
      with:
        path: ${{ runner.temp }}/eval-store
        key: drv-pack-${{ runner.os }}-${{ runner.arch }}
        fail-on-cache-miss: true
cat "$EVALSTORE_IMPORT/$(basename $actionDrv).zst" | unzstd | nix-store --import &>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant