Landlock #74
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
| name: Build Wheels | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| wheel: | |
| name: Build wheel (CUDA ${{ matrix.cuda_version }}) | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: ${{ matrix.cuda_image }} | |
| strategy: | |
| matrix: | |
| include: | |
| # disabled for now | |
| #- cuda_version: "12.8" | |
| # cuda_image: "nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04" | |
| # wheel_tag: "cu128" | |
| # archs: "80;90;100;120" | |
| - cuda_version: "13.0" | |
| cuda_image: "nvidia/cuda:13.0.1-cudnn-devel-ubuntu24.04" | |
| wheel_tag: "cu130" | |
| archs: "80;90;100f;120f" | |
| env: | |
| CMAKE_GENERATOR: Ninja | |
| CMAKE_C_COMPILER: gcc-13 | |
| CMAKE_CXX_COMPILER: g++-13 | |
| CUDAARCHS: ${{ matrix.archs }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install deps | |
| run: apt update && apt install -y git g++-13 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Build wheel | |
| run: uv build --wheel | |
| - name: Repair wheel with auditwheel | |
| run: | | |
| uv run --no-project --with auditwheel --with patchelf auditwheel repair dist/*.whl -w wheelhouse/ --exclude libcuda.so.1 --exclude libcudart.so.12 --exclude libcudart.so.13 --exclude libnvidia-ml.so.1 | |
| rm dist/*-linux_*.whl # Remove non-repaired wheel | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel-${{ matrix.wheel_tag }} | |
| path: wheelhouse/pygpubench*.whl | |
| gpu-test: | |
| name: GPU tests (Modal L4) | |
| needs: wheel | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Download wheel | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheel-* | |
| path: dist/ | |
| merge-multiple: true | |
| - name: Install Modal | |
| run: pip install modal | |
| - name: Run GPU tests | |
| env: | |
| MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }} | |
| MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }} | |
| run: modal run ci/modal_gpu_test.py --wheel dist/pygpubench*.whl --test-dir test | |
| release: | |
| name: Publish to GitHub Releases | |
| needs: wheel | |
| runs-on: ubuntu-24.04 | |
| if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/master') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheel-* | |
| path: dist/ | |
| merge-multiple: true | |
| - name: Get version and short SHA | |
| id: meta | |
| run: | | |
| VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") | |
| SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) | |
| TAG="v${VERSION}-${SHORT_SHA}" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Delete existing release if tag exists | |
| run: gh release delete "${{ steps.meta.outputs.tag }}" --yes || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| run: | | |
| gh release create "${{ steps.meta.outputs.tag }}" dist/*.whl \ | |
| ${{ github.event_name == 'push' && '--prerelease' || '' }} \ | |
| --title "pygpubench ${{ steps.meta.outputs.tag }}" \ | |
| --notes "Built from commit ${{ github.sha }}. | |
| Install with: | |
| \`\`\` | |
| pip install pygpubench --find-links https://github.com/${{ github.repository }}/releases/download/${{ steps.meta.outputs.tag }}/ | |
| \`\`\` | |
| Or install the latest release: | |
| \`\`\` | |
| pip install pygpubench --find-links https://github.com/${{ github.repository }}/releases/latest/download/ | |
| \`\`\`" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |