From 319dcb3103b0c547524e5ccc45535a772c825da7 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 15 May 2026 18:01:56 +0000 Subject: [PATCH] ci: stop a partial mmproj cache from poisoning Mac Studio GGUF CI The "JSON, images" Mac Studio GGUF CI job hit a stale cache for ${{ runner.os }}-gguf-...-mmproj-F16.gguf-v1 that contains only the main GGUF, not the mmproj sibling. cache-hit==true so the download step was skipped, then the post-load \`ls\` failed: ls: ...gguf-cache/mmproj-F16.gguf: No such file or directory Three guards layered: 1) Bump cache key v1 -> v2 to invalidate the poisoned entry on the GitHub-hosted side. 2) New verify-cache step explicitly checks BOTH files are present before trusting cache-hit. If not, fall through to download. 3) Save step gains a hashFiles() check on the mmproj path so a partial mmproj download cannot land back in the cache. Behaviour on a clean run is unchanged; cache hit + verify ok skips the re-download, partial-hit triggers fresh download, success saves a complete archive. --- .../workflows/studio-mac-inference-smoke.yml | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/studio-mac-inference-smoke.yml b/.github/workflows/studio-mac-inference-smoke.yml index 4e8456a297..54d66d84b8 100644 --- a/.github/workflows/studio-mac-inference-smoke.yml +++ b/.github/workflows/studio-mac-inference-smoke.yml @@ -710,11 +710,22 @@ jobs: continue-on-error: true with: path: gguf-cache - key: ${{ runner.os }}-gguf-${{ env.GGUF_REPO }}-${{ env.GGUF_FILE }}-${{ env.MMPROJ_FILE }}-v1 + key: ${{ runner.os }}-gguf-${{ env.GGUF_REPO }}-${{ env.GGUF_FILE }}-${{ env.MMPROJ_FILE }}-v2 - - name: Download GGUF + mmproj if cache miss + - name: Verify cache contains BOTH gguf + mmproj + id: verify-cache + if: steps.cache-gguf.outputs.cache-hit == 'true' + run: | + if [[ -f "gguf-cache/$GGUF_FILE" && -f "gguf-cache/$MMPROJ_FILE" ]]; then + echo "ok=true" >> "$GITHUB_OUTPUT" + else + echo "Partial cache hit -- forcing re-download." + echo "ok=false" >> "$GITHUB_OUTPUT" + fi + + - name: Download GGUF + mmproj if cache miss or partial id: download-gguf - if: steps.cache-gguf.outputs.cache-hit != 'true' || steps.cache-gguf.outcome != 'success' + if: steps.cache-gguf.outputs.cache-hit != 'true' || steps.verify-cache.outputs.ok != 'true' # Authenticated + parallel: shared macos-14 NAT egress stalls # multi-GB anonymous downloads. env: @@ -734,13 +745,15 @@ jobs: ls -lh "gguf-cache/$GGUF_FILE" "gguf-cache/$MMPROJ_FILE" # Save partial caches on cancel. hashFiles guard avoids a hard - # save failure when the download step exits with no files. + # save failure when the download step exits with no files. The + # additional mmproj-presence check stops a partial save from + # poisoning the cache for the next run. - name: Save GGUF + mmproj files - if: always() && steps.download-gguf.outcome != 'skipped' && hashFiles('gguf-cache/**/*.gguf') != '' + if: always() && steps.download-gguf.outcome != 'skipped' && hashFiles('gguf-cache/**/*.gguf') != '' && hashFiles(format('gguf-cache/{0}', env.MMPROJ_FILE)) != '' uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: gguf-cache - key: ${{ runner.os }}-gguf-${{ env.GGUF_REPO }}-${{ env.GGUF_FILE }}-${{ env.MMPROJ_FILE }}-v1 + key: ${{ runner.os }}-gguf-${{ env.GGUF_REPO }}-${{ env.GGUF_FILE }}-${{ env.MMPROJ_FILE }}-v2 - name: Install Studio (--local, --no-torch) env: