Skip to content

QML Pipeline Improvements #1322

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

Merged
merged 140 commits into from
May 7, 2025
Merged
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
b57ba0f
create new demos directory structure
brownj85 Dec 20, 2024
4dc5233
pick lib.qml tool
brownj85 Dec 20, 2024
b2e3edb
fix pytorch constraint
brownj85 Dec 20, 2024
bb76dae
restructure lib
brownj85 Dec 20, 2024
22acefc
Apply suggestions from code review
brownj85 Jan 16, 2025
326e586
docstrings
brownj85 Jan 16, 2025
5fcda7f
specify poetry<2
brownj85 Jan 16, 2025
fb46d78
sync
brownj85 Jan 16, 2025
6b19a63
requirements
brownj85 Jan 16, 2025
bea7530
fix tutorial quantum chemistry paths
brownj85 Jan 16, 2025
c51c68e
docs
brownj85 Jan 16, 2025
e768e21
docstrings
brownj85 Jan 16, 2025
ceea64f
update lockfile
brownj85 Jan 16, 2025
39d96d3
fmt
brownj85 Jan 27, 2025
8441b41
add core dependencies
brownj85 Jan 27, 2025
c54066c
fmt
brownj85 Jan 27, 2025
7aecbae
Merge branch 'master' into sc-79849-implement-improved-demo-build-pip…
brownj85 Jan 27, 2025
1fc423e
sync
brownj85 Jan 27, 2025
60e982e
fix v2
brownj85 Jan 27, 2025
424b4b0
clean conf.py
brownj85 Jan 27, 2025
70797e2
add requirements-parser
brownj85 Jan 27, 2025
00f517c
qiskit-aer spec
brownj85 Jan 27, 2025
36d8ec1
Merge branch 'sc-79849-implement-improved-demo-build-pipeline' into s…
brownj85 Jan 30, 2025
8b828ce
single demo builds
brownj85 Jan 31, 2025
8d1e3ec
don't generate full requirements
brownj85 Feb 7, 2025
0aded43
Merge branch 'master' into sc-79849-implement-improved-demo-build-pip…
brownj85 Feb 7, 2025
a505b55
sync
brownj85 Feb 7, 2025
dd0347a
Merge branch 'sc-79849-implement-improved-demo-build-pipeline' into s…
brownj85 Feb 7, 2025
f4c2367
add lxml
brownj85 Feb 7, 2025
1e86b65
pack demos
brownj85 Feb 7, 2025
03363b4
copy hardware images
brownj85 Feb 7, 2025
bbd53cd
skip non-executable demos
brownj85 Feb 7, 2025
20e7135
Merge branch 'sc-79849-implement-improved-demo-build-pipeline' into s…
brownj85 Feb 7, 2025
b4c1e66
jax
brownj85 Feb 7, 2025
2212966
jax
brownj85 Feb 7, 2025
cf7a5ce
Merge branch 'sc-79849-implement-improved-demo-build-pipeline' into s…
brownj85 Feb 7, 2025
00c4454
add actions for build and deploy to content service
brownj85 Feb 11, 2025
5fa842e
add inherit secrets
brownj85 Feb 11, 2025
9d137e1
add pypandoc_binary
brownj85 Feb 11, 2025
e79f85b
Merge branch 'sc-79849-implement-improved-demo-build-pipeline' into s…
brownj85 Feb 11, 2025
53f52d1
fix organization
brownj85 Feb 11, 2025
7880301
add openfermion dep to tutorial_diffable_shadows
brownj85 Feb 11, 2025
55a29b0
Merge branch 'sc-79849-implement-improved-demo-build-pipeline' into s…
brownj85 Feb 11, 2025
53be132
update
brownj85 Feb 11, 2025
8f0b2d9
remove pypandoc-binary
brownj85 Feb 11, 2025
111fb92
Merge branch 'sc-81925-qml-repository-ci-pushes-newly-built-demos' in…
brownj85 Feb 11, 2025
8c24d01
demo
brownj85 Feb 11, 2025
98c63f8
push trigger
brownj85 Feb 11, 2025
d1ac538
fx environment
brownj85 Feb 11, 2025
a8b5ec3
use GITHUB_OUTPUT
brownj85 Feb 11, 2025
8ba91a3
formatting
brownj85 Feb 11, 2025
b4d200d
deploy
brownj85 Feb 11, 2025
17a8899
gbs
brownj85 Feb 11, 2025
3ecf175
rename deploy step
brownj85 Feb 11, 2025
d86d97a
error handling
brownj85 Feb 11, 2025
9b19a4d
hmm
brownj85 Feb 11, 2025
6dfd10a
fix deploy
brownj85 Feb 11, 2025
5a7aab3
test build
brownj85 Feb 11, 2025
b8a6dcc
reqs
brownj85 Feb 11, 2025
2586336
test
brownj85 Feb 11, 2025
756309c
fix build issues
brownj85 Feb 12, 2025
2c42e58
fix gallery path
brownj85 Feb 12, 2025
76df2c8
requirements
brownj85 Feb 12, 2025
3ff2753
qrack
brownj85 Feb 12, 2025
8f95123
concurrency
brownj85 Feb 12, 2025
420a1ca
install system dependencies
brownj85 Feb 13, 2025
86f7789
fix error summary
brownj85 Feb 13, 2025
35a4477
remove kak_theorem
brownj85 Feb 13, 2025
51f52d2
fetch hymenoptera_data
brownj85 Feb 13, 2025
032be6e
error logging
brownj85 Feb 13, 2025
3e86fe1
test all
brownj85 Feb 13, 2025
0ab9b4b
updates
brownj85 Feb 13, 2025
3ec262b
add get-changed-action
brownj85 Feb 13, 2025
98ff9b5
fix requirements
brownj85 Feb 13, 2025
12ae7a1
index urls
brownj85 Feb 13, 2025
09b0ec3
cleanup
brownj85 Feb 13, 2025
75b35d3
execute
brownj85 Feb 14, 2025
aedec50
increment done
brownj85 Feb 14, 2025
f070f6e
execute_demo log
brownj85 Feb 14, 2025
83816a6
chunk workflow
brownj85 Feb 18, 2025
46e01cf
output
brownj85 Feb 18, 2025
754f6f8
output name
brownj85 Feb 18, 2025
5bc3948
get demo names
brownj85 Feb 18, 2025
1c1c3e9
quoting
brownj85 Feb 18, 2025
d45d0b5
quoting
brownj85 Feb 18, 2025
fa103d3
de-json
brownj85 Feb 18, 2025
88eedbf
consolidate artifacts
brownj85 Feb 18, 2025
0788637
requirements
brownj85 Feb 18, 2025
64b64e3
fix sha
brownj85 Feb 18, 2025
8d59318
dep
brownj85 Feb 19, 2025
15d6872
requirements
brownj85 Feb 19, 2025
5977c96
requirements
brownj85 Feb 19, 2025
a801646
subprocess
brownj85 Feb 19, 2025
a72fde0
dask
brownj85 Feb 19, 2025
79a5b13
Merge branch 'master' into sc-79849-implement-improved-demo-build-pip…
brownj85 Feb 20, 2025
3931fe9
update sync algorithm
brownj85 Feb 20, 2025
c0d7d49
sync
brownj85 Feb 20, 2025
afcd7aa
uv sync
brownj85 Feb 20, 2025
f082f6e
Revert "sync"
brownj85 Feb 20, 2025
32ea6f5
sync v2
brownj85 Feb 20, 2025
3d4c57f
fix univariate_qvr
brownj85 Feb 20, 2025
9bd0d17
rename workflows
brownj85 Feb 25, 2025
ea8ad7f
workflows
brownj85 Feb 25, 2025
c3292b7
refactor workflows
brownj85 Feb 25, 2025
5524d02
scaffold
brownj85 Feb 27, 2025
574ff4a
Merge branch 'master' into add-qml-new-cmds
brownj85 Feb 27, 2025
a19d1cb
add 'new' command
brownj85 Feb 27, 2025
204f013
dependencies
brownj85 Feb 28, 2025
995a650
Merge branch 'master' into v2
brownj85 Feb 28, 2025
11b0b34
rename workflow
brownj85 Feb 28, 2025
9a6ab6f
add inflection
brownj85 Feb 28, 2025
adea110
pl
brownj85 Feb 28, 2025
65bc574
fix dev constraints
brownj85 Feb 28, 2025
b63e7bf
prerelease
brownj85 Feb 28, 2025
9238e66
pin chex
brownj85 Feb 28, 2025
b969e3d
fix constraints
brownj85 Feb 28, 2025
a25722a
delete workflows
brownj85 Feb 28, 2025
f8c869a
Merge branch 'master' into v2
Alan-eMartin Apr 10, 2025
cd7099e
Merge remote-tracking branch 'origin/master' into v2
Alan-eMartin Apr 14, 2025
78b6669
Merge remote-tracking branch 'origin/master' into v2
Alan-eMartin Apr 16, 2025
a775a1d
SC-85409 | Build and deploy demonstration previews on pull requests (…
Alan-eMartin Apr 29, 2025
a6d6a05
Chore Disable auto comment in v2 deploy pr [sc-90282]
Alan-eMartin May 1, 2025
19c659c
Merge branch 'master' into v2
Alan-eMartin May 1, 2025
7fcd6fb
trigger workflow run
Alan-eMartin May 1, 2025
75f3f2c
workflow permissions added to build and deploy, rm branch arg
Alan-eMartin May 1, 2025
5604f68
use stable in `constraints.txt`
Alan-eMartin May 6, 2025
4754157
added new demos to v2
Alan-eMartin May 6, 2025
d869eed
update stable contraints
Alan-eMartin May 6, 2025
31c509b
add catalyst 11 and remove imports
Alan-eMartin May 6, 2025
4f03e42
Merge remote-tracking branch 'origin/master' into run-v2-sync
Alan-eMartin May 6, 2025
7e2f8e7
sync with new annni changes
Alan-eMartin May 7, 2025
31337b2
Merge branch 'run-v2-sync' into v2
Alan-eMartin May 7, 2025
443e51b
Move new readme to qml tool and mark as experimental.
Alan-eMartin May 7, 2025
85b70a5
revert current Readme to prevent confusion
Alan-eMartin May 7, 2025
48d2797
Update .github/workflows/v2-build-and-deploy.yml
Alan-eMartin May 7, 2025
7bee87c
Update .github/workflows/v2-build-and-deploy.yml
Alan-eMartin May 7, 2025
9b43af2
Update .github/workflows/v2-build-demos.yml
Alan-eMartin May 7, 2025
242fb57
Update .github/workflows/v2-build-demos.yml
Alan-eMartin May 7, 2025
f872a00
Apply suggestions from code review
Alan-eMartin May 7, 2025
f124311
remove redundancy of output step
Alan-eMartin May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/v2-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: V2 Build and Deploy Demos

permissions:
contents: read
pull-requests: write
actions: read

on:
workflow_dispatch:
inputs:
environment:
description: SWC environment to deploy to.
options:
- swc-staging
- swc-prod
- swc-dev
required: true
type: choice
target:
default: stable
description: PennyLane version to build the demos. Either 'latest' or the most recent 'stable' release.
options:
- latest
- stable
required: true
type: choice
demos:
description: Demos to build and deploy, space-separated list of slugs (e.g. "demo1 demo2 demo3"), or leave empty for all demos.
required: false
type: string
as-previews:
default: false
description: |
Whether to deploy the demos as previews.
**Please note** that demos built with the latest version cannot be published to swc-staging or swc-prod.
They can only be deployed as previews.
required: false
type: boolean

jobs:
validate-and-parse-inputs:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.set-branch.outputs.branch }}
steps:
- name: Set branch
id: set-branch
run: |
if [[ "${{ github.event.inputs.target }}" == "stable" ]]; then
echo "branch=master" >> $GITHUB_OUTPUT
elif [[ "${{ github.event.inputs.target }}" == "latest" ]]; then
echo "branch=dev" >> $GITHUB_OUTPUT
else
echo "branch=" >> $GITHUB_OUTPUT
fi
- name: Validate preview input
id: validate-preview
run: |
if [[
("${{ github.event.inputs.environment }}" == "swc-staging" ||
"${{ github.event.inputs.environment }}" == "swc-prod") &&
"${{ github.event.inputs.target }}" == "latest" &&
"${{ github.event.inputs.as-previews }}" == "false"
]]; then
echo "========================="
echo "🚫 Invalid input detected:"
echo "Demos built with the latest version cannot be published to 'swc-staging' or 'swc-prod'."
echo "They can only be deployed as previews."
echo "Please set the 'as-previews' input to 'true' in your workflow configuration."
echo "========================="
exit 1
fi
build:
needs: validate-and-parse-inputs
if: >
(needs.validate-and-parse-inputs.outputs.branch == 'master') ||
(needs.validate-and-parse-inputs.outputs.branch == 'dev')
uses: ./.github/workflows/v2-build-demos.yml
with:
ref: ${{ needs.validate-and-parse-inputs.outputs.branch }}
demo-names: ${{ github.event.inputs.demos }}
dev: ${{ github.event.inputs.target == 'latest' }}
save-artifact: true
artifact-name: build-and-deploy-${{ github.event.inputs.target }}
keep-going: false
quiet: false
batch_size: 10

deploy:
uses: ./.github/workflows/v2-deploy-demos.yml
needs:
- validate-and-parse-inputs
- build
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
artifact-name: build-and-deploy-${{ github.event.inputs.target }}
preview: ${{ github.event.inputs.as-previews }}
44 changes: 25 additions & 19 deletions .github/workflows/v2-build-demos.yml
Original file line number Diff line number Diff line change
@@ -8,13 +8,20 @@ on:
type: string
demo-names:
description: |
Instead of building all demos, only build the demos specified in this list.
Only build the demos specified in a space-separated list,
e.g. demo1 demo2 demo3.
If not specified, all demos will be built.
required: false
type: string
default: ''
dev:
description: Use development dependencies.
required: false
type: boolean
default: false
save-artifact:
description: |
Whether to save the built demos as an artifact.
description: Save the built demos as an artifact.
required: false
type: boolean
default: true
@@ -24,22 +31,19 @@ on:
type: string
default: ''
keep-going:
description: Whether to keep going if a demo fails to build
description: Keep going if a demo fails to build.
required: false
type: boolean
default: false
quiet:
description: |
Whether to suppress output from the build process
description: Suppress output from the build process.
required: false
type: boolean
default: false
batch_size:
description: |
Number of demos to build per job
description: Number of demos to build per job.
type: number
default: 10

