-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathContainerfile.local
More file actions
52 lines (45 loc) · 2.08 KB
/
Copy pathContainerfile.local
File metadata and controls
52 lines (45 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# https://quay.io/lightspeed-core/rag-content-cpu
ARG BASE_IMAGE=quay.io/lightspeed-core/rag-content-cpu@sha256:297db4e12b07dcf460b1b5186764f32b6bb41841d77d085aa5e650e30f7b9031
FROM ${BASE_IMAGE} AS lightspeed-core-rag-builder
ARG RHDH_DOCS_VERSION="1.10"
ARG GITHUB_PAT=""
ARG NUM_WORKERS=1
USER 0
WORKDIR /rag-content
RUN python -c "import nltk; nltk.download('stopwords')"
COPY scripts/ .
# Modify script inplace to account for new path
RUN sed -i 's/scripts\///' get_rhdh_plaintext_docs.sh
RUN GITHUB_PAT=${GITHUB_PAT} ./get_rhdh_plaintext_docs.sh $RHDH_DOCS_VERSION
RUN set -e && for RHDH_VERSION in $(ls -1 rhdh-product-docs-plaintext); do \
python ./generate_embeddings_rhdh.py \
-f rhdh-product-docs-plaintext/${RHDH_VERSION} \
-md embeddings_model \
-mn ${EMBEDDING_MODEL} \
-o vector_db/rhdh_product_docs/${RHDH_VERSION} \
-w ${NUM_WORKERS} \
-i rhdh-product-docs-$(echo $RHDH_VERSION | sed 's/\./_/g') \
-t rhdh-docs-topic-map/rhdh_topic_map.yaml \
--vector-store-type=llamastack-faiss \
-v ${RHDH_VERSION}; \
done
# https://registry.access.redhat.com/ubi9/ubi-micro
FROM registry.access.redhat.com/ubi9/ubi-micro:9.8-1782840931@sha256:35de56a9413112f1474e392ebc35e0cf6f0fb484c8e8877bbae59b513694b41f
COPY --from=lightspeed-core-rag-builder /rag-content/vector_db/rhdh_product_docs /rag/vector_db/rhdh_product_docs
COPY --from=lightspeed-core-rag-builder /rag-content/embeddings_model /rag/embeddings_model
USER 65532:65532