From 95fc6dc16dd4ed64f50d9be1ec1934397f9e6475 Mon Sep 17 00:00:00 2001 From: Tim Metzler <33530562+tmetzl@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:04:16 +0100 Subject: [PATCH 01/51] Fix e2xgradingtools minimum version --- notebook/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/requirements.txt b/notebook/requirements.txt index ff64236..3c62bdf 100644 --- a/notebook/requirements.txt +++ b/notebook/requirements.txt @@ -1,5 +1,5 @@ exam_kernel -e2xgradingtools +e2xgradingtools>=0.0.4 ngshare_exchange>=0.5.2 assignmenttest @ git+https://github.com/Digiklausur/assignmenttest@master e2xtest @ git+https://github.com/DigiKlausur/e2xtest@main From d38b2434006bda1c0df83ae57bb6ec94889bbac8 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:01:31 +0100 Subject: [PATCH 02/51] Move images to images folder --- images/datascience-notebook/Dockerfile | 19 +++++++ images/datascience-notebook/README.md | 3 ++ images/datascience-notebook/requirements.txt | 32 +++++++++++ images/minimal-notebook/Dockerfile | 56 ++++++++++++++++++++ images/minimal-notebook/README.md | 6 +++ 5 files changed, 116 insertions(+) create mode 100644 images/datascience-notebook/Dockerfile create mode 100644 images/datascience-notebook/README.md create mode 100644 images/datascience-notebook/requirements.txt create mode 100644 images/minimal-notebook/Dockerfile create mode 100644 images/minimal-notebook/README.md diff --git a/images/datascience-notebook/Dockerfile b/images/datascience-notebook/Dockerfile new file mode 100644 index 0000000..3624de2 --- /dev/null +++ b/images/datascience-notebook/Dockerfile @@ -0,0 +1,19 @@ +ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/minimal-notebook:latest +FROM $IMAGE_SOURCE + +LABEL maintainer="e2x project H-BRS " +LABEL description="e2x datascience notebook" + +USER $NB_USER + +# Install requirements +COPY requirements.txt /tmp/requirements.txt +RUN pip install --no-cache-dir -r /tmp/requirements.txt + +# Jupyter extension list +RUN jupyter nbextension list + +USER root +RUN rm /tmp/requirements.txt + +USER $NB_USER diff --git a/images/datascience-notebook/README.md b/images/datascience-notebook/README.md new file mode 100644 index 0000000..0ac244d --- /dev/null +++ b/images/datascience-notebook/README.md @@ -0,0 +1,3 @@ +### Datascience notebook +* has everything in minimal-notebook +* Add python libraries for datascience and machine learning \ No newline at end of file diff --git a/images/datascience-notebook/requirements.txt b/images/datascience-notebook/requirements.txt new file mode 100644 index 0000000..8893b9a --- /dev/null +++ b/images/datascience-notebook/requirements.txt @@ -0,0 +1,32 @@ +bokeh +colorama +easydict==1.9 +graphviz +imageio==2.31.1 +ipycanvas +ipysheet +ipywidgets +itables +matplotlib==3.7.2 +nltk==3.8 +nbconvert>=7.16.3 +numpy +nx +pandas==2.0.3 +pdfkit +Pillow==10.0.0 +pyagrum +pydantic +pydantic_yaml +pydot +pyparsing>=3.0.0 +pypdf2 +python-sat[aiger,approxmc,pblib] +pyyaml +scikit-image==0.21.0 +scikit-learn==1.3.0 +scipy==1.11.2 +seaborn==0.12.2 +statsmodels==0.14.0 +sympy==1.12 +xlrd diff --git a/images/minimal-notebook/Dockerfile b/images/minimal-notebook/Dockerfile new file mode 100644 index 0000000..7b6fb5d --- /dev/null +++ b/images/minimal-notebook/Dockerfile @@ -0,0 +1,56 @@ +ARG IMAGE_SOURCE=jupyter/minimal-notebook:4d70cf8da953 +FROM $IMAGE_SOURCE +# Built from... https://hub.docker.com/r/jupyter/minimal-notebook/ +# https://github.com/jupyter/docker-stacks/blob/main/images/minimal-notebook/Dockerfile +# Built from... Ubuntu 22.04 + +LABEL maintainer="e2x project H-BRS " +LABEL description="e2x minimal notebook" + +USER root + +ENV TZ=Europe/Berlin + +RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ + locale-gen +ENV LC_ALL en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Create default config for ipython kernel config +RUN mkdir /etc/ipython/ && \ + chown root:$NB_GID /etc/ipython/ &&\ + chmod g+rwX /etc/ipython/ &&\ + chmod +6000 /etc/ipython/ + +# Remove default work dir +RUN rm -rf $HOME/work + +RUN apt-get update -y \ + && apt-get install --yes \ + pandoc \ + vim \ + libgl1-mesa-dev zip wkhtmltopdf \ + build-essential \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +USER $NB_USER + +# Install conda related pkgs +RUN mamba install -y gh --channel conda-forge && \ + mamba install -y graphviz + +RUN pip install --upgrade pip + +USER root + +# clean up +RUN /opt/conda/bin/conda clean -afy && \ + find /opt/conda/ -follow -type f -name '*.a' -delete && \ + find /opt/conda/ -follow -type f -name '*.pyc' -delete && \ + find /opt/conda/ -follow -type f -name '*.js.map' -delete + +USER $NB_USER diff --git a/images/minimal-notebook/README.md b/images/minimal-notebook/README.md new file mode 100644 index 0000000..deaefdb --- /dev/null +++ b/images/minimal-notebook/README.md @@ -0,0 +1,6 @@ + +### Minimal notebook +* has everything in jupyter/minimal-notebook +* add pandocs and xelatex to export notebook +* has git, vim, nano, unzip +* local time is set to Europe/Berlin From 569e429ff5a30ef03a237aec81b5c72c61e5dca1 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:01:43 +0100 Subject: [PATCH 03/51] Add e2xgrader notebook --- images/e2xgrader-notebook/Dockerfile | 38 +++++++++++++++++++ .../common_requirements.txt | 0 .../student_exam_requirements.txt | 0 .../student_requirements.txt | 0 .../teacher_requirements.txt | 0 5 files changed, 38 insertions(+) create mode 100644 images/e2xgrader-notebook/Dockerfile create mode 100644 images/e2xgrader-notebook/common_requirements.txt create mode 100644 images/e2xgrader-notebook/student_exam_requirements.txt create mode 100644 images/e2xgrader-notebook/student_requirements.txt create mode 100644 images/e2xgrader-notebook/teacher_requirements.txt diff --git a/images/e2xgrader-notebook/Dockerfile b/images/e2xgrader-notebook/Dockerfile new file mode 100644 index 0000000..6e6b55e --- /dev/null +++ b/images/e2xgrader-notebook/Dockerfile @@ -0,0 +1,38 @@ +ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/minimal-notebook:latest +FROM $IMAGE_SOURCE + +ARG FROM_REPO=false +ARG E2XGRADER_VERSION="" +ARG E2XGRADER_BRANCH="" +ARG E2XGRADER_MODE=student + +# Inherit from any image, then just install e2xgrader and activate a mode +LABEL maintainer="e2x project H-BRS " + +USER $NB_USER + +# Install requirements shared between all modes +RUN echo "Installing common requirements" +COPY common_requirements.txt /tmp/common_requirements.txt +RUN pip install --no-cache-dir -r /tmp/common_requirements.txt + +# Install mode specific requirements +RUN echo "Installing requirements for ${E2XGRADER_MODE}" +COPY ${E2XGRADER_MODE}_requirements.txt /tmp/mode_requirements.txt +RUN pip install --no-cache-dir -r /tmp/mode_requirements.txt + +# Install e2xgrader +RUN if [ "$FROM_REPO" = "false" ] && [ -z "$E2XGRADER_VERSION" ]; then \ + echo "Installing e2xgrader from default source..."; \ + pip install e2xgrader; \ + elif [ "$FROM_REPO" = "false" ] && [ -n "$E2XGRADER_VERSION" ]; then \ + echo "Installing e2xgrader version: $E2XGRADER_VERSION from PyPI..."; \ + pip install e2xgrader=="$E2XGRADER_VERSION"; \ + elif [ "$FROM_REPO" = "true" ]; then \ + echo "Installing e2xgrader from GitHub repository: https://github.com/DigiKlausur/e2xgrader.git@$E2XGRADER_BRANCH"; \ + pip install --no-cache-dir git+https://github.com/DigiKlausur/e2xgrader.git@"${E2XGRADER_BRANCH}"; \ + fi + +# Activate a mode +RUN e2xgrader activate $E2XGRADER_MODE --sys-prefix + diff --git a/images/e2xgrader-notebook/common_requirements.txt b/images/e2xgrader-notebook/common_requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/images/e2xgrader-notebook/student_exam_requirements.txt b/images/e2xgrader-notebook/student_exam_requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/images/e2xgrader-notebook/student_requirements.txt b/images/e2xgrader-notebook/student_requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/images/e2xgrader-notebook/teacher_requirements.txt b/images/e2xgrader-notebook/teacher_requirements.txt new file mode 100644 index 0000000..e69de29 From b66705b8c4c10078bffae97db9578bb664e15f4e Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:01:54 +0100 Subject: [PATCH 04/51] Add machine learning notebook --- images/ml-notebook/Dockerfile | 19 +++++++++++++++++++ images/ml-notebook/requirements.txt | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 images/ml-notebook/Dockerfile create mode 100644 images/ml-notebook/requirements.txt diff --git a/images/ml-notebook/Dockerfile b/images/ml-notebook/Dockerfile new file mode 100644 index 0000000..c4581a6 --- /dev/null +++ b/images/ml-notebook/Dockerfile @@ -0,0 +1,19 @@ +ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/datascience-notebook:latest +FROM $IMAGE_SOURCE + +LABEL maintainer="e2x project H-BRS " +LABEL description="e2x machine learning notebook" + +USER $NB_USER + +# Install requirements +COPY requirements.txt /tmp/requirements.txt +RUN pip install --no-cache-dir -r /tmp/requirements.txt + +# Jupyter extension list +RUN jupyter nbextension list + +USER root +RUN rm /tmp/requirements.txt + +USER $NB_USER diff --git a/images/ml-notebook/requirements.txt b/images/ml-notebook/requirements.txt new file mode 100644 index 0000000..8dc79f1 --- /dev/null +++ b/images/ml-notebook/requirements.txt @@ -0,0 +1,4 @@ +gymnasium==0.29.1 +opencv-contrib-python==4.8.0.76 +stable-baselines3 +tensorflow==2.12.0 \ No newline at end of file From d9d8844d3d27ff4265fcb2eedcdf40b503d8dc7a Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:02:11 +0100 Subject: [PATCH 05/51] Remove old files --- datascience-notebook/Dockerfile | 19 ------- datascience-notebook/README.md | 3 -- datascience-notebook/requirements.txt | 39 -------------- minimal-notebook/Dockerfile | 73 --------------------------- minimal-notebook/README.md | 6 --- 5 files changed, 140 deletions(-) delete mode 100644 datascience-notebook/Dockerfile delete mode 100644 datascience-notebook/README.md delete mode 100644 datascience-notebook/requirements.txt delete mode 100644 minimal-notebook/Dockerfile delete mode 100644 minimal-notebook/README.md diff --git a/datascience-notebook/Dockerfile b/datascience-notebook/Dockerfile deleted file mode 100644 index e607b9b..0000000 --- a/datascience-notebook/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/minimal-notebook:latest -FROM $IMAGE_SOURCE - -LABEL maintainer="e2x project H-BRS " - -USER $NB_USER - -# Install requirements -COPY requirements.txt /tmp/requirements.txt -RUN pip install --no-cache-dir -r /tmp/requirements.txt && \ - pip install torch==2.0.0+cpu torchvision==0.15.1+cpu torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cpu - -# Jupyter extension list -RUN jupyter nbextension list - -USER root -RUN rm /tmp/requirements.txt - -USER $NB_USER diff --git a/datascience-notebook/README.md b/datascience-notebook/README.md deleted file mode 100644 index 0ac244d..0000000 --- a/datascience-notebook/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Datascience notebook -* has everything in minimal-notebook -* Add python libraries for datascience and machine learning \ No newline at end of file diff --git a/datascience-notebook/requirements.txt b/datascience-notebook/requirements.txt deleted file mode 100644 index e73a12a..0000000 --- a/datascience-notebook/requirements.txt +++ /dev/null @@ -1,39 +0,0 @@ -bokeh -colorama -easydict==1.9 -gensim==4.3.1 -graphviz -gymnasium==0.29.1 -imageio==2.31.1 -ipycanvas -ipysheet -ipywidgets -itables -matplotlib==3.7.2 -nltk==3.8 -numpy -nx -opencv-contrib-python==4.8.0.76 -pandas==2.0.3 -pdfkit -Pillow==10.0.0 -pyagrum -pydantic -pydantic_yaml -pydot -pyparsing>=3.0.0 -pypdf2 -python-sat[aiger,approxmc,pblib] -pyyaml -scikit-image==0.21.0 -scikit-learn==1.3.0 -scipy==1.11.2 -seaborn==0.12.2 -spacy==3.6.1 -stable-baselines3 -statsmodels==0.14.0 -sympy==1.12 -tensorflow==2.12.0 -transformers -wikipedia-api -xlrd diff --git a/minimal-notebook/Dockerfile b/minimal-notebook/Dockerfile deleted file mode 100644 index b3f87f1..0000000 --- a/minimal-notebook/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM jupyter/minimal-notebook:4d70cf8da953 -# Built from... https://hub.docker.com/r/jupyter/minimal-notebook/ -# https://github.com/jupyter/docker-stacks/blob/main/images/minimal-notebook/Dockerfile -# Built from... Ubuntu 22.04 - -LABEL maintainer="e2x project H-BRS " - -USER root - -ENV TZ=Europe/Berlin - -RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ - locale-gen -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 - -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -# Create default config for ipython kernel config -RUN mkdir /etc/ipython/ && \ - chown root:$NB_GID /etc/ipython/ &&\ - chmod g+rwX /etc/ipython/ &&\ - chmod +6000 /etc/ipython/ - -# Remove default work dir -RUN rm -rf $HOME/work - -RUN apt-get update -y \ - && apt-get install --yes \ - pandoc \ - texlive-xetex \ - texlive-fonts-recommended \ - texlive-latex-recommended \ - texlive-latex-extra \ - vim \ - libgl1-mesa-dev zip wkhtmltopdf \ - build-essential \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -USER $NB_USER - -# Install conda related pkgs -RUN mamba install -y gh --channel conda-forge && \ - mamba install -y graphviz - -RUN pip install --upgrade pip && \ - pip install --no-cache-dir RISE==5.7.1 - -# Enable extenstions and Jupyter contrib extensions -RUN cd /tmp && \ - git clone --depth 1 -b master https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git && \ - cd /tmp/jupyter_contrib_nbextensions/src/jupyter_contrib_nbextensions/nbextensions && \ - jupyter nbextension install --sys-prefix codefolding && \ - jupyter nbextension enable --sys-prefix codefolding/main && \ - jupyter nbextension install --sys-prefix collapsible_headings && \ - jupyter nbextension enable --sys-prefix collapsible_headings/main && \ - jupyter nbextension install --sys-prefix execute_time && \ - jupyter nbextension enable --sys-prefix execute_time/ExecuteTime && \ - jupyter-nbextension install rise --py --sys-prefix && \ - jupyter nbextension list && \ - rm -rf /tmp/jupyter_contrib_nbextensions - -USER root - -# clean up -RUN /opt/conda/bin/conda clean -afy && \ - find /opt/conda/ -follow -type f -name '*.a' -delete && \ - find /opt/conda/ -follow -type f -name '*.pyc' -delete && \ - find /opt/conda/ -follow -type f -name '*.js.map' -delete - -USER $NB_USER diff --git a/minimal-notebook/README.md b/minimal-notebook/README.md deleted file mode 100644 index deaefdb..0000000 --- a/minimal-notebook/README.md +++ /dev/null @@ -1,6 +0,0 @@ - -### Minimal notebook -* has everything in jupyter/minimal-notebook -* add pandocs and xelatex to export notebook -* has git, vim, nano, unzip -* local time is set to Europe/Berlin From 6dfbb7cb0d71d0a97d186a9165d723a31b5c0b28 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:02:20 +0100 Subject: [PATCH 06/51] Add workflows --- .../workflows/build_and_push_all_images.yml | 83 +++++++++++++ .github/workflows/build_e2xgrader_images.yml | 113 ++++++++++++++++++ .github/workflows/build_image.yml | 92 ++++++++++++++ .github/workflows/manual-workflow.yml | 67 ----------- .github/workflows/ngshare.yml | 82 ------------- .github/workflows/notebook-dev.yml | 50 -------- .github/workflows/notebook-stable.yml | 50 -------- .github/workflows/pull-request.yml | 25 ---- .github/workflows/tags.yml | 48 -------- .github/workflows/trigger_build_and_push.yml | 60 ++++++++++ 10 files changed, 348 insertions(+), 322 deletions(-) create mode 100644 .github/workflows/build_and_push_all_images.yml create mode 100644 .github/workflows/build_e2xgrader_images.yml create mode 100644 .github/workflows/build_image.yml delete mode 100644 .github/workflows/manual-workflow.yml delete mode 100644 .github/workflows/ngshare.yml delete mode 100644 .github/workflows/notebook-dev.yml delete mode 100644 .github/workflows/notebook-stable.yml delete mode 100644 .github/workflows/pull-request.yml delete mode 100644 .github/workflows/tags.yml create mode 100644 .github/workflows/trigger_build_and_push.yml diff --git a/.github/workflows/build_and_push_all_images.yml b/.github/workflows/build_and_push_all_images.yml new file mode 100644 index 0000000..291cf89 --- /dev/null +++ b/.github/workflows/build_and_push_all_images.yml @@ -0,0 +1,83 @@ +name: Build and push all images + +on: + workflow_call: + inputs: + force_build: + description: If the build should be forced even if there are no changes + type: boolean + required: false + default: false + push: + description: Push the image to the registry + type: boolean + required: false + default: false + registry: + description: Container registry to use + type: string + required: false + default: ghcr.io + tag: + description: Tag to use for the images (e.g. latest, dev) + type: string + required: false + default: latest + e2xgrader_installation_source: + description: Where to install e2xgrader from + type: string + required: false + default: pypi + e2xgrader_version: + description: Use a specific e2xgrader version from PyPi + type: string + required: false + default: "" + e2xgrader_branch: + description: Which e2xgrader branch or tag to install from. Only takes effect if e2xgrader_installation_source is "github" + type: string + required: false + default: "main" + +jobs: + + minimal_notebook: + uses: ./.github/workflows/build_image.yml + with: + force_build: ${{ inputs.force_build }} + image_name: minimal-notebook + registry: ${{ inputs.registry }} + base_image_name: jupyter/minimal-notebook + base_image_tag: 4d70cf8da953 + image_tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + + datascience_notebook: + needs: [minimal_notebook] + uses: ./.github/workflows/build_image.yml + with: + force_build: ${{ inputs.force_build || needs.minimal_notebook.outputs.did_build_image == 'true' }} + image_name: datascience-notebook + image_tag: ${{ inputs.tag }} + registry: ${{ inputs.registry }} + base_image_name: ${{ inputs.registry }}/digiklausur/docker-stacks/minimal-notebook + base_image_tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + + e2x_datascience_notebook: + needs: [datascience_notebook] + uses: ./.github/workflows/build_e2xgrader_images.yml + with: + force_build: ${{ inputs.force_build || needs.datascience_notebook.outputs.did_build_image == 'true' }} + registry: ${{ inputs.registry }} + image_name: datascience-notebook + image_tag: ${{ inputs.tag }} + base_image_name: ${{ inputs.registry }}/digiklausur/docker-stacks/datascience-notebook + base_image_tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + e2xgrader_installation_source: ${{ inputs.e2xgrader_installation_source }} + e2xgrader_version: ${{ inputs.e2xgrader_version }} + e2xgrader_branch: ${{ inputs.e2xgrader_branch }} + + + diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml new file mode 100644 index 0000000..0aeb259 --- /dev/null +++ b/.github/workflows/build_e2xgrader_images.yml @@ -0,0 +1,113 @@ +name: Build e2xgrader image for all modes + +on: + workflow_call: + inputs: + force_build: + description: Force the build even if there are no changes + type: boolean + required: false + default: false + base_image_name: + description: The name of the base image to build from + type: string + required: true + base_image_tag: + description: The tag of the base image to build from + type: string + required: false + default: latest + image_name: + description: The name of the image we build. + type: string + required: true + image_tag: + description: The tag of the image we build. E.g. latest + type: string + required: false + default: latest + e2xgrader_installation_source: + description: Where to install e2xgrader from + type: string + required: false + default: pypi + e2xgrader_version: + description: Use a specific e2xgrader version from PyPi + type: string + required: false + default: "" + e2xgrader_branch: + description: Which e2xgrader branch or tag to install from. Only takes effect if e2xgrader_installation_source is "github" + type: string + required: false + default: "main" + push: + description: Push the image to the registry + type: boolean + required: false + default: false + registry: + description: Container registry to use + type: string + required: false + default: ghcr.io + +jobs: + build: + strategy: + matrix: + e2xgrader_mode: [student, student_exam, teacher] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set image tag + id: set_image_tag + run: | + if [ "${{ matrix.e2xgrader_mode }}" == "student_exam" ]; then + echo "image_tag=${{ inputs.image_name }}-exam:${{ inputs.image_tag }}" >> $GITHUB_OUTPUT + else + echo "image_tag=${{ inputs.image_name }}-${{ matrix.e2xgrader_mode }}:${{ inputs.image_tag }}" >> $GITHUB_OUTPUT + fi + - name: Print image tag + id: print_image_tag + run: | + echo ${{ steps.set_image_tag.outputs.image_tag }} + - name: Login to ghcr.io + if: ${{ inputs.registry == "ghcr.io" }} + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + - name: Login to Quay Container Registry + if: ${{ inputs.registry == "quay.io" }} + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_SECRET }} + - name: Build Docker image + if: ${{ inputs.force_build }} + id: build_image + uses: docker/build-push-action@v5 + with: + context: images/e2xgrader-notebook + push: ${{ inputs.push }} + tags: ${{ inputs.registry }}/${{ github.repository }}/${{ steps.set_image_tag.outputs.image_tag }} + build-args: | + IMAGE_SOURCE=${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} + E2XGRADER_MODE=${{ matrix.e2xgrader_mode }} + E2XGRADER_VERSION=${{ inputs.e2xgrader_version }} + FROM_REPO=${{ inputs.e2xgrader_installation_source == 'github' }} + E2XGRADER_BRANCH=${{ inputs.e2xgrader_branch }} + - name: List images + if: ${{ inputs.force_build }} + run: | + docker images + + + + + + diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml new file mode 100644 index 0000000..518983c --- /dev/null +++ b/.github/workflows/build_image.yml @@ -0,0 +1,92 @@ +name: Build and push image + +on: + workflow_call: + inputs: + force_build: + description: If the build should be forced even if there are no changes + type: boolean + required: false + default: false + push: + description: Push the image to the registry + type: boolean + required: false + default: false + registry: + description: Container registry to use + type: string + required: false + default: ghcr.io + base_image_name: + description: The name of the base image to build from + type: string + required: true + base_image_tag: + description: The tag of the base image to build from + type: string + required: false + default: latest + image_name: + description: The name of the image to build. + type: string + required: true + image_tag: + description: The tag of the image to build. E.g. latest + type: string + required: false + default: latest + outputs: + did_build_image: + description: If the image was built + value: ${{ jobs.build_and_push_image.outputs.did_build_image }} + +jobs: + build_and_push_image: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Print the base image + run: | + echo "The base image to build from is ${{ inputs.base_image_name }}:${{ inputs.base_image_tag }}" + - name: Check if files changed + if: ${{ ! inputs.force_build }} + uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + image_changed: + images/${{ inputs.image_name }}/** + - name: Login to ghcr.io + if: ${{ inputs.registry == "ghcr.io" }} + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + - name: Login to Quay Container Registry + if: ${{ inputs.registry == "quay.io" }} + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_SECRET }} + - name: Build Docker image + if: ${{ inputs.force_build || steps.changes.outputs.image_changed == 'true' }} + id: build_image + uses: docker/build-push-action@v5 + with: + context: images/${{ inputs.image_name }} + push: ${{ inputs.push }} + tags: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image_name }}:${{ inputs.image_tag }} + build-args: | + IMAGE_SOURCE=${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} + - name: List images + if: ${{ inputs.force_build || steps.changes.outputs.image_changed == 'true' }} + run: | + docker images + - name: Set output (image was built) + if: ${{ inputs.force_build || steps.changes.outputs.image_changed == 'true' }} + run: | + echo "image_built=true" >> $GITHUB_OUTPUT diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml deleted file mode 100644 index 3eaad52..0000000 --- a/.github/workflows/manual-workflow.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Manual workflow -on: - workflow_dispatch: - inputs: - branch: - description: 'Branch to build' - required: true - default: 'dev' - image: - descriptiion: 'Image to build' - required: true - default: 'all' - -jobs: - deploy: - name: Deploy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Build and publish to ghcr.io - id: build_and_deploy - run: | - BRANCH=${{ needs.event.inputs.branch }} - IMAGE=${{ needs.event.inputs.image }} - - if [ "$BRANCH" == "dev" ]; then - bash ci/build-and-deploy.sh --deployment dev --registry ghcr.io --image $IMAGE --publish latest - elif [ "$BRANCH" == "master" ]; then - bash ci/build-and-deploy.sh --deployment prod --registry ghcr.io --image $IMAGE --publish latest - else - echo "Branch $BRANCH unknown" - exit 1 - fi - - - name: Login to Quay Container Registry - uses: docker/login-action@v1 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - - - name: Build and publish to quay.io - id: build_and_deploy_to_quay - run: | - BRANCH=${{ needs.event.inputs.branch }} - IMAGE=${{ needs.event.inputs.image }} - - if [ "$BRANCH" == "dev" ]; then - bash ci/build-and-deploy.sh --deployment dev --registry ghcr.io --image $IMAGE --publish latest - elif [ "$BRANCH" == "master" ]; then - bash ci/build-and-deploy.sh --deployment prod --registry ghcr.io --image $IMAGE --publish latest - else - echo "Branch $BRANCH unknown" - exit 1 - fi diff --git a/.github/workflows/ngshare.yml b/.github/workflows/ngshare.yml deleted file mode 100644 index 9833005..0000000 --- a/.github/workflows/ngshare.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -name: Ngshare -on: - push: - branches: - - master - - dev - paths: - - .github/** - - hub/** - - ci/** - -jobs: - build-and-publish-dev: - name: Deploy Dev - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/dev' - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Build and publish to ghcr.io - id: build_and_deploy_to_ghcr - run: | - bash ci/build-and-deploy.sh --deployment dev --registry ghcr.io --image ngshare --publish latest - - - name: Login to Quay Container Registry - uses: docker/login-action@v1 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - - - name: Build and publish to quay.io - id: build_and_deploy_to_quay - run: | - bash ci/build-and-deploy.sh --deployment dev --registry quay.io --image ngshare --publish latest - - build-and-publish-prod: - name: Deploy Prod - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Build and publish to ghcr.io - id: build_and_deploy_to_ghcr - run: | - bash ci/build-and-deploy.sh --deployment prod --registry ghcr.io --image ngshare --publish latest - - - name: Login to Quay Container Registry - uses: docker/login-action@v1 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - - - name: Build and publish to ghcr.io - id: build_and_deploy_to_quay - run: | - bash ci/build-and-deploy.sh --deployment prod --registry quay.io --image ngshare --publish latest diff --git a/.github/workflows/notebook-dev.yml b/.github/workflows/notebook-dev.yml deleted file mode 100644 index 6e8e90c..0000000 --- a/.github/workflows/notebook-dev.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: Notebook Dev -on: - push: - branches: - - dev - paths: - - .github/** - - ci/** - - minimal-notebook/** - - datascience-notebook/** - - notebook/** - - exam-notebook/** - -jobs: - notebook: - name: Notebook - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/dev' - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Build and publish to ghcr.io - id: build_and_publish_to_ghcr - run: | - bash ci/build-and-deploy.sh --deployment dev --registry ghcr.io --image all-notebook --publish latest - - - name: Login to Quay Container Registry - uses: docker/login-action@v1 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - - - name: Build and publish to quay.io - id: build_and_publish_to_quay - run: | - bash ci/build-and-deploy.sh --deployment dev --registry quay.io --image all-notebook --publish latest - diff --git a/.github/workflows/notebook-stable.yml b/.github/workflows/notebook-stable.yml deleted file mode 100644 index 5b9534a..0000000 --- a/.github/workflows/notebook-stable.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: Notebook Stable -on: - push: - branches: - - master - paths: - - .github/** - - ci/** - - minimal-notebook/** - - datascience-notebook/** - - notebook/** - - exam-notebook/** - -jobs: - notebook: - name: Notebook - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Build and publish to ghcr.io - id: build_and_publish_to_ghcr - run: | - bash ci/build-and-deploy.sh --deployment prod --registry ghcr.io --image all-notebook --publish latest - - - name: Login to Quay Container Registry - uses: docker/login-action@v1 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - - - name: Build and publish to quay.io - id: build_and_publish_to_quay - run: | - bash ci/build-and-deploy.sh --deployment prod --registry quay.io --image all-notebook --publish latest - diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml deleted file mode 100644 index 18e1d2d..0000000 --- a/.github/workflows/pull-request.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Pull Request -on: - pull_request: - branches: - - master - - dev - -jobs: - build: - name: Build - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Build image - id: build_image - run: | - bash ci/build-and-deploy.sh --deployment dev --registry ghcr.io --image all --publish none diff --git a/.github/workflows/tags.yml b/.github/workflows/tags.yml deleted file mode 100644 index 915f1b8..0000000 --- a/.github/workflows/tags.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: Deploy tags -on: - push: - tags: - - 'ws*' - - 'ss*' - - 'release-*' - -jobs: - build: - name: Build - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - - name: Build and publis to ghcr.io - id: docker_build_publish_ghcr - run: | - bash ci/build-and-deploy.sh --deployment prod --registry ghcr.io --image all --version ${{ steps.get_version.outputs.VERSION }} --publish version - - - name: Login to Quay Container Registry - uses: docker/login-action@v1 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - - - name: Build and publis to quay.io - id: docker_build_publish_quay - run: | - bash ci/build-and-deploy.sh --deployment prod --registry quay.io --image all --version ${{ steps.get_version.outputs.VERSION }} --publish version diff --git a/.github/workflows/trigger_build_and_push.yml b/.github/workflows/trigger_build_and_push.yml new file mode 100644 index 0000000..a8b89c1 --- /dev/null +++ b/.github/workflows/trigger_build_and_push.yml @@ -0,0 +1,60 @@ +name: Manually build and push all images + +on: + workflow_dispatch: + inputs: + force_build: + description: If the build should be forced even if there are no changes + type: boolean + required: false + default: false + push: + description: Push the image to the registry + type: boolean + required: false + default: false + registry: + description: Container registry to use + type: choice + required: false + default: ghcr.io + options: + - ghcr.io + - quay.io + tag: + description: Tag to use for the images (e.g. latest, dev) + type: string + required: false + default: latest + e2xgrader_installation_source: + description: Where to install e2xgrader from + type: choice + required: false + default: pypi + options: + - pypi + - github + e2xgrader_version: + description: Use a specific e2xgrader version from PyPi + type: string + required: false + default: "" + e2xgrader_branch: + description: Which e2xgrader branch or tag to install from. Only takes effect if e2xgrader_installation_source is "github" + type: string + required: false + default: "main" + +jobs: + + manually_build_all_images: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: ${{ inputs.force_build }} + push: ${{ inputs.push }} + registry: ${{ inputs.registry }} + tag: ${{ inputs.tag }} + e2xgrader_installation_source: ${{ inputs.e2xgrader_installation_source }} + e2xgrader_version: ${{ inputs.e2xgrader_version }} + e2xgrader_branch: ${{ inputs.e2xgrader_branch }} + From a75d76411974f0c73cb15d0e6ad9b09c6907a9e2 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:02:40 +0100 Subject: [PATCH 07/51] Move exam notebook --- exam-notebook/Dockerfile | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 exam-notebook/Dockerfile diff --git a/exam-notebook/Dockerfile b/exam-notebook/Dockerfile deleted file mode 100644 index 969372f..0000000 --- a/exam-notebook/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/notebook:latest -FROM $IMAGE_SOURCE - -LABEL maintainer="e2x project H-BRS " - -USER $NB_USER - -# Activate student exam mode by default -RUN e2xgrader activate student_exam --sys-prefix - -# Deactivate RISE -RUN jupyter-nbextension uninstall rise --py --sys-prefix - -# Jupyter extension list -RUN jupyter nbextension list From 8d15fa477125b3ce0f5599a7d250481a24a94a8e Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:02:57 +0100 Subject: [PATCH 08/51] Move exam notebook --- images/exam-notebook/Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 images/exam-notebook/Dockerfile diff --git a/images/exam-notebook/Dockerfile b/images/exam-notebook/Dockerfile new file mode 100644 index 0000000..969372f --- /dev/null +++ b/images/exam-notebook/Dockerfile @@ -0,0 +1,15 @@ +ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/notebook:latest +FROM $IMAGE_SOURCE + +LABEL maintainer="e2x project H-BRS " + +USER $NB_USER + +# Activate student exam mode by default +RUN e2xgrader activate student_exam --sys-prefix + +# Deactivate RISE +RUN jupyter-nbextension uninstall rise --py --sys-prefix + +# Jupyter extension list +RUN jupyter nbextension list From 16177737ddfe19935076ba9f531b7a9211fe5e54 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:07:16 +0100 Subject: [PATCH 09/51] Add push keyword to workflow file --- .github/workflows/trigger_build_and_push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trigger_build_and_push.yml b/.github/workflows/trigger_build_and_push.yml index a8b89c1..95c274b 100644 --- a/.github/workflows/trigger_build_and_push.yml +++ b/.github/workflows/trigger_build_and_push.yml @@ -1,6 +1,7 @@ name: Manually build and push all images on: + push: workflow_dispatch: inputs: force_build: From 5ba2bda4194c00e441981b7c14a7e205b8f68d3a Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:08:10 +0100 Subject: [PATCH 10/51] Remove push keyword from workflow file --- .github/workflows/trigger_build_and_push.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/trigger_build_and_push.yml b/.github/workflows/trigger_build_and_push.yml index 95c274b..a8b89c1 100644 --- a/.github/workflows/trigger_build_and_push.yml +++ b/.github/workflows/trigger_build_and_push.yml @@ -1,7 +1,6 @@ name: Manually build and push all images on: - push: workflow_dispatch: inputs: force_build: From 1903c72d1100bab8b237ebf31f04a48f1dd9f719 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:11:18 +0100 Subject: [PATCH 11/51] Add workflow to test pushing to ghcr.io --- .github/workflows/build_and_push_to_ghcr.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/build_and_push_to_ghcr.yml diff --git a/.github/workflows/build_and_push_to_ghcr.yml b/.github/workflows/build_and_push_to_ghcr.yml new file mode 100644 index 0000000..1d2817e --- /dev/null +++ b/.github/workflows/build_and_push_to_ghcr.yml @@ -0,0 +1,18 @@ +name: Test build and push to ghcr.io + +on: + push: + branches: + refactor_workflows_and_images + +jobs: + + manually_build_all_images: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: true + push: true + registry: ghcr.io + tag: test + e2xgrader_installation_source: pypi + From 5961d69e0c7f27aaaa04baf379f0200ad9d75dc2 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:13:50 +0100 Subject: [PATCH 12/51] Put registry in quotes --- .github/workflows/build_and_push_to_ghcr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_push_to_ghcr.yml b/.github/workflows/build_and_push_to_ghcr.yml index 1d2817e..50a3b0d 100644 --- a/.github/workflows/build_and_push_to_ghcr.yml +++ b/.github/workflows/build_and_push_to_ghcr.yml @@ -12,7 +12,7 @@ jobs: with: force_build: true push: true - registry: ghcr.io + registry: "ghcr.io" tag: test e2xgrader_installation_source: pypi From 9f83a56ef2360003c62c5407c6fb0cf7edbc1dd8 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:15:33 +0100 Subject: [PATCH 13/51] Fix quotes in workflow files --- .github/workflows/build_and_push_to_ghcr.yml | 2 +- .github/workflows/build_e2xgrader_images.yml | 4 ++-- .github/workflows/build_image.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_push_to_ghcr.yml b/.github/workflows/build_and_push_to_ghcr.yml index 50a3b0d..1d2817e 100644 --- a/.github/workflows/build_and_push_to_ghcr.yml +++ b/.github/workflows/build_and_push_to_ghcr.yml @@ -12,7 +12,7 @@ jobs: with: force_build: true push: true - registry: "ghcr.io" + registry: ghcr.io tag: test e2xgrader_installation_source: pypi diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index 0aeb259..645be4e 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -74,14 +74,14 @@ jobs: run: | echo ${{ steps.set_image_tag.outputs.image_tag }} - name: Login to ghcr.io - if: ${{ inputs.registry == "ghcr.io" }} + if: ${{ inputs.registry == 'ghcr.io' }} uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GH_TOKEN }} - name: Login to Quay Container Registry - if: ${{ inputs.registry == "quay.io" }} + if: ${{ inputs.registry == 'quay.io' }} uses: docker/login-action@v1 with: registry: quay.io diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 518983c..a28b6b6 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -59,14 +59,14 @@ jobs: image_changed: images/${{ inputs.image_name }}/** - name: Login to ghcr.io - if: ${{ inputs.registry == "ghcr.io" }} + if: ${{ inputs.registry == 'ghcr.io' }} uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GH_TOKEN }} - name: Login to Quay Container Registry - if: ${{ inputs.registry == "quay.io" }} + if: ${{ inputs.registry == 'quay.io' }} uses: docker/login-action@v1 with: registry: quay.io From 3296b92adfd07d2a528d368223027ecf13c2b1a7 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:18:26 +0100 Subject: [PATCH 14/51] Update login-action --- .github/workflows/build_e2xgrader_images.yml | 4 ++-- .github/workflows/build_image.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index 645be4e..eff54fc 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -75,14 +75,14 @@ jobs: echo ${{ steps.set_image_tag.outputs.image_tag }} - name: Login to ghcr.io if: ${{ inputs.registry == 'ghcr.io' }} - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GH_TOKEN }} - name: Login to Quay Container Registry if: ${{ inputs.registry == 'quay.io' }} - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index a28b6b6..c08baa7 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -60,14 +60,14 @@ jobs: images/${{ inputs.image_name }}/** - name: Login to ghcr.io if: ${{ inputs.registry == 'ghcr.io' }} - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GH_TOKEN }} - name: Login to Quay Container Registry if: ${{ inputs.registry == 'quay.io' }} - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} From 717f63f63238ee3933c914ba5d290d4730998bef Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:28:14 +0100 Subject: [PATCH 15/51] Inherit secrets --- .github/workflows/build_e2xgrader_images.yml | 1 + .github/workflows/build_image.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index eff54fc..6714230 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -2,6 +2,7 @@ name: Build e2xgrader image for all modes on: workflow_call: + secrets: inherit inputs: force_build: description: Force the build even if there are no changes diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index c08baa7..d986a0d 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -2,6 +2,7 @@ name: Build and push image on: workflow_call: + secrets: inherit inputs: force_build: description: If the build should be forced even if there are no changes From 4d38d73c3c3a50d62b9c78607d9ab613fd056a53 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:30:21 +0100 Subject: [PATCH 16/51] Pass secrets through --- .github/workflows/build_and_push_all_images.yml | 6 ++++++ .github/workflows/build_e2xgrader_images.yml | 4 +++- .github/workflows/build_image.yml | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_push_all_images.yml b/.github/workflows/build_and_push_all_images.yml index 291cf89..6d42e9f 100644 --- a/.github/workflows/build_and_push_all_images.yml +++ b/.github/workflows/build_and_push_all_images.yml @@ -2,6 +2,9 @@ name: Build and push all images on: workflow_call: + secrets: + GH_TOKEN: + required: true inputs: force_build: description: If the build should be forced even if there are no changes @@ -51,6 +54,7 @@ jobs: base_image_tag: 4d70cf8da953 image_tag: ${{ inputs.tag }} push: ${{ inputs.push }} + secrets: inherit datascience_notebook: needs: [minimal_notebook] @@ -63,6 +67,7 @@ jobs: base_image_name: ${{ inputs.registry }}/digiklausur/docker-stacks/minimal-notebook base_image_tag: ${{ inputs.tag }} push: ${{ inputs.push }} + secrets: inherit e2x_datascience_notebook: needs: [datascience_notebook] @@ -78,6 +83,7 @@ jobs: e2xgrader_installation_source: ${{ inputs.e2xgrader_installation_source }} e2xgrader_version: ${{ inputs.e2xgrader_version }} e2xgrader_branch: ${{ inputs.e2xgrader_branch }} + secrets: inherit diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index 6714230..73a20b8 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -2,7 +2,9 @@ name: Build e2xgrader image for all modes on: workflow_call: - secrets: inherit + secrets: + GH_TOKEN: + required: true inputs: force_build: description: Force the build even if there are no changes diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index d986a0d..b9cee85 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -2,7 +2,9 @@ name: Build and push image on: workflow_call: - secrets: inherit + secrets: + GH_TOKEN: + required: true inputs: force_build: description: If the build should be forced even if there are no changes From 84b2b4dafd828fa3d7ed210011315eb8bea08e74 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:31:09 +0100 Subject: [PATCH 17/51] Inherit secrets --- .github/workflows/build_and_push_to_ghcr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_and_push_to_ghcr.yml b/.github/workflows/build_and_push_to_ghcr.yml index 1d2817e..5724f64 100644 --- a/.github/workflows/build_and_push_to_ghcr.yml +++ b/.github/workflows/build_and_push_to_ghcr.yml @@ -15,4 +15,5 @@ jobs: registry: ghcr.io tag: test e2xgrader_installation_source: pypi + secrets: inherit From 128bb21aa624290ac9517efbc515ee0d096948e6 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:40:10 +0100 Subject: [PATCH 18/51] lowercase github.repository --- .github/workflows/build_e2xgrader_images.yml | 5 ++++- .github/workflows/build_image.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index 73a20b8..e38a156 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -76,6 +76,9 @@ jobs: id: print_image_tag run: | echo ${{ steps.set_image_tag.outputs.image_tag }} + - id: lower-repo + run: | + echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT - name: Login to ghcr.io if: ${{ inputs.registry == 'ghcr.io' }} uses: docker/login-action@v3 @@ -97,7 +100,7 @@ jobs: with: context: images/e2xgrader-notebook push: ${{ inputs.push }} - tags: ${{ inputs.registry }}/${{ github.repository }}/${{ steps.set_image_tag.outputs.image_tag }} + tags: ${{ inputs.registry }}/${{ steps.lower-repo.outputs.repository }}/${{ steps.set_image_tag.outputs.image_tag }} build-args: | IMAGE_SOURCE=${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} E2XGRADER_MODE=${{ matrix.e2xgrader_mode }} diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index b9cee85..5d1d2e6 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -53,6 +53,9 @@ jobs: - name: Print the base image run: | echo "The base image to build from is ${{ inputs.base_image_name }}:${{ inputs.base_image_tag }}" + - id: lower-repo + run: | + echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT - name: Check if files changed if: ${{ ! inputs.force_build }} uses: dorny/paths-filter@v3 @@ -82,7 +85,7 @@ jobs: with: context: images/${{ inputs.image_name }} push: ${{ inputs.push }} - tags: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image_name }}:${{ inputs.image_tag }} + tags: ${{ inputs.registry }}/${{ steps.lower-repo.outputs.repository }}/${{ inputs.image_name }}:${{ inputs.image_tag }} build-args: | IMAGE_SOURCE=${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} - name: List images From 8fa6e39adf91d8ed952ae9db97f3d8985c829203 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:51:31 +0100 Subject: [PATCH 19/51] hardcode repository and do not force build --- .github/workflows/build_and_push_to_ghcr.yml | 4 ++-- .github/workflows/build_image.yml | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_and_push_to_ghcr.yml b/.github/workflows/build_and_push_to_ghcr.yml index 5724f64..c099efb 100644 --- a/.github/workflows/build_and_push_to_ghcr.yml +++ b/.github/workflows/build_and_push_to_ghcr.yml @@ -7,10 +7,10 @@ on: jobs: - manually_build_all_images: + build_and_push_to_ghcr: uses: ./.github/workflows/build_and_push_all_images.yml with: - force_build: true + force_build: false push: true registry: ghcr.io tag: test diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 5d1d2e6..6b99abd 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -53,9 +53,6 @@ jobs: - name: Print the base image run: | echo "The base image to build from is ${{ inputs.base_image_name }}:${{ inputs.base_image_tag }}" - - id: lower-repo - run: | - echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT - name: Check if files changed if: ${{ ! inputs.force_build }} uses: dorny/paths-filter@v3 @@ -85,7 +82,7 @@ jobs: with: context: images/${{ inputs.image_name }} push: ${{ inputs.push }} - tags: ${{ inputs.registry }}/${{ steps.lower-repo.outputs.repository }}/${{ inputs.image_name }}:${{ inputs.image_tag }} + tags: ${{ inputs.registry }}/digiklausur/docker-stacks/${{ inputs.image_name }}:${{ inputs.image_tag }} build-args: | IMAGE_SOURCE=${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} - name: List images From 4181bd53314ea040739d73a901699c6813fd6c68 Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 15:56:08 +0100 Subject: [PATCH 20/51] Add ml image to workflow --- .../workflows/build_and_push_all_images.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build_and_push_all_images.yml b/.github/workflows/build_and_push_all_images.yml index 6d42e9f..3f86c42 100644 --- a/.github/workflows/build_and_push_all_images.yml +++ b/.github/workflows/build_and_push_all_images.yml @@ -84,6 +84,35 @@ jobs: e2xgrader_version: ${{ inputs.e2xgrader_version }} e2xgrader_branch: ${{ inputs.e2xgrader_branch }} secrets: inherit + + ml_notebook: + needs: [datascience_notebook] + uses: ./.github/workflows/build_image.yml + with: + force_build: ${{ inputs.force_build || needs.datascience_notebook.outputs.did_build_image == 'true' }} + image_name: ml-notebook + image_tag: ${{ inputs.tag }} + registry: ${{ inputs.registry }} + base_image_name: ${{ inputs.registry }}/digiklausur/docker-stacks/datascience-notebook + base_image_tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + secrets: inherit + + e2x_ml_notebook: + needs: [ml_notebook] + uses: ./.github/workflows/build_e2xgrader_images.yml + with: + force_build: ${{ inputs.force_build || needs.ml_notebook.outputs.did_build_image == 'true' }} + registry: ${{ inputs.registry }} + image_name: ml-notebook + image_tag: ${{ inputs.tag }} + base_image_name: ${{ inputs.registry }}/digiklausur/docker-stacks/ml-notebook + base_image_tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + e2xgrader_installation_source: ${{ inputs.e2xgrader_installation_source }} + e2xgrader_version: ${{ inputs.e2xgrader_version }} + e2xgrader_branch: ${{ inputs.e2xgrader_branch }} + secrets: inherit From bc3dedf8cf95daea34d6af2b815169804aef470f Mon Sep 17 00:00:00 2001 From: Tim Metzler Date: Thu, 28 Mar 2024 16:11:09 +0100 Subject: [PATCH 21/51] Check for file changes in e2xgrader workflow --- .github/workflows/build_e2xgrader_images.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index e38a156..ad3e94b 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -76,9 +76,14 @@ jobs: id: print_image_tag run: | echo ${{ steps.set_image_tag.outputs.image_tag }} - - id: lower-repo - run: | - echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT + - name: Check if files changed + if: ${{ ! inputs.force_build }} + uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + image_changed: + images/e2xgrader-notebook/** - name: Login to ghcr.io if: ${{ inputs.registry == 'ghcr.io' }} uses: docker/login-action@v3 @@ -94,13 +99,13 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_SECRET }} - name: Build Docker image - if: ${{ inputs.force_build }} + if: ${{ inputs.force_build || steps.changes.outputs.image_changed == 'true' }} id: build_image uses: docker/build-push-action@v5 with: context: images/e2xgrader-notebook push: ${{ inputs.push }} - tags: ${{ inputs.registry }}/${{ steps.lower-repo.outputs.repository }}/${{ steps.set_image_tag.outputs.image_tag }} + tags: ${{ inputs.registry }}/digiklausur/docker-stacks/${{ steps.set_image_tag.outputs.image_tag }} build-args: | IMAGE_SOURCE=${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} E2XGRADER_MODE=${{ matrix.e2xgrader_mode }} @@ -108,7 +113,7 @@ jobs: FROM_REPO=${{ inputs.e2xgrader_installation_source == 'github' }} E2XGRADER_BRANCH=${{ inputs.e2xgrader_branch }} - name: List images - if: ${{ inputs.force_build }} + if: ${{ inputs.force_build || steps.changes.outputs.image_changed == 'true' }} run: | docker images From d88247ccd92c3686fd4592414932b53bd2f2c7cb Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 11:28:00 +0200 Subject: [PATCH 22/51] Add base nbgrader_config.py --- images/e2xgrader-notebook/Dockerfile | 6 ++++++ images/e2xgrader-notebook/configs/nbgrader_config.py | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 images/e2xgrader-notebook/configs/nbgrader_config.py diff --git a/images/e2xgrader-notebook/Dockerfile b/images/e2xgrader-notebook/Dockerfile index 6e6b55e..7113efc 100644 --- a/images/e2xgrader-notebook/Dockerfile +++ b/images/e2xgrader-notebook/Dockerfile @@ -9,6 +9,12 @@ ARG E2XGRADER_MODE=student # Inherit from any image, then just install e2xgrader and activate a mode LABEL maintainer="e2x project H-BRS " +USER root +# Copy nbgrader base config +COPY configs/nbgrader_config.py /etc/jupyter/nbgrader_config.py +RUN chown root:$NB_GID /etc/jupyter/nbgrader_config.py &&\ + chmod g+rwX /etc/jupyter/nbgrader_config.py + USER $NB_USER # Install requirements shared between all modes diff --git a/images/e2xgrader-notebook/configs/nbgrader_config.py b/images/e2xgrader-notebook/configs/nbgrader_config.py new file mode 100644 index 0000000..733be1d --- /dev/null +++ b/images/e2xgrader-notebook/configs/nbgrader_config.py @@ -0,0 +1,5 @@ +from e2xgrader.config import configure_base, configure_exchange + +c = get_config() # noqa: F821 +configure_base(c) +configure_exchange(c) From 2beb39d1451e11a002a571bfff6a5a18a2e2328d Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 12:35:21 +0200 Subject: [PATCH 23/51] Install cpu version of pytorch --- images/ml-notebook/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images/ml-notebook/Dockerfile b/images/ml-notebook/Dockerfile index c4581a6..1f546a7 100644 --- a/images/ml-notebook/Dockerfile +++ b/images/ml-notebook/Dockerfile @@ -6,6 +6,9 @@ LABEL description="e2x machine learning notebook" USER $NB_USER +# Install pytorch cpu +pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu + # Install requirements COPY requirements.txt /tmp/requirements.txt RUN pip install --no-cache-dir -r /tmp/requirements.txt From d931508784042abb95dccb04ada0a09bd40ceaff Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 12:46:03 +0200 Subject: [PATCH 24/51] Add missing RUN keyword --- images/ml-notebook/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/ml-notebook/Dockerfile b/images/ml-notebook/Dockerfile index 1f546a7..c9c1f45 100644 --- a/images/ml-notebook/Dockerfile +++ b/images/ml-notebook/Dockerfile @@ -7,7 +7,7 @@ LABEL description="e2x machine learning notebook" USER $NB_USER # Install pytorch cpu -pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu +RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu # Install requirements COPY requirements.txt /tmp/requirements.txt From b9d64cf9bfd2bbbca7e10da3037e53213415d7ff Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 15:39:36 +0200 Subject: [PATCH 25/51] Remove tensorflow from ml-notebook --- images/ml-notebook/requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/ml-notebook/requirements.txt b/images/ml-notebook/requirements.txt index 8dc79f1..7694a9a 100644 --- a/images/ml-notebook/requirements.txt +++ b/images/ml-notebook/requirements.txt @@ -1,4 +1,3 @@ gymnasium==0.29.1 opencv-contrib-python==4.8.0.76 -stable-baselines3 -tensorflow==2.12.0 \ No newline at end of file +stable-baselines3 \ No newline at end of file From b13acaa31c65139df998afd1639a54b168406e08 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 15:46:26 +0200 Subject: [PATCH 26/51] Add nlp notebook --- images/nlp-notebook/Dockerfile | 19 +++++++++++++++++++ images/nlp-notebook/requirements.txt | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 images/nlp-notebook/Dockerfile create mode 100644 images/nlp-notebook/requirements.txt diff --git a/images/nlp-notebook/Dockerfile b/images/nlp-notebook/Dockerfile new file mode 100644 index 0000000..e7bfa46 --- /dev/null +++ b/images/nlp-notebook/Dockerfile @@ -0,0 +1,19 @@ +ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/ml-notebook:latest +FROM $IMAGE_SOURCE + +LABEL maintainer="e2x project H-BRS " +LABEL description="e2x natural language processing notebook" + +USER $NB_USER + +# Install requirements +COPY requirements.txt /tmp/requirements.txt +RUN pip install --no-cache-dir -r /tmp/requirements.txt + +# Jupyter extension list +RUN jupyter nbextension list + +USER root +RUN rm /tmp/requirements.txt + +USER $NB_USER diff --git a/images/nlp-notebook/requirements.txt b/images/nlp-notebook/requirements.txt new file mode 100644 index 0000000..073c56b --- /dev/null +++ b/images/nlp-notebook/requirements.txt @@ -0,0 +1,8 @@ +spacy +gensim +wikipedia +nltk +transformers +tokenizers +huggingface_hub +wordcloud \ No newline at end of file From 871c13e6af6487cc15def43338e622526448d00d Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 15:46:42 +0200 Subject: [PATCH 27/51] Update workflow to build nlp notebook --- .../workflows/build_and_push_all_images.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build_and_push_all_images.yml b/.github/workflows/build_and_push_all_images.yml index 3f86c42..8ace010 100644 --- a/.github/workflows/build_and_push_all_images.yml +++ b/.github/workflows/build_and_push_all_images.yml @@ -113,6 +113,35 @@ jobs: e2xgrader_version: ${{ inputs.e2xgrader_version }} e2xgrader_branch: ${{ inputs.e2xgrader_branch }} secrets: inherit + + nlp_notebook: + needs: [ml_notebook] + uses: ./.github/workflows/build_image.yml + with: + force_build: ${{ inputs.force_build || needs.ml_notebook.outputs.did_build_image == 'true' }} + image_name: nlp-notebook + image_tag: ${{ inputs.tag }} + registry: ${{ inputs.registry }} + base_image_name: ${{ inputs.registry }}/digiklausur/docker-stacks/ml-notebook + base_image_tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + secrets: inherit + + e2x_nlp_notebook: + needs: [nlp_notebook] + uses: ./.github/workflows/build_e2xgrader_images.yml + with: + force_build: ${{ inputs.force_build || needs.nlp_notebook.outputs.did_build_image == 'true' }} + registry: ${{ inputs.registry }} + image_name: nlp-notebook + image_tag: ${{ inputs.tag }} + base_image_name: ${{ inputs.registry }}/digiklausur/docker-stacks/nlp-notebook + base_image_tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + e2xgrader_installation_source: ${{ inputs.e2xgrader_installation_source }} + e2xgrader_version: ${{ inputs.e2xgrader_version }} + e2xgrader_branch: ${{ inputs.e2xgrader_branch }} + secrets: inherit From 53e47e7ef3a194f90aa48fd43dc90278bbcdf929 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 17:03:15 +0200 Subject: [PATCH 28/51] Add nbresuse to minimal-notebook --- images/minimal-notebook/Dockerfile | 13 +++++++++++++ images/minimal-notebook/requirements.txt | 1 + 2 files changed, 14 insertions(+) create mode 100644 images/minimal-notebook/requirements.txt diff --git a/images/minimal-notebook/Dockerfile b/images/minimal-notebook/Dockerfile index 7b6fb5d..0d93779 100644 --- a/images/minimal-notebook/Dockerfile +++ b/images/minimal-notebook/Dockerfile @@ -45,6 +45,19 @@ RUN mamba install -y gh --channel conda-forge && \ RUN pip install --upgrade pip +# Install requirements +COPY requirements.txt /tmp/requirements.txt +RUN pip install --no-cache-dir -r /tmp/requirements.txt + +# Enable extenstions and Jupyter contrib extensions +RUN cd /tmp && \ + git clone --depth 1 -b master https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git && \ + cd /tmp/jupyter_contrib_nbextensions/src/jupyter_contrib_nbextensions/nbextensions && \ + jupyter nbextension install --sys-prefix execute_time && \ + jupyter nbextension enable --sys-prefix execute_time/ExecuteTime && \ + jupyter nbextension list && \ + rm -rf /tmp/jupyter_contrib_nbextensions + USER root # clean up diff --git a/images/minimal-notebook/requirements.txt b/images/minimal-notebook/requirements.txt new file mode 100644 index 0000000..093e4d2 --- /dev/null +++ b/images/minimal-notebook/requirements.txt @@ -0,0 +1 @@ +nbresuse \ No newline at end of file From e63d800c2338a996eb18804d9de8b14c648c9a15 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 17:03:29 +0200 Subject: [PATCH 29/51] Add mode specific requirements --- images/e2xgrader-notebook/common_requirements.txt | 6 ++++++ images/e2xgrader-notebook/student_requirements.txt | 1 + images/e2xgrader-notebook/teacher_requirements.txt | 3 +++ 3 files changed, 10 insertions(+) diff --git a/images/e2xgrader-notebook/common_requirements.txt b/images/e2xgrader-notebook/common_requirements.txt index e69de29..6305fe4 100644 --- a/images/e2xgrader-notebook/common_requirements.txt +++ b/images/e2xgrader-notebook/common_requirements.txt @@ -0,0 +1,6 @@ +assignmenttest @ git+https://github.com/Digiklausur/assignmenttest@master +e2xgradingtools +e2xtest @ git+https://github.com/DigiKlausur/e2xtest@main +exam_kernel +java_syntax_kernel @ git+https://github.com/DigiKlausur/java_syntax_kernel@main +ngshare_exchange>=0.5.2 \ No newline at end of file diff --git a/images/e2xgrader-notebook/student_requirements.txt b/images/e2xgrader-notebook/student_requirements.txt index e69de29..a48935d 100644 --- a/images/e2xgrader-notebook/student_requirements.txt +++ b/images/e2xgrader-notebook/student_requirements.txt @@ -0,0 +1 @@ +RISE=5.7.1 \ No newline at end of file diff --git a/images/e2xgrader-notebook/teacher_requirements.txt b/images/e2xgrader-notebook/teacher_requirements.txt index e69de29..7bbc447 100644 --- a/images/e2xgrader-notebook/teacher_requirements.txt +++ b/images/e2xgrader-notebook/teacher_requirements.txt @@ -0,0 +1,3 @@ +RISE=5.7.1 +weasyprint +pdf_feedback_exporter @ git+https://github.com/DigiKlausur/pdf_feedback_exporter@main \ No newline at end of file From 06315d37ebd67e98e26dd276e624e4f2c1c12a79 Mon Sep 17 00:00:00 2001 From: Tim Metzler <33530562+tmetzl@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:06:41 +0200 Subject: [PATCH 30/51] Update build_image.yml --- .github/workflows/build_image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 6b99abd..add2fb2 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -1,4 +1,5 @@ name: Build and push image +run-name: Build ${{ inputs.image_name }}:${{ inputs.image_tag }} on: workflow_call: From 3dc797ecd01fa78556b9ffa383aa14f89c4b0101 Mon Sep 17 00:00:00 2001 From: Tim Metzler <33530562+tmetzl@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:07:43 +0200 Subject: [PATCH 31/51] Update build_image.yml --- .github/workflows/build_image.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index add2fb2..173f929 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -1,4 +1,3 @@ -name: Build and push image run-name: Build ${{ inputs.image_name }}:${{ inputs.image_tag }} on: From 44019062694897842b6a492e65388a3908f6bb10 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Tue, 2 Apr 2024 17:17:26 +0200 Subject: [PATCH 32/51] Fix operator --- images/e2xgrader-notebook/student_requirements.txt | 2 +- images/e2xgrader-notebook/teacher_requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/e2xgrader-notebook/student_requirements.txt b/images/e2xgrader-notebook/student_requirements.txt index a48935d..4890837 100644 --- a/images/e2xgrader-notebook/student_requirements.txt +++ b/images/e2xgrader-notebook/student_requirements.txt @@ -1 +1 @@ -RISE=5.7.1 \ No newline at end of file +RISE==5.7.1 \ No newline at end of file diff --git a/images/e2xgrader-notebook/teacher_requirements.txt b/images/e2xgrader-notebook/teacher_requirements.txt index 7bbc447..7de7cfb 100644 --- a/images/e2xgrader-notebook/teacher_requirements.txt +++ b/images/e2xgrader-notebook/teacher_requirements.txt @@ -1,3 +1,3 @@ -RISE=5.7.1 +RISE==5.7.1 weasyprint pdf_feedback_exporter @ git+https://github.com/DigiKlausur/pdf_feedback_exporter@main \ No newline at end of file From 6f165f0f00101d108e0b5e5b9694c7e388a9c8b4 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 13:31:36 +0200 Subject: [PATCH 33/51] Remove old exam notebook --- images/exam-notebook/Dockerfile | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 images/exam-notebook/Dockerfile diff --git a/images/exam-notebook/Dockerfile b/images/exam-notebook/Dockerfile deleted file mode 100644 index 969372f..0000000 --- a/images/exam-notebook/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/notebook:latest -FROM $IMAGE_SOURCE - -LABEL maintainer="e2x project H-BRS " - -USER $NB_USER - -# Activate student exam mode by default -RUN e2xgrader activate student_exam --sys-prefix - -# Deactivate RISE -RUN jupyter-nbextension uninstall rise --py --sys-prefix - -# Jupyter extension list -RUN jupyter nbextension list From 537a78414a78437d2b7fa0ab0a7cefe55663c0e4 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 13:32:13 +0200 Subject: [PATCH 34/51] Rename workflow and add quay --- .github/workflows/build_and_push_to_ghcr.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/build_and_push_to_ghcr.yml diff --git a/.github/workflows/build_and_push_to_ghcr.yml b/.github/workflows/build_and_push_to_ghcr.yml deleted file mode 100644 index c099efb..0000000 --- a/.github/workflows/build_and_push_to_ghcr.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Test build and push to ghcr.io - -on: - push: - branches: - refactor_workflows_and_images - -jobs: - - build_and_push_to_ghcr: - uses: ./.github/workflows/build_and_push_all_images.yml - with: - force_build: false - push: true - registry: ghcr.io - tag: test - e2xgrader_installation_source: pypi - secrets: inherit - From fc4204e0fa6a23cfdd594ef7640192b79af8671f Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 13:32:41 +0200 Subject: [PATCH 35/51] Add quay.io secrets --- .../workflows/build_and_push_to_reqistry.yml | 29 +++++++++++++++++++ .github/workflows/build_e2xgrader_images.yml | 4 +++ .github/workflows/build_image.yml | 4 +++ 3 files changed, 37 insertions(+) create mode 100644 .github/workflows/build_and_push_to_reqistry.yml diff --git a/.github/workflows/build_and_push_to_reqistry.yml b/.github/workflows/build_and_push_to_reqistry.yml new file mode 100644 index 0000000..a040c71 --- /dev/null +++ b/.github/workflows/build_and_push_to_reqistry.yml @@ -0,0 +1,29 @@ +name: Test build and push to ghcr.io and quay.io + +on: + push: + branches: + refactor_workflows_and_images + +jobs: + + build_and_push_to_ghcr: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: ghcr.io + tag: test + e2xgrader_installation_source: pypi + secrets: inherit + + build_and_push_to_quay: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: quay.io + tag: test + e2xgrader_installation_source: pypi + secrets: inherit + diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index ad3e94b..6737261 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -5,6 +5,10 @@ on: secrets: GH_TOKEN: required: true + QUAY_USERNAME: + required: true + QUAY_SECRET: + required: true inputs: force_build: description: Force the build even if there are no changes diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 173f929..19d3592 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -5,6 +5,10 @@ on: secrets: GH_TOKEN: required: true + QUAY_USERNAME: + required: true + QUAY_SECRET: + required: true inputs: force_build: description: If the build should be forced even if there are no changes From 0f872dc106b36210ea3fa47fd79366d8ea9870be Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:03:42 +0200 Subject: [PATCH 36/51] Add paths to workflow --- .github/workflows/build_and_push_to_reqistry.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_push_to_reqistry.yml b/.github/workflows/build_and_push_to_reqistry.yml index a040c71..0adc56c 100644 --- a/.github/workflows/build_and_push_to_reqistry.yml +++ b/.github/workflows/build_and_push_to_reqistry.yml @@ -3,7 +3,15 @@ name: Test build and push to ghcr.io and quay.io on: push: branches: - refactor_workflows_and_images + - refactor_workflows_and_images + paths: + - .github/workflows/build_and_push_all_images.yml + - .github/workflows/build_and_push_to_registry.yml + - .github/workflows/build_e2xgrader_images.yml + - .github/workflows/build_image.yml + - images/** + paths-ignore: + - images/**/README.md jobs: From abb80aeac6d5fa83f61cba7dc03b1bc1f236294c Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:04:21 +0200 Subject: [PATCH 37/51] Fix typo in name --- .../workflows/build_and_push_to_registry.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build_and_push_to_registry.yml diff --git a/.github/workflows/build_and_push_to_registry.yml b/.github/workflows/build_and_push_to_registry.yml new file mode 100644 index 0000000..0adc56c --- /dev/null +++ b/.github/workflows/build_and_push_to_registry.yml @@ -0,0 +1,37 @@ +name: Test build and push to ghcr.io and quay.io + +on: + push: + branches: + - refactor_workflows_and_images + paths: + - .github/workflows/build_and_push_all_images.yml + - .github/workflows/build_and_push_to_registry.yml + - .github/workflows/build_e2xgrader_images.yml + - .github/workflows/build_image.yml + - images/** + paths-ignore: + - images/**/README.md + +jobs: + + build_and_push_to_ghcr: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: ghcr.io + tag: test + e2xgrader_installation_source: pypi + secrets: inherit + + build_and_push_to_quay: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: quay.io + tag: test + e2xgrader_installation_source: pypi + secrets: inherit + From 2cf38b2eb8eaa5716c023c88da3d5b51ac497f39 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:04:49 +0200 Subject: [PATCH 38/51] Add workflows for main and dev branch --- .github/workflows/docker_dev.yml | 37 +++++++++++++++++++++++++++++++ .github/workflows/docker_main.yml | 37 +++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/docker_dev.yml create mode 100644 .github/workflows/docker_main.yml diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml new file mode 100644 index 0000000..068ed0f --- /dev/null +++ b/.github/workflows/docker_dev.yml @@ -0,0 +1,37 @@ +name: Build and push latest images to ghcr.io and quay.io + +on: + push: + branches: + - dev + paths: + - .github/workflows/build_and_push_all_images.yml + - .github/workflows/build_and_push_to_registry.yml + - .github/workflows/build_e2xgrader_images.yml + - .github/workflows/build_image.yml + - images/** + paths-ignore: + - images/**/README.md + +jobs: + + build_and_push_to_ghcr: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: ghcr.io + tag: dev + e2xgrader_installation_source: pypi + secrets: inherit + + build_and_push_to_quay: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: quay.io + tag: dev + e2xgrader_installation_source: pypi + secrets: inherit + diff --git a/.github/workflows/docker_main.yml b/.github/workflows/docker_main.yml new file mode 100644 index 0000000..3ed3f86 --- /dev/null +++ b/.github/workflows/docker_main.yml @@ -0,0 +1,37 @@ +name: Build and push latest images to ghcr.io and quay.io + +on: + push: + branches: + - master + paths: + - .github/workflows/build_and_push_all_images.yml + - .github/workflows/build_and_push_to_registry.yml + - .github/workflows/build_e2xgrader_images.yml + - .github/workflows/build_image.yml + - images/** + paths-ignore: + - images/**/README.md + +jobs: + + build_and_push_to_ghcr: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: ghcr.io + tag: latest + e2xgrader_installation_source: pypi + secrets: inherit + + build_and_push_to_quay: + uses: ./.github/workflows/build_and_push_all_images.yml + with: + force_build: false + push: true + registry: quay.io + tag: latest + e2xgrader_installation_source: pypi + secrets: inherit + From 41417c518dba16f96c3997775fd36b6f36c01a87 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:05:02 +0200 Subject: [PATCH 39/51] Fix typo in name --- .../workflows/build_and_push_to_reqistry.yml | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/build_and_push_to_reqistry.yml diff --git a/.github/workflows/build_and_push_to_reqistry.yml b/.github/workflows/build_and_push_to_reqistry.yml deleted file mode 100644 index 0adc56c..0000000 --- a/.github/workflows/build_and_push_to_reqistry.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Test build and push to ghcr.io and quay.io - -on: - push: - branches: - - refactor_workflows_and_images - paths: - - .github/workflows/build_and_push_all_images.yml - - .github/workflows/build_and_push_to_registry.yml - - .github/workflows/build_e2xgrader_images.yml - - .github/workflows/build_image.yml - - images/** - paths-ignore: - - images/**/README.md - -jobs: - - build_and_push_to_ghcr: - uses: ./.github/workflows/build_and_push_all_images.yml - with: - force_build: false - push: true - registry: ghcr.io - tag: test - e2xgrader_installation_source: pypi - secrets: inherit - - build_and_push_to_quay: - uses: ./.github/workflows/build_and_push_all_images.yml - with: - force_build: false - push: true - registry: quay.io - tag: test - e2xgrader_installation_source: pypi - secrets: inherit - From ba14c30c11ffca7e552dde4cabcbe72e1914c2f8 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:13:21 +0200 Subject: [PATCH 40/51] Remove path ignore --- .github/workflows/build_and_push_to_registry.yml | 2 -- .github/workflows/docker_dev.yml | 2 -- .github/workflows/docker_main.yml | 2 -- 3 files changed, 6 deletions(-) diff --git a/.github/workflows/build_and_push_to_registry.yml b/.github/workflows/build_and_push_to_registry.yml index 0adc56c..ff7e17e 100644 --- a/.github/workflows/build_and_push_to_registry.yml +++ b/.github/workflows/build_and_push_to_registry.yml @@ -10,8 +10,6 @@ on: - .github/workflows/build_e2xgrader_images.yml - .github/workflows/build_image.yml - images/** - paths-ignore: - - images/**/README.md jobs: diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index 068ed0f..1630654 100644 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -10,8 +10,6 @@ on: - .github/workflows/build_e2xgrader_images.yml - .github/workflows/build_image.yml - images/** - paths-ignore: - - images/**/README.md jobs: diff --git a/.github/workflows/docker_main.yml b/.github/workflows/docker_main.yml index 3ed3f86..ca29cc6 100644 --- a/.github/workflows/docker_main.yml +++ b/.github/workflows/docker_main.yml @@ -10,8 +10,6 @@ on: - .github/workflows/build_e2xgrader_images.yml - .github/workflows/build_image.yml - images/** - paths-ignore: - - images/**/README.md jobs: From 31a2a0b343939b062b63c1c87ad02a83773832ed Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:18:08 +0200 Subject: [PATCH 41/51] Remove ngshare --- ngshare/Dockerfile | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 ngshare/Dockerfile diff --git a/ngshare/Dockerfile b/ngshare/Dockerfile deleted file mode 100644 index 0a439a9..0000000 --- a/ngshare/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM jupyterhub/jupyterhub:latest -LABEL maintainer="DigiKlausur project HBRS " - -#RUN apt-get install git-all -RUN apt-get update && \ - apt-get install -y git &&\ - apt-get clean &&\ - rm -rf /var/lib/apt/lists/* -# Change time -ENV TZ=Europe/Berlin -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -# Install exam kernel -RUN pip install --no-cache-dir git+https://github.com/LibreTexts/ngshare.git@89685b12580990f983d4523e0ec45fd249afb702 - -USER 65535:65535 -ENTRYPOINT ["python3", "-m", "ngshare"] From 788834e0a4ac1c0c2e547e6641a8165ed607fab2 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:18:19 +0200 Subject: [PATCH 42/51] Fix paths in workflows --- .github/workflows/docker_dev.yml | 4 ++-- .github/workflows/docker_main.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index 1630654..efe3420 100644 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -1,12 +1,12 @@ -name: Build and push latest images to ghcr.io and quay.io +name: Build and push dev images to ghcr.io and quay.io on: push: branches: - dev paths: + - .github/workflows/docker_dev.yml - .github/workflows/build_and_push_all_images.yml - - .github/workflows/build_and_push_to_registry.yml - .github/workflows/build_e2xgrader_images.yml - .github/workflows/build_image.yml - images/** diff --git a/.github/workflows/docker_main.yml b/.github/workflows/docker_main.yml index ca29cc6..3d0a924 100644 --- a/.github/workflows/docker_main.yml +++ b/.github/workflows/docker_main.yml @@ -5,8 +5,8 @@ on: branches: - master paths: + - .github/workflows/docker_main.yml - .github/workflows/build_and_push_all_images.yml - - .github/workflows/build_and_push_to_registry.yml - .github/workflows/build_e2xgrader_images.yml - .github/workflows/build_image.yml - images/** From 8e6ddc73b555524bac47f3a8048a6ce7cd3bb6f4 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:46:28 +0200 Subject: [PATCH 43/51] Remove outdated Makefile --- Makefile | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 4df3d9e..0000000 --- a/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -ifeq ($(CONTAINER_REG_OWNER),) -$(info ERROR! container regisrty and owner is not set) -$(info example for docker hub registry/owner) -$(info CONTAINER_REG_OWNER=registry.hub.docker.com/digiklausur) -$(error CONTAINER_REG_OWNER is not set) -endif - -ifeq ($(IMAGE),) -$(info ERROR!) -$(info Specify image, e.g. notebook, minimal-notebook) -$(error IMAGE is not set) -endif - -ifeq ($(VERSION),) -$(info VERSION is not set) -VERSION=$(shell git rev-parse --short HEAD) -$(info using verison --> $(VERSION)) -else -$(info using version --> $(VERSION)) -endif - -build: - docker build -t $(CONTAINER_REG_OWNER)/$(IMAGE):$(VERSION) $(IMAGE) - -push: - docker push $(CONTAINER_REG_OWNER)/$(IMAGE):$(VERSION) $(IMAGE) - From 64be97530636d3837048517ea8896b84afd04e74 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:46:38 +0200 Subject: [PATCH 44/51] Remove old notebook --- notebook/Dockerfile | 35 ----------------------------- notebook/README.md | 4 ---- notebook/configs/nbgrader_config.py | 5 ----- notebook/requirements.txt | 9 -------- 4 files changed, 53 deletions(-) delete mode 100644 notebook/Dockerfile delete mode 100644 notebook/README.md delete mode 100644 notebook/configs/nbgrader_config.py delete mode 100644 notebook/requirements.txt diff --git a/notebook/Dockerfile b/notebook/Dockerfile deleted file mode 100644 index 72c335b..0000000 --- a/notebook/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/datascience-notebook:latest -FROM $IMAGE_SOURCE - -LABEL maintainer="e2x project H-BRS " - -ARG E2XGRADER=e2xgrader - -USER root -# Copy nbgrader base config -COPY configs/nbgrader_config.py /etc/jupyter/nbgrader_config.py -RUN chown root:$NB_GID /etc/jupyter/nbgrader_config.py &&\ - chmod g+rwX /etc/jupyter/nbgrader_config.py - -USER $NB_USER - -# Install grading requirements -COPY requirements.txt /tmp/requirements.txt -RUN pip install --no-cache-dir -r /tmp/requirements.txt && \ - pip install --no-cache-dir $E2XGRADER - -# Set up kernels -RUN touch /etc/ipython/ipython_config.py && \ - python -m exam_kernel.install --sys-prefix && \ - python -m java_syntax_kernel.install --sys-prefix - -# Activate student mode by default -RUN e2xgrader activate student --sys-prefix - -# Jupyter extension list -RUN jupyter nbextension list - -USER root -RUN rm /tmp/requirements.txt - -USER $NB_USER diff --git a/notebook/README.md b/notebook/README.md deleted file mode 100644 index 4a962c8..0000000 --- a/notebook/README.md +++ /dev/null @@ -1,4 +0,0 @@ -[![docker pulls](https://img.shields.io/docker/pulls/digiklausur/notebook.svg)](https://hub.docker.com/r/digiklausur/notebook) -[![image metadata](https://images.microbadger.com/badges/image/digiklausur/notebook.svg)](https://microbadger.com/images/digiklausur/notebook "digiklausur/notebook image metadata") - -### Jupyter Notebook image for e-assessment diff --git a/notebook/configs/nbgrader_config.py b/notebook/configs/nbgrader_config.py deleted file mode 100644 index 733be1d..0000000 --- a/notebook/configs/nbgrader_config.py +++ /dev/null @@ -1,5 +0,0 @@ -from e2xgrader.config import configure_base, configure_exchange - -c = get_config() # noqa: F821 -configure_base(c) -configure_exchange(c) diff --git a/notebook/requirements.txt b/notebook/requirements.txt deleted file mode 100644 index 3c62bdf..0000000 --- a/notebook/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -exam_kernel -e2xgradingtools>=0.0.4 -ngshare_exchange>=0.5.2 -assignmenttest @ git+https://github.com/Digiklausur/assignmenttest@master -e2xtest @ git+https://github.com/DigiKlausur/e2xtest@main -pdf_feedback_exporter @ git+https://github.com/DigiKlausur/pdf_feedback_exporter@main -java_syntax_kernel @ git+https://github.com/DigiKlausur/java_syntax_kernel@main -nbgitpuller -nbresuse From 83e563af6dbd5fcb3531740ad068e5371026d5d3 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:46:46 +0200 Subject: [PATCH 45/51] Remove ngshare --- images/e2xgrader-notebook/common_requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/e2xgrader-notebook/common_requirements.txt b/images/e2xgrader-notebook/common_requirements.txt index 6305fe4..1e61f93 100644 --- a/images/e2xgrader-notebook/common_requirements.txt +++ b/images/e2xgrader-notebook/common_requirements.txt @@ -2,5 +2,4 @@ assignmenttest @ git+https://github.com/Digiklausur/assignmenttest@master e2xgradingtools e2xtest @ git+https://github.com/DigiKlausur/e2xtest@main exam_kernel -java_syntax_kernel @ git+https://github.com/DigiKlausur/java_syntax_kernel@main -ngshare_exchange>=0.5.2 \ No newline at end of file +java_syntax_kernel @ git+https://github.com/DigiKlausur/java_syntax_kernel@main \ No newline at end of file From 270c3abe4e53f9283095ddf2ed4bbb06af2d7ce0 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:47:45 +0200 Subject: [PATCH 46/51] Remove nltk --- images/datascience-notebook/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/images/datascience-notebook/requirements.txt b/images/datascience-notebook/requirements.txt index 8893b9a..6d42cf5 100644 --- a/images/datascience-notebook/requirements.txt +++ b/images/datascience-notebook/requirements.txt @@ -8,7 +8,6 @@ ipysheet ipywidgets itables matplotlib==3.7.2 -nltk==3.8 nbconvert>=7.16.3 numpy nx From f985433b2b6a3c7c9fa3348f8a7aebcfa328d427 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:54:08 +0200 Subject: [PATCH 47/51] Update packages --- images/datascience-notebook/requirements.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/images/datascience-notebook/requirements.txt b/images/datascience-notebook/requirements.txt index 6d42cf5..ee36c81 100644 --- a/images/datascience-notebook/requirements.txt +++ b/images/datascience-notebook/requirements.txt @@ -1,19 +1,19 @@ bokeh colorama -easydict==1.9 +easydict==1.13 graphviz -imageio==2.31.1 +imageio==2.34.0 ipycanvas ipysheet ipywidgets itables -matplotlib==3.7.2 +matplotlib==3.8.3 nbconvert>=7.16.3 numpy nx -pandas==2.0.3 +pandas==2.2.1 pdfkit -Pillow==10.0.0 +Pillow==10.3.0 pyagrum pydantic pydantic_yaml @@ -22,10 +22,10 @@ pyparsing>=3.0.0 pypdf2 python-sat[aiger,approxmc,pblib] pyyaml -scikit-image==0.21.0 -scikit-learn==1.3.0 -scipy==1.11.2 -seaborn==0.12.2 -statsmodels==0.14.0 +scikit-image==0.22.0 +scikit-learn==1.3.2 +scipy==1.13.0 +seaborn==0.13.2 +statsmodels==0.14.1 sympy==1.12 xlrd From b987ef8b3fc0b8a3b793578885873caebc67af02 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:57:10 +0200 Subject: [PATCH 48/51] Update packages --- images/ml-notebook/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/ml-notebook/requirements.txt b/images/ml-notebook/requirements.txt index 7694a9a..8787e5d 100644 --- a/images/ml-notebook/requirements.txt +++ b/images/ml-notebook/requirements.txt @@ -1,3 +1,3 @@ gymnasium==0.29.1 -opencv-contrib-python==4.8.0.76 +opencv-contrib-python==4.9.0.80 stable-baselines3 \ No newline at end of file From 6feb1e80f62a73308902e7bf3788bbbd7205be63 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 14:57:29 +0200 Subject: [PATCH 49/51] Update packages --- images/nlp-notebook/requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/images/nlp-notebook/requirements.txt b/images/nlp-notebook/requirements.txt index 073c56b..8b858cc 100644 --- a/images/nlp-notebook/requirements.txt +++ b/images/nlp-notebook/requirements.txt @@ -1,8 +1,8 @@ -spacy -gensim +spacy==3.7.4 +gensim==4.3.2 wikipedia -nltk -transformers +nltk==3.8.1 +transformers==4.39.3 tokenizers huggingface_hub wordcloud \ No newline at end of file From d6f774f453fcdd6852a7c7fae87d6efd93855a37 Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 15:12:56 +0200 Subject: [PATCH 50/51] Make job names more descriptive --- .github/workflows/build_and_push_to_registry.yml | 2 ++ .github/workflows/build_image.yml | 1 + .github/workflows/docker_dev.yml | 2 ++ .github/workflows/docker_main.yml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/.github/workflows/build_and_push_to_registry.yml b/.github/workflows/build_and_push_to_registry.yml index ff7e17e..7108b24 100644 --- a/.github/workflows/build_and_push_to_registry.yml +++ b/.github/workflows/build_and_push_to_registry.yml @@ -14,6 +14,7 @@ on: jobs: build_and_push_to_ghcr: + name: ghcr.io uses: ./.github/workflows/build_and_push_all_images.yml with: force_build: false @@ -24,6 +25,7 @@ jobs: secrets: inherit build_and_push_to_quay: + name: quay.io uses: ./.github/workflows/build_and_push_all_images.yml with: force_build: false diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 19d3592..7c0c8b0 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -50,6 +50,7 @@ on: jobs: build_and_push_image: + name: Build ${{ inputs.image_name }}:${{ inputs.image_tag }} from ${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} runs-on: ubuntu-latest steps: - name: Checkout Repo diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index efe3420..17552f5 100644 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -14,6 +14,7 @@ on: jobs: build_and_push_to_ghcr: + name: ghcr.io uses: ./.github/workflows/build_and_push_all_images.yml with: force_build: false @@ -24,6 +25,7 @@ jobs: secrets: inherit build_and_push_to_quay: + name: quay.io uses: ./.github/workflows/build_and_push_all_images.yml with: force_build: false diff --git a/.github/workflows/docker_main.yml b/.github/workflows/docker_main.yml index 3d0a924..b205a47 100644 --- a/.github/workflows/docker_main.yml +++ b/.github/workflows/docker_main.yml @@ -14,6 +14,7 @@ on: jobs: build_and_push_to_ghcr: + name: ghcr.io uses: ./.github/workflows/build_and_push_all_images.yml with: force_build: false @@ -24,6 +25,7 @@ jobs: secrets: inherit build_and_push_to_quay: + name: quay.io uses: ./.github/workflows/build_and_push_all_images.yml with: force_build: false From 276dbd7581532dfc97a2b7fbf20b27541fa9f30f Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 3 Apr 2024 15:34:26 +0200 Subject: [PATCH 51/51] Refactor workflow names --- .github/workflows/build_e2xgrader_images.yml | 1 + .github/workflows/build_image.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_e2xgrader_images.yml b/.github/workflows/build_e2xgrader_images.yml index 6737261..115bf11 100644 --- a/.github/workflows/build_e2xgrader_images.yml +++ b/.github/workflows/build_e2xgrader_images.yml @@ -61,6 +61,7 @@ on: jobs: build: + name: ${{ inputs.image_name }}:${{ inputs.image_tag }} (${{ matrix.e2xgrader_mode }}) strategy: matrix: e2xgrader_mode: [student, student_exam, teacher] diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 7c0c8b0..f769ec8 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -50,7 +50,7 @@ on: jobs: build_and_push_image: - name: Build ${{ inputs.image_name }}:${{ inputs.image_tag }} from ${{ inputs.base_image_name }}:${{ inputs.base_image_tag }} + name: ${{ inputs.image_name }}:${{ inputs.image_tag }} runs-on: ubuntu-latest steps: - name: Checkout Repo