Skip to content

Commit e429854

Browse files
authored
Merge pull request #1854 from radofuchs/HF_e2e_fix
LCORE-2499: prevent HF from downloading
2 parents d8d704d + 531b09b commit e429854

6 files changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/e2e_tests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,20 @@ jobs:
117117
echo "=== lightspeed-stack.yaml ==="
118118
grep -A 3 "llama_stack:" lightspeed-stack.yaml
119119
120+
- name: Cache HuggingFace embedding model
121+
uses: actions/cache@v4
122+
with:
123+
path: /tmp/hf-cache
124+
key: hf-sentence-transformers-all-mpnet-base-v2
125+
126+
- name: Pre-download HuggingFace embedding model
127+
env:
128+
HF_HOME: /tmp/hf-cache
129+
run: |
130+
pip install -q sentence-transformers
131+
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-mpnet-base-v2')"
132+
echo "HF_CACHE_PATH=/tmp/hf-cache" >> $GITHUB_ENV
133+
120134
- name: Docker Login for quay access
121135
if: matrix.mode == 'server'
122136
env:

.github/workflows/e2e_tests_providers.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ jobs:
195195
echo "=== lightspeed-stack.yaml ==="
196196
grep -A 3 "llama_stack:" lightspeed-stack.yaml
197197
198+
- name: Cache HuggingFace embedding model
199+
uses: actions/cache@v4
200+
with:
201+
path: /tmp/hf-cache
202+
key: hf-sentence-transformers-all-mpnet-base-v2
203+
204+
- name: Pre-download HuggingFace embedding model
205+
env:
206+
HF_HOME: /tmp/hf-cache
207+
run: |
208+
pip install -q sentence-transformers
209+
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-mpnet-base-v2')"
210+
echo "HF_CACHE_PATH=/tmp/hf-cache" >> $GITHUB_ENV
211+
198212
- name: Docker Login for quay access
199213
env:
200214
QUAY_ROBOT_USERNAME: ${{ secrets.QUAY_DOWNSTREAM_USERNAME }}

.github/workflows/e2e_tests_rhaiis.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,20 @@ jobs:
132132
echo "$BODY"
133133
[ "$HTTP_CODE" = "200" ]
134134
135+
- name: Cache HuggingFace embedding model
136+
uses: actions/cache@v4
137+
with:
138+
path: /tmp/hf-cache
139+
key: hf-sentence-transformers-all-mpnet-base-v2
140+
141+
- name: Pre-download HuggingFace embedding model
142+
env:
143+
HF_HOME: /tmp/hf-cache
144+
run: |
145+
pip install -q sentence-transformers
146+
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-mpnet-base-v2')"
147+
echo "HF_CACHE_PATH=/tmp/hf-cache" >> $GITHUB_ENV
148+
135149
- name: Docker Login for quay access
136150
if: matrix.mode == 'server'
137151
env:

.github/workflows/e2e_tests_rhelai.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,20 @@ jobs:
146146
echo "$BODY"
147147
[ "$HTTP_CODE" = "200" ]
148148
149+
- name: Cache HuggingFace embedding model
150+
uses: actions/cache@v4
151+
with:
152+
path: /tmp/hf-cache
153+
key: hf-sentence-transformers-all-mpnet-base-v2
154+
155+
- name: Pre-download HuggingFace embedding model
156+
env:
157+
HF_HOME: /tmp/hf-cache
158+
run: |
159+
pip install -q sentence-transformers
160+
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-mpnet-base-v2')"
161+
echo "HF_CACHE_PATH=/tmp/hf-cache" >> $GITHUB_ENV
162+
149163
- name: Docker Login for quay access
150164
env:
151165
QUAY_ROBOT_USERNAME: ${{ secrets.QUAY_DOWNSTREAM_USERNAME }}

docker-compose-library.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
- ./run.yaml:/app-root/run.yaml:Z
2020
- ${GCP_KEYS_PATH:-./tmp/.gcp-keys-dummy}:/opt/app-root/.gcp-keys:ro
2121
- ./tests/e2e/rag:/opt/app-root/src/.llama/storage/rag:Z
22+
- ${HF_CACHE_PATH:-./tmp/.hf-cache}:/opt/app-root/src/.cache/huggingface
2223
- ./tests/e2e/secrets/mcp-token:/tmp/mcp-token:ro,z
2324
- ./tests/e2e/secrets/invalid-mcp-token:/tmp/invalid-mcp-token:ro,z
2425
environment:
@@ -57,6 +58,8 @@ services:
5758
- LLAMA_STACK_LOGGING=${LLAMA_STACK_LOGGING:-}
5859
# FAISS test and inline RAG config
5960
- FAISS_VECTOR_STORE_ID=${FAISS_VECTOR_STORE_ID:-}
61+
# Prevent HuggingFace Hub update checks (HTTP 429 rate-limiting in CI from parallel jobs).
62+
- HF_HUB_OFFLINE=1
6063
healthcheck:
6164
test: ["CMD", "curl", "-f", "http://localhost:8080/liveness"]
6265
interval: 10s # how often to run the check

docker-compose.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ services:
2121
- llama-storage:/opt/app-root/src/.llama/storage
2222
- ./tests/e2e/rag:/opt/app-root/src/.llama/storage/rag:z
2323
- mock-tls-certs:/certs:ro
24+
- ${HF_CACHE_PATH:-./tmp/.hf-cache}:/opt/app-root/src/.cache/huggingface
2425
environment:
2526
- BRAVE_SEARCH_API_KEY=${BRAVE_SEARCH_API_KEY:-}
2627
- TAVILY_SEARCH_API_KEY=${TAVILY_SEARCH_API_KEY:-}
@@ -56,6 +57,8 @@ services:
5657
- LLAMA_STACK_LOGGING=${LLAMA_STACK_LOGGING:-}
5758
# FAISS test
5859
- FAISS_VECTOR_STORE_ID=${FAISS_VECTOR_STORE_ID:-}
60+
# Prevent HuggingFace Hub update checks (HTTP 429 rate-limiting in CI from parallel jobs).
61+
- HF_HUB_OFFLINE=1
5962
# OKP/Solr RAG
6063
- RH_SERVER_OKP=${RH_SERVER_OKP:-}
6164
- SOLR_URL=${SOLR_URL:-}

0 commit comments

Comments
 (0)