3131# │ └── vector-db-data-N/
3232# │ ├── faiss_store.db
3333# │ └── llama-stack.yaml
34- # ├── ocp_vector_db/
35- # │ ├── ocp_X.YZ/
36- # │ │ ├── faiss_store.db
37- # │ │ └── llama-stack.yaml
38- # │ └── ocp_latest/
39- # │ ├── faiss_store.db
40- # │ └── llama-stack.yaml
4134# ├── embeddings_model/
4235# │ └── <model_files>
4336# └── okp_embeddings_model/
4841# ├── <random-tmp-dir>/
4942# │ ├── vector_db/
5043# │ │ ├── vector-db-data-1/
51- # │ │ ├── vector-db-data-N/
52- # │ │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
44+ # │ │ └── vector-db-data-N/
5345# │ └── embeddings_model/
5446# │ └── <model_files>
5547# └── okp_embeddings_model/ (if --enable-okp true)
5648# └── <model_files>
5749#
5850# Arguments:
5951# --vector-db-path PATH Target directory for collected data (required)
60- # --enable-ocp-rag BOOL Enable OCP vector DB collection: true/false (required)
61- # --ocp-version VERSION OCP version to collect, e.g., "X.YZ" (required)
6252# --enable-okp Enable OKP embedding model collection (flag, default: disabled)
6353
6454set -eu
@@ -69,17 +59,6 @@ set -eu
6959# image is mounted. Populated via parse_arguments_and_init.
7060VECTOR_DB_VOLUME_MOUNT_PATH=" "
7161
72- # ENABLE_OCP_RAG specifies whether this script should collect vector database
73- # content related to OCP (expected to be found under OCP_VECTOR_DB_DIR).
74- # Must be set to "true" for the collection to be enabled. Populated via
75- # parse_arguments_and_init.
76- ENABLE_OCP_RAG=" "
77-
78- # OCP_VERSION specifies what version of OCP content should be collected from
79- # the vector database image -> ${OCP_VECTOR_DB_DIR}/ocp_${OCP_VERSION}. Populated
80- # via parse_arguments_and_init.
81- OCP_VERSION=" "
82-
8362# ENABLE_OKP specifies whether this script should collect the OKP embedding
8463# model (expected to be found under OKP_EMBEDDING_MODEL_SRC). Defaults to
8564# "false"; set to "true" via --enable-okp to enable collection.
@@ -102,16 +81,6 @@ VECTOR_DB_DATA_COLLECT_DIR=""
10281# embeddings model should be stored. Populated via parse_arguments_and_init.
10382EMBEDDINGS_MODEL_DATA_COLLECT_DIR=" "
10483
105- # OCP_VECTOR_DB_DIR specifies the directory within the vector DB container image
106- # where OCP-specific vector DB data must reside. This script expects to find the
107- # OCP data exclusively at this location.
108- OCP_VECTOR_DB_DIR=" /rag/ocp_vector_db"
109-
110- # OCP_VECTOR_DB_DIR_FALLBACK specifies the directory within the vector DB container
111- # image that contains the default OCP vector DB data. This path is used when no data
112- # matching the version specified via --ocp-version is found.
113- OCP_VECTOR_DB_DIR_FALLBACK=" /rag/ocp_vector_db/ocp_latest"
114-
11584# VECTOR_DB_DIR specifies the directory within the vector DB container image
11685# where general vector DB data must reside.
11786VECTOR_DB_DIR=" /rag/vector_db"
@@ -140,25 +109,15 @@ parse_arguments_and_init() {
140109 VECTOR_DB_VOLUME_MOUNT_PATH=" $2 "
141110 shift 2
142111 ;;
143- --enable-ocp-rag)
144- ENABLE_OCP_RAG=" $2 "
145- shift 2
146- ;;
147- --ocp-version)
148- OCP_VERSION=" $2 "
149- shift 2
150- ;;
151112 --enable-okp)
152113 ENABLE_OKP=" true"
153114 shift 1
154115 ;;
155116 -h|--help)
156- echo " Usage: $0 --vector-db-path PATH --enable-ocp-rag BOOL --ocp-version VERSION [--enable-okp]"
117+ echo " Usage: $0 --vector-db-path PATH [--enable-okp]"
157118 echo " "
158119 echo " Arguments:"
159120 echo " --vector-db-path Target path for vector DB data collection"
160- echo " --enable-ocp-rag Enable OCP RAG collection (true/false)"
161- echo " --ocp-version OCP version to collect (e.g., 4.16)"
162121 echo " --enable-okp Enable OKP embedding model collection (default: disabled)"
163122 echo " -h, --help Show this help message"
164123 exit 0
@@ -176,16 +135,6 @@ parse_arguments_and_init() {
176135 exit 1
177136 fi
178137
179- if [ -z " ${ENABLE_OCP_RAG:- } " ]; then
180- echo " ERROR: --enable-ocp-rag is required"
181- exit 1
182- fi
183-
184- if [ -z " ${OCP_VERSION:- } " ]; then
185- echo " ERROR: --ocp-version is required"
186- exit 1
187- fi
188-
189138 COLLECT_DIR=$( mktemp -d " ${VECTOR_DB_VOLUME_MOUNT_PATH} /XXXXXXXXXX" )
190139 VECTOR_DB_DATA_COLLECT_DIR=" ${COLLECT_DIR} /vector_db/"
191140 EMBEDDINGS_MODEL_DATA_COLLECT_DIR=" ${COLLECT_DIR} /embeddings_model"
@@ -210,26 +159,6 @@ validate_vector_db_dir() {
210159 fi
211160}
212161
213- collect_ocp_vector_db_data () {
214- if [ " ${ENABLE_OCP_RAG} " != " true" ]; then
215- echo " Collecting of OCP vector db data is DISABLED => Skipping"
216- return
217- fi
218-
219- echo " Collecting OCP vector DB data ..."
220- mkdir -p " ${VECTOR_DB_DATA_COLLECT_DIR} "
221-
222- ocp_dir=" ${OCP_VECTOR_DB_DIR} /ocp_${OCP_VERSION} "
223- if [ ! -d " ${ocp_dir} " ]; then
224- echo " Data for OCP version ${OCP_VERSION} not found. Using: ${OCP_VECTOR_DB_DIR_FALLBACK} "
225- ocp_dir=${OCP_VECTOR_DB_DIR_FALLBACK}
226- fi
227-
228- validate_vector_db_dir " ${ocp_dir} "
229- cp -rL " ${ocp_dir} " " ${VECTOR_DB_DATA_COLLECT_DIR} "
230- echo " Discovered and collected OCP vector DB data from ${ocp_dir} "
231- }
232-
233162collect_vector_db_data () {
234163 echo " Collecting vector DB data ..."
235164 mkdir -p " ${VECTOR_DB_DATA_COLLECT_DIR} "
@@ -243,8 +172,8 @@ collect_vector_db_data() {
243172 echo " Discovered and collected vector DB data from ${dir} "
244173 done
245174
246- if [ " ${ENABLE_OCP_RAG} " != " true " ] && [ ${vector_db_data_collected} != " true" ]; then
247- echo " ERROR: ENABLE_OCP_RAG=' ${ENABLE_OCP_RAG} ' and no generic vector db data found."
175+ if [ ${vector_db_data_collected} != " true" ]; then
176+ echo " ERROR: no generic vector db data found."
248177 exit 1
249178 fi
250179}
@@ -288,7 +217,6 @@ main() {
288217 # variables are initialized before proceeding.
289218 parse_arguments_and_init " $@ "
290219 collect_vector_db_data
291- collect_ocp_vector_db_data
292220 collect_embeddings_model
293221 collect_okp_embeddings_model
294222}
0 commit comments