jetify-com / devbox-install-action

31 stars 15 forks source link

Devbox cache restore fails on self-hosted runners #49

Closed supershal closed 2 months ago

supershal commented 3 months ago

The devbox cache is restored to /usr/local/bin/devbox. https://github.com/jetify-com/devbox-install-action/blob/main/action.yml#L58

This works well with github hosted runners. however self hosted runners runs as a runner user and they dont have permission to restore files outside home or workspace. As a result the cache restore fails.

/usr/bin/tar -xf /runner/_work/_temp/fe855c32-ce18-4de4-a823-45e0f7cd2593/cache.tzst -P -C /runner/_work/myorg/myrepo --use-compress-program unzstd
/usr/bin/tar: ../../../../usr/local/bin/devbox: Cannot open: Permission denied
/usr/bin/tar: Exiting with failure status due to previous errors
Warning: Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2
Cache not found for input keys: Linux-X64-devbox-cli-0.10.6

Related issue filed at actions/cache: https://github.com/actions/cache/issues/1127

Various self hosted images are built from Dockerfiles at: https://github.com/actions/actions-runner-controller/tree/master/runner

Should the devbox restored and installed at ~/.local/bin directory and make it accessible by adding it to $PATH?

supershal commented 3 months ago

@LucilleH any thoughts on this?

LucilleH commented 3 months ago

@supershal Good call! Thank you for the suggestion and PR

DjoleLepi commented 2 months ago

It seems that the line mentioned in the comment here wasn't fixed wit the PR.

The devbox cache is restored to /usr/local/bin/devbox. https://github.com/jetify-com/devbox-install-action/blob/main/action.yml#L58

LucilleH commented 2 months ago

@DjoleLepi you are right 😭