|
| 1 | +name: release-docker-images |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +env: |
| 9 | + IMAGE: zappi/vllm-openai |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-triton-wheel-arm64: |
| 13 | + runs-on: ubuntu-22.04-arm |
| 14 | + concurrency: arm64 |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v5 |
| 18 | + with: |
| 19 | + repository: triton-lang/triton |
| 20 | + ref: v3.3.1 |
| 21 | + - name: Patch setup |
| 22 | + run: | |
| 23 | + echo "[build_ext]" >> python/setup.cfg |
| 24 | + echo "base-dir=/project" >> python/setup.cfg |
| 25 | + - name: Build wheels |
| 26 | + |
| 27 | + env: |
| 28 | + CIBW_BEFORE_ALL: "dnf install clang lld -y" |
| 29 | + CIBW_BUILD: "cp312-manylinux_aarch64" |
| 30 | + CIBW_ENVIRONMENT: "MAX_JOBS=4 TRITON_BUILD_WITH_CLANG_LLD=1" |
| 31 | + with: |
| 32 | + package-dir: python |
| 33 | + output-dir: wheelhouse |
| 34 | + - name: Upload wheels |
| 35 | + uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + name: triton-wheels-linux-arm64 |
| 38 | + path: ./wheelhouse/*.whl |
| 39 | + |
| 40 | + docker-hub-release-amd64: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + concurrency: amd64 |
| 43 | + steps: |
| 44 | + - name: Free additional disk space |
| 45 | + run: | |
| 46 | + df -h |
| 47 | + echo "Removing android..." |
| 48 | + sudo rm -rf /usr/local/lib/android |
| 49 | + echo "Removing dotnet..." |
| 50 | + sudo rm -rf /usr/share/dotnet |
| 51 | + echo "Removing haskell" |
| 52 | + sudo rm -rf /opt/ghc |
| 53 | + sudo rm -rf /usr/local/.ghcup |
| 54 | + echo "Removing tool cache..." |
| 55 | + sudo rm -rf /opt/hostedtoolcache |
| 56 | + df -h |
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v5 |
| 59 | + - name: Prepare image metadata |
| 60 | + id: metadata |
| 61 | + uses: docker/metadata-action@v5 |
| 62 | + with: |
| 63 | + images: ${{ env.IMAGE }} |
| 64 | + - name: Set up QEMU |
| 65 | + uses: docker/setup-qemu-action@v3 |
| 66 | + - name: Set up Docker Buildx |
| 67 | + uses: docker/setup-buildx-action@v3 |
| 68 | + - name: Login to Docker Hub |
| 69 | + uses: docker/login-action@v3 |
| 70 | + with: |
| 71 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 72 | + password: ${{ secrets.DOCKER_HUB_TOKEN }} |
| 73 | + - name: Build, tag, and push image |
| 74 | + uses: docker/build-push-action@v6 |
| 75 | + with: |
| 76 | + context: . |
| 77 | + file: Dockerfile.amd64 |
| 78 | + labels: ${{ steps.metadata.outputs.labels }} |
| 79 | + platforms: linux/amd64 |
| 80 | + push: true |
| 81 | + tags: ${{ steps.metadata.outputs.tags }} |
| 82 | + |
| 83 | + docker-hub-release-arm64: |
| 84 | + runs-on: ubuntu-latest |
| 85 | + needs: build-triton-wheel-arm64 |
| 86 | + concurrency: arm64 |
| 87 | + steps: |
| 88 | + - name: Free additional disk space |
| 89 | + run: | |
| 90 | + df -h |
| 91 | + echo "Removing android..." |
| 92 | + sudo rm -rf /usr/local/lib/android |
| 93 | + echo "Removing dotnet..." |
| 94 | + sudo rm -rf /usr/share/dotnet |
| 95 | + echo "Removing haskell" |
| 96 | + sudo rm -rf /opt/ghc |
| 97 | + sudo rm -rf /usr/local/.ghcup |
| 98 | + echo "Removing tool cache..." |
| 99 | + sudo rm -rf /opt/hostedtoolcache |
| 100 | + df -h |
| 101 | + - name: Checkout |
| 102 | + uses: actions/checkout@v5 |
| 103 | + - name: Download a single artifact |
| 104 | + uses: actions/download-artifact@v5 |
| 105 | + with: |
| 106 | + name: triton-wheels-linux-arm64 |
| 107 | + path: ./wheelhouse/ |
| 108 | + - name: Prepare image metadata |
| 109 | + id: metadata |
| 110 | + uses: docker/metadata-action@v5 |
| 111 | + with: |
| 112 | + images: ${{ env.IMAGE }} |
| 113 | + - name: Set up QEMU |
| 114 | + uses: docker/setup-qemu-action@v3 |
| 115 | + - name: Set up Docker Buildx |
| 116 | + uses: docker/setup-buildx-action@v3 |
| 117 | + - name: Login to Docker Hub |
| 118 | + uses: docker/login-action@v3 |
| 119 | + with: |
| 120 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 121 | + password: ${{ secrets.DOCKER_HUB_TOKEN }} |
| 122 | + - name: Build, tag, and push image |
| 123 | + uses: docker/build-push-action@v6 |
| 124 | + with: |
| 125 | + context: . |
| 126 | + file: Dockerfile.arm64 |
| 127 | + labels: ${{ steps.metadata.outputs.labels }} |
| 128 | + platforms: linux/arm64 |
| 129 | + push: true |
| 130 | + tags: ${{ steps.metadata.outputs.tags }} |
| 131 | + |
| 132 | + docker-hub-release-manifest: |
| 133 | + runs-on: ubuntu-latest |
| 134 | + needs: |
| 135 | + - build-amd64 |
| 136 | + - build-arm64 |
| 137 | + steps: |
| 138 | + - name: Checkout |
| 139 | + uses: actions/checkout@v5 |
| 140 | + - name: Prepare image metadata |
| 141 | + id: metadata |
| 142 | + uses: docker/metadata-action@v5 |
| 143 | + with: |
| 144 | + images: ${{ env.IMAGE }} |
| 145 | + - name: Set up QEMU |
| 146 | + uses: docker/setup-qemu-action@v3 |
| 147 | + - name: Set up Docker Buildx |
| 148 | + uses: docker/setup-buildx-action@v3 |
| 149 | + - name: Login to Docker Hub |
| 150 | + uses: docker/login-action@v3 |
| 151 | + with: |
| 152 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 153 | + password: ${{ secrets.DOCKER_HUB_TOKEN }} |
| 154 | + - name: Build, tag, and push image to Docker Hub |
| 155 | + uses: docker/build-push-action@v6 |
| 156 | + with: |
| 157 | + cache-from: type=gha |
| 158 | + cache-to: type=gha,mode=max |
| 159 | + context: . |
| 160 | + labels: ${{ steps.metadata.outputs.labels }} |
| 161 | + platforms: linux/amd64,linux/arm64 |
| 162 | + push: true |
| 163 | + tags: ${{ steps.metadata.outputs.tags }} |
| 164 | + - name: Update description on Docker Hub Description |
| 165 | + uses: peter-evans/dockerhub-description@v5 |
| 166 | + with: |
| 167 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 168 | + password: ${{ secrets.DOCKER_HUB_TOKEN }} |
| 169 | + repository: ${{ env.IMAGE }} |
| 170 | + |
| 171 | + github-release: |
| 172 | + runs-on: ubuntu-latest |
| 173 | + needs: docker-hub-release |
| 174 | + steps: |
| 175 | + - name: Checkout |
| 176 | + uses: actions/checkout@v5 |
| 177 | + - name: Create Release |
| 178 | + uses: actions/create-release@v1 |
| 179 | + env: |
| 180 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 181 | + with: |
| 182 | + tag_name: ${{ github.ref }} |
| 183 | + release_name: Version ${{ github.ref }} |
| 184 | + draft: false |
| 185 | + prerelease: false |
0 commit comments