Final changes necessary to auto-update PyTorch version (#1438)

* build: push directly from CI to main branch

This avoids the need to create, approve, and merge a separate PR, in
addition to avoiding unnecessary CI runs for the PyTorch version update.

* build: schedule cronjob to run RollPyTorch action

This patch schedules the RollPyTorch action to be run at noon UTC, which
roughly corresponds to 4am Pacific Time.  We pick this time since the
commit for PyTorch nightly releases are picked just after midnight
Pacific Time and the nightly release artifacts are produced in about 2
to 3 hours after the commit is picked.
pull/1442/head
Ashay Rane 2022-09-29 17:15:32 -05:00 committed by GitHub
parent 15e1c45ed6
commit cf41a2582e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 20 deletions

View File

@ -1,20 +1,27 @@
name: Roll PyTorch
on: workflow_dispatch
on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
jobs:
build_linux:
name: Manylinux Build
runs-on: ubuntu-latest
steps:
- name: Get torch-mlir
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: 'true'
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
- name: Setup ccache
uses: ./.github/actions/setup-build
with:
cache-suffix: x86_64-out-of-tree-OFF
- name: Determine nightly PyTorch version
run: |
cd ${GITHUB_WORKSPACE}
@ -33,6 +40,7 @@ jobs:
# retrieve them when creating a PR
echo "PT_HASH=${PT_HASH}" >> ${GITHUB_ENV}
echo "PT_RELEASE=${PT_RELEASE}" >> ${GITHUB_ENV}
- name: Build and test
run: |
cd ${GITHUB_WORKSPACE}
@ -40,22 +48,14 @@ jobs:
TORCH_MLIR_SRC_PYTORCH_BRANCH="${{ env.PT_HASH }}" \
TORCH_MLIR_SRC_PYTORCH_RELEASE="${{ env.PT_RELEASE }}" \
./build_tools/python_deploy/build_linux_packages.sh
- name: Create PR to push new PyTorch version
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
add-paths: |
pytorch-version.txt
pytorch-requirements.txt
delete-branch: true
branch: ${{ env.BRANCH }}
title: ${{ env.TITLE }}
author: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
body: |
PyTorch commit hash `${{ env.PT_HASH }}`
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
commit-message: |
${{ env.TITLE }}
PyTorch commit hash `${{ env.PT_HASH }}`
reviewers: powderluv
- name: Push changes to main branch
run: |
cd ${GITHUB_WORKSPACE}
git config user.email "torch-mlir@users.noreply.github.com"
git config user.name "Roll PyTorch Action"
git fetch
git checkout main
git add pytorch-version.txt pytorch-requirements.txt
git commit -m "update PyTorch version to ${{ env.PT_RELEASE }}"
git push --set-upstream origin main