diff --git a/base-images/vscode-nocuda/Dockerfile b/base-images/vscode-nocuda/Dockerfile deleted file mode 100644 index 2814a54..0000000 --- a/base-images/vscode-nocuda/Dockerfile +++ /dev/null @@ -1,140 +0,0 @@ -ARG JUPYTER_VARIANT - -FROM jupyter/${JUPYTER_VARIANT}-notebook:lab-3.6.3 as nocuda - -ARG JUPYTER_VARIANT -ENV BUILD_JUPYTER_VARIANT=$JUPYTER_VARIANT -ENV BUILD_IMAGE_NAME vscode-${BUILD_JUPYTER_VARIANT} - -LABEL maintainer "Fachhochschule Südwestfalen" -LABEL ki.fh-swf.de.jupyterhub.runtime="CPU" -LABEL ki.fh-swf.de.jupyterhub.namelabel="jupyter/${BUILD_JUPYTER_VARIANT}-notebook" -LABEL ki.fh-swf.de.jupyterhub.description="Based on the original jupyterlab ${BUILD_JUPYTER_VARIANT}-notebook" -LABEL org.opencontainers.image.description="Based on the original jupyterlab ${BUILD_JUPYTER_VARIANT}-notebook" -LABEL org.opencontainers.image.authors="Fachhoschschule Südwestfalen" -LABEL org.opencontainers.image.licenses="MIT" - -############### -# vscode -############### -#FROM ${CUDA_VARIANT} - -USER root - -### VS-Code install -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - fonts-dejavu \ - htop \ - git \ - build-essential gcc g++ gnupg2 make less cmake \ - wget curl jq moreutils \ - openssh-client \ - iputils-ping \ - && apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Code Server server-proxy/vscode-proxy from https://coder.com/docs/code-server/latest -ENV CODE_VERSION=4.21.0 - -ENV CODE_BUILTIN_EXTENSIONS_DIR=/usr/lib/code-server/lib/vscode/extensions/ -ENV PATH=/opt/code-server/bin:$PATH \ - CS_DISABLE_GETTING_STARTED_OVERRIDE=1 - -ENV CODE_EXTENSIONSDIR='/home/$NB_USER/.local/share/code-server-$BUILD_IMAGE_NAME/extensions/' -ENV CODE_USERDATADIR='/home/$NB_USER/.local/share/code-server-$BUILD_IMAGE_NAME/' - -#ENV SERVICE_URL=https://open-vsx.org/vscode/gallery -#ENV ITEM_URL=https://open-vsx.org/vscode/item - -# maybe create a image specific folder for vs code extensions inside $HOME and install extension at runtime via script -RUN cd /tmp \ - && curl -fsSL https://code-server.dev/install.sh | sh \ - && rm -rf /tmp/* $HOME/.config $HOME/.local $HOME/.cache \ - && fix-permissions $HOME && fix-permissions $CONDA_DIR && fix-permissions /home/$NB_USER - -RUN code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension ms-python.python \ - && code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension ms-toolsai.jupyter \ - && code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension ms-toolsai.vscode-jupyter-cell-tags \ - && code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension humao.rest-client \ - && code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension redhat.vscode-yaml \ - && code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension donjayamanne.githistory \ - && code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension alefragnani.project-manager \ - && code-server --extensions-dir ${CODE_BUILTIN_EXTENSIONS_DIR} --install-extension esbenp.prettier-vscode \ - ## Create folders temp and tmp for Jupyter extension, 202 shoueld default to the verison 2023-X.XYZ - && cd ${CODE_BUILTIN_EXTENSIONS_DIR}/ms-toolsai.jupyter-202* \ - && mkdir -m 1777 temp \ - && mkdir -m 1777 tmp \ - # update defualt values - && QUERY='.contributes.configuration.properties."python.condaPath".default="/opt/conda/bin/conda"' \ - && jq $QUERY /usr/lib/code-server/lib/vscode/extensions/ms-python.python-*/package.json | sponge /usr/lib/code-server/lib/vscode/extensions/ms-python.python-*/package.json \ - && QUERY='.contributes.configuration.properties."python.defaultInterpreterPath".default="/opt/conda/bin/python"' \ - && jq $QUERY /usr/lib/code-server/lib/vscode/extensions/ms-python.python-*/package.json | sponge /usr/lib/code-server/lib/vscode/extensions/ms-python.python-*/package.json \ - && rm -rf /tmp/* $HOME/.config $HOME/.local $HOME/.cache \ - && fix-permissions $HOME && fix-permissions $CONDA_DIR && fix-permissions /home/$NB_USER \ - && fix-permissions $CODE_BUILTIN_EXTENSIONS_DIR \ - && cd /tmp - -RUN pip install \ - jupyterlab-lsp \ - jupyter-server-proxy \ - git+https://github.com/fhswf/Jupyterhub-K8s.git@main#subdirectory=packages/jupyter_vscodeserver_proxy \ - jedi-language-server \ - nbgitpuller \ - && rm -rf /tmp/* $HOME/.cache - -# only install scilab-kernel for scipy notebooks -RUN if [ "$JUPYTER_VARIANT" = "scipy" ]; \ - then pip install scilab-kernel && rm -rf /tmp/* $HOME/.cache; \ - fi - -# conda tectlive latex lsp -# conda install --channel conda-forge tectonic texlab chktex -# conda install -c conda-forge texlab chktex - -# make /home group writable in case we want to move /home/$NB_USER -RUN chmod g+rwx /home -# copy start scripts -COPY rebind_home.sh /usr/local/bin/before-notebook.d/01_rebind_home.sh -RUN chmod +x /usr/local/bin/before-notebook.d/01_rebind_home.sh -COPY setup_env.sh /usr/local/bin/before-notebook.d/10_setup_env.sh -RUN chmod +x /usr/local/bin/before-notebook.d/10_setup_env.sh -COPY clean_runtime.sh /usr/local/bin/before-notebook.d/40_clean_runtime.sh -RUN chmod +x /usr/local/bin/before-notebook.d/40_clean_runtime.sh -COPY launch_services.sh /usr/local/bin/before-notebook.d/60_launch_services.sh -RUN chmod +x /usr/local/bin/before-notebook.d/60_launch_services.sh - -# git LFS and other extras -RUN apt-get update \ - && curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash \ - && apt-get install -y --no-install-recommends \ - git-lfs zlib1g-dev \ - libncurses-dev \ - && apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# user -USER $NB_UID - -RUN pip install bash_kernel \ - && python -m bash_kernel.install --prefix /opt/conda \ - && rm -rf /tmp/* $HOME/.cache - -## npm language servers: -RUN npm install -g --save-dev \ - bash-language-server \ - pyright \ - sql-language-server \ - typescript-language-server \ - unified-language-server \ - vscode-css-languageserver-bin \ - vscode-html-languageserver-bin \ - yaml-language-server \ - vscode-json-languageserver-bin \ - && rm -rf /tmp/* $HOME/.cache - -RUN npm config set cache /opt/conda/npm-cache --global - -LABEL ki.fh-swf.de.jupyterhub.namelabel="vscode-${BUILD_JUPYTER_VARIANT}" -LABEL ki.fh-swf.de.jupyterhub.description="Based on the original jupyterlab ${BUILD_JUPYTER_VARIANT}-notebook VS Code." -LABEL org.opencontainers.image.description="Based on the original jupyterlab ${BUILD_JUPYTER_VARIANT}-notebook VS Code." diff --git a/base-images/vscode-nocuda/clean_runtime.sh b/base-images/vscode-nocuda/clean_runtime.sh deleted file mode 100644 index 83c93d2..0000000 --- a/base-images/vscode-nocuda/clean_runtime.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [[ -d "$HOME/.local/share/jupyter/runtime" ]] ; then - rm -f $HOME/.local/share/jupyter/runtime/kernel-*.json $HOME/.local/share/jupyter/runtime/nbserver-*.html $HOME/.local/share/jupyter/runtime/nbserver-*.json; -else - rm -f /home/jovyan/.local/share/jupyter/runtime/kernel-*.json /home/jovyan/.local/share/jupyter/runtime/nbserver-*.html /home/jovyan/.local/share/jupyter/runtime/nbserver-*.json; -fi -echo "done cleaning left over kernel connectors" \ No newline at end of file diff --git a/base-images/vscode-nocuda/launch_services.sh b/base-images/vscode-nocuda/launch_services.sh deleted file mode 100644 index c6eec38..0000000 --- a/base-images/vscode-nocuda/launch_services.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -e -eval `ssh-agent -s` diff --git a/base-images/vscode-nocuda/rebind_home.sh b/base-images/vscode-nocuda/rebind_home.sh deleted file mode 100644 index 7dc2bc6..0000000 --- a/base-images/vscode-nocuda/rebind_home.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -set -e - -# works for command: docker run --user 5000:100 --group-add root --group-add 1000 -e NB_USER="myuser" ... -if [[ -w /etc/passwd ]] && [[ -w /home ]]; then - if [[ "${NB_USER}" != "jovyan" ]]; then - _log "creating enw home for user ${NB_USER}" - mkdir -p /home/${NB_USER}; - head -n -1 /etc/passwd > /tmp/passwd; - echo "creating passwd entry ${NB_USER}:x:$(id -u):$(id -g):,,,:/home/${NB_USER}:/bin/bash"; - echo "${NB_USER}:x:$(id -u):$(id -g):,,,:/home/${NB_USER}:/bin/bash" >> /tmp/passwd; - cat /tmp/passwd > /etc/passwd; - rm /tmp/passwd; - if [[ $HOME != "/home/${NB_USER}" ]]; then - export HOME=/home/${NB_USER} - fi - if [[ ${PWD}/ == "/home/jovyan/"* ]]; then - new_wd="/home/${NB_USER}/${PWD:13}" - echo "Changing working directory to ${new_wd}" - cd "${new_wd}" - fi - # snippets taken from the docker-stacks start.sh that do not get executed atm. - # note that file system permissions for /home/${NB_USER} have to be checked/corercted with a privilieged initContainer. - export XDG_CACHE_HOME="/home/${NB_USER}/.cache" - fi -else - echo "WARNING: unable to fix missing /etc/passwd entry because we don't have write permission. Try setting gid=0 with \"--user=$(id -u):0\"." -fi \ No newline at end of file diff --git a/base-images/vscode-nocuda/setup_env.sh b/base-images/vscode-nocuda/setup_env.sh deleted file mode 100644 index f71c5fb..0000000 --- a/base-images/vscode-nocuda/setup_env.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e - -if [[ ! -f "$HOME/.bashrc" ]] ; then - echo "no bashrc found in $HOME, restoring defaults"; - cp /etc/skel/.bashrc $HOME; - cp /etc/skel/.profile $HOME; - cp /etc/skel/.bash_logout $HOME; -else - echo "bashrc found in $HOME"; -fi \ No newline at end of file diff --git a/images/Compilerbau/Dockerfile b/images/Compilerbau/Dockerfile deleted file mode 100644 index c68a203..0000000 --- a/images/Compilerbau/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -ARG BASE_CONTAINER=ghcr.io/fhswf/jupyterhub-k8s/vscode-base:sha-e108ac9 -FROM $BASE_CONTAINER -ARG BASE_CONTAINER -ENV BUILD_IMAGE_NAME compilerbau - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -USER root - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - flex \ - bison \ - libfl-dev \ - libbison-dev \ - graphviz \ - git \ - gcc \ - make \ - clang \ - && apt-get clean && \ - rm -rf /var/lib/apt/lists/* - - -USER $NB_UID - -LABEL ki.fh-swf.de.jupyterhub.runtime="CPU" -LABEL ki.fh-swf.de.jupyterhub.namelabel="$BUILD_IMAGE_NAME" -LABEL ki.fh-swf.de.jupyterhub.description="Programmierung fuer KI" -LABEL org.opencontainers.image.description="Programmierung fuer KI" -LABEL org.opencontainers.image.authors="Fachhoschschule Südwestfalen" -LABEL org.opencontainers.image.licenses="MIT" -LABEL org.opencontainers.image.base.name=$BASE_CONTAINER