Skip to content
Snippets Groups Projects
Commit 75985cac authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-499: Expose tangostationcontrol package to jupyter

Uses start-ds.sh to prevent duplicate code
parent b69e146d
No related branches found
No related tags found
1 merge request!192L2SS-499: Expose tangostationcontrol package to jupyter
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
# Serves as entrypoint script for docker containers # Serves as entrypoint script for docker containers
if [[ ! -d "/opt/lofar/tango" ]]; then
>&2 echo "/opt/lofar/tango volume does not exist!"
exit 1
fi
# Check required support file exists # Check required support file exists
if [[ ! -f "/usr/local/bin/wait-for-it.sh" ]]; then if [[ ! -f "/usr/local/bin/wait-for-it.sh" ]]; then
>&2 echo "/usr/local/bin/wait-for-it.sh file does not exist!" >&2 echo "/usr/local/bin/wait-for-it.sh file does not exist!"
...@@ -14,6 +19,11 @@ if [[ ! $TANGO_HOST ]]; then ...@@ -14,6 +19,11 @@ if [[ ! $TANGO_HOST ]]; then
exit 1 exit 1
fi fi
# Store directory so we can return to it after installation
CWD=$(pwd)
cd /opt/lofar/tango || exit 1
# Check if configured for specific version # Check if configured for specific version
if [[ $TANGOSTATIONCONTROL ]]; then if [[ $TANGOSTATIONCONTROL ]]; then
# TODO (Corne): Download version from artifacts or pypi. # TODO (Corne): Download version from artifacts or pypi.
...@@ -28,4 +38,8 @@ else ...@@ -28,4 +38,8 @@ else
sudo pip install --force-reinstall "$(ls -Art /tmp/tangostationcontrol/*.whl | tail -n 1)" sudo pip install --force-reinstall "$(ls -Art /tmp/tangostationcontrol/*.whl | tail -n 1)"
fi fi
# Return to the stored the directory, this preserves the working_dir argument in
# docker-compose files.
cd "$CWD"
/usr/local/bin/wait-for-it.sh "$TANGO_HOST" --timeout=30 --strict -- "$@" /usr/local/bin/wait-for-it.sh "$TANGO_HOST" --timeout=30 --strict -- "$@"
...@@ -30,10 +30,6 @@ services: ...@@ -30,10 +30,6 @@ services:
user: ${CONTAINER_EXECUTION_UID} user: ${CONTAINER_EXECUTION_UID}
working_dir: /jupyter-notebooks working_dir: /jupyter-notebooks
entrypoint: entrypoint:
- /usr/local/bin/wait-for-it.sh - /opt/lofar/tango/bin/start-ds.sh
- ${TANGO_HOST}
- --timeout=30
- --strict
- --
- /usr/bin/tini -- /usr/local/bin/jupyter-notebook --port=8888 --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token= --NotebookApp.password= - /usr/bin/tini -- /usr/local/bin/jupyter-notebook --port=8888 --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token= --NotebookApp.password=
restart: unless-stopped restart: unless-stopped
...@@ -10,23 +10,13 @@ ENV HOME=/home/user ...@@ -10,23 +10,13 @@ ENV HOME=/home/user
RUN sudo mkdir -p ${HOME} RUN sudo mkdir -p ${HOME}
RUN sudo chown ${CONTAINER_EXECUTION_UID} -R ${HOME} RUN sudo chown ${CONTAINER_EXECUTION_UID} -R ${HOME}
# ipython 7.28 is broken in combination with Jupyter, it causes connection errors with notebooks COPY requirements.txt ./
RUN sudo pip3 install ipython==7.27.0 RUN sudo pip3 install -r requirements.txt
RUN sudo pip3 install jupyter
RUN sudo pip3 install ipykernel
RUN sudo pip3 install jupyter_bokeh
# Install matplotlib, jupyterplot
RUN sudo pip3 install matplotlib jupyterplot
# Allow Download as -> PDF via html
RUN sudo pip3 install nbconvert
RUN sudo pip3 install notebook-as-pdf
# see https://github.com/jupyter/nbconvert/issues/1434 # see https://github.com/jupyter/nbconvert/issues/1434
RUN sudo bash -c "echo DEFAULT_ARGS += [\\\"--no-sandbox\\\"] >> /usr/local/lib/python3.7/dist-packages/pyppeteer/launcher.py" RUN sudo bash -c "echo DEFAULT_ARGS += [\\\"--no-sandbox\\\"] >> /usr/local/lib/python3.7/dist-packages/pyppeteer/launcher.py"
RUN sudo apt-get update -y RUN sudo apt-get update -y
RUN sudo apt-get install -y gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libcairo-gobject2 libxinerama1 libgtk2.0-0 libpangoft2-1.0-0 libthai0 libpixman-1-0 libxcb-render0 libharfbuzz0b libdatrie1 libgraphite2-3 libgbm1 RUN sudo apt-get install -y git gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libcairo-gobject2 libxinerama1 libgtk2.0-0 libpangoft2-1.0-0 libthai0 libpixman-1-0 libxcb-render0 libharfbuzz0b libdatrie1 libgraphite2-3 libgbm1
# Allow Download as -> PDF via LaTeX # Allow Download as -> PDF via LaTeX
RUN sudo apt-get install -y texlive-xetex texlive-fonts-recommended texlive-latex-recommended RUN sudo apt-get install -y texlive-xetex texlive-fonts-recommended texlive-latex-recommended
...@@ -43,15 +33,8 @@ RUN sudo chown ${CONTAINER_EXECUTION_UID} -R /opt/ipython-profiles ...@@ -43,15 +33,8 @@ RUN sudo chown ${CONTAINER_EXECUTION_UID} -R /opt/ipython-profiles
COPY jupyter-kernels /usr/local/share/jupyter/kernels/ COPY jupyter-kernels /usr/local/share/jupyter/kernels/
# Install patched jupyter executable # Install patched jupyter executable
RUN sudo pip3 install python-logstash-async
COPY jupyter-notebook /usr/local/bin/jupyter-notebook COPY jupyter-notebook /usr/local/bin/jupyter-notebook
#Install further python modules
RUN sudo pip3 install PyMySQL[rsa] sqlalchemy
# Packages to interface with testing hardware directly
RUN sudo pip3 install pyvisa pyvisa-py opcua
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes. # Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes.
ENV TINI_VERSION v0.6.0 ENV TINI_VERSION v0.6.0
ENV JUPYTER_RUNTIME_DIR=/tmp ENV JUPYTER_RUNTIME_DIR=/tmp
......
from tangostationcontrol import *
\ No newline at end of file
GitPython >= 3.1.24 # BSD
ipython >=7.27.0,!=7.28.0 # BSD
jupyter
ipykernel
jupyter_bokeh
matplotlib
jupyterplot
nbconvert
notebook-as-pdf
python-logstash-async
PyMySQL[rsa]
sqlalchemy
pyvisa
pyvisa-py
opcua
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment