Skip to content

Commit c0556c1

Browse files
authored
Merge branch 'lightspeed-core:main' into LCORE_2035_koflux_tls_e2e_fix
2 parents c2c47c3 + 28b57cc commit c0556c1

40 files changed

Lines changed: 2076 additions & 207 deletions

.konflux/requirements.hashes.source.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ importlib-metadata==8.5.0 \
500500
joserfc==1.6.4 \
501501
--hash=sha256:34ce5f499bfcc5e9ad4cc75077f9278ab3227b71da9aaf28f9ab705f8a560d3c \
502502
--hash=sha256:3e4a22b509b41908989237a045e25c8308d5fd47ab96bdae2dd8057c6451003a
503+
idna==3.15 \
504+
--hash=sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8 \
505+
--hash=sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc
503506
jsonpath-ng==1.8.0 \
504507
--hash=sha256:54252968134b5e549ea5b872f1df1168bd7defe1a52fed5a358c194e1943ddc3 \
505508
--hash=sha256:b8dde192f8af58d646fc031fac9c99fe4d00326afc4148f1f043c601a8cfe138

.konflux/requirements.hashes.wheel.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ httpx==0.28.1 \
8484
--hash=sha256:c75bc8d287ff8e92be7e4359732032ba1b93fa3f920ee1cb179ba09bb613dc7a
8585
httpx-sse==0.4.3 \
8686
--hash=sha256:74d0e4713b33a61ca0083d00841f00f12d6b3dd311edb62ccc85809b607b9fb5
87-
idna==3.11 \
88-
--hash=sha256:e1049ef074501ba8c5d802d712b257889257f6d2f460f959f26c4b2d4375923c
8987
jinja2==3.1.6 \
9088
--hash=sha256:961c7281585491fb02ca0027b29e9ffc7a1bd7b52a5e03095f3a4e3afc42336e
9189
jiter==0.12.0 \

.konflux/requirements.hermetic.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
uv==0.9.16
2-
pip==25.3
1+
uv==0.11.6
2+
pip==26.1

