1
- ARG PYTHON= 3.13
1
+ ARG BASE_IMAGE=docker.io/python: 3.13-slim
2
2
3
3
# 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
5
8
6
9
# Copy repository files
7
- COPY / /src
10
+ COPY / /opt/app-root/ src
8
11
9
12
# 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
15
15
16
16
# Prod image
17
- FROM docker.io/python:${PYTHON}-slim
17
+ FROM $BASE_IMAGE
18
18
19
19
# 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
21
21
22
22
# Add guidellm bin to PATH
23
- ENV PATH="/opt/guidellm/bin:$PATH"
23
+ ENV PATH="/opt/app-root/ guidellm/bin:$PATH"
24
24
25
25
# Create a non-root user
26
26
RUN useradd -md /results guidellm
@@ -35,14 +35,8 @@ WORKDIR /results
35
35
LABEL org.opencontainers.image.source="https://github.com/vllm-project/guidellm" \
36
36
org.opencontainers.image.description="GuideLLM Performance Benchmarking Container"
37
37
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/guidellm" ]
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" ]
0 commit comments