-
Notifications
You must be signed in to change notification settings - Fork 567
CNTRLPLANE-3329: Use fuse-overlayfs for build cache instead of full copy #8568
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
Merged
celebdor
merged 2 commits into
openshift:main
from
celebdor:CNTRLPLANE-3329/use-cache-directly
May 21, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,22 @@ | ||
| name: 'Warm Go build cache' | ||
| description: 'Set GOCACHE and optionally warm from EFS-backed PV' | ||
| description: 'Set GOCACHE via fuse-overlayfs over the EFS-backed PV or a writable fallback' | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - shell: bash | ||
| run: | | ||
| echo "GOCACHE=/tmp/go-build-cache" >> "$GITHUB_ENV" | ||
| if [ -d /cache/go-build ]; then | ||
| mkdir -p /tmp/go-build-cache && \ | ||
| mkdir -p /tmp/go-build-cache | ||
| mounted=false | ||
| if [ -d /cache/go-build ] && command -v fuse-overlayfs >/dev/null 2>&1 && [ -e /dev/fuse ]; then | ||
| mkdir -p /tmp/go-cache-upper /tmp/go-cache-work | ||
| if fuse-overlayfs -o lowerdir=/cache/go-build,upperdir=/tmp/go-cache-upper,workdir=/tmp/go-cache-work /tmp/go-build-cache; then | ||
| mounted=true | ||
| else | ||
| echo "::warning::fuse-overlayfs mount failed, falling back to copy" | ||
| fi | ||
| fi | ||
| if [ "$mounted" = "false" ] && [ -d /cache/go-build ]; then | ||
| timeout 120 cp -a /cache/go-build/. /tmp/go-build-cache/ || \ | ||
| echo "::warning::Failed to copy EFS cache, proceeding without cache" | ||
| echo "::warning::Failed to copy EFS cache, proceeding without cache" | ||
| fi | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| echo "GOCACHE=/tmp/go-build-cache" >> "$GITHUB_ENV" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
What is the correct syntax for fuse-overlayfs mount command with lowerdir, upperdir, and workdir options?💡 Result:
The correct syntax for the fuse-overlayfs mount command is [1][2]: fuse-overlayfs -o lowerdir=DIR1[:DIR2...],upperdir=UPPER,workdir=WORK MOUNTPOINT Options explanation: -o lowerdir=DIR1[:DIR2...]: A colon-separated list of directories to be merged as the read-only base layers [1][3][4]. -o upperdir=UPPER: The directory where all write changes to the filesystem will be stored [1][3][4]. -o workdir=WORK: An internal working directory required by the filesystem, which must reside on the same filesystem as the upperdir [1][3][4]. MOUNTPOINT: The target directory where the merged filesystem will be accessible [1][3]. Example: fuse-overlayfs -o lowerdir=lower1:lower2,upperdir=upper,workdir=work merged_dir [2] Note that workdir must be an empty directory on the same filesystem as the upperdir [1][3]. If you omit upperdir and workdir, the filesystem will be mounted in a read-only state [5].
Citations:
🏁 Script executed:
Repository: openshift/hypershift
Length of output: 1045
Confirm fuse-overlayfs mount syntax and tighten workdir requirements.
fuse-overlayfs -o lowerdir=/cache/go-build,upperdir=/tmp/go-cache-upper,workdir=/tmp/go-cache-work /tmp/go-build-cachematches fuse-overlayfs’ documented-o lowerdir=...,upperdir=...,workdir=... MOUNTPOINTsyntax, and/tmp/go-build-cacheis created before the mount call./tmp/go-cache-workis an empty directory before mounting (the currentmkdir -pdoesn’t guarantee emptiness per fuse-overlayfs’ requirement).🤖 Prompt for AI Agents