Skip to content

Commit 7940b75

Browse files
author
Radovan Fuchs
committed
add the fix to workflow
1 parent 9ddb521 commit 7940b75

5 files changed

Lines changed: 16 additions & 17 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:

deploy/lightspeed-stack/Containerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,6 @@ RUN mkdir -p /opt/app-root/src/.llama/storage /opt/app-root/src/.llama/providers
123123
RUN mkdir -p /opt/app-root/src/.cache/huggingface && \
124124
chown -R 1001:1001 /opt/app-root/src/.cache
125125

126-
# Pre-cache embedding model so HF_HUB_OFFLINE=1 works at runtime.
127-
# ARG defaults to 0: hermetic Konflux builds have no outbound network.
128-
# docker-compose passes PREBAKE_HF_MODELS=1 for local/CI builds.
129-
ARG PREBAKE_HF_MODELS=0
130-
RUN [ "${PREBAKE_HF_MODELS}" != "1" ] || \
131-
( HF_HOME=/opt/app-root/src/.cache/huggingface \
132-
/app-root/.venv/bin/python -c \
133-
"from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-mpnet-base-v2')" && \
134-
chown -R 1001:1001 /opt/app-root/src/.cache/huggingface )
135-
136126
# Add executables from .venv to system PATH
137127
ENV PATH="/app-root/.venv/bin:$PATH"
138128

deploy/llama-stack/test.containerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ RUN mkdir -p /opt/app-root/src/.llama/storage \
3737
chown -R 1001:0 /opt/app-root && \
3838
chmod -R 775 /opt/app-root
3939

40-
# Pre-cache embedding model so HF_HUB_OFFLINE=1 works at runtime.
41-
RUN HF_HOME="/opt/app-root/src/.cache/huggingface" \
42-
/opt/app-root/.venv/bin/python -c \
43-
"from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-mpnet-base-v2')"
44-
4540
# Copy enrichment scripts for runtime config enrichment
4641
COPY src/llama_stack_configuration.py /opt/app-root/llama_stack_configuration.py
4742
COPY scripts/llama-stack-entrypoint.sh /opt/app-root/enrich-entrypoint.sh

docker-compose-library.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ services:
44
build:
55
context: .
66
dockerfile: deploy/lightspeed-stack/Containerfile
7-
args:
8-
PREBAKE_HF_MODELS: "1"
97
platform: linux/amd64
108
container_name: lightspeed-stack
119
ports:
@@ -21,6 +19,7 @@ services:
2119
- ./run.yaml:/app-root/run.yaml:Z
2220
- ${GCP_KEYS_PATH:-./tmp/.gcp-keys-dummy}:/opt/app-root/.gcp-keys:ro
2321
- ./tests/e2e/rag:/opt/app-root/src/.llama/storage/rag:Z
22+
- ${HF_CACHE_PATH:-./tmp/.hf-cache}:/opt/app-root/src/.cache/huggingface
2423
- ./tests/e2e/secrets/mcp-token:/tmp/mcp-token:ro,z
2524
- ./tests/e2e/secrets/invalid-mcp-token:/tmp/invalid-mcp-token:ro,z
2625
environment:

docker-compose.yaml

Lines changed: 1 addition & 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:-}

0 commit comments

Comments
 (0)