# =============================================================================
# Hello Motion — Self-Hosted Worker Debug Image
#
# Simulates the full HY-Motion inference pipeline (model loading, staged
# progress updates, SMPL-format NPZ upload) without a GPU or real weights.
# Use this to verify the complete self-hosted worker pipeline: registration,
# Hatchet connection, progress streaming, S3 upload, and job callback.
#
# Build (from workers/self-hosted/):
#   docker compose build hello-motion
#
# Run:
#   docker run ph-hello-motion:latest ph-worker start --token <portal-token> --portal-url <url>
# =============================================================================

FROM python:3.13-slim

# The install steps live in recipes/install.sh, which a native host runs
# verbatim. Building the image by executing that same script is what keeps the
# two from drifting; PH_IN_DOCKER tells it the interpreter is already
# provisioned, so only the venv creation step is skipped.
COPY . /opt/worker-src
RUN PH_IN_DOCKER=1 \
    PH_PYTHON="$(command -v python)" \
    PH_WORKER_SRC=/opt/worker-src \
    bash /opt/worker-src/poly_hammer_worker/jobs/hello_motion/recipes/install.sh \
        --profile "hello-motion/linux-x64/docker" --prefix /opt/ph-install \
        --wheelhouse /opt/worker-src/wheelhouse \
    && rm -rf /opt/worker-src

# ---------- Runtime configuration ----------
ENV PH_JOB_CLASS="poly_hammer_worker.jobs.hello_motion.job.HelloMotionJob"

CMD ["ph-worker", "check-gpu"]
