diff --git a/.github/workflows/component-build.yml b/.github/workflows/component-build.yml index ef6270b..81afa25 100644 --- a/.github/workflows/component-build.yml +++ b/.github/workflows/component-build.yml @@ -155,7 +155,7 @@ jobs: uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5 with: &cache-mounts path: ${{ runner.temp }}/buildkit-cache-mounts - key: buildkit-cache-mounts-${{ inputs.docker-file-name }}-${{ hashFiles('**/*.gradle.kts', '**/gradle.properties', 'gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties', '**/package-lock.json', '**/pnpm-lock.yaml', '**/yarn.lock', '**/bun.lock', '**/bun.lockb', '**/requirements*.txt', '**/poetry.lock', '**/uv.lock', '**/go.sum', '**/Cargo.lock') }}${{ env.S3_CACHE == 'true' && format('-{0}', github.sha) || '' }} + key: buildkit-cache-mounts-${{ inputs.docker-file-name }}-${{ hashFiles('**/*.gradle.kts', '**/gradle.properties', 'gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties', '**/package-lock.json', '**/pnpm-lock.yaml', '**/yarn.lock', '**/bun.lock', '**/bun.lockb', '**/requirements*.txt', '**/poetry.lock', '**/uv.lock', '**/go.sum', '**/Cargo.lock') }} restore-keys: | buildkit-cache-mounts-${{ inputs.docker-file-name }}- - name: Restore Dockerfile cache mounts (S3) diff --git a/CLAUDE.md b/CLAUDE.md index 9a70a63..e26ec8e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,8 +5,11 @@ - **Latest SHA**: 84fb68d (check for newer commits) - **Changes**: new `pnpm-dependency-submission.yml` and `pnpm-dependency-graph` action for pnpm 12 lockfiles +## Recent Changes (2026-11-15) +1. **Dockerfile cache mounts are saved only when the lockfiles change again, on S3 too**: the per-commit key from 2026-11-14 is gone. Measured on infra-portal's backend deploys: a fresh Go build cache cut `go build` from ~130 s to 6.8 s, but every build then paid ~70 s to restore and inject ~600 MB of cache mounts and ~135 s to extract (cache-dance's post step, 125 s) and upload them, so the build job was about a minute slower than without the cache at all. Extraction is skipped only on an exact key hit, so a key that never hits makes every build pay it. The cache mounts stay in `runner.temp`. A repo that wants a fresh compile cache is better off compiling on the runner (e.g. `actions/setup-go`'s cache) and copying the artifact into the image. + ## Recent Changes (2026-11-14) -1. **Dockerfile cache mounts live outside the checkout and, on S3, are saved every build**: `component-build.yml` restores the cache mounts into `${{ runner.temp }}/buildkit-cache-mounts` (and cache-dance's scratch dir into `runner.temp`) instead of `buildkit-cache-mounts` in the checkout. With the folder in the checkout, a Dockerfile that runs `COPY . .` without a `.dockerignore` shipped the whole restored cache (1.3 GB for infra-portal's Go caches) as build context, baked it into a layer and compressed it into the registry cache on every build. On the S3 backend the key also ends in the commit SHA, so every build saves its caches and the next one restores the newest saved for the Dockerfile (the existing prefix restore key). Before, the key changed only with the lockfiles, so the Go build cache (and Gradle's) went stale with every commit: infra-portal's `go build` took ~130 s with the cache restored, against ~11 s locally with a fresh one. The `actions/cache` backend keeps the lockfile-only key, since per-commit saves would churn the 10 GB GitHub cache quota. +1. **Dockerfile cache mounts live outside the checkout and, on S3, are saved every build** (per-commit key reverted 2026-11-15, see above): `component-build.yml` restores the cache mounts into `${{ runner.temp }}/buildkit-cache-mounts` (and cache-dance's scratch dir into `runner.temp`) instead of `buildkit-cache-mounts` in the checkout. With the folder in the checkout, a Dockerfile that runs `COPY . .` without a `.dockerignore` shipped the whole restored cache (1.3 GB for infra-portal's Go caches) as build context, baked it into a layer and compressed it into the registry cache on every build. On the S3 backend the key also ends in the commit SHA, so every build saves its caches and the next one restores the newest saved for the Dockerfile (the existing prefix restore key). Before, the key changed only with the lockfiles, so the Go build cache (and Gradle's) went stale with every commit: infra-portal's `go build` took ~130 s with the cache restored, against ~11 s locally with a fresh one. The `actions/cache` backend keeps the lockfile-only key, since per-commit saves would churn the 10 GB GitHub cache quota. ## Recent Changes (2026-11-12) 1. **`argocd-wait-sync-multi` refreshes and polls apps in parallel**: the initial refresh and each poll ran `argocd app get` once per app, one after another (~2.6 s each). With monorepo-typescript's 18 apps the refresh took ~47 s before the first poll, and a poll sweep 15-25 s, so an app's `end` was late by up to a sweep. Both now run every app's call in the background and `wait`; the per-app state machine then reads the fetched status from a temp dir, unchanged. Against a 1 s fake `argocd` with 10 already-healthy apps the script went from 23 s to 3 s. Offline tests unchanged and passing.