Skip to content
Snippets Groups Projects
Commit a25c32e8 authored by Marco Del Tufo's avatar Marco Del Tufo
Browse files

Update jupiterhub-for-openbis.md

parent 0b59e56e
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -59,7 +59,7 @@ How to run the official JupyterHub for openBIS image in your local machine ...@@ -59,7 +59,7 @@ How to run the official JupyterHub for openBIS image in your local machine
1. After downloading the jupyterhub-openbis, find the id of your image. 1. After downloading the jupyterhub-openbis, find the id of your image.
```bash ```shell
$ docker images $ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE REPOSITORY TAG IMAGE ID CREATED SIZE
openbis/jupyterhub-openbis-sis-20180405 latest 585a9adf333b 23 hours ago 4.75GB openbis/jupyterhub-openbis-sis-20180405 latest 585a9adf333b 23 hours ago 4.75GB
...@@ -110,7 +110,7 @@ It can probably be done but we are currently not supporting it. ...@@ -110,7 +110,7 @@ It can probably be done but we are currently not supporting it.
### Check Available Octave Libraries ### Check Available Octave Libraries
```bash ```shell
pkg list pkg list
``` ```
...@@ -122,7 +122,7 @@ It can probably be done but we are currently not supporting it. ...@@ -122,7 +122,7 @@ It can probably be done but we are currently not supporting it.
### Check Available Python 3 Libraries ### Check Available Python 3 Libraries
```bash ```shell
pip freeze pip freeze
``` ```
...@@ -138,8 +138,10 @@ recommended to do so. ...@@ -138,8 +138,10 @@ recommended to do so.
### Check Available R Libraries ### Check Available R Libraries
my_packages <- library()$results ```python
head(my_packages, 1000000) my_packages <- library()$results
head(my_packages, 1000000)
```
![image info](img/259.png) ![image info](img/259.png)
...@@ -155,7 +157,7 @@ Modify a currently running container - From Console (for admins) ...@@ -155,7 +157,7 @@ Modify a currently running container - From Console (for admins)
1. Find the container id of the image currently running. 1. Find the container id of the image currently running.
```bash ```shell
$ docker ps $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 4 seconds ago Up 2 seconds 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8081->8081/tcp nervous_leakey a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 4 seconds ago Up 2 seconds 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8081->8081/tcp nervous_leakey
...@@ -163,15 +165,15 @@ a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 4 ...@@ -163,15 +165,15 @@ a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 4
2. Log into the container. 2. Log into the container.
```bash ```shell
$ docker exec -it a2b76d1dd204 bash $ docker exec -it a2b76d1dd204 shell
``` ```
### Add Python Library ### Add Python Library
Add a new library to Python 3 Add a new library to Python 3
```bash ```shell
# First we should move to the environment used by JupyterHub # First we should move to the environment used by JupyterHub
[root@a2b76d1dd204 /]# export PATH=/vagrant_installation/miniconda3/bin:$PATH [root@a2b76d1dd204 /]# export PATH=/vagrant_installation/miniconda3/bin:$PATH
[root@a2b76d1dd204 /]# export LC_ALL=en_US.utf8 [root@a2b76d1dd204 /]# export LC_ALL=en_US.utf8
...@@ -197,7 +199,7 @@ lost. ...@@ -197,7 +199,7 @@ lost.
Add a new library to R Add a new library to R
```bash ```shell
# First we should move to the environment used by JupyterHub # First we should move to the environment used by JupyterHub
[root@a2b76d1dd204 /]# export PATH=/vagrant_installation/miniconda3/bin:$PATH [root@a2b76d1dd204 /]# export PATH=/vagrant_installation/miniconda3/bin:$PATH
[root@a2b76d1dd204 /]# export LC_ALL=en_US.utf8 [root@a2b76d1dd204 /]# export LC_ALL=en_US.utf8
...@@ -219,7 +221,8 @@ If you know that you have made significant changes that you want to keep ...@@ -219,7 +221,8 @@ If you know that you have made significant changes that you want to keep
until you build a new docker recipe, you have the option to save the until you build a new docker recipe, you have the option to save the
running container as a new image. running container as a new image.
```bash
```shell
bs-mbpr28:jupyterhub_reference_installation juanf$ docker ps bs-mbpr28:jupyterhub_reference_installation juanf$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 37 minutes ago Up 37 minutes 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8081->8081/tcp lucid_stonebraker a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 37 minutes ago Up 37 minutes 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8081->8081/tcp lucid_stonebraker
...@@ -232,6 +235,7 @@ jupyterhub-openbis-sis-juanextensions-20180406 latest 5dd0036664c ...@@ -232,6 +235,7 @@ jupyterhub-openbis-sis-juanextensions-20180406 latest 5dd0036664c
jupyterhub-openbis-sis-20180405 latest 585a9adf333b 23 hours ago 4.75GB jupyterhub-openbis-sis-20180405 latest 585a9adf333b 23 hours ago 4.75GB
``` ```
Extend a docker image using a docker recipe (for maintenance) Extend a docker image using a docker recipe (for maintenance)
------------------------------------------------------------- -------------------------------------------------------------
...@@ -241,7 +245,7 @@ latest official docker image distributed by SIS. ...@@ -241,7 +245,7 @@ latest official docker image distributed by SIS.
Using our last example, let's create a file called "Dockerfile" and with Using our last example, let's create a file called "Dockerfile" and with
the content shown below. the content shown below.
```bash ```shell
# vim:set ft=dockerfile: # vim:set ft=dockerfile:
FROM openbis/jupyterhub-openbis-sis-20180405 FROM openbis/jupyterhub-openbis-sis-20180405
## Adding Python 3 library ## Adding Python 3 library
...@@ -259,7 +263,7 @@ the official repository. ...@@ -259,7 +263,7 @@ the official repository.
> :warning: **It is best practice to include both the name of the user and the creation date in the image name. This will help when dealing with many versions created by different users at different times**. > :warning: **It is best practice to include both the name of the user and the creation date in the image name. This will help when dealing with many versions created by different users at different times**.
```bash ```shell
$ docker build -t jupyterhub-openbis-sis-juanextensions-recipe-20180406 . $ docker build -t jupyterhub-openbis-sis-juanextensions-recipe-20180406 .
Sending build context to Docker daemon 4.957GB Sending build context to Docker daemon 4.957GB
Step 1/2 : FROM openbis/jupyterhub-openbis-sis-20180405 Step 1/2 : FROM openbis/jupyterhub-openbis-sis-20180405
...@@ -288,25 +292,31 @@ your admin). ...@@ -288,25 +292,31 @@ your admin).
2. Find the container id of the image that is currently running. 2. Find the container id of the image that is currently running.
$ docker ps ```shell
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ docker ps
a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 4 seconds ago Up 2 seconds 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8081->8081/tcp nervous_leakey CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a2b76d1dd204 jupyterhub-openbis-sis-20180405 "./vagrant/initial..." 4 seconds ago Up 2 seconds 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8081->8081/tcp nervous_leakey
```
3. Stop the current container. 3. Stop the current container.
$ docker kill a2b76d1dd204 ```shell
a2b76d1dd204 $ docker kill a2b76d1dd204
a2b76d1dd204
```
4. Edit the jupyterhub-openbis-start.sh file in your server and update 4. Edit the jupyterhub-openbis-start.sh file in your server and update
the name of the image it runs to the one of your choice the name of the image it runs to the one of your choice
```bash ```shell
docker run -v /Users/juanf/Documents/programming/git/jupyter-openbis-integration/jupyterhub_reference_installation/home:/home -v /Users/juanf/Documents/programming/git/jupyter-openbis-integration/jupyterhub_reference_installation/vagrant/config/certificates:/vagrant/config/certificates -e OPENBIS_URL=https://129.132.229.37:8443 -e JUPYTERHUB_INTEGRATION_SERVICE_PORT=8002 -e JUPYTERHUB_PORT=8000 -e CERTIFICATE_KEY=/vagrant/config/certificates/default.key -e CERTIFICATE_CRT=/vagrant/config/certificates/default.crt -p 8000:8000 -p 8081:8081 -p 8001:8001 -p 8002:8002 jupyterhub-openbis-sis-20180405 ./vagrant/initialize/start_jupyterhub.sh docker run -v /Users/juanf/Documents/programming/git/jupyter-openbis-integration/jupyterhub_reference_installation/home:/home -v /Users/juanf/Documents/programming/git/jupyter-openbis-integration/jupyterhub_reference_installation/vagrant/config/certificates:/vagrant/config/certificates -e OPENBIS_URL=https://129.132.229.37:8443 -e JUPYTERHUB_INTEGRATION_SERVICE_PORT=8002 -e JUPYTERHUB_PORT=8000 -e CERTIFICATE_KEY=/vagrant/config/certificates/default.key -e CERTIFICATE_CRT=/vagrant/config/certificates/default.crt -p 8000:8000 -p 8081:8081 -p 8001:8001 -p 8002:8002 jupyterhub-openbis-sis-20180405 ./vagrant/initialize/start_jupyterhub.sh
``` ```
5. Start the new image. 5. Start the new image.
```bash ```shell
$ ./jupyterhub-openbis-start.sh $ ./jupyterhub-openbis-start.sh
``` ```
...@@ -317,7 +327,7 @@ Other useful Docker commands ...@@ -317,7 +327,7 @@ Other useful Docker commands
> :warning: **It is best practice to include both the name of the user and the creation date in the image name. This will help when dealing with many versions created by different users at different times**. > :warning: **It is best practice to include both the name of the user and the creation date in the image name. This will help when dealing with many versions created by different users at different times**.
```bash ```shell
$ docker save jupyterhub-openbis-sis-20180405 > jupyterhub-openbis-sis-20180405.tar $ docker save jupyterhub-openbis-sis-20180405 > jupyterhub-openbis-sis-20180405.tar
$ ls -lah $ ls -lah
total 9681080 total 9681080
...@@ -326,7 +336,7 @@ total 9681080 ...@@ -326,7 +336,7 @@ total 9681080
### Load an image from a tar file ### Load an image from a tar file
```bash ```shell
$ docker load < jupyterhub-openbis-sis-20180405.tar $ docker load < jupyterhub-openbis-sis-20180405.tar
8feeda13d3ce: Loading layer [==================================================>] 27.65kB/27.65kB 8feeda13d3ce: Loading layer [==================================================>] 27.65kB/27.65kB
622cd2c170f3: Loading layer [==================================================>] 152MB/152MB 622cd2c170f3: Loading layer [==================================================>] 152MB/152MB
...@@ -341,13 +351,13 @@ jupyterhub-openbis-sis-20180405 latest 585a9adf333b 24 hou ...@@ -341,13 +351,13 @@ jupyterhub-openbis-sis-20180405 latest 585a9adf333b 24 hou
### Remove an image ### Remove an image
```bash ```shell
$ docker rmi jupyterhub-openbis-sis-juanextensions-recipe-20180406 $ docker rmi jupyterhub-openbis-sis-juanextensions-recipe-20180406
``` ```
### Remove all stopped containers ### Remove all stopped containers
```bash ```shell
$ docker rm $(docker ps -aq) $ docker rm $(docker ps -aq)
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment