Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: release-build-wheels

on:
push:
tags:
- 'v*'

jobs:
build-wheels:
runs-on: [self-hosted, p-dev-ws2040-03]

strategy:
fail-fast: false
matrix:
# python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.10']
platform: ['manylinux2_28_x86_64']
# cuda-version: ['12.4', '12.6', '12.8', '13.0']
cuda-version: ['12.4']
include:
- cuda-version: "12.4"
cuda-image: "pytorch/manylinux2_28-builder:cuda12.4"
# - cuda-version: "12.6"
# cuda-image: "pytorch/manylinux2_28-builder:cuda12.6"
# - cuda-version: "12.8"
# cuda-image: "pytorch/manylinux2_28-builder:cuda12.8"
# - cuda-version: "13.0"
# cuda-image: "pytorch/manylinux2_28-builder:cuda13.0"

env:
PY_VERS: ${{ matrix.python-version }}
CUDA_IMAGE: ${{ matrix.cuda-image }}

steps:
- name: Checkout code
uses: actions/checkout@v4

# - name: Check GPU free
# shell: bash
# run: tools/gpu_check.sh

- name: Determine Python executable
id: python
run: |
case $PY_VERS in
3.10) echo "PY_EXEC=/opt/python/cp310-cp310/bin/python" >> $GITHUB_ENV ;;
3.11) echo "PY_EXEC=/opt/python/cp311-cp311/bin/python" >> $GITHUB_ENV ;;
3.12) echo "PY_EXEC=/opt/python/cp312-cp312/bin/python" >> $GITHUB_ENV ;;
3.13) echo "PY_EXEC=/opt/python/cp313-cp313/bin/python" >> $GITHUB_ENV ;;
*) echo "Unsupported python version"; exit 1 ;;
esac

- name: Start manylinux CUDA builder container
run: |
container=$(docker run -td \
-v ${{ github.workspace }}:/workspace \
-v ${{ runner.temp }}/wheelhouse:/wheelhouse \
-w /workspace \
$CUDA_IMAGE)
echo "CONTAINER=$container" >> $GITHUB_ENV


- name: Install build dependencies inside container
run: |
docker exec -t $CONTAINER $PY_EXEC -m pip install --upgrade pip setuptools wheel

- name: Build wheel inside container
run: |
docker exec -t $CONTAINER bash -c '
CMAKE_ARGS="-DFLAGGEMS_BUILD_C_EXTENSIONS=ON \
-DFLAGGEMS_INSTALL=ON \
-DFLAGGEMS_USE_EXTERNAL_TRITON_JIT=OFF \
-DFLAGGEMS_BUILD_WHEEL=ON"
'"$PY_EXEC"' -m pip wheel . -w /wheelhouse --no-build-isolation --no-deps
'

# - name: Fix wheel (auditwheel repair)
# run: |
# docker exec -t $CONTAINER bash -c "\
# auditwheel repair /wheelhouse/*.whl -w /wheelhouse/fixed \
# "

- name: Upload wheels to private PyPI
run: |
$PY_EXEC -m pip install --upgrade twine
$PY_EXEC -m twine upload \
--repository-url http://10.1.1.16/repository/pipy-private/ \
-u testuser -p 'testuser@12345' \
/wheelhouse/*.whl

# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheel-${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}
# path: ${{ runner.temp }}/wheelhouse/fixed/*.whl
# if-no-files-found: error
Loading