.tekton/lightspeed-stack-pull-request.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ spec:
5858
],
5959
"requirements_build_files": ["requirements-build.txt"],
6060
"binary": {
61-
"packages": "aiohappyeyeballs,aiosignal,aiosqlite,annotated-doc,annotated-types,anyio,asyncpg,cffi,chevron,cryptography,click,dill,distro,dnspython,docstring-parser,durationpy,einops,email-validator,faiss-cpu,fire,frozenlist,fsspec,google-crc32c,google-genai,grpcio,grpcio-status,h11,hf-xet,httpcore,httpx,httpx-sse,idna,importlib-metadata,jinja2,jiter,joblib,jsonschema-specifications,kubernetes,markdown-it-py,mdurl,mpmath,multidict,networkx,numpy,oauthlib,packaging,pandas,peft,pillow,prometheus-client,prompt-toolkit,propcache,psycopg2-binary,pyarrow,pyasn1-modules,pycparser,pydantic,pydantic-core,python-dateutil,pyyaml,referencing,requests-oauthlib,rpds-py,safetensors,scikit-learn,scipy,setuptools,six,sniffio,sqlalchemy,sympy,termcolor,threadpoolctl,tiktoken,tokenizers,torch,tqdm,transformers,tree-sitter,triton,typing-extensions,typing-inspection,websocket-client,websockets,wrapt,xxhash,yarl,zipp,uv,pip,maturin",
61+
"packages": "aiohappyeyeballs,aiosignal,aiosqlite,annotated-doc,annotated-types,anyio,asyncpg,cffi,chevron,cryptography,click,dill,distro,dnspython,docstring-parser,durationpy,einops,email-validator,faiss-cpu,fire,frozenlist,fsspec,google-crc32c,google-genai,grpcio,grpcio-status,h11,hf-xet,httpcore,httpx,httpx-sse,importlib-metadata,jinja2,jiter,joblib,jsonschema-specifications,kubernetes,markdown-it-py,mdurl,mpmath,multidict,networkx,numpy,oauthlib,packaging,pandas,peft,pillow,prometheus-client,prompt-toolkit,propcache,psycopg2-binary,pyarrow,pyasn1-modules,pycparser,pydantic,pydantic-core,python-dateutil,pyyaml,referencing,requests-oauthlib,rpds-py,safetensors,scikit-learn,scipy,setuptools,six,sniffio,sqlalchemy,sympy,termcolor,threadpoolctl,tiktoken,tokenizers,torch,tqdm,transformers,tree-sitter,triton,typing-extensions,typing-inspection,websocket-client,websockets,wrapt,xxhash,yarl,zipp,uv,pip,maturin",
6262
"os": "linux",
6363
"arch": "x86_64,aarch64",
6464
"py_version": 312
@@ -149,6 +149,10 @@ spec:
149149
default: 'true'
150150
description: Use the package registry proxy when prefetching dependencies
151151
type: string
152+
- name: sast-target-dirs
153+
type: string
154+
default: .
155+
description: Target directories to scan with SAST tools. Multiple values should be separated with commas.
152156
results:
153157
- description: ""
154158
name: IMAGE_URL
@@ -172,7 +176,7 @@ spec:
172176
- name: name
173177
value: init
174178
- name: bundle
175-
value: quay.io/konflux-ci/tekton-catalog/task-init:0.4@sha256:b797dd453ddad669365de6de4649e3a9e37e77aa26eb9862ca079a36cbfe64a4
179+
value: quay.io/konflux-ci/tekton-catalog/task-init:0.4@sha256:5a423246792ac501ea279229b42ee57da9927da441c04b5c9ff86817b0856b08
176180
- name: kind
177181
value: task
178182
resolver: bundles
@@ -219,7 +223,7 @@ spec:
219223
- name: name
220224
value: prefetch-dependencies-oci-ta
221225
- name: bundle
222-
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:1b209c0d93e52e418f3e6cd4b4fd915a84e4bd7f68e1cfd0d6446133540d7f43
226+
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:a2efbcdcecfa5293a622eb356a18f5c88e5714046b214fe8730b43b1a7dbb77d
223227
- name: kind
224228
value: task
225229
resolver: bundles
@@ -342,7 +346,7 @@ spec:
342346
- name: name
343347
value: deprecated-image-check
344348
- name: bundle
345-
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.5@sha256:57d1f556982115311f603dd9a728c52a7a1d092f022e1db4560da01eca9e5d17
349+
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.5@sha256:e78d0d3baf3c8cfc1a5ad278196b74032d9568b143a87c7a79ab780fedfb296e
346350
- name: kind
347351
value: task
348352
resolver: bundles
@@ -369,7 +373,7 @@ spec:
369373
- name: name
370374
value: clair-scan
371375
- name: bundle
372-
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.3@sha256:cd49cdea7e5403a87c4774bd8ea10bc4e6aeb83841ff490cbe42b782779513a7
376+
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.3@sha256:8fad4c2e2f470f82ee43d6b2ac72327b4d9c6e9cb514a678911c1c9359c29894
373377
- name: kind
374378
value: task
375379
resolver: bundles
@@ -394,7 +398,7 @@ spec:
394398
- name: name
395399
value: ecosystem-cert-preflight-checks
396400
- name: bundle
397-
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:25dcef1d9270b2e03fe6710a733171f7c7208e341fc627dac3a579088f44af34
401+
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:9c300728a03f41beee9a689422d66513d32ab5f804664fe561b11cebacd07799
398402
- name: kind
399403
value: task
400404
resolver: bundles
@@ -415,6 +419,8 @@ spec:
415419
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
416420
- name: ARGS
417421
value: --project-name=lightspeed-stack --report --org=dca2ca89-7e51-4a3a-b7a5-6ad5633057b8
422+
- name: TARGET_DIRS
423+
value: $(params.sast-target-dirs)
418424
runAfter:
419425
- build-image-index
420426
taskRef:
@@ -487,6 +493,8 @@ spec:
487493
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
488494
- name: CACHI2_ARTIFACT
489495
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
496+
- name: TARGET_DIRS
497+
value: $(params.sast-target-dirs)
490498
runAfter:
491499
- coverity-availability-check
492500
taskRef:
@@ -534,6 +542,8 @@ spec:
534542
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
535543
- name: CACHI2_ARTIFACT
536544
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
545+
- name: TARGET_DIRS
546+
value: $(params.sast-target-dirs)
537547
runAfter:
538548
- build-image-index
539549
taskRef:
@@ -560,6 +570,8 @@ spec:
560570
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
561571
- name: CACHI2_ARTIFACT
562572
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
573+
- name: TARGET_DIRS
574+
value: $(params.sast-target-dirs)
563575
runAfter:
564576
- build-image-index
565577
taskRef:
@@ -629,7 +641,7 @@ spec:
629641
- name: name
630642
value: rpms-signature-scan
631643
- name: bundle
632-
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:1d807f6be3be2bd8bff76321e9599bbafce8196dcd9597eeffd9df65466682af
644+
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:d4e3499ad4af6869470233bef6faaa1bdd69ef56276841eeec93ce6e62deeb93
633645
- name: kind
634646
value: task
635647
resolver: bundles

.tekton/lightspeed-stack-push.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ spec:
5050
],
5151
"requirements_build_files": ["requirements-build.txt"],
5252
"binary": {
53-
"packages": "aiohappyeyeballs,aiosignal,aiosqlite,annotated-doc,annotated-types,anyio,asyncpg,cffi,chevron,cryptography,click,dill,distro,dnspython,docstring-parser,durationpy,einops,email-validator,faiss-cpu,fire,frozenlist,fsspec,google-crc32c,google-genai,grpcio,grpcio-status,h11,hf-xet,httpcore,httpx,httpx-sse,idna,importlib-metadata,jinja2,jiter,joblib,jsonschema-specifications,kubernetes,markdown-it-py,mdurl,mpmath,multidict,networkx,numpy,oauthlib,packaging,pandas,peft,pillow,prometheus-client,prompt-toolkit,propcache,psycopg2-binary,pyarrow,pyasn1-modules,pycparser,pydantic,pydantic-core,python-dateutil,pyyaml,referencing,requests-oauthlib,rpds-py,safetensors,scikit-learn,scipy,setuptools,six,sniffio,sqlalchemy,sympy,termcolor,threadpoolctl,tiktoken,tokenizers,torch,tqdm,transformers,tree-sitter,triton,typing-extensions,typing-inspection,websocket-client,websockets,wrapt,xxhash,yarl,zipp,uv,pip,maturin",
53+
"packages": "aiohappyeyeballs,aiosignal,aiosqlite,annotated-doc,annotated-types,anyio,asyncpg,cffi,chevron,cryptography,click,dill,distro,dnspython,docstring-parser,durationpy,einops,email-validator,faiss-cpu,fire,frozenlist,fsspec,google-crc32c,google-genai,grpcio,grpcio-status,h11,hf-xet,httpcore,httpx,httpx-sse,importlib-metadata,jinja2,jiter,joblib,jsonschema-specifications,kubernetes,markdown-it-py,mdurl,mpmath,multidict,networkx,numpy,oauthlib,packaging,pandas,peft,pillow,prometheus-client,prompt-toolkit,propcache,psycopg2-binary,pyarrow,pyasn1-modules,pycparser,pydantic,pydantic-core,python-dateutil,pyyaml,referencing,requests-oauthlib,rpds-py,safetensors,scikit-learn,scipy,setuptools,six,sniffio,sqlalchemy,sympy,termcolor,threadpoolctl,tiktoken,tokenizers,torch,tqdm,transformers,tree-sitter,triton,typing-extensions,typing-inspection,websocket-client,websockets,wrapt,xxhash,yarl,zipp,uv,pip,maturin",
5454
"os": "linux",
5555
"arch": "x86_64,aarch64",
5656
"py_version": 312
@@ -137,6 +137,10 @@ spec:
137137
default: 'true'
138138
description: Use the package registry proxy when prefetching dependencies
139139
type: string
140+
- name: sast-target-dirs
141+
type: string
142+
default: .
143+
description: Target directories to scan with SAST tools. Multiple values should be separated with commas.
140144
results:
141145
- description: ""
142146
name: IMAGE_URL
@@ -157,7 +161,7 @@ spec:
157161
- name: name
158162
value: init
159163
- name: bundle
160-
value: quay.io/konflux-ci/tekton-catalog/task-init:0.4@sha256:b797dd453ddad669365de6de4649e3a9e37e77aa26eb9862ca079a36cbfe64a4
164+
value: quay.io/konflux-ci/tekton-catalog/task-init:0.4@sha256:5a423246792ac501ea279229b42ee57da9927da441c04b5c9ff86817b0856b08
161165
- name: kind
162166
value: task
163167
resolver: bundles
@@ -204,7 +208,7 @@ spec:
204208
- name: name
205209
value: prefetch-dependencies-oci-ta
206210
- name: bundle
207-
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:1b209c0d93e52e418f3e6cd4b4fd915a84e4bd7f68e1cfd0d6446133540d7f43
211+
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:a2efbcdcecfa5293a622eb356a18f5c88e5714046b214fe8730b43b1a7dbb77d
208212
- name: kind
209213
value: task
210214
resolver: bundles
@@ -323,7 +327,7 @@ spec:
323327
- name: name
324328
value: deprecated-image-check
325329
- name: bundle
326-
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.5@sha256:57d1f556982115311f603dd9a728c52a7a1d092f022e1db4560da01eca9e5d17
330+
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.5@sha256:e78d0d3baf3c8cfc1a5ad278196b74032d9568b143a87c7a79ab780fedfb296e
327331
- name: kind
328332
value: task
329333
resolver: bundles
@@ -350,7 +354,7 @@ spec:
350354
- name: name
351355
value: clair-scan
352356
- name: bundle
353-
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.3@sha256:cd49cdea7e5403a87c4774bd8ea10bc4e6aeb83841ff490cbe42b782779513a7
357+
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.3@sha256:8fad4c2e2f470f82ee43d6b2ac72327b4d9c6e9cb514a678911c1c9359c29894
354358
- name: kind
355359
value: task
356360
resolver: bundles
@@ -375,7 +379,7 @@ spec:
375379
- name: name
376380
value: ecosystem-cert-preflight-checks
377381
- name: bundle
378-
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:25dcef1d9270b2e03fe6710a733171f7c7208e341fc627dac3a579088f44af34
382+
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:9c300728a03f41beee9a689422d66513d32ab5f804664fe561b11cebacd07799
379383
- name: kind
380384
value: task
381385
resolver: bundles
@@ -396,6 +400,8 @@ spec:
396400
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
397401
- name: ARGS
398402
value: --project-name=lightspeed-stack --report --org=dca2ca89-7e51-4a3a-b7a5-6ad5633057b8
403+
- name: TARGET_DIRS
404+
value: $(params.sast-target-dirs)
399405
runAfter:
400406
- build-image-index
401407
taskRef:
@@ -468,6 +474,8 @@ spec:
468474
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
469475
- name: CACHI2_ARTIFACT
470476
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
477+
- name: TARGET_DIRS
478+
value: $(params.sast-target-dirs)
471479
runAfter:
472480
- coverity-availability-check
473481
taskRef:
@@ -515,6 +523,8 @@ spec:
515523
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
516524
- name: CACHI2_ARTIFACT
517525
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
526+
- name: TARGET_DIRS
527+
value: $(params.sast-target-dirs)
518528
runAfter:
519529
- build-image-index
520530
taskRef:
@@ -541,6 +551,8 @@ spec:
541551
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
542552
- name: CACHI2_ARTIFACT
543553
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
554+
- name: TARGET_DIRS
555+
value: $(params.sast-target-dirs)
544556
runAfter:
545557
- build-image-index
546558
taskRef:
@@ -613,7 +625,7 @@ spec:
613625
- name: name
614626
value: rpms-signature-scan
615627
- name: bundle
616-
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:1d807f6be3be2bd8bff76321e9599bbafce8196dcd9597eeffd9df65466682af
628+
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:d4e3499ad4af6869470233bef6faaa1bdd69ef56276841eeec93ce6e62deeb93
617629
- name: kind
618630
value: task
619631
resolver: bundles

Makefile

Lines changed: 88 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,96 @@ PYTHON_REGISTRY = pypi
1111
CONFIG ?= lightspeed-stack.yaml
1212
LLAMA_STACK_CONFIG ?= run.yaml
1313

14-
run: ## Run the service locally
14+
# Container configuration
15+
LLAMA_STACK_CONTAINER_NAME ?= lightspeed-llama-stack
16+
LLAMA_STACK_IMAGE ?= lightspeed-llama-stack:local
17+
LLAMA_STACK_PORT ?= 8321
18+
CONTAINER_RUNTIME ?= $(shell command -v podman 2>/dev/null || command -v docker 2>/dev/null)
19+
20+
.PHONY: run build-llama-stack-image remove-llama-stack-container start-llama-stack-container wait-for-llama-stack-health clean-llama-stack
21+
22+
run: start-llama-stack-container ## Run the service locally with llama-stack container
23+
@echo "Starting Lightspeed Core Stack..."
1524
uv run src/lightspeed_stack.py -c $(CONFIG)
1625

17-
run-llama-stack: ## Start Llama Stack with enriched config (for local service mode)
18-
uv run src/llama_stack_configuration.py -c $(CONFIG) -i $(LLAMA_STACK_CONFIG) -o $(LLAMA_STACK_CONFIG) && \
19-
AZURE_API_KEY=$$(grep '^AZURE_API_KEY=' .env | cut -d'=' -f2-) \
20-
uv run llama stack run $(LLAMA_STACK_CONFIG)
26+
build-llama-stack-image: remove-llama-stack-container ## Build llama-stack container image
27+
@echo "Building llama-stack container image..."
28+
@if [ -z "$(CONTAINER_RUNTIME)" ]; then \
29+
echo "ERROR: No container runtime found. Install podman or docker."; \
30+
exit 1; \
31+
fi
32+
$(CONTAINER_RUNTIME) build -f deploy/llama-stack/test.containerfile -t $(LLAMA_STACK_IMAGE) .
33+
34+
remove-llama-stack-container: ## Remove existing llama-stack container
35+
@if [ -n "$(CONTAINER_RUNTIME)" ] && $(CONTAINER_RUNTIME) inspect $(LLAMA_STACK_CONTAINER_NAME) >/dev/null 2>&1; then \
36+
echo "Removing existing llama-stack container..."; \
37+
$(CONTAINER_RUNTIME) rm -f $(LLAMA_STACK_CONTAINER_NAME); \
38+
fi
39+
40+
start-llama-stack-container: build-llama-stack-image ## Start llama-stack container
41+
@echo "Starting llama-stack container..."
42+
$(CONTAINER_RUNTIME) run -d \
43+
--name $(LLAMA_STACK_CONTAINER_NAME) \
44+
-p $(LLAMA_STACK_PORT):8321 \
45+
--health-cmd "curl -f http://localhost:8321/v1/health || exit 1" \
46+
--health-interval 10s \
47+
--health-timeout 5s \
48+
--health-retries 3 \
49+
--health-start-period 15s \
50+
-v $(PWD)/$(LLAMA_STACK_CONFIG):/opt/app-root/run.yaml:ro,z \
51+
-v $(PWD)/$(CONFIG):/opt/app-root/lightspeed-stack.yaml:ro,z \
52+
-v $(PWD)/scripts/llama-stack-entrypoint.sh:/opt/app-root/enrich-entrypoint.sh:ro,z \
53+
-v $(PWD)/src/llama_stack_configuration.py:/opt/app-root/llama_stack_configuration.py:ro,z \
54+
-e OPENAI_API_KEY \
55+
-e EXTERNAL_PROVIDERS_DIR=$${EXTERNAL_PROVIDERS_DIR:-/opt/app-root/external_providers} \
56+
-e BRAVE_SEARCH_API_KEY \
57+
-e TAVILY_SEARCH_API_KEY \
58+
-e E2E_OPENAI_MODEL=$${E2E_OPENAI_MODEL:-gpt-4o-mini} \
59+
-e TENANT_ID=$${TENANT_ID:-} \
60+
-e CLIENT_ID=$${CLIENT_ID:-} \
61+
-e CLIENT_SECRET \
62+
-e RHAIIS_URL=$${RHAIIS_URL:-} \
63+
-e RHAIIS_PORT=$${RHAIIS_PORT:-} \
64+
-e RHAIIS_API_KEY \
65+
-e RHAIIS_MODEL=$${RHAIIS_MODEL:-} \
66+
-e RHEL_AI_URL=$${RHEL_AI_URL:-} \
67+
-e RHEL_AI_PORT=$${RHEL_AI_PORT:-} \
68+
-e RHEL_AI_API_KEY \
69+
-e RHEL_AI_MODEL=$${RHEL_AI_MODEL:-} \
70+
-e GOOGLE_APPLICATION_CREDENTIALS \
71+
-e VERTEX_AI_PROJECT=$${VERTEX_AI_PROJECT:-} \
72+
-e VERTEX_AI_LOCATION=$${VERTEX_AI_LOCATION:-} \
73+
-e WATSONX_BASE_URL=$${WATSONX_BASE_URL:-} \
74+
-e WATSONX_PROJECT_ID=$${WATSONX_PROJECT_ID:-} \
75+
-e WATSONX_API_KEY \
76+
-e LITELLM_DROP_PARAMS=true \
77+
-e AWS_BEARER_TOKEN_BEDROCK \
78+
-e LLAMA_STACK_LOGGING=$${LLAMA_STACK_LOGGING:-} \
79+
-e FAISS_VECTOR_STORE_ID=$${FAISS_VECTOR_STORE_ID:-} \
80+
$(LLAMA_STACK_IMAGE)
81+
@$(MAKE) wait-for-llama-stack-health
82+
83+
wait-for-llama-stack-health: ## Wait for llama-stack container to be healthy
84+
@echo "Waiting for llama-stack container to be healthy..."
85+
@for i in {1..30}; do \
86+
STATUS=$$($(CONTAINER_RUNTIME) inspect --format='{{.State.Health.Status}}' $(LLAMA_STACK_CONTAINER_NAME) 2>/dev/null || echo "no-healthcheck"); \
87+
if [ "$$STATUS" = "healthy" ]; then \
88+
echo "✓ Llama-stack is healthy and ready!"; \
89+
exit 0; \
90+
fi; \
91+
echo " Health status: $$STATUS (attempt $$i/30)"; \
92+
sleep 2; \
93+
done; \
94+
echo "✗ ERROR: Llama-stack did not become healthy within 60 seconds"; \
95+
echo "Container logs:"; \
96+
$(CONTAINER_RUNTIME) logs $(LLAMA_STACK_CONTAINER_NAME); \
97+
exit 1
98+
99+
clean-llama-stack: remove-llama-stack-container ## Remove container and image
100+
@if [ -n "$(CONTAINER_RUNTIME)" ] && $(CONTAINER_RUNTIME) images -q $(LLAMA_STACK_IMAGE) | grep -q .; then \
101+
echo "Removing llama-stack image..."; \
102+
$(CONTAINER_RUNTIME) rmi $(LLAMA_STACK_IMAGE); \
103+
fi
21104

22105
test-unit: ## Run the unit tests
23106
@echo "Running unit tests..."

0 commit comments

Comments
 (0)