Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python setup.py in build scripts #241

Merged
merged 4 commits into from
May 14, 2024
Merged
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
44 changes: 28 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@ on:
options:
- nightly
- release
ref:
description: 'Branch or tag name'
required: false
default: 'main'

jobs:
build-and-publish:
runs-on: ubuntu-latest
runs-on: linux.g5.12xlarge.nvidia.gpu
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -33,14 +27,32 @@ jobs:
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt

- uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: ${{ matrix.runs-on }}
gpu-arch-type: "cuda"
gpu-arch-version: "12.1"
script: |
conda create -n venv python=3.9 -y
conda activate venv
echo "::group::Install newer objcopy that supports --set-section-alignment"
yum install -y devtoolset-10-binutils
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
python -m pip install --upgrade pip
pip install torch
pip install -r requirements.txt
pip install -r dev-requirements.txt

- name: Build package
run: |
if [ "${{ github.event_name }}" = "schedule" ]; then
export TORCHAO_NIGHTLY=1
elif [ "${{ github.event.inputs['build-type'] }}" = "nightly" ]; then
export TORCHAO_NIGHTLY=1
fi
pip install .
python setup.py sdist bdist_wheel
pytest test --verbose -s
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -49,11 +61,11 @@ jobs:
repository_url: https://upload.pypi.org/legacy/
packages_dir: dist/

- name: Open issue on failure
if: ${{ failure() && github.event_name == 'schedule' }}
uses: dacbd/create-issue-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Nightly Build failed
body: Commit ${{ github.sha }} daily scheduled [CI run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed, please check why
assignees: ''
# - name: Open issue on failure
# if: ${{ failure() && github.event_name == 'schedule' }}
# uses: dacbd/create-issue-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# title: Nightly Build failed
# body: Commit ${{ github.sha }} daily scheduled [CI run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed, please check why
# assignees: ''
Loading