Skip to content

Conversation

@rpardini
Copy link
Member

build: gha: always use GHA cache for Linuxkit Cache in hopes of diminishing DockerHub pull-rate limits trouble

  • previously, it only used GHA cache for builds running on GH-hosted runners
  • this now enables it for all builds, even on self-hosted runners
  • next few builds might still fail, but further ones will have a cache (we've save-always: true) and should eventually work

Signed-off-by: Ricardo Pardini ricardo@pardini.net

…ishing DockerHub pull-rate limits trouble

- previously, it only used GHA cache for builds running on GH-hosted runners
- this now enables it for all builds, even on self-hosted runners
- next few builds might still fail, but further ones will have a cache (we've `save-always: true`) and should eventually work

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
@rpardini
Copy link
Member Author

Alternatively to this, we could remove the vars CI_RUNNER_LK_ARM64 and CI_RUNNER_LK_AMD64, and thus let LK builds run on GitHub-hosted runners -- then those will have a cache.

The original logic was to disable cache for self-hosted runners as those are (usually/by default) not ephemeral, and always run in the same dir in the host, thus the cache dir should survive across GHA jobs -- this is somehow not happening here @jacobweinstock any idea why?

@rpardini
Copy link
Member Author

the cache dir should survive across GHA jobs -- this is somehow not happening here

Oh damn. I always forget about this -- actions/checkout defaults to clean: true (and fetch-depth: 1!) and thus obliterates the local cache away. Adding with: { clean: false, fetch-depth: 0 } to all the action/checkout calls should also make the cache effective (and git pulls much faster over time) also on self-hosted runners.

Let me know which you prefer -- and if there's something on the runners to make them ephemeral somehow.

@rpardini
Copy link
Member Author

Alternative to this: #231

@jacobweinstock
Copy link
Member

Hey @rpardini , lets try this one! Thanks!

@jacobweinstock jacobweinstock marked this pull request as ready for review June 19, 2024 22:24
@jacobweinstock jacobweinstock added the ready-to-merge Signal to Mergify to merge the PR. label Jun 19, 2024
@mergify mergify bot merged commit 30bbf4a into tinkerbell:main Jun 19, 2024
@rpardini rpardini deleted the always-use-gh-cache-even-for-hosted-runners branch March 5, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Signal to Mergify to merge the PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants