Repository navigation
Commit a7e4ec0
committed
fix(serve): repack source_code for image_uri/ModelTrainer builds
ModelBuilder classified any image_uri build with a model artifact and
source_code (no model/inference_spec) as passthrough and dropped the
inference code, so build() produced a model.tar.gz without code/ and
register() yielded a package that could not serve. This regressed the
classic v2 Model(model_data, entry_point, source_dir) repack behavior.
In _build_for_passthrough(), distinguish a pure image-only deployment
from an "image + model artifact + source_code" build. For the latter,
keep the source code and bridge model_path to s3_model_data_url so the
existing _upload_code(repack=True) path repacks the code into the model
artifact, producing a self-contained tarball. Pure-image (Nova/BYOC)
passthrough behavior is unchanged. ModelTrainer builds are covered too
since they are normalized to model_path before validation.
Also pass script_dependencies (a list derived from SourceCode) to
repack_model instead of the deprecated self.dependencies auto-detect
dict, which repack_model would otherwise iterate as filesystem paths.1 parent 368a1a9 commit a7e4ec0
1 file changed
Lines changed: 46 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1879 | 1879 | | |
1880 | 1880 | | |
1881 | 1881 | | |
| 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 | + | |
1882 | 1920 | | |
1883 | 1921 | | |
1884 | 1922 | | |
| |||
2282 | 2320 | | |
2283 | 2321 | | |
2284 | 2322 | | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
2285 | 2329 | | |
2286 | 2330 | | |
2287 | 2331 | | |
2288 | 2332 | | |
2289 | 2333 | | |
2290 | 2334 | | |
2291 | 2335 | | |
2292 | | - | |
| 2336 | + | |
2293 | 2337 | | |
2294 | 2338 | | |
2295 | 2339 | | |
2296 | 2340 | | |
2297 | 2341 | | |
2298 | 2342 | | |
2299 | | - | |
| 2343 | + | |
2300 | 2344 | | |
2301 | 2345 | | |
2302 | 2346 | | |
| |||
0 commit comments