forked from vllm-project/guidellm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
74 lines (57 loc) · 2.31 KB
/
Containerfile
File metadata and controls
74 lines (57 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# TODO: Update to official python-3.13-minimal image when available
ARG BASE_IMAGE=quay.io/fedora/python-313-minimal:latest
# Use a multi-stage build to create a lightweight production image
FROM $BASE_IMAGE as builder
# release: take the last version and add a post if build iteration
# candidate: increment to next minor, add 'rc' with build iteration
# nightly: increment to next minor, add 'a' with build iteration
# alpha: increment to next minor, add 'a' with build iteration
# dev: increment to next minor, add 'dev' with build iteration
ARG GUIDELLM_BUILD_TYPE=dev
# Switch to root for installing packages
USER root
# Install build tooling
RUN dnf install -y git \
&& /usr/bin/python3 -m venv /tmp/pdm \
&& /tmp/pdm/bin/pip install --no-cache-dir -U pdm \
&& ln -s /tmp/pdm/bin/pdm /usr/local/bin/pdm
# Disable pdm update check
# Set correct build type for versioning
ENV PDM_CHECK_UPDATE=false \
GUIDELLM_BUILD_TYPE=$GUIDELLM_BUILD_TYPE
# Copy repository files
# Do this as late as possible to leverage layer caching
COPY / /src
# Install guidellm and locked dependencies
RUN pdm use -p /src -f /opt/app-root \
&& pdm install -p /src -G all --check --prod --no-editable
# Prod image
FROM $BASE_IMAGE
# Switch to root for installing packages
USER root
# Install some helpful utilities and deps
RUN dnf install -y --setopt=install_weak_deps=False \
vi tar rsync ffmpeg-free \
&& dnf clean all
# Switch back to unpriv user
# Root group for k8s
USER 1001:0
# Add guidellm bin to PATH
# Argument defaults can be set with GUIDELLM_<ARG>
ENV HOME="/home/guidellm" \
GUIDELLM_OUTPUT_PATH="/results/benchmarks.json"
# Create the user home dir
WORKDIR $HOME
# Create a volume for results
VOLUME /results
# Metadata
LABEL io.k8s.display-name="GuideLLM" \
org.opencontainers.image.description="GuideLLM Performance Benchmarking Container" \
org.opencontainers.image.source="https://github.com/vllm-project/guidellm" \
org.opencontainers.image.documentation="https://blog.vllm.ai/guidellm/stable" \
org.opencontainers.image.license="Apache-2.0"
# Copy the virtual environment from the builder stage
# Do this as late as possible to leverage layer caching
COPY --chown=1001:0 --from=builder /opt/app-root /opt/app-root
ENTRYPOINT [ "/opt/app-root/bin/guidellm" ]
CMD [ "benchmark", "run" ]