Skip to content
Snippets Groups Projects
Commit d3ab6d15 authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Merge branch 'jupyter' into 'master'

Jupyter

See merge request !3
parents 070bd845 d203c6e0
No related branches found
No related tags found
1 merge request!3Jupyter
#
# Docker compose file that launches an interactive iTango session.
#
# Connect to the interactive session with 'docker attach itango'.
# Disconnect with the Docker deattach sequence: <CTRL>+<P> <CTRL>+<Q>
#
# Defines:
# - itango: iTango interactive session
#
# Requires:
# - tango.yml
#
version: '2'
services:
jupyter:
build:
context: lofar-jupyter
args:
SOURCE_IMAGE: lofar-itango:latest
container_name: ${CONTAINER_NAME_PREFIX}jupyter
network_mode: ${NETWORK_MODE}
volumes:
- ${TANGO_SKA_CONTAINER_MOUNT}
- ${TANGO_LOFAR_CONTAINER_MOUNT}
- ${HOME}:/hosthome
environment:
- TANGO_HOST=${TANGO_HOST}
- XAUTHORITY=${XAUTHORITY}
- DISPLAY=${DISPLAY}
ports:
- "8888:8888"
ARG VERSION=latest
FROM lofar-itango:${VERSION}
RUN pip3 install jupyter
RUN pip3 install ipykernel
RUN pip3 install jupyter_bokeh
# Configure jupyter_bokeh
RUN sudo mkdir -p /usr/share/jupyter /usr/etc
RUN sudo chmod a+rwx /usr/share/jupyter /usr/etc
RUN jupyter nbextension install --sys-prefix --symlink --py jupyter_bokeh
RUN jupyter nbextension enable jupyter_bokeh --py --sys-prefix
# Install profiles for ipython & jupyter
COPY ipython-profiles /opt/ipython-profiles/
RUN sudo chown tango.tango -R /opt/ipython-profiles
COPY jupyter-kernels /usr/local/share/jupyter/kernels/
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes.
ENV TINI_VERSION v0.6.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN sudo chmod +x /usr/bin/tini
ENTRYPOINT ["/usr/bin/tini", "--"]
# Start jupyter notebooks on startup of container
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root", "--NotebookApp.token=", "--NotebookApp.password="]
from tango import *
This is the IPython startup directory
.py and .ipy files in this directory will be run *prior* to any code or files specified
via the exec_lines or exec_files configurables whenever you load this profile.
Files will be run in lexicographical order, so you can control the execution order of files
with a prefix, e.g.::
00-first.py
50-middle.py
99-last.ipy
{
"argv": [
"python",
"-m",
"ipykernel",
"-f",
"{connection_file}",
"--profile-dir",
"/opt/ipython-profiles/stationcontrol-jupyter/"
],
"language": "python",
"display_name": "StationControl"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment