fix(serve): create local model_path dir before using it as download dir - #6147
Conversation
ModelBuilder.build() assigned the default model_path (/tmp/sagemaker/model-builder/<uuid>) to settings._local_download_dir without creating it on disk, so repack_model()'s _tmpdir() validation raised "Inputted directory ... does not exist" for source_code repack builds. Only use model_path as the local download dir when it is a local path, creating it first; skip s3:// URIs.
|
Claude finished @lucasjia-aws's task in 50s —— View job PR Review: create local model_path dir before using it as download dir
The fix looks correct and well-targeted. A few things I verified:
Minor considerations (non-blocking)
Overall this is a small, sensible bug fix. The main suggestion is adding a regression test for the source_code repack path. |
|
1. 2. 3. Regression test — Added |
|
Claude finished @lucasjia-aws's task in 46s —— View job PR Review: create local model_path dir before using it as download dir
The updated PR looks clean and correct. The added tests address the one gap flagged in the earlier round. Correctness — confirmed
Tests — good coverage
Minor (non-blocking)
No blocking issues. Ship it. |
|
Both test failures are flaky and unrelated to this PR (which only touches
Both are concurrency races in infra/service code, not regressions from this change. Retrying should turn them green. |
ModelBuilder.build() assigned the default model_path (/tmp/sagemaker/model-builder/) to settings._local_download_dir without creating it on disk, so repack_model()'s _tmpdir() validation raised "Inputted directory ... does not exist" for source_code repack builds. Only use model_path as the local download dir when it is a local path, creating it first; skip s3:// URIs.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.