Skip to content

Commit 45e061a

Browse files
committed
fix(ci): cache embedder model from release to avoid LFS budget exhaustion
The 178 MB model_q4.onnx is stored in LFS, but GitHub free LFS budget (1 GB bandwidth/month) is exhausted, causing all CI jobs to fail at checkout with lfs: true. Changes: - lint/vet/security: checkout without lfs (no model file needed) - test/build: checkout without lfs, restore model from GitHub Actions cache, fallback to download from Release asset on cache miss - Added MODEL_PATH env var for consistent path reference
1 parent 058840b commit 45e061a

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ env:
3535
CGO_ENABLED: 1
3636
GOLANGCI_LINT_VERSION: v2.9
3737
MINDX_WORKSPACE: ${{ github.workspace }}/.test
38+
MODEL_PATH: runtime/data/models/model_q4.onnx
3839

3940
jobs:
4041
# ==========================================================================
@@ -46,8 +47,6 @@ jobs:
4647
steps:
4748
- name: Checkout
4849
uses: actions/checkout@v4
49-
with:
50-
lfs: true
5150

5251
- name: Set up Go
5352
uses: actions/setup-go@v6
@@ -70,8 +69,6 @@ jobs:
7069
steps:
7170
- name: Checkout
7271
uses: actions/checkout@v4
73-
with:
74-
lfs: true
7572

7673
- name: Set up Go
7774
uses: actions/setup-go@v6
@@ -99,8 +96,6 @@ jobs:
9996
steps:
10097
- name: Checkout
10198
uses: actions/checkout@v4
102-
with:
103-
lfs: true
10499

105100
- name: Set up Go
106101
uses: actions/setup-go@v6
@@ -136,15 +131,27 @@ jobs:
136131
steps:
137132
- name: Checkout
138133
uses: actions/checkout@v4
139-
with:
140-
lfs: true
141134

142135
- name: Set up Go
143136
uses: actions/setup-go@v6
144137
with:
145138
go-version: ${{ env.GO_VERSION }}
146139
cache: true
147140

141+
- name: Restore embedder model from cache
142+
id: model-cache
143+
uses: actions/cache@v4
144+
with:
145+
path: ${{ env.MODEL_PATH }}
146+
key: model-q4-onnx-v1
147+
148+
- name: Download embedder model (cache miss)
149+
if: steps.model-cache.outputs.cache-hit != 'true'
150+
run: |
151+
mkdir -p "$(dirname "${{ env.MODEL_PATH }}")"
152+
curl -fL -o "${{ env.MODEL_PATH }}" \
153+
"https://github.com/DotNetAge/mindx/releases/download/v2.3.0/model_q4.onnx"
154+
148155
- name: Prepare test workspace
149156
run: |
150157
mkdir -p .test
@@ -222,15 +229,27 @@ jobs:
222229
steps:
223230
- name: Checkout
224231
uses: actions/checkout@v4
225-
with:
226-
lfs: true
227232

228233
- name: Set up Go
229234
uses: actions/setup-go@v6
230235
with:
231236
go-version: ${{ env.GO_VERSION }}
232237
cache: true
233238

239+
- name: Restore embedder model from cache
240+
id: model-cache
241+
uses: actions/cache@v4
242+
with:
243+
path: ${{ env.MODEL_PATH }}
244+
key: model-q4-onnx-v1
245+
246+
- name: Download embedder model (cache miss)
247+
if: steps.model-cache.outputs.cache-hit != 'true'
248+
run: |
249+
mkdir -p "$(dirname "${{ env.MODEL_PATH }}")"
250+
curl -fL -o "${{ env.MODEL_PATH }}" \
251+
"https://github.com/DotNetAge/mindx/releases/download/v2.3.0/model_q4.onnx"
252+
234253
- name: Install musl cross-compiler
235254
if: matrix.goos == 'linux'
236255
run: |

0 commit comments

Comments
 (0)