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

Add support for non-GitHub-hosted caching for self-hosted runners #1051

Open
RoystonS opened this issue Apr 9, 2022 · 4 comments · May be fixed by #1695
Open

Add support for non-GitHub-hosted caching for self-hosted runners #1051

RoystonS opened this issue Apr 9, 2022 · 4 comments · May be fixed by #1695
Labels
enhancement New feature or request

Comments

@RoystonS
Copy link

RoystonS commented Apr 9, 2022

Describe the enhancement

Right now, Action caching isn't very useful when using self-hosted GitHub Actions runners: I have runners deployed on my own hardware but the cached data is being sent to and from GitHub cache servers. The time and cost of making those transfers across the Internet and back makes caching almost entirely pointless for self-hosted runners.

Instead I'd like the ability to use the GitHub Actions caching API to cache data on my own servers nearer my runners.

What's missing:

  • there's no downloadable cache server implementation that we can use to run a cache server somewhere else
  • there's no documentation for how to write such a caching server even if GitHub doesn't provide one
  • it doesn't look like there's any ability to control the action/toolkit cache package to make it work with a non-GitHub server. I can see there's an ACTIONS_CACHE_URL that is provided by the runner environment and points to a GitHub server, but there's no easy way to override that. Even if there were, it looks like the cache system authenticates using ACTIONS_RUNTIME_TOKEN, which also lacks documentation or the ability to override. It's also used for more than just caching, so if I did somehow override it to point to a custom caching server, it would break something else in the actions runner.

Additional information
Add any other context about the feature here.

@RoystonS RoystonS added the enhancement New feature or request label Apr 9, 2022
@TheElectronWill
Copy link

I concur! It would be great to be able to store the cache on the runner (or any sel-hosted storage) instead of GitHub's servers. Otherwise it's a waste of resources.

@tuxillo
Copy link

tuxillo commented Feb 2, 2023

Has anybody tested this? : https://github.com/whywaita/actions-cache-s3

@adiroiban
Copy link

adiroiban commented Nov 13, 2023

I guess that in the future there will be more self-hosted runners deployed via Kubernetes.

With that in mind, maybe it make sense to just add support for caching to a local path.

The k8s can then handle the storage based on any cluster persistent volume (ex OpenEBS with directly attached NVMe).

S3 protocol is an option, and with minio is easy to deploy a local S3 server.

But for best performance, maybe a local filesystem storage is much faster... and I expect that it might not be that hard to implement.

For example, I have a bare metal Windows server, that runs a bunch of runner processes in parallel. No VMs, no containers. Windows NTFS filesystem is already super slow.

@maxnowack
Copy link

I started my own solution, forked the actions/cache code and modified it to place a tarball on a local volume instead upload/download all the cache everytime.
You can use it as a drop-in replacement for actions/cache@v3: https://github.com/maxnowack/local-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants