perf: parallelize model downloads and switch to registry cache

- Parallelize all 14 model downloads using ThreadPoolExecutor (6 workers)
  Downloads were sequential (~30 min), now concurrent (~5-10 min)
- Switch Docker cache from type=gha to type=registry (GHCR)
  GHA cache has 10 GB limit causing blob eviction and corrupted builds
  Registry cache has no size limit and persists across runner instances
- Add pip download cache mounts to all pip install layers
  Prevents re-downloading packages when layers rebuild
This commit is contained in:
ashim-hq
2026-04-17 14:54:23 +08:00
parent 2fd0c00564
commit 79c4ed6a35
4 changed files with 69 additions and 25 deletions
+9 -2
View File
@@ -99,6 +99,13 @@ jobs:
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR (for registry cache)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
@@ -106,5 +113,5 @@ jobs:
push: false
tags: ashim:ci
build-args: SKIP_MODEL_DOWNLOADS=true
cache-from: type=gha,scope=unified
cache-to: type=gha,mode=max,scope=unified
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:cache-linux-amd64
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:cache-ci,mode=max
+2 -2
View File
@@ -121,8 +121,8 @@ jobs:
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,"name=ashimhq/ashim,ghcr.io/${{ github.repository }}",push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha,scope=${{ env.PLATFORM_PAIR }}
cache-to: type=gha,mode=max,scope=${{ env.PLATFORM_PAIR }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:cache-${{ env.PLATFORM_PAIR }}
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:cache-${{ env.PLATFORM_PAIR }},mode=max
- name: Export digest
run: |