Closed crazy4pi314 closed 2 years ago
@Misty-W and @rmlarose got this filed from our investigations yesterday :)
Thanks Sarah for the clear description.
There are two ways to approach solving this:
- See if the newer PyQuil packages come bundled with the servers/compilers bundled natively with the pip packages
- (Drastic) Move to hosting our own docs via GH pages
Is there any notion of saving output in a .myst file like in an .ipynb file? If so this could be an alternative.
I would also add "leave as is" as an option. It's certainly not ideal but not terrible to add a note saying "you'll have to run this yourself to see output." People using pyQuil will be familiar with the reason why.
thanks Sarah for filing the issue :)
@rmlarose I like the idea of saving the output in a file to solve the immediate problem, although I'm not familiar with RTD so I don't know how to make it work on that end.
Re: saving output, that could be really hard as it would have to be checked into the repo, and we would have to update it manually. The point of having executable docs was to avoid precisely this problem. I will look into updating the PyQuil package, as the drastic option (preferable for other reasons) is gonna be a lot more time.
https://pyquil-docs.rigetti.com/en/stable/migration.html what I am looking at
@crazy4pi314, fyi my examples will need to be updated to work on pyQuil 3.0. Should be easy to fix though.
What about if we define a mock PyQuil qvm or, more simply, a mock PyQuil executor? They could be used as a second option if the QVM is not available when building the docs.
Qiskit uses a similar trick (https://qiskit.org/documentation/tutorials/simulators/2_device_noise_simulation.html#Terra-Mock-Backends).
Under the hood a mock qvm
could:
qvm
.Alternatively, a mock PyQuil executor
could:
@andreamari +1 for your suggestion.
Imo, the effort doing this would be better spend moving docs generation to our control on GitHub as it addresses other issues/features that we have wanted (custom domain, jupyter book support, etc.)
FYI, Jupyter Book projects can now be hosted on Read the Docs, see https://jupyterbook.org/publish/readthedocs.html (still to be released).
This some wonderful news!
This issue had no activity for 2 months, and will be closed in one week unless there is new activity. Cheers!
This issue had no activity for 2 months, and will be closed in one week unless there is new activity. Cheers!
@crazy4pi314, @nathanshammah, I haven't really been following this issue lately- are there any plans to solve it?
AFAIK there are 2 ways to handle this:
We could add this to the agenda for friday, but so far I think 1 has been preferred, but with no implementation of yet.
There's a contorted but effective workaround for this use case: https://github.com/dfm/rtds-action/
From @crazy4pi314's comment on PR #1095:
The one thing I am not sure what to do with here is the conf setting which asks the os for the GITHUB_TOKEN. Now this is well defined in the CI runner, but takes setting up api keys for users on local machines doing doc testing. This isn't the worst, but it could be friction we don't want users to deal with.
So an update here, I with ~10 lines got our current docs builds in CI to publish to GH pages. You can see that the pyquill examples are executed correctly (#1135):
RTD: https://mitiq.readthedocs.io/en/stable/examples/pyquil_demo.html GH pages: https://unitaryfund.github.io/mitiq/examples/pyquil_demo.html
I know this is not the best solution, but it at least currently works. What I would suggest is that we use a custom domain (we own some for mitiq) and have that re-direct to GH Pages. For posterity, we can probably re-direct RTD to the new link.
Looks awesome, thank you @crazy4pi314! 🎉
Very nice @crazy4pi314. Maybe we could start testing this. Having versions as in RTD and docs preview in PR would be great. Maybe there are ways to keep these features also on GH pages.
https://holzhaus.github.io/sphinx-multiversion/master/index.html <- This sphinx plugin would give us version selection in the TOC on the side, drafts for open PRs would be def possible but not straight forward.
I motion that this is closed for now, and other issues opened for adding the versioning to the GH pages test doc site, feel free to re-open if needed.
Pre-Report Checklist
Issue Description
We have two places in the docs where we execute notebooks that use PyQuil backends, and they are not showing the execution output:
Looking at the RTD logs (below), this is because the evaluation environment on their server cannot start the necessary Docker images needed to act as the server/simulator. They don't support specifying these containers, and when we run the docs build on GH we can (logs).
There are two ways to approach solving this:
Logs