Skip to content

Commit 244d6b0

Browse files
committed
Separate RAG content and embeddings images, use CPU version of torch library
1 parent ab0df77 commit 244d6b0

File tree

7 files changed

+79
-294
lines changed

7 files changed

+79
-294
lines changed

.tekton/ansible-chatbot-service-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ spec:
258258
- name: COMMIT_SHA
259259
value: $(tasks.clone-repository.results.commit)
260260
- name: BUILD_ARGS
261-
value: ["IMAGE_TAGS=pr-{{pull_request_number}} pr-{{pull_request_number}}.$(tasks.git-metadata.results.commit-timestamp)", "GIT_COMMIT=$(tasks.clone-repository.results.commit)", "RAG_CONTENTS_SUB_FOLDER=vector_db/aap_product_docs", "LIGHTSPEED_RAG_CONTENT_IMAGE=quay.io/ansible/aap-rag-content:latest"]
261+
value: ["IMAGE_TAGS=pr-{{pull_request_number}} pr-{{pull_request_number}}.$(tasks.git-metadata.results.commit-timestamp)", "GIT_COMMIT=$(tasks.clone-repository.results.commit)", "RAG_CONTENTS_SUB_FOLDER=vector_db/aap_product_docs", "LIGHTSPEED_RAG_CONTENT_IMAGE=quay.io/ansible/aap-rag-content:latest", "LIGHTSPEED_RAG_EMBEDDINGS_IMAGE=quay.io/ansible/aap-rag-embeddings-image:latest"]
262262
- name: BUILD_ARGS_FILE
263263
value: $(params.build-args-file)
264264
runAfter:

.tekton/ansible-chatbot-service-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ spec:
274274
- name: TARGET_STAGE
275275
value: production
276276
- name: BUILD_ARGS
277-
value: [ "IMAGE_TAGS=latest 1.0.$(tasks.git-metadata.results.commit-timestamp)", "GIT_COMMIT=$(tasks.clone-repository.results.commit)", "RAG_CONTENTS_SUB_FOLDER=vector_db/aap_product_docs", "LIGHTSPEED_RAG_CONTENT_IMAGE=quay.io/ansible/aap-rag-content:latest"]
277+
value: [ "IMAGE_TAGS=latest 1.0.$(tasks.git-metadata.results.commit-timestamp)", "GIT_COMMIT=$(tasks.clone-repository.results.commit)", "RAG_CONTENTS_SUB_FOLDER=vector_db/aap_product_docs", "LIGHTSPEED_RAG_CONTENT_IMAGE=quay.io/ansible/aap-rag-content:latest", "LIGHTSPEED_RAG_EMBEDDINGS_IMAGE=quay.io/ansible/aap-rag-embeddings-image:latest"]
278278
runAfter:
279279
- prefetch-dependencies
280280
taskRef:

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
2828
WORKDIR /app-root
2929

3030
COPY --from=lightspeed-rag-content /rag/${RAG_CONTENTS_SUB_FOLDER} ${APP_ROOT}/${RAG_CONTENTS_SUB_FOLDER}
31-
COPY --from=lightspeed-rag-content /rag/embeddings_model ./embeddings_model
31+
COPY --from=lightspeed-rag-embeddings /rag/embeddings_model ./embeddings_model
3232

3333
# Add explicit files and directories
3434
# (avoid accidental inclusion of local directories or env files or credentials)

pdm.lock

Lines changed: 55 additions & 220 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ description = "Road-core service is an AI powered assistant that runs on OpenShi
8989
authors = []
9090
dependencies = [
9191
"pdm==2.21.0",
92-
"torch==2.5.1",
92+
'torch@http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp311-cp311-linux_x86_64.whl ; platform_system != "Darwin"',
93+
'torch-macos@http://download.pytorch.org/whl/cpu/torch-2.5.1-cp311-none-macosx_11_0_arm64.whl ; platform_system == "Darwin"',
9394
"pandas==2.1.4",
9495
"httpx==0.27.2",
9596
"fastapi==0.115.6",

requirements.txt

Lines changed: 16 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ frozenlist==1.5.0 \
235235
fsspec==2024.12.0 \
236236
--hash=sha256:670700c977ed2fb51e0d9f9253177ed20cbde4a3e5c0283cc5385b5870c8533f \
237237
--hash=sha256:b520aed47ad9804237ff878b504267a3b0b441e97508bd6d2d8774e3db85cee2
238-
google-auth==2.38.0 \
239-
--hash=sha256:8285113607d3b80a3f1543b75962447ba8a09fe85783432a784fdeef6ac094c4 \
240-
--hash=sha256:e7dae6694313f434a2727bf2906f27ad259bae090d7aa896590d86feec3d9d4a
238+
google-auth==2.37.0 \
239+
--hash=sha256:0054623abf1f9c83492c63d3f47e77f0a544caa3d40b2d98e099a611c2dd5d00 \
240+
--hash=sha256:42664f18290a6be591be5329a96fe30184be1a1badb7292a7f686a9659de9ca0
241241
greenlet==3.1.1 \
242242
--hash=sha256:09fc016b73c94e98e29af67ab7b9a879c307c6731a2c9da0db5a7d9b7edd1159 \
243243
--hash=sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9 \
@@ -362,9 +362,9 @@ langchain-text-splitters==0.3.5 \
362362
langsmith==0.1.147 \
363363
--hash=sha256:2e933220318a4e73034657103b3b1a3a6109cc5db3566a7e8e03be8d6d7def7a \
364364
--hash=sha256:7166fc23b965ccf839d64945a78e9f1157757add228b086141eb03a60d699a15
365-
llama-cloud==0.1.10 \
366-
--hash=sha256:56ffe8f2910c2047dd4eb1b13da31ee5f67321a000794eee559e0b56954d2f76 \
367-
--hash=sha256:d91198ad92ea6c3a25757e5d6cb565b4bd6db385dc4fa596a725c0fb81a68f4e
365+
llama-cloud==0.1.9 \
366+
--hash=sha256:792ee316985bbf4dd0294007105a100489d4baba0bcc4f3e16284f0c01d832d4 \
367+
--hash=sha256:fc03bd338a1da04b7607a44d82a62b3eb178d80af05a53653e801d6f8bb67df7
368368
llama-index==0.12.2 \
369369
--hash=sha256:971528db7889f5a0d15fd9039a403bc6f92bfafc2d4e1bab2d166657728ae94c \
370370
--hash=sha256:da9738dd666e219689839c7451c9df8bed72e6510a6f7d6f7d9907bfdd4588eb
@@ -410,9 +410,9 @@ llama-index-readers-llama-parse==0.4.0 \
410410
llama-index-vector-stores-faiss==0.3.0 \
411411
--hash=sha256:2148163dba1222c855bd367a7b796bc35d46dc2e77d57bafd321ba14aac00177 \
412412
--hash=sha256:c9df99dd00fe7058606ef4fce113535fa30b73edd650136be87c9b5b240df3f9
413-
llama-parse==0.5.20 \
414-
--hash=sha256:649e256431d3753025b9a320bb03b76849ce4b5a1121394c803df543e6c1006f \
415-
--hash=sha256:9617edb3428d3218ea01f1708f0b6105f3ffef142fedbeb8c98d50082c37e226
413+
llama-parse==0.5.19 \
414+
--hash=sha256:715cc895d183531b4299359d4f4004089b2e522f5f137f316084e7aa04035b62 \
415+
--hash=sha256:db69da70e199a2664705eb983a70fa92b7cee19dd6cff175af7692a0b8a4dd53
416416
lomond==0.3.3 \
417417
--hash=sha256:427936596b144b4ec387ead99aac1560b77c8a78107d3d49415d3abbe79acbd3 \
418418
--hash=sha256:df1dd4dd7b802a12b71907ab1abb08b8ce9950195311207579379eb3b1553de7
@@ -441,9 +441,9 @@ markupsafe==2.1.5 \
441441
--hash=sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b \
442442
--hash=sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b \
443443
--hash=sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5
444-
marshmallow==3.26.0 \
445-
--hash=sha256:1287bca04e6a5f4094822ac153c03da5e214a0a60bcd557b140f3e66991b8ca1 \
446-
--hash=sha256:eb36762a1cc76d7abf831e18a3a1b26d3d481bbc74581b8e532a3d3a8115e1cb
444+
marshmallow==3.25.1 \
445+
--hash=sha256:ec5d00d873ce473b7f2ffcb7104286a376c354cab0c2fa12f5573dab03e87210 \
446+
--hash=sha256:f4debda3bb11153d81ac34b0d582bf23053055ee11e791b54b4b35493468040a
447447
mdurl==0.1.2 \
448448
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
449449
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
@@ -543,51 +543,6 @@ numpy==1.26.4 \
543543
--hash=sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218 \
544544
--hash=sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2 \
545545
--hash=sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef
546-
nvidia-cublas-cu12==12.4.5.8; platform_system == "Linux" and platform_machine == "x86_64" \
547-
--hash=sha256:0f8aa1706812e00b9f19dfe0cdb3999b092ccb8ca168c0db5b8ea712456fd9b3 \
548-
--hash=sha256:2fc8da60df463fdefa81e323eef2e36489e1c94335b5358bcb38360adf75ac9b \
549-
--hash=sha256:5a796786da89203a0657eda402bcdcec6180254a8ac22d72213abc42069522dc
550-
nvidia-cuda-cupti-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64" \
551-
--hash=sha256:5688d203301ab051449a2b1cb6690fbe90d2b372f411521c86018b950f3d7922 \
552-
--hash=sha256:79279b35cf6f91da114182a5ce1864997fd52294a87a16179ce275773799458a \
553-
--hash=sha256:9dec60f5ac126f7bb551c055072b69d85392b13311fcc1bcda2202d172df30fb
554-
nvidia-cuda-nvrtc-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64" \
555-
--hash=sha256:0eedf14185e04b76aa05b1fea04133e59f465b6f960c0cbf4e37c3cb6b0ea198 \
556-
--hash=sha256:a178759ebb095827bd30ef56598ec182b85547f1508941a3d560eb7ea1fbf338 \
557-
--hash=sha256:a961b2f1d5f17b14867c619ceb99ef6fcec12e46612711bcec78eb05068a60ec
558-
nvidia-cuda-runtime-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64" \
559-
--hash=sha256:09c2e35f48359752dfa822c09918211844a3d93c100a715d79b59591130c5e1e \
560-
--hash=sha256:64403288fa2136ee8e467cdc9c9427e0434110899d07c779f25b5c068934faa5 \
561-
--hash=sha256:961fe0e2e716a2a1d967aab7caee97512f71767f852f67432d572e36cb3a11f3
562-
nvidia-cudnn-cu12==9.1.0.70; platform_system == "Linux" and platform_machine == "x86_64" \
563-
--hash=sha256:165764f44ef8c61fcdfdfdbe769d687e06374059fbb388b6c89ecb0e28793a6f \
564-
--hash=sha256:6278562929433d68365a07a4a1546c237ba2849852c0d4b2262a486e805b977a
565-
nvidia-cufft-cu12==11.2.1.3; platform_system == "Linux" and platform_machine == "x86_64" \
566-
--hash=sha256:5dad8008fc7f92f5ddfa2101430917ce2ffacd86824914c82e28990ad7f00399 \
567-
--hash=sha256:d802f4954291101186078ccbe22fc285a902136f974d369540fd4a5333d1440b \
568-
--hash=sha256:f083fc24912aa410be21fa16d157fed2055dab1cc4b6934a0e03cba69eb242b9
569-
nvidia-curand-cu12==10.3.5.147; platform_system == "Linux" and platform_machine == "x86_64" \
570-
--hash=sha256:1f173f09e3e3c76ab084aba0de819c49e56614feae5c12f69883f4ae9bb5fad9 \
571-
--hash=sha256:a88f583d4e0bb643c49743469964103aa59f7f708d862c3ddb0fc07f851e3b8b \
572-
--hash=sha256:f307cc191f96efe9e8f05a87096abc20d08845a841889ef78cb06924437f6771
573-
nvidia-cusolver-cu12==11.6.1.9; platform_system == "Linux" and platform_machine == "x86_64" \
574-
--hash=sha256:19e33fa442bcfd085b3086c4ebf7e8debc07cfe01e11513cc6d332fd918ac260 \
575-
--hash=sha256:d338f155f174f90724bbde3758b7ac375a70ce8e706d70b018dd3375545fc84e \
576-
--hash=sha256:e77314c9d7b694fcebc84f58989f3aa4fb4cb442f12ca1a9bde50f5e8f6d1b9c
577-
nvidia-cusparse-cu12==12.3.1.170; platform_system == "Linux" and platform_machine == "x86_64" \
578-
--hash=sha256:9bc90fb087bc7b4c15641521f31c0371e9a612fc2ba12c338d3ae032e6b6797f \
579-
--hash=sha256:9d32f62896231ebe0480efd8a7f702e143c98cfaa0e8a76df3386c1ba2b54df3 \
580-
--hash=sha256:ea4f11a2904e2a8dc4b1833cc1b5181cde564edd0d5cd33e3c168eff2d1863f1
581-
nvidia-nccl-cu12==2.21.5; platform_system == "Linux" and platform_machine == "x86_64" \
582-
--hash=sha256:8579076d30a8c24988834445f8d633c697d42397e92ffc3f63fa26766d25e0a0
583-
nvidia-nvjitlink-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64" \
584-
--hash=sha256:06b3b9b25bf3f8af351d664978ca26a16d2c5127dbd53c0497e28d1fb9611d57 \
585-
--hash=sha256:4abe7fef64914ccfa909bc2ba39739670ecc9e820c83ccc7a6ed414122599b83 \
586-
--hash=sha256:fd9020c501d27d135f983c6d3e244b197a7ccad769e34df53a42e276b0e25fa1
587-
nvidia-nvtx-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64" \
588-
--hash=sha256:641dccaaa1139f3ffb0d3164b4b84f9d253397e38246a4f2f36728b48566d485 \
589-
--hash=sha256:781e950d9b9f60d8241ccea575b32f5105a5baf4c2351cab5256a24869f12a1a \
590-
--hash=sha256:7959ad635db13edf4fc65c06a6e9f9e55fc2f92596db928d169c0bb031e88ef3
591546
oauthlib==3.2.2 \
592547
--hash=sha256:8139f29aac13e25d502680e9e19963e83f16838d48a0d71c287fe40e7067fbca \
593548
--hash=sha256:9859c40929662bec5d64f34d01c99e093149682a3f38915dc0655d5a633dd918
@@ -1034,24 +989,16 @@ tokenizers==0.21.0 \
1034989
tomlkit==0.12.0 \
1035990
--hash=sha256:01f0477981119c7d8ee0f67ebe0297a7c95b14cf9f4b102b45486deb77018716 \
1036991
--hash=sha256:926f1f37a1587c7a4f6c7484dae538f1345d96d793d9adab5d3675957b1d0766
1037-
torch==2.5.1 \
1038-
--hash=sha256:31f8c39660962f9ae4eeec995e3049b5492eb7360dd4f07377658ef4d728fa4c \
1039-
--hash=sha256:340ce0432cad0d37f5a31be666896e16788f1adf8ad7be481196b503dad675b9 \
1040-
--hash=sha256:3f4b7f10a247e0dcd7ea97dc2d3bfbfc90302ed36d7f3952b0008d0df264e697 \
1041-
--hash=sha256:603c52d2fe06433c18b747d25f5c333f9c1d58615620578c326d66f258686f9a \
1042-
--hash=sha256:73e58e78f7d220917c5dbfad1a40e09df9929d3b95d25e57d9f8558f84c9a11c \
1043-
--hash=sha256:8c712df61101964eb11910a846514011f0b6f5920c55dbf567bff8a34163d5b1 \
1044-
--hash=sha256:de5b7d6740c4b636ef4db92be922f0edc425b65ed78c5076c43c42d362a45457 \
1045-
--hash=sha256:ed231a4b3a5952177fafb661213d690a72caaad97d5824dd4fc17ab9e15cec03
992+
torch @ http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp311-cp311-linux_x86_64.whl \
993+
--hash=sha256:07d7c9e069123d5af08b0cf0013d74f680b2d8be7d9e2cf561a52c90c55d9409
994+
torch-macos @ http://download.pytorch.org/whl/cpu/torch-2.5.1-cp311-none-macosx_11_0_arm64.whl ; platform_system == "Darwin" \
995+
--hash=sha256:31f8c39660962f9ae4eeec995e3049b5492eb7360dd4f07377658ef4d728fa4c
1046996
tqdm==4.67.1 \
1047997
--hash=sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2 \
1048998
--hash=sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2
1049999
transformers==4.48.1 \
10501000
--hash=sha256:24be0564b0a36d9e433d9a65de248f1545b6f6edce1737669605eb6a8141bbbb \
10511001
--hash=sha256:7c1931facc3ee8adcbf86fc7a87461d54c1e40eca3bb57fef1ee9f3ecd32187e
1052-
triton==3.1.0; platform_system == "Linux" and platform_machine == "x86_64" and python_version < "3.13" \
1053-
--hash=sha256:0f34f6e7885d1bf0eaaf7ba875a5f0ce6f3c13ba98f9503651c1e6dc6757ed5c \
1054-
--hash=sha256:c8182f42fd8080a7d39d666814fa36c5e30cc00ea7eeeb1a2983dbb4c99a0fdc
10551002
truststore==0.10.0; python_version >= "3.10" \
10561003
--hash=sha256:5da347c665714fdfbd46f738c823fe9f0d8775e41ac5fb94f325749091187896 \
10571004
--hash=sha256:b3798548e421ffe2ca2a6217cca49e7a17baf40b72d86a5505dc7d701e77d15b

scripts/build-container-aap.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Build an ansible-chatbot-service image locally
44

55
AAP_VERSION=v2.5
6-
LIGHTSPEED_RAG_CONTENT_IMAGE=quay.io/ttakamiy/aap-rag-content:latest
6+
LIGHTSPEED_RAG_CONTENT_IMAGE=quay.io/ansible/aap-rag-content:latest
7+
LIGHTSPEED_RAG_EMBEDDINGS_IMAGE=quay.io/ansible/aap-rag-embeddings-image:latest
78
RAG_CONTENTS_SUB_FOLDER=vector_db/aap_product_docs
89

910
CACHE_OPTS=""
@@ -16,6 +17,7 @@ podman build \
1617
${CACHE_OPTS} \
1718
--build-arg=VERSION="${AAP_VERSION}" \
1819
--build-arg=LIGHTSPEED_RAG_CONTENT_IMAGE="${LIGHTSPEED_RAG_CONTENT_IMAGE}" \
20+
--build-arg=LIGHTSPEED_RAG_EMBEDDINGS_IMAGE="${LIGHTSPEED_RAG_EMBEDDINGS_IMAGE}" \
1921
--build-arg=RAG_CONTENTS_SUB_FOLDER="${RAG_CONTENTS_SUB_FOLDER}" \
2022
-t "${AAP_API_IMAGE:-quay.io/ansible/ansible-chatbot-service:latest}" \
2123
-f Containerfile

0 commit comments

Comments
 (0)