Skip to content

Commit

Permalink
[CI] update wheels workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ptillet committed Dec 7, 2023
1 parent e2f1b58 commit 946705b
Showing 1 changed file with 15 additions and 52 deletions.
67 changes: 15 additions & 52 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
jobs:

Build-Wheels:
timeout-minutes: 60

runs-on: [self-hosted, CPU]
permissions:
Expand All @@ -16,13 +15,6 @@ jobs:

steps:

- name: Prune stale docker containers
run: |
# If cibuildwheel crashes (or, say, is OOM-killed), it leaves behind a
# docker container. Eventually these consume all the disk space on
# this machine.
docker container prune -f
- name: Checkout
uses: actions/checkout@v3

Expand All @@ -48,55 +40,26 @@ jobs:
- name: Build wheels
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
run: |
export LATEST_DATE=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd")
# Pass MAX_JOBS=4 because, at time of writing, the VM "only" has 32GB
# of RAM and OOMs while building if we give it the default number of
# workers (2 * NUM_CPUs).
#
# Sadly, I couldn't make TRITON_BUILD_WITH_CLANG_LLD=1 work. The
# manylinux image has a relatively recent gcc (v10, released 2020),
# but its clang is ancient, v3.4, released in 2014 (!). I tried
# installing the prebuilt clang 10 binary distributed by LLVM, and I
# quickly ran into Linux DLL hell. I give up, for now. Perhaps
# manylinux_x_y will save us; I didn't try.
export CIBW_ENVIRONMENT="MAX_JOBS=4 TRITON_WHEEL_NAME=triton-nightly TRITON_WHEEL_VERSION_SUFFIX=-$LATEST_DATE"
export CIBW_MANYLINUX_X86_64_IMAGE="quay.io/pypa/manylinux2014_x86_64:latest"
#export CIBW_MANYLINUX_PYPY_X86_64_IMAGE="quay.io/pypa/manylinux2014_x86_64:latest"
export CIBW_BEFORE_BUILD="pip install cmake;"
export CIBW_SKIP="cp{35,36}-*"
export CIBW_BUILD="cp3*-manylinux_x86_64"
export CIBW_SKIP="{cp,pp}{35,36}-*"
export CIBW_BUILD="{cp,pp}3*-manylinux_x86_64"
python3 -m cibuildwheel python --output-dir wheelhouse
- name: Install Azure CLI
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Azure login
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- id: generate-token
name: Generate token
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
run: |
AZ_TOKEN=$(az account get-access-token --query accessToken)
echo "::add-mask::$AZ_TOKEN"
echo "access_token=$AZ_TOKEN" >> "$GITHUB_OUTPUT"
- name: Publish wheels to Azure DevOps
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
- name: Append build number
shell: bash
run: |
python3 -m pip install twine
python3 -m twine upload -r Triton-Nightly -u TritonArtifactsSP -p ${{ steps.generate-token.outputs.access_token }} --config-file utils/nightly.pypirc --non-interactive --verbose wheelhouse/*
set -ex
mkdir -p wheelhouse-1
find wheelhouse -type f
for i in $(find wheelhouse -type f); do
echo "Patching $i"
python3 -mwheel unpack "$i"
python3 -mwheel pack triton-2.2.0 --build-number 0 --dest-dir wheelhouse-1
rm -rf triton-2.2.0
done
- name: Azure Logout
if: ${{ steps.check-version.outputs.new_commit == 'true' && (success() || failure()) }}
- name: Upload wheels to PyPI
run: |
az logout
az cache purge
az account clear
python3 -m twine upload wheelhouse-1/* -u __token__ -p ${{ secrets.PYPY_API_TOKEN }}

0 comments on commit 946705b

Please sign in to comment.