|
38 | 38 | # │ └── ocp_latest/ |
39 | 39 | # │ ├── faiss_store.db |
40 | 40 | # │ └── llama-stack.yaml |
41 | | -# └── embeddings_model/ |
| 41 | +# ├── embeddings_model/ |
| 42 | +# │ └── <model_files> |
| 43 | +# └── okp_embeddings_model/ |
42 | 44 | # └── <model_files> |
43 | 45 | # |
44 | 46 | # Output Structure: |
45 | 47 | # <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 present in the image) |
| 56 | +# └── <model_files> |
53 | 57 | # |
54 | 58 | # Arguments: |
55 | 59 | # --vector-db-path PATH Target directory for collected data (required) |
@@ -110,6 +114,10 @@ VECTOR_DB_DIR="/rag/vector_db" |
110 | 114 | # where embeddings model must reside. |
111 | 115 | EMBEDDINGS_MODEL_DIR="/rag/embeddings_model" |
112 | 116 |
|
| 117 | +# OKP_EMBEDDING_MODEL_SRC specifies the directory within the vector DB container |
| 118 | +# image where the OKP embedding model must reside. |
| 119 | +OKP_EMBEDDING_MODEL_SRC="/rag/okp_embeddings_model" |
| 120 | + |
113 | 121 | # OGX_CONFIG_FILE_NAME is the name of the OGX config file associated with a |
114 | 122 | # single vector database. |
115 | 123 | OGX_CONFIG_FILE_NAME="llama-stack.yaml" |
@@ -246,13 +254,26 @@ collect_embeddings_model() { |
246 | 254 | echo "Discovered and collected embeddings model data from ${EMBEDDINGS_MODEL_DIR}" |
247 | 255 | } |
248 | 256 |
|
| 257 | +collect_okp_embeddings_model() { |
| 258 | + if [ ! -d "${OKP_EMBEDDING_MODEL_SRC}" ]; then |
| 259 | + echo "OKP embedding model not found under ${OKP_EMBEDDING_MODEL_SRC} => Skipping" |
| 260 | + return |
| 261 | + fi |
| 262 | + |
| 263 | + echo "Collecting OKP embedding model ..." |
| 264 | + rm -rf "${VECTOR_DB_VOLUME_MOUNT_PATH}/okp_embeddings_model" |
| 265 | + cp -rL "${OKP_EMBEDDING_MODEL_SRC}" "${VECTOR_DB_VOLUME_MOUNT_PATH}/okp_embeddings_model" |
| 266 | + echo "Discovered and collected OKP embedding model from ${OKP_EMBEDDING_MODEL_SRC}" |
| 267 | +} |
| 268 | + |
249 | 269 | main() { |
250 | 270 | # NOTE: parse_arguments_and_init must be called first to ensure all global |
251 | 271 | # variables are initialized before proceeding. |
252 | 272 | parse_arguments_and_init "$@" |
253 | 273 | collect_vector_db_data |
254 | 274 | collect_ocp_vector_db_data |
255 | 275 | collect_embeddings_model |
| 276 | + collect_okp_embeddings_model |
256 | 277 | } |
257 | 278 |
|
258 | 279 | main "$@" |
0 commit comments