-
Notifications
You must be signed in to change notification settings - Fork 132
Add CI build caching and improve benchmark workflow #1148
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
Open
sbryngelson
wants to merge
13
commits into
MFlowCode:master
Choose a base branch
from
sbryngelson:caching
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+213
−93
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3738e14
Add CI build caching for GitHub-hosted and self-hosted HPC runners
sbryngelson c3a2469
Fix race conditions and cleanup in build cache
sbryngelson 79ce4e7
Fix stale retry log messages
sbryngelson bb7f705
Disable git clean on self-hosted runners to preserve build cache
sbryngelson 08490be
Skip build cache for benchmarks and fix benchmark trigger logic
sbryngelson 4172553
Fix cross-runner cache by updating install/ config paths
sbryngelson 233aa11
Delete install/ on workspace path change to fix stale binaries
sbryngelson 2406c64
Simplify build cache to per-runner directories
sbryngelson d4e7c8f
Remove restore-keys prefix fallback from GH-hosted build cache
sbryngelson 84835be
Make benchmark pipeline robust to transient GPU failures
sbryngelson 09920e7
Suppress pylint too-many-nested-blocks for bench()
sbryngelson 1adc121
Fix rm -rf following build symlink into shared cache
sbryngelson f7d0164
Detect stale cached binaries and include install/ in retry cleanup
sbryngelson 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
Some comments aren't visible on the classic Files Changed page.
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 | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -52,16 +52,16 @@ else | |||||||||||||||||||||||||||||||||||||||||||||||
| echo "Master job completed successfully" | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if either job failed | ||||||||||||||||||||||||||||||||||||||||||||||||
| # Warn if either job failed (partial results may still be usable) | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "${pr_exit}" -ne 0 ] || [ "${master_exit}" -ne 0 ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "ERROR: One or both benchmark jobs failed: pr_exit=${pr_exit}, master_exit=${master_exit}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "WARNING: Benchmark jobs had failures: pr=${pr_exit}, master=${master_exit}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Checking for partial results..." | ||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Both benchmark jobs completed successfully!" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+55
to
63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Use a flag to track benchmark job failures and exit with a non-zero status at the end of the script if any job failed, ensuring the workflow status is accurate. [possible issue, importance: 9]
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Both benchmark jobs completed successfully!" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Final verification that output files exist before proceeding | ||||||||||||||||||||||||||||||||||||||||||||||||
| pr_yaml="pr/bench-${device}-${interface}.yaml" | ||||||||||||||||||||||||||||||||||||||||||||||||
| master_yaml="master/bench-${device}-${interface}.yaml" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
|
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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #!/bin/bash | ||
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Sets up a persistent build cache for self-hosted CI runners. | ||
| # Creates a symlink: ./build -> <scratch>/.mfc-ci-cache/<key>/build | ||
| # | ||
| # Each runner gets its own cache keyed by (cluster, device, interface, runner). | ||
| # This avoids cross-runner path issues entirely — CMake's absolute paths are | ||
| # always correct because the same runner always uses the same workspace path. | ||
| # | ||
| # Usage: source .github/scripts/setup-build-cache.sh <cluster> <device> <interface> | ||
|
|
||
| _cache_cluster="${1:?Usage: setup-build-cache.sh <cluster> <device> <interface>}" | ||
| _cache_device="${2:?}" | ||
| _cache_interface="${3:-none}" | ||
| _cache_runner="${RUNNER_NAME:?RUNNER_NAME not set}" | ||
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| _cache_key="${_cache_cluster}-${_cache_device}-${_cache_interface}-${_cache_runner}" | ||
| _cache_base="$HOME/scratch/.mfc-ci-cache/${_cache_key}/build" | ||
|
|
||
| mkdir -p "$_cache_base" | ||
| _cache_dir="$(cd "$_cache_base" && pwd -P)" | ||
|
|
||
| echo "=== Build Cache Setup ===" | ||
| echo " Cache key: $_cache_key" | ||
| echo " Cache dir: $_cache_dir" | ||
|
|
||
| # Replace any existing build/ (real dir or stale symlink) with a symlink | ||
| # to our runner-specific cache directory. | ||
| # Use unlink for symlinks to avoid rm -rf following the link and deleting | ||
| # the shared cache contents (which another runner may be using). | ||
| if [ -L "build" ]; then | ||
| unlink "build" | ||
| elif [ -e "build" ]; then | ||
| rm -rf "build" | ||
| fi | ||
|
|
||
| ln -s "$_cache_dir" "build" | ||
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
sbryngelson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| echo " Symlink: build -> $_cache_dir" | ||
| echo "=========================" | ||
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
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
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
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
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
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.