Build wheel #4
Workflow file for this run
This file contains 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 wheel | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to build and push' | |
required: true | |
type: string | |
env: | |
# Tells where to store caches. | |
CI_CACHE_DIR: ${{ github.workspace }}/../../ci_cache | |
jobs: | |
build_wheel: | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.11"] | |
cuda: ["12.1"] | |
torch: ["2.3"] | |
runs-on: [self-hosted, linux, release] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Create cache directory | |
run: | | |
mkdir -p $CI_CACHE_DIR/.vcpkg/bincache | |
mkdir -p $CI_CACHE_DIR/.ccache | |
- name: Build wheel | |
run: | | |
docker pull vectorchai/scalellm_manylinux:cuda${{ matrix.cuda }} | |
docker run --rm -t \ | |
-v "$CI_CACHE_DIR":/ci_cache \ | |
-v "$GITHUB_WORKSPACE":/ScaleLLM \ | |
-e PYTHON_VERSION=${{ matrix.python }} \ | |
-e CUDA_VERSION=${{ matrix.cuda }} \ | |
-e TORCH_VERSION=${{ matrix.torch }} \ | |
-e RENAME_WHL=true \ | |
-e VCPKG_DEFAULT_BINARY_CACHE=/ci_cache/.vcpkg/bincache \ | |
-e CCACHE_DIR=/ci_cache/.ccache \ | |
-u $(id -u):$(id -g) \ | |
vectorchai/scalellm_manylinux:cuda${{ matrix.cuda }} \ | |
bash /ScaleLLM/scripts/build_wheel.sh | |
timeout-minutes: 60 | |
- name: show wheel size | |
run: du -h python/dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }} | |
path: python/dist/* | |
release: | |
needs: build_wheel | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
path: python/dist | |
merge-multiple: true | |
pattern: wheel-* | |
- name: Show wheels | |
run: ls -lha python/dist | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: python/dist/scalellm-*.whl | |
tag_name: ${{ inputs.tag }} | |
draft: true | |
prerelease: true | |
publish_whl_index: | |
needs: build_wheel | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
pattern: wheel-* | |
- name: Show wheels | |
run: ls -lha dist | |
- name: Clone whl repo | |
run: | | |
git clone https://oauth2:${WHL_TOKEN}@github.com/vectorch-ai/whl.git | |
env: | |
WHL_TOKEN: ${{ secrets.WHL_TOKEN }} | |
- name: Update whl index | |
run: | | |
cd whl | |
python ./publish_whl.py --whl_path=../dist | |
- name: Publish whl index | |
run: | | |
cd whl | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -A | |
git commit -m "Update whl index for version ${{ inputs.tag }}" | |
git push | |