-
Notifications
You must be signed in to change notification settings - Fork 191
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
Implement improved demo build pipeline #1286
base: master
Are you sure you want to change the base?
Conversation
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.
Looks like a great improvement, nice work @brownj85! 🚀
I've reviewed the additions to lib/qml/*
here. A few questions and suggestions.
Are the tutorials mainly copy code? Probably too much to be reviewed in a PR, perhaps this can be QA'd interactively?
if quiet: | ||
cmd.append("--quiet") | ||
|
||
cmd.extend(str(arg) for arg in args) |
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.
Question
Should we include some error handling for processing the args
here?
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.
No, we can just delegate to the underlying process to raise an appropriate error.
def _install_build_dependencies(venv: Virtualenv, build_dir: Path): | ||
"""Install dependencies for running sphinx-build into `venv`.""" |
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.
Question
For my understanding - is this all being performed on a GitHub runner or are we executing this on some other hardware?
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.
This will be run in a github runner, for the time being. We may look into moving demo execution into software cloud.
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.
Question:
@brownj85 — Do you have any suggestions on how we can test this locally?
Or as @anthayes92 mentioned above, should we do a live QA of these changes?
Hey @Alan-eMartin, @anthayes92 added some suggestions on testing to the top 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.
Thanks for the presentation yesterday @brownj85, looks great.
Would it make sense to use the qml CLI tool in the CI builds now, or would that be introduced in a subsequent PR? |
That will be in a a subsequent PR - the diff for this is already massive. |
Thank you for opening this pull request. You can find the built site at this link. Deployment Info:
Note: It may take several minutes for updates to this pull request to be reflected on the deployed site. |
Context
This PR is the initial phase of a re-factor of the demo build process. The goal is to improve the organization of the QML repo, make it easier to use, improve build times and simplify the process of deploying to pennylane.ai. To that end, this PR introduces a command line tool
qml
which will allow us to abstract over the sphinx-build process, and acts as an extension point to introduce new tooling. Theqml
tool can be install by runningpip install .
in the repository root.Changes
Introduce a new structure for the demo files that gives each demo its own directory, containing the metadata (
metadata.json
), runtime requirements (requirements.in
), any resources used by the demo, as well as the demo file itself (demo.py
). Since this structure is not directly compatible with sphinx or sphinx-gallery, we use theqml
tool to orchestrate the build process. (The new demo files are stored in thedemonstrations_v2
directory, to avoid interfering with the existing build).The command
qml build [demo names]
does the following:_build/demonstrations
, structured to be compatible withsphinx-gallery
--execute
), install execution dependencies for requested demo(s). The package versions are constrained by theexecutable-dependencies
dependency group inpyproject.toml
sphinx-build
on the staging directoryTesting
Testers should verifying that the
qml build
command executes correctly usingjson
andhtml
formats, and produces output identical to themake html
ormake json
commands. Testers should also runqml build
with and without the--execute
flag.Installation
Create a Python3.10 virtual environment and install the qml tool:
Then
qml build
can be run anywhere in the repo: