Skip to content

Commit 38536cb

Browse files
mwaykolecursoragentJoohosivanantha321
authored
fix: improve storage-initializer error messages (kserve#5016)
Signed-off-by: Milind Waykole <mwaykole@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Jooho Lee <jlee@redhat.com> Co-authored-by: Sivanantham <90966311+sivanantha321@users.noreply.github.com>
1 parent 8cec2b5 commit 38536cb

7 files changed

Lines changed: 644 additions & 212 deletions

File tree

python/storage-initializer/scripts/initializer-entrypoint

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ configure_logging()
88

99
if len(sys.argv) < 3 or len(sys.argv) % 2 != 1:
1010
print("Usage: initializer-entrypoint src_uri_0 dest_path_0 ... src_uri_n dest_path_n")
11-
sys.exit()
11+
sys.exit(1)
1212

1313
src_uris = sys.argv[1::2]
1414
dest_paths = sys.argv[2::2]
1515

16-
logger.info(f"Initializing, args: (src_uri, dest_path): {[(src_uri, dest_path) for src_uri, dest_path in zip(src_uris, dest_paths)]}")
17-
Storage.download_files(src_uris, dest_paths)
16+
logger.info("Initializing, args: (src_uri, dest_path): %s", list(zip(src_uris, dest_paths)))
17+
18+
try:
19+
Storage.download_files(src_uris, dest_paths)
20+
except RuntimeError as e:
21+
logger.error("Storage initialization failed: %s", e)
22+
sys.exit(1)
23+
except Exception as e:
24+
logger.error("Unexpected error during storage initialization: %s", e)
25+
sys.exit(1)

python/storage/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ These are all handled by the `huggingface_hub` package, you can see all the avai
115115
- `S3_VERIFY_SSL`: Enable/disable SSL verification
116116
- `S3_USER_VIRTUAL_BUCKET`: Use virtual hosted-style URLs
117117
- `S3_USE_ACCELERATE`: Use transfer acceleration
118-
- `S3_MAX_FILE_CONCURRENCY`: number of files to download parallel
118+
- `S3_MAX_FILE_CONCURRENCY`: Number of files to download in parallel
119+
- `S3_CONNECT_TIMEOUT`: Connection timeout in seconds (default: 15)
120+
- `S3_READ_TIMEOUT`: Read timeout in seconds (default: 30)
121+
- `S3_MAX_ATTEMPTS`: Maximum retry attempts for S3 operations (default: 3)
119122
- `awsAnonymousCredential`: Use unsigned requests for public access
120123

121124
### Azure Configuration

0 commit comments

Comments
 (0)