From d0e7b0bb08a0d5bfea81627b9c41f6ad80423220 Mon Sep 17 00:00:00 2001 From: Samuel Monson Date: Wed, 30 Jul 2025 16:24:33 -0400 Subject: [PATCH 1/4] Drop entrypoint script Signed-off-by: Samuel Monson --- deploy/Containerfile | 2 +- deploy/entrypoint.sh | 43 ------------------------------------------- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100755 deploy/entrypoint.sh diff --git a/deploy/Containerfile b/deploy/Containerfile index 2702e24d..2f5c492e 100644 --- a/deploy/Containerfile +++ b/deploy/Containerfile @@ -45,4 +45,4 @@ ENV GUIDELLM_TARGET="http://localhost:8000" \ GUIDELLM_MAX_SECONDS="" \ GUIDELLM_OUTPUT_PATH="/results/results.json" -ENTRYPOINT [ "/opt/guidellm/bin/entrypoint.sh" ] +ENTRYPOINT [ "/opt/guidellm/bin/guidellm" ] diff --git a/deploy/entrypoint.sh b/deploy/entrypoint.sh deleted file mode 100755 index d6ff4ea0..00000000 --- a/deploy/entrypoint.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Path to the guidellm binary -guidellm_bin="/opt/guidellm/bin/guidellm" - -# If we receive any arguments switch to guidellm command -if [ $# -gt 0 ]; then - echo "Running command: guidellm $*" - exec $guidellm_bin "$@" -fi - -# Get a list of environment variables that start with GUIDELLM_ -args="$(printenv | cut -d= -f1 | grep -E '^GUIDELLM_')" - -# NOTE: Bash array + exec prevent shell escape issues -CMD=("${guidellm_bin}" "benchmark") - -# Parse environment variables for the benchmark command -for var in $args; do - # Remove GUIDELLM_ prefix - arg_name="${var#GUIDELLM_}" - - # If there is an extra underscore at the - # start than this is a config variable - if [ "${arg_name:0:1}" == "_" ]; then - continue - fi - - # Convert to lowercase - arg_name="${arg_name,,}" - # Replace underscores with dashes - arg_name="${arg_name//_/-}" - - # Add the argument to the command array if set - if [ -n "${!var}" ]; then - CMD+=("--${arg_name}" "${!var}") - fi -done - -# Execute the command -echo "Running command: ${CMD[*]}" -exec "${CMD[@]}" From 24c7ac499dcf7f32e505fe1b6ff7cef3ee537fb3 Mon Sep 17 00:00:00 2001 From: Samuel Monson Date: Wed, 30 Jul 2025 16:29:23 -0400 Subject: [PATCH 2/4] Integrate changes from #213 Signed-off-by: Samuel Monson --- deploy/Containerfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/deploy/Containerfile b/deploy/Containerfile index 2f5c492e..cee8b958 100644 --- a/deploy/Containerfile +++ b/deploy/Containerfile @@ -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 @@ -45,4 +45,5 @@ ENV GUIDELLM_TARGET="http://localhost:8000" \ GUIDELLM_MAX_SECONDS="" \ GUIDELLM_OUTPUT_PATH="/results/results.json" -ENTRYPOINT [ "/opt/guidellm/bin/guidellm" ] +ENTRYPOINT [ "/opt/app-root/guidellm/bin/guidellm" ] +CMD [ "benchmark", "run" ] From 49f47a43b535df9e89f1dac82f0195c1ac0387e0 Mon Sep 17 00:00:00 2001 From: Samuel Monson Date: Wed, 30 Jul 2025 17:48:09 -0400 Subject: [PATCH 3/4] Drop default scenario from image ENV Signed-off-by: Samuel Monson --- deploy/Containerfile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/deploy/Containerfile b/deploy/Containerfile index cee8b958..7715de93 100644 --- a/deploy/Containerfile +++ b/deploy/Containerfile @@ -35,15 +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" +# Argument defaults can be set with GUIDELLM_ +ENV GUIDELLM_OUTPUT_PATH="/results/benchmarks.json" ENTRYPOINT [ "/opt/app-root/guidellm/bin/guidellm" ] CMD [ "benchmark", "run" ] From e87926709fc30064021065ba90efb7150aa14262 Mon Sep 17 00:00:00 2001 From: Samuel Monson Date: Wed, 30 Jul 2025 17:31:45 -0400 Subject: [PATCH 4/4] Add section to readme on container images Signed-off-by: Samuel Monson --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 9312c55f..b1abc75f 100644 --- a/README.md +++ b/README.md @@ -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)