-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Maint] The Gallery is broken in CircleCI previews #174
Comments
It looks like all of the examples are failing with the following message:
|
It is boring to see the same error again and again. The next problem from the storage of global reference to QtWidget, which is cleaned during destroy of the viewer. :( |
Ok! Currently, changing the system/qt dependencies for CircleCI the error has moved from the one above to
As @psobolewskiPhD has found, this may mean CircleCI is running out of memory: https://support.circleci.com/hc/en-us/articles/115014359648-Exit-Code-137-Out-of-Memory I tried increasing the CircleCI image memory but we don't have that machine available in our tier. So currently our options are:
Feel free to inspect things here: #178 |
Did qtgallery allow to create custom teardown setup after each example? |
I think that should be possible, if not via qtgallery, which has It doesn't look like napari would be closed afterwards? So making the gallery would just pile up naparis? maybe the qtgallery handling of the event loop isn't working with |
@dalthviz this is the issue we discussed today, maybe you can take a look 😄 |
Checking, I think the issue comes from the way Also, an idea that maybe could be worthy to explore is to divide the examples generation so kind of calling the |
Ah I think I could have been better help as I wrote some of this code in Sphinx Gallery 🤦
Yes this is true. We can do a garbage collection after each example by adding a 'resetting' function to run at the end of each example. Sphinx Gallery should delete references to variables created in examples, at the end of execution of each example. See: sphinx-gallery/sphinx-gallery#853 I can have a go at doing this tomorrow. |
As a starting point, we are using qtgallery and we did add a reset to gallery examples here: Lines 210 to 225 in 704fb54
This is probably not enough or there is some interaction still missing here... |
I spent entirely too much time debugging the docs CI for napari/napari#4865 and ended up making a more specific "napari scraper" that seems to help and might be of use here as well (see #207). This also vastly speeds up the build for me on CI; from ~25 min to ~11 min on GitHub Actions, though no improvement on CircleCI. One caveat is that it only scrapes napari Viewer windows - I'm not sure if we have any gallery examples that need to scrape other windows but will go through them to check. |
Amazing. This is great because I've realised that Sphinx gallery will do a garbage collection between every example. |
# Description This is a CI change that removes `qtgallery` in favor of a napari-specific scraper. It's not that different but gives us a little more control and is not much code. This seems to fix the error seen in "Build PR Docs" for napari/napari#4865 and also speeds up the docs build quite a bit (~11 min instead of ~25 min). I'm no Qt expert but suspect the main improvements here are related to adding `napari.Viewer.close_all()` (which maybe belongs in the reset fn) and calling `processEvents()` one more time after this. The main drawback right now is that this doesn't capture non-Viewer windows, but this could probably be added if needed. ## Type of change - [x] Fixes or improves workflow, documentation build or deployment # References closes #174 (maybe?) fixes errors in docs build for napari/napari#4865 ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have commented my code, particularly in hard-to-understand areas
# Description This is a CI change that removes `qtgallery` in favor of a napari-specific scraper. It's not that different but gives us a little more control and is not much code. This seems to fix the error seen in "Build PR Docs" for napari/napari#4865 and also speeds up the docs build quite a bit (~11 min instead of ~25 min). I'm no Qt expert but suspect the main improvements here are related to adding `napari.Viewer.close_all()` (which maybe belongs in the reset fn) and calling `processEvents()` one more time after this. The main drawback right now is that this doesn't capture non-Viewer windows, but this could probably be added if needed. ## Type of change - [x] Fixes or improves workflow, documentation build or deployment # References closes napari#174 (maybe?) fixes errors in docs build for napari/napari#4865 ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have commented my code, particularly in hard-to-understand areas
🧰 Task
Figure out what the issue is, the CircleCI action is different than the build_docs action, which works correctly—the gallery is fine in the .zip.
There is a difference in the order of the installs, which results in different ninja version.
There is a difference in python version
There is a difference in Qt backend.
I took some stabs at the first and second part, but that resulted in worse outcomes, with one of the examples failing totally and the build failing as as result, see:
#173
The text was updated successfully, but these errors were encountered: