From 0d91fa1f1b8b80535e00ab4b0c02998853782d20 Mon Sep 17 00:00:00 2001 From: Elmar Kresse Date: Thu, 19 Sep 2024 10:39:47 +0200 Subject: [PATCH] Add CodeOcean Docker Images documentation --- content/codeocean-dockerimages.asciidoc | 63 +++++++++++++++++++++++++ main.asciidoc | 4 ++ 2 files changed, 67 insertions(+) create mode 100644 content/codeocean-dockerimages.asciidoc diff --git a/content/codeocean-dockerimages.asciidoc b/content/codeocean-dockerimages.asciidoc new file mode 100644 index 0000000..a0b7c4b --- /dev/null +++ b/content/codeocean-dockerimages.asciidoc @@ -0,0 +1,63 @@ +To work with codeocean and execute programming and automatic grading tasks custom docker images are used that serve file copy/paste and logging functionality customized for codeocean. +The images are built from the Dockerfiles in their example https://github.com/openHPI/dockerfiles repository. + +The following images are used by CodeOcean: +//tabelle +[cols="2,2",options="header"] +|=== +|Image | Version | +co_execenv_java | 8 | +co_execenv_julia | 1.8/1.10 | +co_execenv_node | 0.12 | +co_execenv_python | 3.4-rpi-web; 3.4; 3.7-ml; 3.8 | +co_execenv_r | 4 | +co_execenv_ruby | 2.5 | +docker_exec_phusion | | +ubuntu-base | Old ubuntu images no longer in use | +ubuntu-coffee | | +ubuntu-cpp | | +ubuntu-exec | | +ubuntu-jruby | | +ubuntu-python | | +ubuntu-sinatra | | +ubuntu-sqlite | | +|=== + +Supported images + +- docker_exec_phusion: Base image for all execution environments +- co_execenv_: An image used by CodeOcean for the specific programming language and version + +All supported images are built for the following architectures: + +- amd64 +- arm64 + +To create own images, the Dockerfiles can be used as a template. The repository contains a `Dockerfile` for each supported language and version. The Dockerfiles are based on the `docker_exec_phusion` image and install the necessary dependencies for the respective language. The Dockerfiles also contain the necessary configuration for the CodeOcean environment. + +For example the `Dockerfile` for the Java 17 image looks like this: + +[source,docker] +---- +FROM openhpi/docker_exec_phusion +MAINTAINER openHPI Team +LABEL description='This image provides a Java 17.0 environment with JUnit 5 support.' +LABEL run_command='make run' +LABEL test_command='make test CLASS_NAME="%{class_name}" FILENAME="%{filename}"' + +# Get target architecture from Docker buildx +ARG TARGETARCH + +# Install latest OpenJDK version 17.0 +RUN install_clean openjdk-17-jdk make + +# Add JUnit 5 Platform +ARG JUNIT_VERSION=1.11.0 +RUN mkdir -p /usr/java/lib +RUN curl -fsSL -O --output-dir /usr/java/lib https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/$JUNIT_VERSION/junit-platform-console-standalone-$JUNIT_VERSION.jar + +# Adjust Path variables +ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-$TARGETARCH +ENV JUNIT /usr/java/lib/junit-platform-console-standalone-$JUNIT_VERSION.jar +ENV CLASSPATH .:$JUNIT +---- \ No newline at end of file diff --git a/main.asciidoc b/main.asciidoc index 6f86063..96df02b 100644 --- a/main.asciidoc +++ b/main.asciidoc @@ -129,6 +129,10 @@ include::{includedir}/dockerization-codeocean.asciidoc[] include::{includedir}/deployment.asciidoc[] +=== CodeOcean Docker Images === + +include::{includedir}/codeocean-dockerimages.asciidoc[] + === edX Kubernetes Deployment === include::{includedir}/edX-k8s.asciidoc[]