File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 - -c
3939 - |
4040 set -e
41+ # Fast-path: PVC already has a valid venv from a previous pod creation in this pipeline run.
42+ # TLS scenarios delete+recreate this pod up to 16 times; skipping the expensive install
43+ # reduces per-restart time from ~6-15 min to ~30-90 s (just RAG seed refresh + chown).
44+ if [[ -d /opt/app-root/.venv ]] \
45+ && /opt/app-root/.venv/bin/python --version >/dev/null 2>&1 \
46+ && [[ -d /opt/app-root/src ]]; then
47+ echo "PVC cache hit: app-root already provisioned — skipping full install"
48+ mkdir -p /opt/app-root/.e2e-rag-seed /opt/app-root/src/.llama/storage/rag /opt/app-root/src/.llama/storage/files
49+ if [[ -f /rag-seed/kv_store.db.gz ]]; then
50+ gzip -dc /rag-seed/kv_store.db.gz > /opt/app-root/.e2e-rag-seed/kv_store.db
51+ _sz=$(stat -c%s /opt/app-root/.e2e-rag-seed/kv_store.db)
52+ if [[ "${_sz}" -lt 1048576 ]]; then
53+ echo "FATAL: RAG seed too small (${_sz} bytes); check rag-data ConfigMap"
54+ exit 1
55+ fi
56+ cp -f /opt/app-root/.e2e-rag-seed/kv_store.db /opt/app-root/src/.llama/storage/rag/kv_store.db
57+ fi
58+ chmod -R 775 /opt/app-root && chown -R 1001:0 /opt/app-root
59+ echo "PVC fast-path complete"
60+ exit 0
61+ fi
62+ # Full provisioning (PVC is empty — first pod creation this pipeline run).
4163 REPO_URL="${REPO_URL:-https://github.com/lightspeed-core/lightspeed-stack.git}"
4264 REPO_REVISION="${REPO_REVISION:-main}"
4365 case "$REPO_URL" in git@github.com:*) REPO_URL="https://github.com/${REPO_URL#git@github.com:}"; esac
@@ -207,7 +229,8 @@ spec:
207229 readOnly : true
208230 volumes :
209231 - name : app-root
210- emptyDir : {}
232+ persistentVolumeClaim :
233+ claimName : llama-stack-app-root
211234 - name : config-cm
212235 configMap :
213236 name : llama-stack-config
Original file line number Diff line number Diff line change @@ -143,6 +143,25 @@ log "✅ Mock servers deployed"
143143# ========================================
144144progress " Deploying lightspeed-stack and llama-stack"
145145
146+ # PVC for llama-stack app-root: caches dnf/uv/git install so TLS per-scenario pod
147+ # recreates skip the expensive init (~6-15 min → ~1-2 min). Delete first to guarantee
148+ # a fresh checkout for this pipeline revision; re-create immediately so the pod can bind.
149+ log " Recreating llama-stack-app-root PVC (fresh per pipeline run)..."
150+ oc delete pvc llama-stack-app-root -n " $NAMESPACE " --ignore-not-found=true 2> /dev/null || true
151+ cat << 'EOF ' | oc apply -n "$NAMESPACE" -f -
152+ apiVersion: v1
153+ kind: PersistentVolumeClaim
154+ metadata:
155+ name: llama-stack-app-root
156+ spec:
157+ accessModes:
158+ - ReadWriteOnce
159+ resources:
160+ requests:
161+ storage: 10Gi
162+ EOF
163+ log " ✅ llama-stack-app-root PVC created"
164+
146165# Llama run config: single source with GitHub E2E (tests/e2e/configs/run-ci.yaml).
147166# Lightspeed stack: same tree as local/docker E2E (tests/e2e/configuration/server-mode).
148167oc create configmap llama-stack-config -n " $NAMESPACE " \
Original file line number Diff line number Diff line change @@ -26,9 +26,25 @@ oc create secret generic llama-stack-ip-secret \
2626 -n " $NAMESPACE " \
2727 --dry-run=client -o yaml | oc apply -f -
2828
29+ # PVC must exist before the pod (pipeline-konflux.sh creates it; guard here for standalone use).
30+ oc get pvc llama-stack-app-root -n " $NAMESPACE " > /dev/null 2>&1 || \
31+ oc apply -n " $NAMESPACE " -f - << 'PVCEOF '
32+ apiVersion: v1
33+ kind: PersistentVolumeClaim
34+ metadata:
35+ name: llama-stack-app-root
36+ spec:
37+ accessModes:
38+ - ReadWriteOnce
39+ resources:
40+ requests:
41+ storage: 10Gi
42+ PVCEOF
43+
2944timeout 120 oc delete pod llama-stack-service -n " $NAMESPACE " --ignore-not-found=true --wait=true 2> /dev/null || true
3045oc apply -n " $NAMESPACE " -f " $BASE_DIR /manifests/lightspeed/llama-stack-openai.yaml"
31- oc wait pod/llama-stack-service -n " $NAMESPACE " --for=condition=Ready --timeout=600s
46+ # First boot runs the full init (dnf + git clone + uv sync ≈ 6-15 min); use a generous timeout.
47+ oc wait pod/llama-stack-service -n " $NAMESPACE " --for=condition=Ready --timeout=900s
3248oc label pod llama-stack-service pod=llama-stack-service -n " $NAMESPACE "
3349oc expose pod llama-stack-service --name=llama-stack-service-svc --port=8321 --type=ClusterIP -n " $NAMESPACE "
3450
You can’t perform that action at this time.
0 commit comments