Commit a9845c6
authored
feat: Python version matrix for Docker images + error-masking fix (#76)
* feat: add Python version matrix for Docker images
Parameterize all 4 Dockerfiles with PYTHON_VERSION build arg.
GPU images also accept PYTORCH_BASE to select the correct PyTorch
base image per Python version.
Add versioned Makefile targets:
- build-all-versioned: builds 10 images (GPU 3.11/3.12, CPU 3.10-3.12)
- build-wip-versioned: multi-platform push with latest alias
- smoketest-versioned: verify Python version in each image
GPU base image mapping:
- Python 3.11: pytorch/pytorch:2.9.1-cuda12.8-cudnn9-runtime
- Python 3.12: pytorch/pytorch:2.10.0-cuda12.8-cudnn9-runtime
* fix: stop masking deployment errors by falling back to Live Serverless
Previously, _load_generated_handler() silently returned None on any
failure (missing file, import error, syntax error), causing deployed
endpoints to fall back to the FunctionRequest/Live Serverless handler.
This masked real deployment issues like Python version mismatches.
Now deployed mode (FLASH_RESOURCE_NAME set) treats handler loading
failures as fatal RuntimeError. Live Serverless mode skips the
generated handler entirely since it only uses FunctionRequest protocol.
* fix: update handler tests for RuntimeError + sync uv.lock
Tests expected None returns but handler.py now raises RuntimeError in
deployed mode. Updated all 8 TestLoadGeneratedHandler tests to use
pytest.raises(RuntimeError). Also synced uv.lock to pick up latest
runpod-flash version.
* feat: add Python version to startup banner
Include platform.python_version() in the worker boot banner for
runtime version visibility during E2E testing.
* fix(review): address PR #76 feedback
- Add build-time Python version validation to GPU Dockerfiles
- Restructure build-all-versioned to run setup once via internal targets
- Add version assertion to smoketest-versioned (fail on mismatch)
* fix(review): address PR #76 round 2 feedback
- Add default case to pytorch_base() shell function in all Makefile targets
- Guard test_handler.py import against FLASH_RESOURCE_NAME env var
* fix: preserve base image torch by removing Python symlink and targeting running interpreter
GPU Dockerfiles symlinked /usr/local/bin/python to /usr/bin/python3.X,
switching to the system Python which lacks torch and other base image
packages. Removed the symlink to preserve the pytorch base image's
environment. Changed dependency_installer to use sys.executable instead
of --system so runtime package installs go into the same site-packages
as torch.
* feat: versioned Docker image builds with single pytorch base image
- CI matrix builds py3.10/3.11/3.12 for all image types
- Removed per-version pytorch base mapping (single runpod/pytorch image)
- GPU/LB builds amd64-only (pytorch base has no arm64 manifest)
- Added --break-system-packages to CPU Dockerfiles
- Auto-detect local Python version in Makefile for build-wip
- Bumped runpod-flash dependency to >=1.7.0
- Removed .python-version (version comes from build args)
* fix: format dependency_installer.py
* docs: document Python version constraints and base image layout
GPU workers are pinned to Python 3.12 (torch/CUDA only installed for
3.12 in base image). CPU workers support 3.10-3.12. Added base image
Python layout details to architecture doc.
* feat: pin GPU images to Python 3.12, default CPU to 3.12
- GPU Dockerfiles: remove PYTHON_VERSION ARG (base image is 3.12),
add numpy install (excluded from tarballs by flash build)
- CPU Dockerfiles: default PYTHON_VERSION from 3.11 to 3.12
- Makefile: GPU_PYTHON_VERSIONS reduced to 3.12 only, remove
--build-arg PYTHON_VERSION from GPU/LB build targets
* chore: update lockfile
* fix: auto-detect local Python version for CPU image builds
PYTHON_VERSION was hardcoded to 3.12 default, ignoring the user's
local Python. Restore auto-detection so `make build-wip` with
Python 3.10 produces py3.10-wip CPU images as expected. GPU images
remain fixed at 3.12.
* fix(review): address PR #76 feedback -- CI matrix, Dockerfiles, pip safety
- Fix CI matrix duplication: use include-only for GPU jobs (3.12 only)
- Remove duplicate python-version list from CPU job matrices
- Add Python version validation to GPU Dockerfiles
- Use python -m pip instead of bare pip in Dockerfiles
- Use sys.executable for pip fallback in dependency_installer.py
- Update docs to match uv pip --python sys.executable implementation
- Correct image count comment in Makefile (8 not 10)
* chore: bump runpod-flash dependency to 1.8.01 parent 4499808 commit a9845c6
16 files changed
Lines changed: 746 additions & 1005 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
166 | 175 | | |
167 | 176 | | |
168 | 177 | | |
| |||
188 | 197 | | |
189 | 198 | | |
190 | 199 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
199 | 212 | | |
200 | 213 | | |
201 | 214 | | |
| |||
210 | 223 | | |
211 | 224 | | |
212 | 225 | | |
213 | | - | |
| 226 | + | |
214 | 227 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
219 | 231 | | |
220 | 232 | | |
221 | 233 | | |
222 | 234 | | |
223 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
224 | 245 | | |
225 | 246 | | |
226 | 247 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 248 | + | |
231 | 249 | | |
232 | 250 | | |
233 | 251 | | |
| |||
249 | 267 | | |
250 | 268 | | |
251 | 269 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
260 | 282 | | |
261 | 283 | | |
262 | 284 | | |
| |||
273 | 295 | | |
274 | 296 | | |
275 | 297 | | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
280 | 303 | | |
281 | 304 | | |
282 | 305 | | |
283 | 306 | | |
284 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
285 | 313 | | |
286 | 314 | | |
287 | 315 | | |
| |||
307 | 335 | | |
308 | 336 | | |
309 | 337 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
318 | 350 | | |
319 | 351 | | |
320 | 352 | | |
| |||
329 | 361 | | |
330 | 362 | | |
331 | 363 | | |
332 | | - | |
| 364 | + | |
333 | 365 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
338 | 369 | | |
339 | 370 | | |
340 | 371 | | |
341 | 372 | | |
342 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
343 | 383 | | |
344 | 384 | | |
345 | 385 | | |
| |||
365 | 405 | | |
366 | 406 | | |
367 | 407 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
376 | 420 | | |
377 | 421 | | |
378 | 422 | | |
| |||
389 | 433 | | |
390 | 434 | | |
391 | 435 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
3 | 14 | | |
4 | 15 | | |
5 | 16 | | |
| |||
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
| 44 | + | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
36 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
37 | 59 | | |
38 | 60 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
3 | 12 | | |
4 | 13 | | |
5 | 14 | | |
| |||
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
36 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
37 | 57 | | |
38 | 58 | | |
39 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments