Skip to content

build: refine the build process, make normal workflow code works. (#90) #14

build: refine the build process, make normal workflow code works. (#90)

build: refine the build process, make normal workflow code works. (#90) #14

name: Release Packages[Cuda Only]
# docker download mirror should setup in self host machine.
# the mirror status can be found at : https://status.daocloud.io/status/docker
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
# Needed to create release and upload assets
permissions:
contents: write
jobs:
build-tgz:
strategy:
matrix:
arch: [X64]
image: ["docker.cnb.cool/thinksrc/dashinfer/dev-ubi8-cu124:latest"]
enable_cuda: [1]
runs-on: [self-hosted, Linux, "${{ matrix.arch }}"]
container:
image: ${{ matrix.image }}
env:
# force use node16 instead of node20
# otherwise it may cause GLIBCXX_2.27 not found
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ENABLE_CUDA: ${{ matrix.enable_cuda }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: true
submodules: false
- name: Build tgz package
shell: bash
run: |
source /root/.bashrc
if [ -f "/miniconda/etc/profile.d/conda.sh" ]; then
source /miniconda/etc/profile.d/conda.sh
fi
source activate ds_py
git config --global --add safe.directory '*'
git fetch --tags
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
VERSION_NUMBER=$(echo "$TAG_NAME" | sed 's/^v//' | sed 's/-.*$//')
export AS_RELEASE_VERSION=$VERSION_NUMBER
export AS_BUILD_PACKAGE=ON
echo "ENABLE_CUDA value: $ENABLE_CUDA"
# export ENABLE_MULTINUMA="ON"
if [[ "${{ matrix.arch }}" == "ARM64" ]]; then
export AS_PLATFORM="armclang"
bash build.sh
else
if [ "$ENABLE_CUDA" -eq "1" ];
then
export AS_PLATFORM="cuda"
export AS_CUDA_SM="'70;75;80;86;89;90a'"
bash scripts/release/cpp_build_cuda.sh
else
export AS_PLATFORM="x86"
bash build.sh
fi
fi
- name: Upload tgz package
uses: actions/upload-artifact@v4
with:
name: dashinfer-tgz-${{ matrix.arch }}-${{ matrix.enable_cuda }}
path: build/*.tar.gz
build-wheels:
strategy:
matrix:
arch: [X64]
image: ["docker.cnb.cool/thinksrc/dashinfer/dev-ubi8-cu124:latest"]
enable_cuda: [1]
runs-on: [self-hosted, Linux, "${{ matrix.arch }}"]
container:
image: ${{ matrix.image }}
env:
ENABLE_CUDA: ${{ matrix.enable_cuda }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: true
submodules: false
- name: Build manylinux wheels
shell: bash
run: |
set -x
source /root/.bashrc
if [ -f "/miniconda/etc/profile.d/conda.sh" ]; then
source /miniconda/etc/profile.d/conda.sh
fi
git config --global --add safe.directory '*'
git fetch --tags
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
VERSION_NUMBER=$(echo "$TAG_NAME" | sed 's/^v//')
export AS_RELEASE_VERSION=$VERSION_NUMBER
echo "ENABLE_CUDA value: $ENABLE_CUDA"
if [[ "${{ matrix.arch }}" == "ARM64" ]]; then
bash scripts/release/python_manylinux_build.sh
else
if [ "$ENABLE_CUDA" -eq "1" ];
then
export AS_PLATFORM="cuda"
export AS_CUDA_SM="'70;75;80;86;89;90a'"
bash scripts/release/python_manylinux_build_cuda.sh
else
bash scripts/release/python_manylinux_build.sh
fi
fi
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: python-manylinux-wheels-${{ matrix.arch }}-${{ matrix.enable_cuda }}
path: python/wheelhouse/*-manylinux*.whl
publish:
runs-on: [self-hosted, Linux]
needs: [build-tgz, build-wheels]
strategy:
matrix:
arch: [X64]
enable_cuda: [1]
steps:
- name: Download tgz packages
uses: actions/download-artifact@v4
with:
name: dashinfer-tgz-${{ matrix.arch }}-${{ matrix.enable_cuda }}
path: release/
- name: Download python wheels
uses: actions/download-artifact@v4
with:
name: python-manylinux-wheels-${{ matrix.arch }}-${{ matrix.enable_cuda }}
path: release/
- name: Release all packages
uses: softprops/action-gh-release@v1
with:
files: release/*