Skip to content

Commit 4259926

Browse files
committed
refactor(ci): selectively disable pip cache for large ML packages only
Instead of disabling all pip caching, only disable cache for the large packages (torch, transformers) that cause cache service failures. Changes: - Split Python dependency installation into two steps - Large packages (torch, transformers): Install with --no-cache-dir - Small packages (optimum, onnxruntime): Install normally (uses pip cache) Benefits: - Avoids cache service 400 errors from large packages - Smaller packages still benefit from pip's built-in cache - More targeted fix than disabling all caching Package sizes: - torch: ~700MB-2GB (installed without cache) - transformers: ~500MB-1GB (installed without cache) - optimum[onnx]: ~100-200MB (cached) - onnxruntime: ~50-100MB (cached)
1 parent 3d0ffcc commit 4259926

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/build-wasm.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,22 @@ jobs:
153153
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
154154
with:
155155
python-version: '3.11'
156-
# Disabled pip cache - large ML packages (torch, transformers) cause
157-
# cache service failures (400 errors) on every run. Build time impact
158-
# is minimal (~2-3 minutes) since AI models are cached separately.
159-
# cache: 'pip'
160-
# cache-dependency-path: 'packages/socketbin-cli-ai/requirements.txt'
161156

162-
- name: Install Python dependencies
157+
- name: Install Python dependencies (large packages without cache)
163158
run: |
164-
echo "::group::Installing Python dependencies"
165-
pip install -r packages/socketbin-cli-ai/requirements.txt
159+
echo "::group::Installing large Python packages (torch, transformers)"
160+
# Install large packages without caching to avoid cache service failures.
161+
# torch (~700MB-2GB) and transformers (~500MB-1GB) are too large for
162+
# GitHub's cache service and cause 400 errors.
163+
pip install --no-cache-dir torch transformers
164+
echo "::endgroup::"
165+
166+
- name: Install Python dependencies (smaller packages with cache)
167+
run: |
168+
echo "::group::Installing remaining Python dependencies"
169+
# Install smaller packages normally (optimum, onnxruntime).
170+
# These are cached by pip's default cache location.
171+
pip install optimum[onnx] onnxruntime>=1.21.0
166172
echo "::endgroup::"
167173
168174
- name: Install dependencies

0 commit comments

Comments
 (0)