-
Notifications
You must be signed in to change notification settings - Fork 427
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
[OpenXLA-pin-update trigger] Create _openxla_pin_update_weekly.yml #7108
base: master
Are you sure you want to change the base?
Changes from all commits
2fb1c87
0038481
ab6a1bc
265d2cb
d3b1717
0b29eb7
88ac75e
ebdb09f
d92b8c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Weekly Code Update PR | ||
on: | ||
workflow_dispatch: # Manual trigger | ||
# schedule: | ||
# - cron: '0 9 * * 1' # Each Monday 9:00AM (PDT time) | ||
|
||
jobs: | ||
update_and_create_pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get current date | ||
run: echo "CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | ||
|
||
- name: Create new branch | ||
run: git checkout -b weekly-update-${{ env.CURRENT_DATE }} | ||
|
||
- name: Install sed | ||
run: sudo apt-get update && sudo apt-get install -y sed | ||
|
||
- name: Get JAX version for specified date | ||
run: | | ||
JAX_VERSION=$(curl -s https://storage.googleapis.com/jax-releases/jax_releases.json | jq -r '.[] | select(.released_on == "${{ env.CURRENT_DATE }}") | .version') | ||
if [ -z "$JAX_VERSION" ]; then | ||
echo "No JAX release found for ${{ env.CURRENT_DATE }}. Skipping update." | ||
exit 0 | ||
fi | ||
echo "JAX_VERSION=$JAX_VERSION" >> $GITHUB_ENV | ||
|
||
- name: Update date in setup.py | ||
run: | | ||
sed -i "s/_date =.*/_date = '${{ env.CURRENT_DATE }}'/" setup.py | ||
sed -i "s/_jax_version =.*/_jax_version = f'${{ env.JAX_VERSION }}.dev${{ env.CURRENT_DATE }}'/" setup.py | ||
git add setup.py | ||
# git commit -m "Weekly update setup.py to (${{ env.CURRENT_DATE }})" | ||
# git push origin HEAD | ||
|
||
- name: Fetch HEAD commit from OpenXLA github repo | ||
run: | | ||
echo "HEAD_COMMIT=$(git ls-remote https://github.com/openxla/xla.git HEAD | awk '{print $1}')" >> $GITHUB_ENV | ||
|
||
- name: Update OpenXLA commit in WORKSPACE | ||
ManfeiBai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
sed -i "s/xla_hash =.*/xla_hash = '${{ env.GITHUB_ENV }}'/" WORKSPACE | ||
git add WORKSPACE | ||
git commit -m "Weekly update WORKSPACE with (${{ env.GITHUB_ENV }})" | ||
git push origin HEAD | ||
|
||
- name: Create Pull Request | ||
uses: actions/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: weekly-update-${{ env.CURRENT_DATE }} | ||
base: main | ||
title: "Weekly Code Update - ${{ env.CURRENT_DATE }}" | ||
body: "This PR contains the weekly OpenXLA-pin update at commit: (HEAD commit: ${{ env.HEAD_COMMIT }}), with libtpu version at ${{ env.CURRENT_DATE }}." | ||
|
||
- name: Add TPUCI label | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If the label is not on the PR when it is created, the TPU CI will not run. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good suggestion, have we used |
||
uses: actions/github-script@v6 | ||
if: ${{ github.event_name == 'schedule' }} # Only label scheduled PRs | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['tpuci'] | ||
}) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
https://storage.googleapis.com/jax-releases/jax_releases.json
the correct path? I don't see a JSON file when Igsutil ls gs://jax-releases
.