Shard macOS Namespace caches by lane

This commit is contained in:
Conrad Kramer 2026-03-19 02:13:12 -07:00
parent bf4b270db5
commit 8678ef61ba
3 changed files with 45 additions and 27 deletions

View file

@ -74,30 +74,32 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
cache_root="${NSC_CACHE_PATH:-${HOME}/.cache/burrow}" cache_root="${NSC_CACHE_PATH:-${HOME}/.cache/burrow}"
shared_root="${NSC_SHARED_CACHE_PATH:-${cache_root}/shared}"
lane_root="${NSC_LANE_CACHE_PATH:-${cache_root}/lane/${{ matrix.cache-id }}}"
mkdir -p \ mkdir -p \
"${cache_root}/cargo" \ "${shared_root}/cargo" \
"${cache_root}/cargo-target/${{ matrix.cache-id }}" \ "${shared_root}/rustup" \
"${cache_root}/rustup" \ "${shared_root}/sccache" \
"${cache_root}/sccache" \ "${shared_root}/homebrew" \
"${cache_root}/homebrew" \ "${shared_root}/apple/PackageCache" \
"${cache_root}/apple/PackageCache" \ "${shared_root}/apple/SourcePackages" \
"${cache_root}/apple/SourcePackages" \ "${lane_root}/cargo-target" \
"${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" "${lane_root}/DerivedData"
rm -rf \ rm -rf \
"${cache_root}/cargo-target/${{ matrix.cache-id }}" \ "${lane_root}/cargo-target" \
"${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" "${lane_root}/DerivedData"
mkdir -p \ mkdir -p \
"${cache_root}/cargo-target/${{ matrix.cache-id }}" \ "${lane_root}/cargo-target" \
"${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" "${lane_root}/DerivedData"
echo "CARGO_HOME=${cache_root}/cargo" >> "${GITHUB_ENV}" echo "CARGO_HOME=${shared_root}/cargo" >> "${GITHUB_ENV}"
echo "CARGO_TARGET_DIR=${cache_root}/cargo-target/${{ matrix.cache-id }}" >> "${GITHUB_ENV}" echo "CARGO_TARGET_DIR=${lane_root}/cargo-target" >> "${GITHUB_ENV}"
echo "RUSTUP_HOME=${cache_root}/rustup" >> "${GITHUB_ENV}" echo "RUSTUP_HOME=${shared_root}/rustup" >> "${GITHUB_ENV}"
echo "SCCACHE_DIR=${cache_root}/sccache" >> "${GITHUB_ENV}" echo "SCCACHE_DIR=${shared_root}/sccache" >> "${GITHUB_ENV}"
echo "HOMEBREW_CACHE=${cache_root}/homebrew" >> "${GITHUB_ENV}" echo "HOMEBREW_CACHE=${shared_root}/homebrew" >> "${GITHUB_ENV}"
echo "APPLE_PACKAGE_CACHE=${cache_root}/apple/PackageCache" >> "${GITHUB_ENV}" echo "APPLE_PACKAGE_CACHE=${shared_root}/apple/PackageCache" >> "${GITHUB_ENV}"
echo "APPLE_SOURCE_PACKAGES=${cache_root}/apple/SourcePackages" >> "${GITHUB_ENV}" echo "APPLE_SOURCE_PACKAGES=${shared_root}/apple/SourcePackages" >> "${GITHUB_ENV}"
echo "APPLE_DERIVED_DATA=${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" >> "${GITHUB_ENV}" echo "APPLE_DERIVED_DATA=${lane_root}/DerivedData" >> "${GITHUB_ENV}"
df -h "${cache_root}" || true df -h "${shared_root}" "${lane_root}" || true
- name: Install Rust - name: Install Rust
shell: bash shell: bash

View file

@ -41,9 +41,15 @@ namespace:
size_gb: 40 size_gb: 40
macos_cache_path: "/Users/runner/.cache/burrow" macos_cache_path: "/Users/runner/.cache/burrow"
macos_cache_volumes: macos_cache_volumes:
- tag: "burrow-forgejo-macos-cache-v2" - tag: "burrow-forgejo-macos-shared-v1"
mount_point: "/Users/runner/.cache/burrow" mount_point: "/Users/runner/.cache/burrow/shared"
size_gb: 160 size_gb: 80
- tag: "burrow-forgejo-macos-macos-v1"
mount_point: "/Users/runner/.cache/burrow/lane/macos"
size_gb: 80
- tag: "burrow-forgejo-macos-ios-simulator-v1"
mount_point: "/Users/runner/.cache/burrow/lane/ios-simulator"
size_gb: 80
runner: runner:
name_prefix: "nscloud-" name_prefix: "nscloud-"

View file

@ -193,9 +193,19 @@ func (c *Config) Validate() error {
if len(c.Namespace.MacosCacheVolumes) == 0 { if len(c.Namespace.MacosCacheVolumes) == 0 {
c.Namespace.MacosCacheVolumes = []CacheVolumeConfig{ c.Namespace.MacosCacheVolumes = []CacheVolumeConfig{
{ {
Tag: "burrow-forgejo-macos-cache-v2", Tag: "burrow-forgejo-macos-shared-v1",
MountPoint: c.Namespace.MacosCachePath, MountPoint: c.Namespace.MacosCachePath + "/shared",
SizeGb: 160, SizeGb: 80,
},
{
Tag: "burrow-forgejo-macos-macos-v1",
MountPoint: c.Namespace.MacosCachePath + "/lane/macos",
SizeGb: 80,
},
{
Tag: "burrow-forgejo-macos-ios-simulator-v1",
MountPoint: c.Namespace.MacosCachePath + "/lane/ios-simulator",
SizeGb: 80,
}, },
} }
} }