mirror of
https://github.com/hanzo-ml/kserve.git
synced 2026-10-30 20:53:49 +00:00
Signed-off-by: Milind Waykole <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Jooho Lee <[email protected]> Co-authored-by: Sivanantham <[email protected]>
26 lines
724 B
Python
26 lines
724 B
Python
#!/usr/bin/env python3
|
|
import sys
|
|
|
|
from kserve_storage import Storage
|
|
from kserve_storage.logging import configure_logging, logger
|
|
|
|
configure_logging()
|
|
|
|
if len(sys.argv) < 3 or len(sys.argv) % 2 != 1:
|
|
print("Usage: initializer-entrypoint src_uri_0 dest_path_0 ... src_uri_n dest_path_n")
|
|
sys.exit(1)
|
|
|
|
src_uris = sys.argv[1::2]
|
|
dest_paths = sys.argv[2::2]
|
|
|
|
logger.info("Initializing, args: (src_uri, dest_path): %s", list(zip(src_uris, dest_paths)))
|
|
|
|
try:
|
|
Storage.download_files(src_uris, dest_paths)
|
|
except RuntimeError as e:
|
|
logger.error("Storage initialization failed: %s", e)
|
|
sys.exit(1)
|
|
except Exception as e:
|
|
logger.error("Unexpected error during storage initialization: %s", e)
|
|
sys.exit(1)
|