-
Notifications
You must be signed in to change notification settings - Fork 217
Daily qml builds with RC environment #1587
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
6856ec4
Daily qml builds with RC environment
runora95 e4ab07b
Merge branch 'master' into sc-101692-dailyrcbuild
runora95 22907e9
Merge branch 'master' into sc-101692-dailyrcbuild
runora95 26f8c8c
input variables
runora95 e5b85bb
run
runora95 3b26909
push
runora95 f984654
typo
runora95 8adf3c9
rmv todo
runora95 083987a
update inputs
runora95 7e13ac2
rmv some inputs
runora95 2a8fdcf
add pre back
runora95 30ebd6c
qiskit
runora95 2fff40d
use variables
runora95 2fc73cc
fix typo in inputs
runora95 69e5f62
rmv extra ind url
runora95 c777344
Merge branch 'master' into sc-101692-dailyrcbuild
runora95 6d8aed6
rmv extra args
runora95 ba0d9fc
rmv extra args
runora95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Build Daily RC Demos | ||
| on: | ||
| schedule: | ||
| - cron: '0 11 * * 1-5' # Runs weekdays 6 am ET | ||
| workflow_dispatch: | ||
| push: | ||
|
|
||
| jobs: | ||
| check-for-rc-branches: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| branch_exists: ${{ steps.check-rc-branches.outputs.branch_exists }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: PennyLaneAI/pennylane | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install latest setuptools | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install --upgrade setuptools packaging | ||
|
|
||
| - name: Check for RC branches | ||
| id: check-rc-branches | ||
| run: | | ||
| VERSION=$(python setup.py --version) | ||
| echo "Current version: $VERSION" | ||
| IFS=. read MAJ MIN PAT <<< "${VERSION%-dev[0-9]*}" | ||
| RC_BRANCH="v${MAJ}.$((MIN-2)).${PAT}-rc0" | ||
| if git ls-remote --exit-code origin "refs/heads/$RC_BRANCH"; then | ||
| echo "branch_exists=true" >> $GITHUB_OUTPUT | ||
| echo "rc_branch=$RC_BRANCH" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "branch_exists=true" >> $GITHUB_OUTPUT # TODO change to false | ||
| echo "No RC branch found." | ||
| fi | ||
|
|
||
| build-demos-with-rc-branches: | ||
| runs-on: ubuntu-latest | ||
| needs: check-for-rc-branches | ||
| # if: needs.check-for-rc-branches.outputs.branch_exists == 'true' | ||
| outputs: | ||
| pennylane-version: ${{ steps.setup-rc-versions.outputs.pennylane-version }} | ||
| lightning-version: ${{ steps.setup-rc-versions.outputs.lightning-version }} | ||
| catalyst-version: ${{ steps.setup-rc-versions.outputs.catalyst-version }} | ||
| rc-build-branch: ${{ steps.setup-rc-versions.outputs.rc-build-branch }} | ||
| steps: | ||
| - name: Checkout QML repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Set up rc versions | ||
| id: setup-rc-versions | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| rc_build_branch=rc-daily-build-$(date +'%Y-%m-%d-%H%M%S') | ||
| git checkout -b $rc_build_branch | ||
| python -m pip index versions pennylane 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true | ||
| pennylane_version=$(python -m pip index versions pennylane 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true) | ||
| lightning_version=$(python -m pip index versions pennylane-lightning 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 ||true ) | ||
| catalyst_version=$(python -m pip index versions pennylane-catalyst 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true) | ||
| echo "lightning-version=$lightning_version" >> $GITHUB_OUTPUT | ||
| echo "catalyst-version=$catalyst_version" >> $GITHUB_OUTPUT | ||
| echo "pennylane-version=$pennylane_version" >> $GITHUB_OUTPUT | ||
| echo "rc-build-branch=$rc_build_branch" >> $GITHUB_OUTPUT | ||
| echo "PennyLane version: $pennylane_version, PennyLane-Lightning version: $lightning_version, PennyLane-Catalyst version: $catalyst_version" | ||
|
|
||
| - name: Update demo versions | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| sed -i -E "s#git\+https://github.com/PennyLaneAI/pennylane.git\#egg=pennylane\",#pennylane<=${{ steps.setup-rc-versions.outputs.pennylane-version }}\",\\n\\t\\t\\t\"—extra-index-url\",\\n\\t\\t\\t\"https://test.pypi.org/simple/\",\\n\\t\\t\\tpre=True,#" lib/qml/lib/demo.py | ||
| sed -i "s/PennyLane-Lightning/pennylane-lightning<=${{ steps.setup-rc-versions.outputs.lightning-version }}/" lib/qml/lib/demo.py | ||
| sed -i "s/PennyLane-Catalyst/pennylane-catalyst<=${{ steps.setup-rc-versions.outputs.catalyst-version }}/" lib/qml/lib/demo.py | ||
| git commit -am "Set up RC versions for demo builds" | ||
| # git push --set-upstream origin ${{ steps.setup-rc-versions.outputs.rc-build-branch }} | ||
|
|
||
| build-demos: | ||
| needs: build-demos-with-rc-branches | ||
| uses: ./.github/workflows/v2-build-demos.yml | ||
| with: | ||
| ref: '${{ needs.build-demos-with-rc-branches.outputs.rc-build-branch }}' | ||
| demo-names: '' | ||
| execute: true | ||
| dev: false | ||
| save-artifact: true | ||
| artifact-name: 'demo-build-use-rc' | ||
| artifact-retention: 10 | ||
| keep-going: false | ||
| quiet: false | ||
| batch_size: 10 | ||
|
|
||
| cleanup: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - build-demos | ||
| - build-demos-with-rc-branches | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Cleanup branch | ||
| run: | | ||
| echo "Cleaning up branch '${{ needs.build-demos-with-rc-branches.outputs.rc-build-branch }}'" | ||
| # git push origin --delete '${{ needs.build-demos-with-rc-branches.outputs.rc-build-branch }}'|| true | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.