3838# │ └── ocp_latest/
3939# │ ├── faiss_store.db
4040# │ └── llama-stack.yaml
41- # └── embeddings_model/
41+ # ├── embeddings_model/
42+ # │ └── <model_files>
43+ # └── okp_embeddings_model/
4244# └── <model_files>
4345#
4446# Output Structure:
4547# <target-path>/ (specified via --vector-db-path)
46- # └── <random-tmp-dir>/
47- # ├── vector_db/
48- # │ ├── vector-db-data-1/
49- # │ ├── vector-db-data-N/
50- # │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
51- # └── embeddings_model/
52- # └── <model_files>
48+ # ├── <random-tmp-dir>/
49+ # │ ├── vector_db/
50+ # │ │ ├── vector-db-data-1/
51+ # │ │ ├── vector-db-data-N/
52+ # │ │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
53+ # │ └── embeddings_model/
54+ # │ └── <model_files>
55+ # └── okp_embeddings_model/ (if --enable-okp true)
56+ # └── <model_files>
5357#
5458# Arguments:
5559# --vector-db-path PATH Target directory for collected data (required)
5660# --enable-ocp-rag BOOL Enable OCP vector DB collection: true/false (required)
5761# --ocp-version VERSION OCP version to collect, e.g., "X.YZ" (required)
62+ # --enable-okp Enable OKP embedding model collection (flag, default: disabled)
5863
5964set -eu
6065
@@ -74,6 +79,11 @@ ENABLE_OCP_RAG=""
7479# the vector database image -> ${OCP_VECTOR_DB_DIR}/ocp_${OCP_VERSION}. Populated
7580# via parse_arguments_and_init.
7681OCP_VERSION=" "
82+
83+ # ENABLE_OKP specifies whether this script should collect the OKP embedding
84+ # model (expected to be found under OKP_EMBEDDING_MODEL_SRC). Defaults to
85+ # "false"; set to "true" via --enable-okp to enable collection.
86+ ENABLE_OKP=" false"
7787# ----------------------------------------------------------------------------
7888
7989# -- Global vars -------------------------------------------------------------
@@ -110,6 +120,10 @@ VECTOR_DB_DIR="/rag/vector_db"
110120# where embeddings model must reside.
111121EMBEDDINGS_MODEL_DIR=" /rag/embeddings_model"
112122
123+ # OKP_EMBEDDING_MODEL_SRC specifies the directory within the vector DB container
124+ # image where the OKP embedding model must reside.
125+ OKP_EMBEDDING_MODEL_SRC=" /rag/okp_embeddings_model"
126+
113127# OGX_CONFIG_FILE_NAME is the name of the OGX config file associated with a
114128# single vector database.
115129OGX_CONFIG_FILE_NAME=" llama-stack.yaml"
@@ -134,13 +148,18 @@ parse_arguments_and_init() {
134148 OCP_VERSION=" $2 "
135149 shift 2
136150 ;;
151+ --enable-okp)
152+ ENABLE_OKP=" true"
153+ shift 1
154+ ;;
137155 -h|--help)
138- echo " Usage: $0 --vector-db-path PATH --enable-ocp-rag BOOL --ocp-version VERSION"
156+ echo " Usage: $0 --vector-db-path PATH --enable-ocp-rag BOOL --ocp-version VERSION [--enable-okp] "
139157 echo " "
140158 echo " Arguments:"
141159 echo " --vector-db-path Target path for vector DB data collection"
142160 echo " --enable-ocp-rag Enable OCP RAG collection (true/false)"
143161 echo " --ocp-version OCP version to collect (e.g., 4.16)"
162+ echo " --enable-okp Enable OKP embedding model collection (default: disabled)"
144163 echo " -h, --help Show this help message"
145164 exit 0
146165 ;;
@@ -246,13 +265,32 @@ collect_embeddings_model() {
246265 echo " Discovered and collected embeddings model data from ${EMBEDDINGS_MODEL_DIR} "
247266}
248267
268+ collect_okp_embeddings_model () {
269+ if [ " ${ENABLE_OKP} " != " true" ]; then
270+ echo " Collecting of OKP embedding model is DISABLED => Skipping"
271+ return
272+ fi
273+
274+ if [ ! -d " ${OKP_EMBEDDING_MODEL_SRC} " ]; then
275+ echo " ERROR: OKP embedding model dir not found under ${OKP_EMBEDDING_MODEL_SRC} ."
276+ exit 1
277+ fi
278+
279+ echo " Collecting OKP embedding model ..."
280+ rm -rf " ${VECTOR_DB_VOLUME_MOUNT_PATH} /okp_embeddings_model"
281+ mkdir -p " ${VECTOR_DB_VOLUME_MOUNT_PATH} /okp_embeddings_model"
282+ cp -rL " ${OKP_EMBEDDING_MODEL_SRC} /." " ${VECTOR_DB_VOLUME_MOUNT_PATH} /okp_embeddings_model"
283+ echo " Discovered and collected OKP embedding model from ${OKP_EMBEDDING_MODEL_SRC} "
284+ }
285+
249286main () {
250287 # NOTE: parse_arguments_and_init must be called first to ensure all global
251288 # variables are initialized before proceeding.
252289 parse_arguments_and_init " $@ "
253290 collect_vector_db_data
254291 collect_ocp_vector_db_data
255292 collect_embeddings_model
293+ collect_okp_embeddings_model
256294}
257295
258296main " $@ "
0 commit comments