[PUBLISHING] Skip nightly run if no commits (#1807)

Previously the nightly run was failing to upload if there had been no
commits since the previous night. Also moves time ahead 20 minutes to
avoid hourly spike delays launching workflows.
This commit is contained in:
Nathaniel McVicar
2023-06-21 18:12:32 -07:00
committed by GitHub
parent c3cba05f77
commit d416d63152
3 changed files with 44 additions and 19 deletions

View File

@@ -2,7 +2,7 @@ name: Wheels
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
- cron: "20 2 * * *"
jobs:
@@ -18,25 +18,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install Azure CLI
# The LATEST_DATE here should be kept in sync with the one in Patch setup.py
- id: check-version
name: Check latest version
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Azure login
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
run: |
AZ_TOKEN=$(az account get-access-token --query accessToken)
echo "::add-mask::$AZ_TOKEN"
echo "access_token=$AZ_TOKEN" >> "$GITHUB_OUTPUT"
export PACKAGE_DATE=$(python3 -m pip install --user --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/Triton-Nightly/pypi/simple/ --dry-run triton-nightly== |& grep -oP '(?<=, )[0-9\.]+dev[0-9]+(?=\))' | grep -oP '(?<=dev)[0-9]+')
export LATEST_DATE=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd")
if cmp -s <(echo $PACKAGE_DATE) <(echo $LATEST_DATE); then
echo "new_commit=false" >> "$GITHUB_OUTPUT"
else
echo "new_commit=true" >> "$GITHUB_OUTPUT"
fi
- name: Patch setup.py
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
run: |
sed -i 's/name\=\"triton\"/name="triton-nightly"/g' python/setup.py
export LATEST_DATE=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd")
@@ -46,6 +41,7 @@ jobs:
echo "base-dir=/project" >> python/setup.cfg
- name: Build wheels
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
run: |
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"
@@ -54,6 +50,35 @@ jobs:
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' }}
run: |
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/*
- name: Azure Logout
if: ${{ steps.check-version.outputs.new_commit == 'true' && (success() || failure()) }}
run: |
az logout
az cache purge
az account clear

View File

@@ -25,7 +25,7 @@ You can install the latest stable release of Triton from pip:
```bash
pip install triton
```
Binary wheels are available for CPython 3.8-3.11 and PyPy 3.8-3.9.
Binary wheels are available for CPython 3.7-3.11 and PyPy 3.8-3.9.
And the latest nightly release:

View File

@@ -12,7 +12,7 @@ You can install the latest stable release of Triton from pip:
pip install triton
Binary wheels are available for CPython 3.8-3.11 and PyPy 3.8-3.9.
Binary wheels are available for CPython 3.7-3.11 and PyPy 3.8-3.9.
And the latest nightly release: