From 9f196443de227caf2044379d96b2150572c4837e Mon Sep 17 00:00:00 2001 From: Jonathan Beezley Date: Thu, 2 Feb 2017 14:13:28 -0500 Subject: [PATCH 1/2] Enable geonotebook in deveops scripts --- devops/docker/Dockerfile | 6 ++++-- devops/roles/geonotebook/tasks/main.yml | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/devops/docker/Dockerfile b/devops/docker/Dockerfile index 5b0f599..3697d7f 100644 --- a/devops/docker/Dockerfile +++ b/devops/docker/Dockerfile @@ -51,9 +51,11 @@ RUN /usr/sbin/jupyter-notebook --generate-config \ RUN git clone https://github.com/OpenGeoscience/geonotebook.git /opt/geonotebook \ && pushd /opt/geonotebook \ - && git checkout master \ + && git checkout devops_enable_extension \ && pip2 install https://github.com/OpenGeoscience/KTile/archive/master.zip \ - && pip2 install . + && pip2 install . \ + && jupyter serverextension enable --py geonotebook --sys-prefix \ + && jupyter nbextension enable --py geonotebook --sys-prefix VOLUME /notebooks WORKDIR /notebooks diff --git a/devops/roles/geonotebook/tasks/main.yml b/devops/roles/geonotebook/tasks/main.yml index 86770ae..cd33b4c 100644 --- a/devops/roles/geonotebook/tasks/main.yml +++ b/devops/roles/geonotebook/tasks/main.yml @@ -116,4 +116,14 @@ state: present when: geonotebook_auth_enabled +- name: Enable geonotebook server extension + command: "jupyter serverextension enable --user --py geonotebook" + args: + creates: "{{ ansible_user_dir }}/.jupyter/jupyter_notebook_config.json" + +- name: Enable geonotebook notebook extension + command: "jupyter nbextension enable --user --py geonotebook" + args: + creates: "{{ ansible_user_dir }}/.jupyter/nbconfig/notebook.json" + - include: daemon.yml From bd6c73dba8e8c92fab35d639b2f84f7f8351089b Mon Sep 17 00:00:00 2001 From: Jonathan Beezley Date: Thu, 2 Feb 2017 15:01:08 -0500 Subject: [PATCH 2/2] Move Dockerfile to the repository root --- devops/docker/Dockerfile => Dockerfile | 11 ++++++----- devops/docker/README.md | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) rename devops/docker/Dockerfile => Dockerfile (84%) diff --git a/devops/docker/Dockerfile b/Dockerfile similarity index 84% rename from devops/docker/Dockerfile rename to Dockerfile index 3697d7f..895c91b 100644 --- a/devops/docker/Dockerfile +++ b/Dockerfile @@ -49,15 +49,16 @@ RUN /usr/sbin/jupyter-notebook --generate-config \ && sed -i s/#c.NotebookApp.token\ \=\ \'\'/c.NotebookApp.token\ \=\ \'\'/g \ /root/.jupyter/jupyter_notebook_config.py -RUN git clone https://github.com/OpenGeoscience/geonotebook.git /opt/geonotebook \ - && pushd /opt/geonotebook \ - && git checkout devops_enable_extension \ - && pip2 install https://github.com/OpenGeoscience/KTile/archive/master.zip \ +RUN pip2 install https://github.com/OpenGeoscience/KTile/archive/master.zip + +ADD . /opt/geonotebook +ADD devops/docker/jupyter.sh /jupyter.sh + +RUN pushd /opt/geonotebook \ && pip2 install . \ && jupyter serverextension enable --py geonotebook --sys-prefix \ && jupyter nbextension enable --py geonotebook --sys-prefix VOLUME /notebooks WORKDIR /notebooks -ADD jupyter.sh /jupyter.sh CMD ../jupyter.sh diff --git a/devops/docker/README.md b/devops/docker/README.md index 80706e5..4f94efb 100644 --- a/devops/docker/README.md +++ b/devops/docker/README.md @@ -3,7 +3,7 @@ Geonotebook relies on a complex stack of technologies that are not always easy to install and properly configure. To ease this complexity we provide a docker container for running the notebook on docker compatible systems. To install docker on your system please see docker's [documentation](https://docs.docker.com/engine/installation/) for your operating system. ## Build the container -First you must build the docker container. After checking out the current repository and navigating to ```devops/docker/``` you can run +First you must build the docker container. After checking out the current repository, you can run ``` docker build -t geonotebook .