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

Pin dependency versions in requirements.txt for Docker Image #135

Open
cameronbronstein opened this issue Jul 1, 2020 · 4 comments
Open

Comments

@cameronbronstein
Copy link
Contributor

The local docker build is a bit slow, as conda has to work through several build attempts. This could maybe be sped up if specific versions were pinned in the requirements.txt. It could also improve local re-builds when adding dependencies that support new notebooks.

@cameronbronstein
Copy link
Contributor Author

cameronbronstein commented Jul 30, 2020

When adding the following libraries to the requirements.txt:

  • datashader
  • descartes
  • geoviews
  • holoviews
  • xarray

Build attempt taken ~20 minutes before crashing.

Step 6/9 : RUN conda config --set channel_priority strict &&     conda install -y -c conda-forge --file /tmp/requirements.txt
 ---> Running in 9f1176ea350c
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... Solving environment: ...working... Killed
The command '/bin/sh -c conda config --set channel_priority strict &&     conda install -y -c conda-forge --file /tmp/requirements.txt' returned a non-zero code: 137

I'll investigate if these new libraries are making the conda solve more difficult or if it happens regardless.

@cameronbronstein
Copy link
Contributor Author

cameronbronstein commented Jul 30, 2020

A few more tests:

From the latest planetlabs/notebooks docker image, enter the container via /bin/bash and install new libraries one by one (alphabetically) with conda:

  • conda install descartes
  • conda install geoviews (holoviews is a dependency of geoviews, so we can remove that).

This verifies that we can conda install these.

Next, I ran conda list -e > pinned-requirements.txt. I was able to use these versions to modify the requirements.txt and rebuild the docker image. This does not appear to speed up the conda solve compared to the build pre-analytics notebooks dependencies. However, I retried the docker build w/o pinned dependencies again (but with these additional two libraries), and the build is killed.

My resolution is that pinning the dependencies, including the newly added descartes and geoviews, is the way to go.

@jreiberkyle
Copy link
Contributor

@cameronbronstein so there was no issue with the build when you pinned the dependencies? My thought was that the build was being killed because conda solve timed out, so I'm surprised the build is successful even though conda solve takes just as long

@cameronbronstein
Copy link
Contributor Author

Looking more into the killed problem, I now think it is a memory issue. Killed is the response from a system issue, not a conda issue.

I increased memory allocation for docker on my laptop to 8 BG. Looking at my activity monitor, docker was using nearly 9 GB of ram trying to solve the conda build. After more than 30 min, I exited the build.

This is further indication that pinning the dependencies improved conda solve times, however, pinning could cause issues in the future with new updates to notebooks and/or the dependencies themselves.

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