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

Caching on self-hosted runners #2271

Closed
rajaie-sg opened this issue Dec 21, 2020 · 14 comments · Fixed by #4084 or #10397
Closed

Caching on self-hosted runners #2271

rajaie-sg opened this issue Dec 21, 2020 · 14 comments · Fixed by #4084 or #10397
Labels
actions This issue or pull request should be reviewed by the docs actions team content Problems or updates in the docs content on docs.github.com. ecosystem This issue or pull request should be reviewed by the docs ecosystem team

Comments

@rajaie-sg
Copy link

What article on docs.github.com is affected?

https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/migrating-from-circleci-to-github-actions#caching

What part(s) of the article would you like to see updated?

Caching

Additional information

The docs state that GitHub Actions caching is only applicable to GitHub-hosted runners. which seems to indicate we can't use caching on self-hosted runners, but I just tested caching on a self-hosted runner and it worked fine. Are the docs out of date?

@welcome
Copy link

welcome bot commented Dec 21, 2020

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team. label Dec 21, 2020
@github-actions github-actions bot added this to Triage in Docs open source board Dec 21, 2020
@janiceilene
Copy link
Collaborator

@rajaie-sg Thanks for opening an issue! I don't know the answer to that question, so I'm going to triage this to have the right team take a look 👀

@janiceilene janiceilene moved this from Triage to Engineering in Docs open source board Dec 22, 2020
@janiceilene janiceilene added actions This issue or pull request should be reviewed by the docs actions team content Problems or updates in the docs content on docs.github.com. ecosystem This issue or pull request should be reviewed by the docs ecosystem team labels Dec 22, 2020
@janiceilene janiceilene moved this from Engineering to Ecosystem in Docs open source board Dec 22, 2020
@akashshrimali

This comment has been minimized.

@antoniogamiz
Copy link

Any updates on this?

@janiceilene
Copy link
Collaborator

Thanks for your patience! Our small team is working our way through reviewing all of the issues and PRs 

@jmarlena jmarlena moved this from Ecosystem to Actions in Docs open source board Jan 15, 2021
@janiceilene janiceilene moved this from Actions to Content review needed in Docs open source board Feb 18, 2021
@janiceilene janiceilene removed the triage Do not begin working on this issue until triaged by the team. label Feb 18, 2021
@janiceilene
Copy link
Collaborator

👋 @rajaie-sg I've gotten some answers from our engineering team and caching only works for repos hosted on github.com.

We should update the line from GitHub Actions caching is only applicable to GitHub-hosted runners. to read GitHub Actions caching is only applicable for repositories hosted on github.com

You or anyone else is welcome to open a PR with that fix

@janiceilene janiceilene moved this from Content review needed to Help wanted in Docs open source board Feb 25, 2021
@janiceilene janiceilene added good first issue Good for newcomers help wanted Anyone is welcome to open a pull request to fix this issue. labels Feb 25, 2021
Maks3w added a commit to Maks3w/docs that referenced this issue Feb 27, 2021
@janiceilene janiceilene removed good first issue Good for newcomers help wanted Anyone is welcome to open a pull request to fix this issue. labels Mar 1, 2021
@janiceilene janiceilene removed this from Help wanted in Docs open source board Mar 1, 2021
@github-actions github-actions bot added this to Triage in Docs open source board Mar 5, 2021
@janiceilene janiceilene moved this from Triage to Done in Docs open source board Mar 5, 2021
@fishpen0
Copy link

Where does the cache actually live when using self-hosted runners? Is it on the filesystem, github's servers, somewhere else? Does caching do anything useful when also using the runner in ephemeral mode?

@ethomson
Copy link
Contributor

We should update the line from GitHub Actions caching is only applicable to GitHub-hosted runners. to read GitHub Actions caching is only applicable for repositories hosted on github.com

I think that a more precise statement would be that caching is only applicable for workflows running on dotcom or GHEC. (In other words, caching does not work for GitHub Enterprise Server).

Where does the cache actually live when using self-hosted runners? Is it on the filesystem, github's servers, somewhere else?

GitHub's servers.

At the moment actions/cache will only store caches on GitHub itself; this is true whether your runner is self-hosted or GitHub-hosted. Obviously the question about whether this makes sense for your self-hosted runners, network-wise, is an important one. If you're caching computed data then it's probably a win! If you're caching to avoid network cost, then it may be that your cache restore is almost as expensive as running npm install.

Does caching do anything useful when also using the runner in ephemeral mode?

No, it's no different than using static self-hosted runners.

@OmgImAlexis
Copy link

At the moment actions/cache will only store caches on GitHub itself; this is true whether your runner is self-hosted or GitHub-hosted. Obviously the question about whether this makes sense for your self-hosted runners, network-wise, is an important one. If you're caching computed data then it's probably a win! If you're caching to avoid network cost, then it may be that your cache restore is almost as expensive as running npm install.

Can you please explain how this makes any sense at all to upload/download the data from github each time? Guessing this explains this...
image

@OmgImAlexis
Copy link

This should be reopened.

@janiceilene
Copy link
Collaborator

👋 @OmgImAlexis The best place to send your feedback is to https://github.com/github/feedback/discussions 💛

@OmgImAlexis
Copy link

👋 @OmgImAlexis The best place to send your feedback is to https://github.com/github/feedback/discussions 💛

Your link is broken btw. Managed to include the emoji in the link.

I've created a discussion for this as asked community/community#18549

@janiceilene
Copy link
Collaborator

🙈 Thanks for letting me know!

@ramonfritsch
Copy link

Just found out that you can use MasterworksIO/action-local-cache@1.0.0 for this. It just like actions/cache but runs entirely local, very suitable for self hosted instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content Problems or updates in the docs content on docs.github.com. ecosystem This issue or pull request should be reviewed by the docs ecosystem team
Development

Successfully merging a pull request may close this issue.

11 participants