Skip to content

Commit

Permalink
workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
MayDomine committed Feb 23, 2024
1 parent 281860a commit fef8a7a
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build wheel

on:
pull_request:
types: [opened, reopened]
branches:
- 'dev'

jobs:
build-upload-wheel:

uses: OpenBMB/BMTrain/.github/workflows/build_whl.yml@workflow
secrets:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set Up the Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Download distribution files
uses: actions/download-artifact@v2
with:
name: dist
path: dist
55 changes: 55 additions & 0 deletions .github/workflows/build_whl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build wheel

on:
workflow_call:
secrets:
DOCKERHUB_TOKEN:
required: true
DOCKERHUB_USERNAME:
required: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['37', '38', '39', '310', '311']


steps:

- name: Check the disk space and clear unnecessary library
run: |
rm -rf /home/runner/work/BMTrain/BMTrain/dist
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -hl
- name: Checkout code
uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Pull Docker image
run: docker pull pytorch/manylinux-cuda113:latest

- name: Run Docker image and execute script
run: |
version=${{ matrix.python-version }}
docker run -e BUILD_DOCKER_ENV=1 -e CUDACXX=/usr/local/cuda-11.3/bin/nvcc -e PATH="/opt/rh/devtoolset-9/root/usr/bin:$PATH" -e LD_LIBRARY_PATH="/opt/rh/devtoolset-9/root/usr/lib64:/opt/rh/devtoolset-9/root/usr/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:$LD_LIBRARY_PATH" -v ${{ github.workspace }}:/workspace/BMTrain -i pytorch/manylinux-cuda113:latest /bin/bash -c "cd /workspace/BMTrain;/opt/python/cp${version}*/bin/pip install build; /opt/python/cp${version}*/bin/python -m build .;for file in dist/*-linux_x86_64.whl; do mv \"\$file\" \"\${file//-linux_x86_64/-manylinux2014_x86_64}\"; done"
- name: Archive distribution files
uses: actions/upload-artifact@v2
with:
name: dist
path: |
dist/*.tar.gz
dist/*.whl

0 comments on commit fef8a7a

Please sign in to comment.