Skip to content

Commit

Permalink
Initial jupyterlab tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Jun 25, 2024
1 parent 9b7c146 commit dc1473c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile_JL
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# syntax=docker/dockerfile:1

FROM quay.io/jupyter/base-notebook
RUN pip install --no-cache-dir pyneuroml
4 changes: 4 additions & 0 deletions build_jl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

version=$(<VERSION) # Read version of Dockerfile from file VERSION
docker build "$@" -t "openworm/openworm_jl:$version" -f Dockerfile_JL .
29 changes: 29 additions & 0 deletions run_jl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

OW_OUT_DIR=/home/ow/shared
HOST_OUT_DIR=$PWD

version=$(<VERSION) # Read version of Dockerfile from file VERSION

xhost +

docker run --rm \
--name openworm_jl_$version \
--device=/dev/dri:/dev/dri \
-e DISPLAY=$DISPLAY \
-e OW_OUT_DIR=$OW_OUT_DIR \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--privileged \
-v $HOST_OUT_DIR:$OW_OUT_DIR:rw \
-p 8889:8888 \
openworm/openworm_jl:$version \
start-notebook.py \
--NotebookApp.token='openworm' &

sleep 3
echo
echo -e "To access the running JupyterLab instance, go to:"
echo -e " http://localhost:8889/lab?token=openworm"
echo
echo -e "To stop the service type: ./stop_jl.sh"
echo
6 changes: 6 additions & 0 deletions stop_jl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

version=$(<VERSION) # Read version of Dockerfile from file VERSION

docker stop openworm_jl_${version}
docker rm openworm_jl_${version}

0 comments on commit dc1473c

Please sign in to comment.