-
Notifications
You must be signed in to change notification settings - Fork 64
Caching consolidation #43
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
base: main
Are you sure you want to change the base?
Changes from all commits
769b70d
072142a
227b942
b3516bf
a3c8b9a
ba50454
d7f2764
07ea49d
b2bd51b
9a415d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| .cache | ||
| release/** | ||
| vm-saves/** |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,8 @@ OMARCHY_INSTALLER_REF="${OMARCHY_INSTALLER_REF:-master}" | |
| DOCKER_ARGS=( | ||
| --rm | ||
| --privileged | ||
| --platform linux/amd64 # Suppress warnings if building on Apple Silicon | ||
| --ulimit nofile=8192:8192 # Prevent "Too many open files in system" errors during build | ||
|
Author
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. I started getting an error "Too many open files in system" during builds, so this fixes that. |
||
| -e "OMARCHY_INSTALLER_REPO=$OMARCHY_INSTALLER_REPO" | ||
| -e "OMARCHY_INSTALLER_REF=$OMARCHY_INSTALLER_REF" | ||
| -e "HOST_UID=$(id -u)" | ||
|
|
@@ -62,19 +64,25 @@ if [[ -n "${LOCAL_SOURCE-}" ]]; then | |
| DOCKER_ARGS+=(-v "$OMARCHY_PATH:/omarchy:ro") | ||
| fi | ||
|
|
||
| # Use local pacman cache if you already have one on host to speed up repeat runs | ||
| if [ -d "/var/cache/pacman/pkg" ]; then | ||
| DOCKER_ARGS+=(-v "/var/cache/pacman/pkg:/var/cache/pacman/pkg") | ||
| fi | ||
|
|
||
| # Mount the build cache directory where packages are downloaded | ||
| # Set up host caching unless disabled | ||
| if [[ -z "$NO_CACHE" ]]; then | ||
| # using a dated dir on the host to refresh daily if building multiple times | ||
| BUILD_DATE=$(date +%Y-%m-%d) | ||
| OFFLINE_REPO_BUILD_CACHE_DIR="$HOME/.cache/omarchy/iso_${BUILD_DATE}/airootfs/var/cache/omarchy" | ||
| OMARCHY_CACHE_DIR="${OMARCHY_CACHE_DIR:-$HOME/.cache/omarchy}" | ||
|
Author
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. Use a sensible default location that can be overridden with an env var. |
||
|
|
||
| # Use a local pacman cache to speed up repeat runs | ||
| DOCKER_ARGS+=(-v "$OMARCHY_CACHE_DIR/pacman:/var/cache/pacman") | ||
| mkdir -p "$OMARCHY_CACHE_DIR/pacman" | ||
|
|
||
| # Use a dated dir on the host to refresh daily if building multiple times | ||
| OFFLINE_REPO_BASE="$OMARCHY_CACHE_DIR/iso" | ||
| TODAY=$(date +%Y-%m-%d) | ||
| OFFLINE_REPO_BUILD_CACHE_DIR="$OFFLINE_REPO_BASE/$TODAY/airootfs/var/cache/omarchy" | ||
| mkdir -p "$OFFLINE_REPO_BUILD_CACHE_DIR" | ||
|
|
||
| # Mount to /var/cache/airootfs/var/cache/omarchy since that's where repo packages go in the ISO | ||
| DOCKER_ARGS+=(-v "$OFFLINE_REPO_BUILD_CACHE_DIR:/var/cache/airootfs/var/cache/omarchy") | ||
|
|
||
| # Wipe stale cache folders | ||
| find "$OFFLINE_REPO_BASE" -mindepth 1 -maxdepth 1 -type d ! -name "$TODAY" -exec rm -rf {} + | ||
| fi | ||
|
|
||
| # Run the builder with assembled args | ||
|
|
||
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.
Avoid the annoying message (I'm still building stuff on my Mac)