Repository navigation
Commit 6daed77
committed
fix(serve): honor source_code for image_uri/model-server builds
ModelBuilder classified any image_uri build without an in-memory model
or inference_spec as passthrough, ignoring source_code. _build_for_
passthrough() then cleared source_dir/entry_point, so custom inference
code was silently dropped: no repack occurred, the container pointed at
the raw model artifact, register()/deploy() produced a model with no
serving code. Regressed from v2 Model(model_data, entry_point,
source_dir) + _RepackModelStep; introduced by #5969 (commit ebeb54c)
which added the passthrough nulling.
Fix the passthrough classification at its source: do not treat a build
as passthrough when source_code is set (both 1P and non-1P image
branches). Such builds route to the normal model-server path and repack
the code into the artifact.
Also:
- Relax the _build_for_model_server guard to accept s3_model_data_url
(a prebuilt training artifact) alongside model/MLflow/inference_spec.
- In _upload_code repack, pass script_dependencies (a list) instead of
the deprecated self.dependencies auto-detect dict, which repack_model
would otherwise iterate as filesystem paths.
- Update _build_for_model_server unit tests to set s3_model_data_url
so the missing-parameter cases still validate.1 parent a7e4ec0 commit 6daed77
3 files changed
Lines changed: 22 additions & 40 deletions
File tree
- sagemaker-serve
- src/sagemaker/serve
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1851 | 1851 | | |
1852 | 1852 | | |
1853 | 1853 | | |
| 1854 | + | |
1854 | 1855 | | |
1855 | 1856 | | |
1856 | 1857 | | |
| |||
1861 | 1862 | | |
1862 | 1863 | | |
1863 | 1864 | | |
| 1865 | + | |
1864 | 1866 | | |
1865 | 1867 | | |
1866 | 1868 | | |
| |||
1879 | 1881 | | |
1880 | 1882 | | |
1881 | 1883 | | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
1889 | | - | |
1890 | | - | |
1891 | | - | |
1892 | | - | |
1893 | | - | |
1894 | | - | |
1895 | | - | |
1896 | | - | |
1897 | | - | |
1898 | | - | |
1899 | | - | |
1900 | | - | |
1901 | | - | |
1902 | | - | |
1903 | | - | |
1904 | | - | |
1905 | | - | |
1906 | | - | |
1907 | | - | |
1908 | | - | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | 1884 | | |
1921 | 1885 | | |
1922 | 1886 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
105 | 117 | | |
106 | 118 | | |
107 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
| |||
328 | 330 | | |
329 | 331 | | |
330 | 332 | | |
| 333 | + | |
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
| |||
469 | 472 | | |
470 | 473 | | |
471 | 474 | | |
| 475 | + | |
472 | 476 | | |
473 | 477 | | |
474 | 478 | | |
| |||
485 | 489 | | |
486 | 490 | | |
487 | 491 | | |
| 492 | + | |
488 | 493 | | |
489 | 494 | | |
490 | 495 | | |
| |||
501 | 506 | | |
502 | 507 | | |
503 | 508 | | |
| 509 | + | |
504 | 510 | | |
505 | 511 | | |
506 | 512 | | |
| |||
0 commit comments