Skip to content

[WIP] ci: refactor main branch cache strategy#1717

Open
jamesgao-jpg wants to merge 3 commits into
zilliztech:mainfrom
jamesgao-jpg:codex/knowhere-cache-runner-class
Open

[WIP] ci: refactor main branch cache strategy#1717
jamesgao-jpg wants to merge 3 commits into
zilliztech:mainfrom
jamesgao-jpg:codex/knowhere-cache-runner-class

Conversation

@jamesgao-jpg

@jamesgao-jpg jamesgao-jpg commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Question

How can Knowhere keep fast compilation without uploading persistent self-hosted runner caches, while still giving ephemeral GitHub-hosted jobs useful and reusable caches?

The current workflow hard-codes ~/.ccache. On Github-Action-Runner-Knowhere-2, the Actions service runs as ubuntu and CCache reports /home/ubuntu/.cache/ccache; its CCache and Conan homes are both persistent and multi-GB. Transferring those local caches through GitHub adds latency and consumes repository cache quota without providing persistence.

Conan cache keys also include the job and CPU feature bucket. That duplicates large dependency archives across hosted jobs and prevents maintained branches from having explicit cache identities.

Solution

  • Keep both CCache and Conan entirely local for the self-hosted Linux UT; remove GitHub cache restore/save from that job.
  • Ask CCache for its configured directory on ephemeral runners instead of assuming a platform-specific path.
  • Limit hosted-runner CCache archives to 1 GB before upload to control repository cache pressure.
  • Scope hosted cache keys by stable runner class and target branch.
  • Keep hosted CCache job-specific because build flags differ, while sharing hosted Conan across jobs within one runner class and branch.
  • Start the new hosted cache namespaces cold instead of retaining migration-only legacy restore prefixes; successful main runs seed caches reusable by later PRs.
  • Install dependencies before Analyzer cache resolution so the CCache CLI is consistently available.
  • Document each non-obvious decision next to the relevant workflow/action logic.

Cardinal PR https://github.com/zilliztech/cardinal/pull/887 introduces the related runner-class and target-branch cache strategy for Cardinal. Cardinal PR https://github.com/zilliztech/cardinal/pull/889 applies the same persistent-local-cache policy to its self-hosted 2.6 compatibility job.

Verification

  • Ruby YAML parser on all modified workflow and composite-action files
  • git diff --check
  • Programmatic audit confirms the self-hosted UT invokes no GitHub cache action
  • Verified all hosted cache action callers provide runner-class and cache-branch
  • Verified restore/save cache-key symmetry for hosted jobs
  • Verified no legacy CPU/OS restore references remain
  • Verified directly that the runner service uses ubuntu with persistent 6.4 GB Conan and 5.2 GB CCache directories
  • DCO sign-off verified exactly

Keep the persistent self-hosted compiler cache local, bound hosted-runner CCache uploads, and make Conan caches reusable by runner class and target branch.

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>
@sre-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jamesgao-jpg
To complete the pull request process, please assign marcelo-cjl after the PR has been reviewed.
You can assign the PR to them by writing /assign @marcelo-cjl in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify

mergify Bot commented Jul 11, 2026

Copy link
Copy Markdown

@jamesgao-jpg 🔍 Important: PR Classification Needed!

For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:

  1. If you're fixing a bug, label it as kind/bug.
  2. For small tweaks (less than 20 lines without altering any functionality), please use kind/improvement.
  3. Significant changes that don't modify existing functionalities should be tagged as kind/enhancement.
  4. Adjusting APIs or changing functionality? Go with kind/feature.

For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”.

Thanks for your efforts and contribution to the community!.

@jamesgao-jpg jamesgao-jpg changed the title ci: make Knowhere caches runner- and branch-aware [WIP] ci: make Knowhere caches runner- and branch-aware Jul 11, 2026
@jamesgao-jpg jamesgao-jpg changed the title [WIP] ci: make Knowhere caches runner- and branch-aware [WIP] ci: refactor main branch cache strategy Jul 12, 2026
Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>
Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>
@mergify mergify Bot added the ci-passed label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants