-
Notifications
You must be signed in to change notification settings - Fork 86
Various fixes to container image and CI #254
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
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4164b4e
Add a containerignore
sjmonson 303ac5d
Make container more k8s friendly
sjmonson fb3cdda
Move Containerfile to toplevel
sjmonson 47015af
Add build-arg for release type
sjmonson d65e1d6
Tag rc and release images with version
sjmonson cb89576
Install git into container
sjmonson 031fa8f
Ensure full commit history is fetched for versioning
sjmonson 23945cd
Use PDM for venv
sjmonson 7dc5acc
Add nightly job for updating latest and stable tags
sjmonson 61b73be
Add job for cleaning up old development images
sjmonson d94844c
Reorder layers to improve layer reuse
sjmonson 5316605
Run tagging after cleanup
sjmonson 62fcf9b
Add list of image tags to README
sjmonson ea460f3
Give root group write perm in /home/guidellm
sjmonson ab05120
More layer cleanup
sjmonson 43dd26d
Update container image to make use of fedora base
sjmonson 8c866e8
Fixups and labels
sjmonson 369943f
Switch to upstream image
sjmonson 7bddfeb
Fix version handler again
sjmonson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.gitignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Container Image Maintenance | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * 3' # Runs at 2am on Wednesdays | ||
workflow_dispatch: # Enables manual triggering of the workflow | ||
|
||
# Only run one at a time | ||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
cleanup-container-tags: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete PR and untagged images older than 2 weeks | ||
uses: snok/[email protected] | ||
with: | ||
account: ${{ github.actor }} | ||
token: ${{ github.token }} | ||
image-names: ${{ github.event.repository.name }} | ||
image-tags: "pr-*" | ||
cut-off: 2w | ||
dry-run: true | ||
|
||
push-container-tags: | ||
runs-on: ubuntu-latest | ||
needs: cleanup-container-tags | ||
if: always() # Run after cleanup even if it fails | ||
steps: | ||
- name: Log into ghcr.io | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
registry: ghcr.io/${{ github.repository_owner }} | ||
- name: Get list of tags | ||
run: | | ||
skopeo list-tags docker://${{ github.repository }} | jq --raw-output '.Tags[]' > tags | ||
- name: Get latest release and rc tags | ||
run: | | ||
STABLE_TAG="$(grep -P '^v\d+\.\d+\.\d+$' tags | sort -rV | head -n1)" | ||
echo "STABLE_TAG=${STABLE_TAG:-v0.0.0}" >> $GITHUB_ENV | ||
LATEST_TAG="$(grep -P '^v\d+\.\d+\.\d+' tags | sort -rV | head -n1)" | ||
echo "LATEST_TAG=${LATEST_TAG:-v0.0.0}" >> $GITHUB_ENV | ||
- name: Update latest and stable tags | ||
run: | | ||
skopeo copy docker://${{ github.repository }}:${{ env.stable_tag }} docker://${{ github.repository }}:stable | ||
skopeo copy docker://${{ github.repository }}:${{ env.latest_tag }} docker://${{ github.repository }}:latest | ||
sjmonson marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# TODO: Update to official python-3.13-minimal image when available | ||
ARG BASE_IMAGE=quay.io/psap/python-313-minimal:fedora | ||
|
||
# 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 | ||
|
||
# Use a multi-stage build to create a lightweight production image | ||
FROM $BASE_IMAGE as builder | ||
|
||
# Switch to root for installing packages | ||
USER root | ||
|
||
# Install build tooling | ||
RUN dnf install -y git \ | ||
&& 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 / /opt/app-root/src | ||
|
||
# Install guidellm and locked dependencies | ||
RUN pdm use -p /opt/app-root/src -f /opt/app-root \ | ||
&& pdm install -p /opt/app-root/src --check --prod --no-editable | ||
|
||
# Prod image | ||
FROM $BASE_IMAGE | ||
|
||
# Add guidellm bin to PATH | ||
# Argument defaults can be set with GUIDELLM_<ARG> | ||
ENV HOME="/home/guidellm" \ | ||
GUIDELLM_OUTPUT_PATH="/results/benchmarks.json" | ||
|
||
# Make sure root is the primary group | ||
USER 1001:0 | ||
|
||
# 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" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this to
dry-run
for now until we can confirm it deletes the correct set of images.