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

namespacelabs/nscloud-cache-action // [Error: EACCES: permission denied, mkdir '/nix'] { #1217

Open
ghuntley opened this issue Dec 21, 2023 · 2 comments

Comments

@ghuntley
Copy link
Contributor

Intention:

  • Configure namespacelabs/nscloud-cache-action to persist /nix across runs

Error:

https://github.com/ghuntley/ghuntley/actions/runs/7289014044/job/19862751390

Found Namespace cross-invocation cache at /cache.
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EACCES: permission denied, mkdir '/nix'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/nix'
}

Config:

https://github.com/ghuntley/ghuntley/blob/598bf1bd5cfe90ba8106ced4103dbc3eba5c6781/.github/workflows/build.yml

name: "Build"
on:
  pull_request:
  push:
    branches:
      - 'trunk'
  workflow_dispatch:

# Cancel in-progress runs for pull requests when developers push
# additional changes
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  build:
    runs-on: namespace-profile-cached-amd64
    steps:
      - uses: namespacelabs/nscloud-checkout-action@v2
      - uses: namespacelabs/nscloud-cache-action@v1
        with:
          path: |
            /nix
      - uses: cachix/install-nix-action@v24
        with:
          nix_path: nixpkgs=channel:nixos-unstable

      - uses: cachix/cachix-action@v12
        with:
          name: ghuntley
          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

      - uses: JRMurr/direnv-nix-action@v3
        with:
          install-nix: "false"
          cache-store: "true"

      - run: direnv exec . pre-commit run --all-files

      - run: direnv exec . depot build
      - run: direnv exec . depot build //ops/nixos
@gmichelo
Copy link
Contributor

Hey @ghuntley, thanks for reporting this! The team is working on support nix natively in our cache action.

In the meantime, this workaround could get you unblocked: https://github.com/namespace-integration-demos/nix-cache-example/blob/main/.github/workflows/demo.yaml#L38-L42C33.

@ghuntley
Copy link
Contributor Author

ghuntley commented Dec 21, 2023

Confirming that bind mount into the cache volume works. Reduced 4mins off basic build of my monorepo :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants