Skip to content

Commit 674843f

Browse files
authored
docker image improvements (#1890)
<!-- .github/pull_request_template.md --> ## 📌 Description 1. Added more triggers to push a new docker image 2. Added an update-docker-tags job. This creates a PR to update docker-tags, when new images are pushed 3. Swapped order of torch installation with requirements, to ensure the desired torch package gets installed in the docker image Example workflow: commit b3f22f2 on https://github.com/flashinfer-ai/flashinfer/tree/refined_docker_sha triggered the following github workflow: https://github.com/flashinfer-ai/flashinfer/actions/runs/18382220944/job/52374357169 This succesfully resulted in generating an automated PR here: #1896 ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [ ] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [ ] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. -->
1 parent 4f7b549 commit 674843f

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

.github/workflows/release-ci-docker.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ on:
88
paths:
99
- 'docker/**'
1010
- '.github/workflows/release-ci-docker.yml'
11+
- 'requirements.txt'
1112
pull_request:
1213
branches:
1314
- main
1415
paths:
1516
- 'docker/**'
1617
- '.github/workflows/release-ci-docker.yml'
17-
18+
- 'requirements.txt'
1819
jobs:
1920
generate-tag:
2021
runs-on: ubuntu-latest
@@ -104,3 +105,42 @@ jobs:
104105
-t flashinfer/flashinfer-ci-${{ matrix.cuda }}:latest \
105106
flashinfer/flashinfer-ci-${{ matrix.cuda }}:amd64-${DATE_SHA} \
106107
flashinfer/flashinfer-ci-${{ matrix.cuda }}:arm64-${DATE_SHA}
108+
109+
update-docker-tags:
110+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
111+
runs-on: ubuntu-latest
112+
needs: [generate-tag, create-manifests]
113+
steps:
114+
- uses: actions/checkout@v4
115+
116+
- name: Update docker-tags.yml
117+
env:
118+
DATE_SHA: ${{ needs.generate-tag.outputs.date_sha }}
119+
run: |
120+
cat > ci/docker-tags.yml << EOF
121+
flashinfer/flashinfer-ci-cu126: ${DATE_SHA}
122+
flashinfer/flashinfer-ci-cu128: ${DATE_SHA}
123+
flashinfer/flashinfer-ci-cu129: ${DATE_SHA}
124+
flashinfer/flashinfer-ci-cu130: ${DATE_SHA}
125+
EOF
126+
127+
- name: Create Pull Request
128+
uses: peter-evans/create-pull-request@v6
129+
with:
130+
commit-message: "Update Docker tags to ${{ needs.generate-tag.outputs.date_sha }}"
131+
title: "Update Docker CI tags to ${{ needs.generate-tag.outputs.date_sha }}"
132+
body: |
133+
This PR updates the Docker CI image tags to the latest version: `${{ needs.generate-tag.outputs.date_sha }}`
134+
135+
Updated images:
136+
- flashinfer/flashinfer-ci-cu126:${{ needs.generate-tag.outputs.date_sha }}
137+
- flashinfer/flashinfer-ci-cu128:${{ needs.generate-tag.outputs.date_sha }}
138+
- flashinfer/flashinfer-ci-cu129:${{ needs.generate-tag.outputs.date_sha }}
139+
- flashinfer/flashinfer-ci-cu130:${{ needs.generate-tag.outputs.date_sha }}
140+
141+
Auto-generated by [release-ci-docker workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
142+
branch: update-docker-tags-${{ needs.generate-tag.outputs.date_sha }}
143+
delete-branch: true
144+
labels: |
145+
docker
146+
automated

docker/install/install_python_packages.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ set -u
2222
# Accept CUDA version as parameter (e.g., cu126, cu128, cu129)
2323
CUDA_VERSION=${1:-cu128}
2424

25-
pip3 install torch --index-url https://download.pytorch.org/whl/${CUDA_VERSION}
25+
# Install requirements.txt first, so we can override any versions later for docker image
2626
pip3 install -r /install/requirements.txt
27+
pip3 install torch --index-url https://download.pytorch.org/whl/${CUDA_VERSION}
2728
pip3 install responses pytest scipy build cuda-python nvidia-nvshmem-cu12
2829

2930
# Install cudnn package based on CUDA version

0 commit comments

Comments
 (0)