-
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
Conversation
andrijapau
left a comment
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.
Have you tried this out?
yep, I tried it out here |
| 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 }} |
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.
I can see the logic here, but I don't think manipulating the qml build tool files directly with sed in an Action is the right approach. I would prefer instead to add new command line argument(s) to the tool. We could even make this more general so you can build any version for PLC by passing in the arguments. We can then keep the logic that parses out the RC branches here in the Action.
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.
I agree 🤔
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.
makes sense
| needs: build-demos-with-rc-branches | ||
| uses: ./.github/workflows/v2-build-demos.yml | ||
| with: | ||
| ref: sc-101692-dailyrcbuild #'${{ needs.build-demos-with-rc-branches.outputs.rc-build-branch }}' | ||
| demo-names: '' | ||
| execute: true | ||
| dev: true | ||
| save-artifact: true | ||
| artifact-name: 'demo-build-use-rc' | ||
| artifact-retention: 10 | ||
| keep-going: false | ||
| quiet: false | ||
| batch_size: 10 | ||
| pennylane-version: '${{ needs.build-demos-with-rc-branches.outputs.pennylane-version }}' | ||
| lightning-version: '${{ needs.build-demos-with-rc-branches.outputs.lightning-version }}' | ||
| catalyst-version: '${{ needs.build-demos-with-rc-branches.outputs.catalyst-version }}' | ||
| extra-index-url: 'https://test.pypi.org/simple/' | ||
| testpypi: true | ||
| prerelease-packages: true | ||
|
|
||
| cleanup: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 days ago
To fix the problem, add an explicit permissions: block to the workflow file .github/workflows/v2-build-rc-demos-daily.yml. The block can be added at the workflow root to set default least-privilege permissions for all jobs (e.g., contents: read). For jobs that need additional permissions (such as cleanup, which pushes branch deletions), add a more permissive permissions: block to just that job (e.g., contents: write). This ensures all jobs only have the access they require. The changes involve inserting a root-level permissions: block (just after the name: and before on:), and inserting a permissions: block in the cleanup: job with contents: write.
-
Copy modified lines R2-R3 -
Copy modified lines R114-R115
| @@ -1,4 +1,6 @@ | ||
| name: Build Daily RC Demos | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| schedule: | ||
| - cron: '0 11 * * 1-5' # Runs weekdays 6 am ET | ||
| @@ -109,6 +111,8 @@ | ||
|
|
||
| cleanup: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| needs: | ||
| - build-demos | ||
| - build-demos-with-rc-branches |
|
Superseded by #1604 |
Title:
Daily QML builds with the RC environment when it exists.
Summary:
demo.pyfile with them, and builds the demos.Relevant references:
Example demo.py configuration for an RC build
Possible Drawbacks:
None
Related GitHub Issues:
1579