Skip to content

GPNB Development Environment Setup

liefeld edited this page Jul 17, 2019 · 4 revisions

Introduction:

Due to the complexity of the GPNB image, getting a development environment setup can be a bit of a chore (and on my mac impossible it seems) however as with so many other configuration issues of the past, Docker has come to the rescue once again.

The whole idea is that the current container from the GenePattern Notebook server already has everything installed and configured, so all we need to do is to run that container with our local git copies of the extensions mounted into the expected directories of the container.

So for example, to be able to work on the nbtools package (also from the GenePattern team and a dependency of this repository) we can do the following docker run to have the extension work out of our local nbtools copy in place if the ones installed in the container. There are 3 of these, one for the root pip install (used only for nbtools extensions) and one each for the jupyter kernels (3.6 and 3.7 at the time of this writing). So for example you could do this to run out of the local directory in which you have nbtools;

 `docker run --name gpnbdev -p 8888:8888 
      -v $PWD/nbtools/nbtools/static:/opt/conda/share/jupyter/nbextensions/nbtools 
      -v $PWD/nbtools:/opt/conda/envs/python3.6/lib/python3.6/site-packages/nbtools
      -v $PWD/nbtools:/opt/conda/envs/python3.7/lib/python3.7/site-packages/nbtools
      -v $PWD:$PWD -w $PWD -it genepattern/genepattern-notebook:latest`

or for this genepattern-notebook extension;

docker run --name gpnbdev -p 8888:8888 -v $PWD:$PWD -w $PWD -v $PWD/genepattern-notebook/genepattern/static:/opt/conda/share/jupyter/nbextensions/genepattern -v $PWD/genepattern-notebook/genepattern:/opt/conda/envs/python3.6/lib/python3.6/site-packages/genepattern -v $PWD/genepattern-notebook/genepattern:/opt/conda/envs/python3.7/lib/python3.7/site-packages/genepattern -v $PWD/genepattern-notebook/genepattern/static:/opt/conda/lib/python3.6/site-packages/genepattern -it genepattern/genepattern-notebook:latest

And should you be editing both these packages you would need the superset of volume mounts to get both from the repos in your local directory

Clone this wiki locally