outputs:
artifact-name:
description: "Name of the artifact containing the built demos"
@@ -57,25 +61,28 @@ on:
required: false
type: string
default: ''
dev:
description: Use development dependencies.
required: false
type: boolean
default: false
save-artifact:
description: |
Whether to save the built demos as an artifact.
description: Save the built demos as an artifact.
required: false
type: boolean
default: true
artifact-name:
description: Name of the artifact containing the built demos (defaults to demo-build-{ref})
required: true
description: Name of the build artifact (defaults to demo-build-{ref}).
required: false
type: string
default: ''
keep-going:
description: Whether to keep going if a demo fails to build
description: Keep going if a demo fails to build.
required: false
type: boolean
default: false
quiet:
description: |
Whether to suppress output from the build process
description: Suppress output from the build process.
required: false
type: boolean
default: false
@@ -165,7 +172,8 @@ jobs:
--execute \
${{ inputs.keep-going && '--keep-going' || '--no-keep-going' }} \
${{ inputs.quiet && '--quiet' || '--no-quiet' }} \
${{ steps.demo-name-list.outputs.demo-names }}
${{ steps.demo-name-list.outputs.demo-names }} \
${{ inputs.dev && '--dev' || '--no-dev' }}
- name: Upload artifacts
id: upload-artifacts
@@ -207,5 +215,3 @@ jobs:
uses: geekyeggo/delete-artifact@v5
with:
name: ${{ needs.generate-build-variables.outputs.artifact-name }}-c*


