Skip to content

Drop Entrypoint and Improve Containerfile #250

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

Merged
merged 4 commits into from
Jul 30, 2025
Merged
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
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,25 @@ pip install git+https://github.com/vllm-project/guidellm.git

For detailed installation instructions and requirements, see the [Installation Guide](https://github.com/vllm-project/guidellm/blob/main/docs/install.md).

### With Podman / Docker

Alternatively we publish container images at [ghcr.io/vllm-project/guidellm](https://github.com/vllm-project/guidellm/pkgs/container/guidellm). Running a container is (by default) equivalent to `guidellm benchmark run`:

```bash
podman run \
--rm -it \
-v "./results:/results:rw" \
-e GUIDELLM_TARGET=http://localhost:8000 \
-e GUIDELLM_RATE_TYPE=sweep \
-e GUIDELLM_MAX_SECONDS=30 \
-e GUIDELLM_DATA="prompt_tokens=256,output_tokens=128" \
ghcr.io/vllm-project/guidellm:latest
```

> [!TIP] CLI options can also be specified as ENV variables (E.g. `--rate-type sweep` -> `GUIDELLM_RATE_TYPE=sweep`). If both are specified then the CLI option overrides the the ENV.

Replace `latest` with `stable` for the newest tagged release or set a specific release if desired.

### Quick Start

#### 1. Start an OpenAI Compatible Server (vLLM)
Expand Down
38 changes: 16 additions & 22 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 @@ -35,14 +35,8 @@ WORKDIR /results
LABEL org.opencontainers.image.source="https://github.com/vllm-project/guidellm" \
org.opencontainers.image.description="GuideLLM Performance Benchmarking Container"

# Set the environment variable for the benchmark script
# TODO: Replace with scenario environment variables
ENV GUIDELLM_TARGET="http://localhost:8000" \
GUIDELLM_MODEL="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16" \
GUIDELLM_RATE_TYPE="sweep" \
GUIDELLM_DATA="prompt_tokens=256,output_tokens=128" \
GUIDELLM_MAX_REQUESTS="100" \
GUIDELLM_MAX_SECONDS="" \
GUIDELLM_OUTPUT_PATH="/results/results.json"

ENTRYPOINT [ "/opt/guidellm/bin/entrypoint.sh" ]
# Argument defaults can be set with GUIDELLM_<ARG>
ENV GUIDELLM_OUTPUT_PATH="/results/benchmarks.json"

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

This file was deleted.