From f39d903cdf6e5d24c15921e1f00580da938b91a4 Mon Sep 17 00:00:00 2001 From: Andreas Zeller Date: Sun, 30 Jun 2024 15:22:43 +0200 Subject: [PATCH] Sync from debuggingbook --- binder/Dockerfile | 9 ++++++++- binder/postBuild.template | 33 ++++++++++++++++----------------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index 0c9cdd2c6..967c5c2a9 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -26,6 +26,9 @@ FROM docker.io/library/buildpack-deps:jammy ARG PROJECT=fuzzingbook ARG REPO=https://github.com/uds-se/${PROJECT}.git +# Meta-data +LABEL description="$(PROJECT).org image from $(REPO)" + # Install git and pip RUN apt-get update RUN apt-get install -y git python3 pip npm gcc @@ -37,6 +40,9 @@ RUN echo "This is ${PROJECT} with $(python3 --version)" 1>&2 RUN pip install --no-cache --upgrade pip && \ pip install --no-cache notebook jupyterlab +# Install mermaid +RUN npm i -g mermaid + # Add the default user ARG NB_USER=jovyan ARG NB_UID=1000 @@ -70,7 +76,8 @@ USER ${NB_USER} ENV PATH="/home/${NB_USER}/.local/bin:$PATH" # Set up the conda environment -# (Skipping for now, as installing conda is hard) +# (Skipping for now, as installing conda is hard, +# and apparently we can do without) # RUN conda env create -f binder/environment.yml # RUN conda activate myenv diff --git a/binder/postBuild.template b/binder/postBuild.template index a56084fc3..b2ca2948e 100755 --- a/binder/postBuild.template +++ b/binder/postBuild.template @@ -1,37 +1,36 @@ #!/bin/bash # Enable incompatible extensions -echo postBuild: Enabling incompatible Jupyter extensions... -NBCONFIG_PATH=$HOME/.jupyter/nbconfig -mkdir -p $NBCONFIG_PATH -echo '{ - "nbext_hide_incompat": false -}' > $NBCONFIG_PATH/common.json +# echo postBuild: Enabling incompatible Jupyter extensions... +# NBCONFIG_PATH=$HOME/.jupyter/nbconfig +# mkdir -p $NBCONFIG_PATH +# echo '{ +# "nbext_hide_incompat": false +# }' > $NBCONFIG_PATH/common.json # Install and enable Jupyter nbextensions # https://github.com/binder-examples/jupyter-extension # https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html -echo postBuild: Installing Jupyter extensions... -jupyter contrib nbextension install --user -jupyter nbextension enable toc2/main --user -jupyter nbextension enable exercise2/main --user -jupyter nbextensions_configurator enable --user -jupyter nbextension list +# echo postBuild: Installing Jupyter extensions... +# jupyter contrib nbextension install --user +# jupyter nbextension enable toc2/main --user +# jupyter nbextension enable exercise2/main --user +# jupyter nbextensions_configurator enable --user +# jupyter nbextension list # Install and enable Jupyter lab extensions echo postBuild: Installing Jupyter Lab extensions... pip install jupyterlab-markup # Mermaid in Jupyter Lab -jupyter labextension enable @agoose77/jupyterlab-markup -jupyter labextension install jupyterlab-cell-flash -jupyter labextension list +pip install jupyterlab-cell-flash +jupyter lab build # Install grcov echo postBuild: Installing grcov... cargo install grcov -# Install mermaid +# # Install mermaid echo postBuild: Installing mermaid... -npm i -g mermaid +npm i mermaid # run matplotlib once to generate the font cache echo postBuild: Generating matplotlib font cache...