81 changes: 81 additions & 0 deletions .github/workflows/v2-build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: V2 Build PR

on:
pull_request:
branches: [master, dev]

permissions:
contents: read

concurrency:
group: build-v2-demos-${{ github.event.pull_request.head.sha }}
cancel-in-progress: true

jobs:
# Step 1: Identify changed demos
identify-changed-demos:
runs-on: ubuntu-latest
outputs:
updated: ${{ steps.get-changed-demos.outputs.updated }}
deleted: ${{ steps.get-changed-demos.outputs.deleted }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get changed demos
id: get-changed-demos
uses: ./.github/actions/get-changed-demos

- name: Output changed demos
run: |
echo "Updated Demos: ${{ steps.get-changed-demos.outputs.updated }}"
echo "Deleted Demos: ${{ steps.get-changed-demos.outputs.deleted }}"
- name: Exit if no changes
if: steps.get-changed-demos.outputs.updated == ''
run: |
echo "No changes found in demos. Exiting workflow."
# Step 2: Build demos
build:
if: needs.identify-changed-demos.outputs.updated != ''
uses: ./.github/workflows/v2-build-demos.yml
needs:
- identify-changed-demos
with:
ref: ${{ github.event.pull_request.head.sha }}
demo-names: ${{ needs.identify-changed-demos.outputs.updated }}
dev: ${{ github.event.pull_request.base.ref == 'dev' }}
save-artifact: true
artifact-name: demo-build-${{ github.event.pull_request.head.sha }}
keep-going: false
quiet: false
batch_size: 10

# Step 3: Save build context
save-build-context:
runs-on: ubuntu-latest
needs:
- build
- identify-changed-demos
steps:
- name: Save Pull Request Event Context
run: |
mkdir -p /tmp/pr
cat >/tmp/pr/pr_info.json <<EOL
{
"id": "${{ github.event.pull_request.number }}",
"ref": "${{ github.event.pull_request.head.sha }}",
"ref_name": "${{ github.event.pull_request.head.ref }}",
"updated_demos": "${{ needs.identify-changed-demos.outputs.updated }}",
"deleted_demos": "${{ needs.identify-changed-demos.outputs.deleted }}"
}
EOL
- name: Upload Pull Request Event Context as Artifact
uses: actions/upload-artifact@v4
with:
name: pr_info
path: /tmp/pr
retention-days: 30
4 changes: 1 addition & 3 deletions .github/workflows/v2-deploy-demos.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ on:
type: environment
required: true
artifact-name:
description: Name of artifact containing demo builds
description: Name of artifact containing demo zip files.
type: string
preview:
description: Whether to deploy demos as preview
@@ -38,7 +38,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
fetch-depth: 1

- name: Configure AWS credentials
@@ -67,4 +66,3 @@ jobs:
python3 .github/workflows/qml_pipeline_v2/deploy.py \
--preview ${{ inputs.preview }} \
_build/pack/*.zip
Loading