You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cache Save/Restore is not working between GitHub Runner and Container, even with the same absolute path. #1455
Thank you for digging in further and finding a solution! I haven't been able to test it yet, but it seems plausible. I would have thought enableCrossOsArchive: 'true' would have handled this, but maybe that's just focused on windows/linux cross platform.
It looks like enableCrossOsArchive: 'true' just tries to solve cross platform issue.
And it doesn't solve even the issue when an absolute path not in a workdir is used. If workdirs in a container and in a native runner have different nesting level, the archive is restored not in an absolute path, but in a relative.
In general it looks like the interoperability part for this GitHub action is not well designed/implemented yet, there are too many unspecified edge cases.
Yeah it's really bad. I'm having issues with it too. I read in another issue that making sure your relative path starts with ./ fixes some issues but I haven't had a chance to directly investigate that.
Activity
vkuptcov commentedon Sep 3, 2024
Can confirm the issue: have a similar one in one of my projects
vkuptcov commentedon Sep 4, 2024
@sabbott1877 I've found the reason of the issue.
The problem is that despite the fact that the same keys are used, cache versions for the container and ubuntu-latest Github runners are different: https://github.com/actions/cache?tab=readme-ov-file#cache-version
Cache version depends on used compression method https://github.com/actions/toolkit/blob/6c4e082c181a51609197e536ef5255a0c9baeef7/packages/cache/README.md?plain=1#L15 and default ubuntu-latest uses
zstdto compress data.If a container doesn't have
zstdinstalled,gzipwill be used instead https://github.com/actions/toolkit/blob/6c4e082c181a51609197e536ef5255a0c9baeef7/packages/cache/src/internal/cacheUtils.ts#L100The solution for me was to add
zstdinto the container, and after that I can use caches between my container and GitHub runner.A better solution might be to allow to explicitly set a compression method via the action parameters.
sb185296 commentedon Sep 4, 2024
@vkuptcov can you sahre what its mean to install zstd
what is missing in the pod
can you sahre the steps?
thanks
sb185296 commentedon Sep 4, 2024
ya its working !!!
thanks for the help !
sabbott1877 commentedon Sep 6, 2024
Thank you for digging in further and finding a solution! I haven't been able to test it yet, but it seems plausible. I would have thought
enableCrossOsArchive: 'true'would have handled this, but maybe that's just focused on windows/linux cross platform.vkuptcov commentedon Sep 10, 2024
It looks like
enableCrossOsArchive: 'true'just tries to solve cross platform issue.And it doesn't solve even the issue when an absolute path not in a workdir is used. If workdirs in a container and in a native runner have different nesting level, the archive is restored not in an absolute path, but in a relative.
In general it looks like the interoperability part for this GitHub action is not well designed/implemented yet, there are too many unspecified edge cases.
laverdet commentedon Sep 10, 2024
Yeah it's really bad. I'm having issues with it too. I read in another issue that making sure your relative path starts with
./fixes some issues but I haven't had a chance to directly investigate that.deitch commentedon Sep 25, 2024
See the issue to which I linked in
actions/toolkit.breadadams commentedon Sep 25, 2024
Just ran into this problem too when trying to restore a
node_modulescache in job that uses a Playwright container image.I solved it by adding the following step before using the cache action:
y-bruin commentedon Oct 30, 2024
@breadadams I tried it but didn't work for me
ci: install zstd for actions/cache
ci: install zstd for actions/cache (#10)
gmile commentedon Nov 27, 2024
We're too seeing cache restoration issue, however in our case it appears that both runner type and container have effect on the result.
I'd done 3 tests:
GitHub runner details
Ubicloud runner details
A workaround in our case was to make sure all jobs that share cache - run in the same type of runner.
Stop Setup Playwright from touching apt-get
Stop Setup Playwright from hanging on apt-get (#27252)
Stop Setup Playwright from hanging on apt-get (TryGhost#27252)