Skip to content

Drop Container Entrypoint and #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions deploy/Containerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
ARG PYTHON=3.13
ARG BASE_IMAGE=docker.io/python:3.13-slim

# Use a multi-stage build to create a lightweight production image
FROM docker.io/python:${PYTHON}-slim as builder
FROM $BASE_IMAGE as builder

# Ensure files are installed as root
USER root

# Copy repository files
COPY / /src
COPY / /opt/app-root/src

# Create a venv and install guidellm
RUN python3 -m venv /opt/guidellm \
&& /opt/guidellm/bin/pip install --no-cache-dir /src

# Copy entrypoint script into the venv bin directory
RUN install -m0755 /src/deploy/entrypoint.sh /opt/guidellm/bin/entrypoint.sh
RUN python3 -m venv /opt/app-root/guidellm \
&& /opt/app-root/guidellm/bin/pip install --no-cache-dir /opt/app-root/src

# Prod image
FROM docker.io/python:${PYTHON}-slim
FROM $BASE_IMAGE

# Copy the virtual environment from the builder stage
COPY --from=builder /opt/guidellm /opt/guidellm
COPY --from=builder /opt/app-root/guidellm /opt/app-root/guidellm

# Add guidellm bin to PATH
ENV PATH="/opt/guidellm/bin:$PATH"
ENV PATH="/opt/app-root/guidellm/bin:$PATH"

# Create a non-root user
RUN useradd -md /results guidellm
Expand All @@ -45,4 +45,5 @@ ENV GUIDELLM_TARGET="http://localhost:8000" \
GUIDELLM_MAX_SECONDS="" \
GUIDELLM_OUTPUT_PATH="/results/results.json"

ENTRYPOINT [ "/opt/guidellm/bin/entrypoint.sh" ]
ENTRYPOINT [ "/opt/app-root/guidellm/bin/guidellm" ]
CMD [ "benchmark", "run" ]
43 changes: 0 additions & 43 deletions deploy/entrypoint.sh

This file was deleted.