Skip to content

Commit ef04f60

Browse files
authored
Drop Entrypoint and Improve Containerfile (#250)
* Drop the container entrypoint script as GuideLLM has had native support for its features since #99 * Make containerfile more rebuild friendly based on #213 * Drop the ENV default scenario as it is confusing to users setting CLI args Closes: #213 --------- Signed-off-by: Samuel Monson <[email protected]>
1 parent bc49ac8 commit ef04f60

File tree

3 files changed

+35
-65
lines changed

3 files changed

+35
-65
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ pip install git+https://github.com/vllm-project/guidellm.git
5252

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

55+
### With Podman / Docker
56+
57+
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`:
58+
59+
```bash
60+
podman run \
61+
--rm -it \
62+
-v "./results:/results:rw" \
63+
-e GUIDELLM_TARGET=http://localhost:8000 \
64+
-e GUIDELLM_RATE_TYPE=sweep \
65+
-e GUIDELLM_MAX_SECONDS=30 \
66+
-e GUIDELLM_DATA="prompt_tokens=256,output_tokens=128" \
67+
ghcr.io/vllm-project/guidellm:latest
68+
```
69+
70+
> [!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.
71+
72+
Replace `latest` with `stable` for the newest tagged release or set a specific release if desired.
73+
5574
### Quick Start
5675

5776
#### 1. Start an OpenAI Compatible Server (vLLM)

deploy/Containerfile

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
ARG PYTHON=3.13
1+
ARG BASE_IMAGE=docker.io/python:3.13-slim
22

33
# Use a multi-stage build to create a lightweight production image
4-
FROM docker.io/python:${PYTHON}-slim as builder
4+
FROM $BASE_IMAGE as builder
5+
6+
# Ensure files are installed as root
7+
USER root
58

69
# Copy repository files
7-
COPY / /src
10+
COPY / /opt/app-root/src
811

912
# Create a venv and install guidellm
10-
RUN python3 -m venv /opt/guidellm \
11-
&& /opt/guidellm/bin/pip install --no-cache-dir /src
12-
13-
# Copy entrypoint script into the venv bin directory
14-
RUN install -m0755 /src/deploy/entrypoint.sh /opt/guidellm/bin/entrypoint.sh
13+
RUN python3 -m venv /opt/app-root/guidellm \
14+
&& /opt/app-root/guidellm/bin/pip install --no-cache-dir /opt/app-root/src
1515

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

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

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

2525
# Create a non-root user
2626
RUN useradd -md /results guidellm
@@ -35,14 +35,8 @@ WORKDIR /results
3535
LABEL org.opencontainers.image.source="https://github.com/vllm-project/guidellm" \
3636
org.opencontainers.image.description="GuideLLM Performance Benchmarking Container"
3737

38-
# Set the environment variable for the benchmark script
39-
# TODO: Replace with scenario environment variables
40-
ENV GUIDELLM_TARGET="http://localhost:8000" \
41-
GUIDELLM_MODEL="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16" \
42-
GUIDELLM_RATE_TYPE="sweep" \
43-
GUIDELLM_DATA="prompt_tokens=256,output_tokens=128" \
44-
GUIDELLM_MAX_REQUESTS="100" \
45-
GUIDELLM_MAX_SECONDS="" \
46-
GUIDELLM_OUTPUT_PATH="/results/results.json"
47-
48-
ENTRYPOINT [ "/opt/guidellm/bin/entrypoint.sh" ]
38+
# Argument defaults can be set with GUIDELLM_<ARG>
39+
ENV GUIDELLM_OUTPUT_PATH="/results/benchmarks.json"
40+
41+
ENTRYPOINT [ "/opt/app-root/guidellm/bin/guidellm" ]
42+
CMD [ "benchmark", "run" ]

deploy/entrypoint.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)