Skip to content

Commit d8dc873

Browse files
author
Radovan Fuchs
committed
prevent HF from downloading
1 parent bf9b8a7 commit d8dc873

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/e2e_tests.yaml

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

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:-}
@@ -57,6 +58,8 @@ services:
5758
- LLAMA_STACK_LOGGING=${LLAMA_STACK_LOGGING:-}
5859
# FAISS test
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
# OKP/Solr RAG
6164
- RH_SERVER_OKP=${RH_SERVER_OKP:-}
6265
- SOLR_URL=${SOLR_URL:-}

0 commit comments

Comments
 (0)