swactor/examples/pipeline-parallel-inference/Dockerfile

28 lines
1.4 KiB
Text
Raw Normal View History

2026-05-29 08:55:10 +00:00
# Pipeline-parallel CODE image — thin layer over the heavy base.
2026-05-28 07:05:41 +00:00
#
2026-06-06 17:53:25 +00:00
# Carries only the fast-changing artifacts: the pipeline binaries and the
# worker script. Everything heavy (CUDA libs, tinygrad, NVRTC headers, sshd,
# the PID-1 supervisor, ENTRYPOINT) lives in the base image, so a code push
# rebuilds just this handful of COPYs — no apt, no pip.
2026-05-28 07:05:41 +00:00
#
2026-05-29 08:55:10 +00:00
# Stub mode is a runtime toggle (-e PP_WORKER_STUB=1), not a separate image:
# the worker only imports tinygrad in real mode, so the CUDA base is inert
# under the stub and the same image runs the no-GPU CPU E2E.
#
2026-06-06 17:53:25 +00:00
# Build context must be the workspace root. Build the base first, then this
# image:
2026-05-29 08:55:10 +00:00
# docker build -f examples/pipeline-parallel-inference/Dockerfile.base \
# -t swactor-pp-base:cuda12.6 .
# docker build -f examples/pipeline-parallel-inference/Dockerfile \
# -t swactor-pp-gpu:latest .
ARG BASE_IMAGE=swactor-pp-base:cuda12.6
FROM ${BASE_IMAGE}
2026-06-06 17:53:25 +00:00
# Pipeline binaries (this crate's target/). Statically linked enough that the
# base stage's libc is all they need; the worker is pure Python.
2026-05-30 07:51:22 +00:00
COPY examples/pipeline-parallel-inference/target/release/pp-worker /usr/local/bin/pp-worker
COPY examples/pipeline-parallel-inference/target/release/pp-orchestrator /usr/local/bin/pp-orchestrator
COPY examples/pipeline-parallel-inference/pp_tinygrad_worker.py /usr/local/share/pp_tinygrad_worker.py
ENV WORKER_SCRIPT=/usr/local/share/pp_tinygrad_worker.py