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

Command killed due to excessive memory consumption #6412

Closed
lukelbd opened this issue Nov 27, 2019 · 8 comments
Closed

Command killed due to excessive memory consumption #6412

lukelbd opened this issue Nov 27, 2019 · 8 comments
Labels
Support Support question

Comments

@lukelbd
Copy link

lukelbd commented Nov 27, 2019

Details

Expected Result

Successful build.

Actual Result

Failed build. The conda environment solve step causes excess memory consumption.

I also have python.system_packages = True in my yaml. Maybe I can reduce the environment solve complexity by using the shared packages? Currently the contents of environment.yml are:

name: proplot-dev
channels:
  - conda-forge
dependencies:
  - pip
  - numpy
  - xarray
  - pandas
  - matplotlib
  - cartopy
  - basemap
  - nbsphinx
  - sphinx
  - ipython
  - ipykernel
  - pip:
    - lxml
    - pyyaml
    - sphinx_rtd_theme
    - git+https://github.com/lukelbd/sphinx-automodapi@v0.6.proplot-mods

But I'm also worried about memory consumption for the nbsphinx steps, which generate some fairly high resolution figures. Before this merge I used nbconvert to manually generate RST files and synced those.

@humitos
Copy link
Member

humitos commented Dec 1, 2019

Hi @lukelbd! The main problem here is that conda consumes a lot of memory to do the package resolution. We had this problem in the past and it's a known issue in the conda community.

I enabled two flags in your project that could help with this (the most important one, is to update conda at startup, since the latest conda release has some memory consumptions improvements).

I triggered a build already. Let's see how it goes.

@humitos
Copy link
Member

humitos commented Dec 1, 2019

That didn't help too much. I had to increase the memory limit to 2.5Gb to make the conda create env step to pass.

The build is still failing because your proplot library is not properly installed in the conda environment created, so it failed when importing it from Sphinx. See https://readthedocs.org/projects/proplot/builds/10046893/

@lukelbd
Copy link
Author

lukelbd commented Dec 1, 2019

Thanks a lot!

I fixed the failed build by adding proplot to environment.yml with a

dependencies:
  - pip:
    .. # relative path for installing current proplot master branch

But now it fails because I've renamed some classes and class methods. I think it will run if I can call make clean on the RTD server. How can I do this?

@lukelbd
Copy link
Author

lukelbd commented Dec 1, 2019

It seems this error is related to #208 (which was posted by the astropy developers). Astropy released the little-known sphinx-automodapi plugin that I also use for ProPlot -- it imports your package and automatically figures out which classes + functions need to be documented, but when the class + function names change and you still have the auto-generated stub pages with the old names, you get errors.

I'll try adding a step in conf.py that empties out the api/*.rst stub pages generated by sphinx-automodapi every single time make html is run. This isn't the most efficient approach but should solve the problem.

Actually it's probably better to just "wipe" the build as described in #208 every time this happens. The main API changes quite rarely. Just triggered another build, hopefully it goes through.

@lukelbd
Copy link
Author

lukelbd commented Dec 1, 2019

Next we have a KeyError: PROJ_LIB issue associated with basemap as described in #5339. Basemap needs to use a custom environment variable, but since RTD does not use conda activate, this variable is unset. I'll copy their hack into my conf.py and try again.

lukelbd added a commit to proplot-dev/proplot that referenced this issue Dec 1, 2019
@lukelbd
Copy link
Author

lukelbd commented Dec 2, 2019

Perfect, it's live! Thanks for the help. Luckily it seems the nbsphinx step doesn't need any more memory than the conda step.

@lukelbd
Copy link
Author

lukelbd commented Mar 6, 2020

@humitos I've been getting a lot of "Build exited due to time out" errors lately. The build is successful maybe ~10-20% of the time, seemingly randomly. I have to keep manually re-building. You'll notice a ton of failed builds in my build history.

Would it be possible to increase my maximum compile time?

@lukelbd lukelbd reopened this Mar 6, 2020
@humitos
Copy link
Member

humitos commented Mar 6, 2020

I increased the time for your project and triggered a build at https://readthedocs.org/projects/proplot/builds/10567203/. Feel free to reopen if it does not work.

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

No branches or pull requests

3 participants