Skip to content
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

sphinx-build not scalable #165

Open
avivajpeyi opened this issue Dec 20, 2021 · 9 comments
Open

sphinx-build not scalable #165

avivajpeyi opened this issue Dec 20, 2021 · 9 comments

Comments

@avivajpeyi
Copy link
Collaborator

avivajpeyi commented Dec 20, 2021

sphinx-build taking several hours for ~2k notebooks
jupyter-book/jupyter-book#1571

@avivajpeyi
Copy link
Collaborator Author

Maybe we can try switching to sphinx-build: sphinx will allow more customisation in the building stage.

@avivajpeyi
Copy link
Collaborator Author

Ah! The issue must lie in the doctree pickles!

-d path
Since Sphinx has to read and parse all source files before it can write an output file, the parsed source files are cached as “doctree pickles”. Normally, these files are put in a directory called .doctrees under the build directory; with this option you can select a different cache directory (the doctrees can be shared between all builders).

https://www.sphinx-doc.org/en/master/man/sphinx-build.html

See _build/.doctrees

.
├── citation.doctree
├── content
│   ├── example_loader.doctree
│   ├── toi_fits.doctree
│   └── toi_notebooks
│       ├── toi_553.doctree
│       └── toi_560.doctree
├── environment.pickle
├── glue_cache.json
├── index.doctree
└── jupyter_execute
    ├── content
    │   └── toi_notebooks
    │       ├── toi_553.doctree
    │       └── toi_560.doctree

It'd be great if we could generate each of these independently...

@avivajpeyi
Copy link
Collaborator Author

@avivajpeyi avivajpeyi changed the title jupyter-book build taking too much ram (over 34 GB) sphinx-build taking too a very long time Jun 6, 2022
@avivajpeyi
Copy link
Collaborator Author

Update: using -j 4 might have made it slightly faster? Still taking 4+ hours... hmm

@avivajpeyi
Copy link
Collaborator Author

Git issue about sphinx-build taking a long time: executablebooks/sphinx-book-theme#561

@avivajpeyi avivajpeyi changed the title sphinx-build taking too a very long time sphinx-build taking several hours Jun 6, 2022
@avivajpeyi
Copy link
Collaborator Author

Ran it with 64GB ram, 6hrs

@avivajpeyi
Copy link
Collaborator Author

seems like it works with the slurm file

#SBATCH --job-name=webpage
#SBATCH --output=webpage.log
#
#SBATCH --ntasks=1
#SBATCH --time=10:00:00
#SBATCH --mem=64GB
#SBATCH --cpus-per-task=1

module load git/2.18.0 gcc/9.2.0 openmpi/4.0.2 python/3.8.5
source /fred/oz200/avajpeyi/envs/tess/bin/activate

sphinx-build -b html -j auto outdir outdir/_build

@avivajpeyi avivajpeyi reopened this Oct 13, 2022
@avivajpeyi avivajpeyi changed the title sphinx-build taking several hours sphinx-build not scalable Oct 13, 2022
@avivajpeyi
Copy link
Collaborator Author

sphinx-build really isnt scalable -- it eats up more and more resources as we add in additional TOIs.

We should consider ditching this, generate individual pages, maybe serve them with django + use the sphinx-book theme CSS.

As i havent messed with Django since my undergrad days, this may take a some effort, but is doable.

@dfm
Copy link
Owner

dfm commented Oct 13, 2022

We decided to use nbconvert to manually and statically convert each notebook instead of something heavy like Django

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants