Repository navigation
Commit 2d0804d
fix(image_uris): reject unsupported container_version instead of returning a bad URI (#6377)
* fix(image_uris): reject unsupported container_version instead of bad URI
retrieve() concatenated a caller-supplied container_version into the image
tag with no validation, so e.g. retrieve("pytorch", version="1.12",
image_scope="inference", instance_type="ml.p3.8xlarge", container_version="1.1")
returned pytorch-inference:1.12-gpu-py38-1.1 -- an image that does not exist
(the "1.1" is a Deep Learning Containers release version, not a tag build
component). The call silently succeeded with an unpullable URI (#3702).
container_version is only meaningful for frameworks whose tag carries a
trailing build component: declared in the config container_version map (which
already overrides the caller value), or appended by the graviton, neuron,
HuggingFace and pytorch-smp paths. For any other framework a caller-supplied
container_version can only produce a non-existent tag, so raise a clear
ValueError instead of returning a broken URI.
This is the V2 (master-v2) counterpart of #6376.
Add a unit test; existing graviton and HuggingFace container_version tests
continue to pass.
Relates-to #3702
* fix(image_uris): allow container_version for Spark framework
The #3702 guard rejected a caller-supplied container_version for any
framework whose config has no container_version map and that is not
HuggingFace/graviton/neuron/pytorch-smp. That wrongly broke Spark:
PySparkProcessor/SparkJarProcessor call image_uris.retrieve("spark", ...,
container_version="v1"), and spark.json has no container_version map, so the
guard raised ValueError and broke Spark image retrieval
(test_processing.py::test_retrieve_image_uri).
Replace the ad hoc framework checks with an explicit
FRAMEWORKS_WITH_CONTAINER_VERSION_SUFFIX allowlist (huggingface, pytorch-smp,
spark) so the set of frameworks that legitimately append a container_version
is self-documenting, and add a Spark regression test.
Relates-to #3702
---------
Co-authored-by: Roja Reddy Sareddy <rsareddy@amazon.com>1 parent 7c37579 commit 2d0804d
2 files changed
Lines changed: 83 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
226 | 235 | | |
227 | 236 | | |
228 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
229 | 242 | | |
230 | 243 | | |
231 | 244 | | |
| |||
281 | 294 | | |
282 | 295 | | |
283 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
284 | 322 | | |
285 | 323 | | |
286 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
86 | 131 | | |
87 | 132 | | |
88 | 133 | | |
| |||
0 commit comments