Skip to content

Commit 0d0a4ff

Browse files
committed
feat: support the openedx/codejail-service implementation
1 parent ab1b57a commit 0d0a4ff

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

README.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
Codejail plugin for `Tutor`_
22
============================
33

4-
Tutor plugin that configures and runs a `Codejail Service`_ using a REST API. `Codejail`_ allows for the
5-
secure execution of untrusted code within sandboxes, providing a safe environment for running potentially dangerous code.
4+
Tutor plugin that configures and runs a `Codejail Service`_ using a REST API.
5+
`Codejail`_ allows for the secure execution of untrusted code within sandboxes,
6+
providing a safe environment for running potentially dangerous code.
7+
8+
Starting from the Ulmo release, the codejail plugin is transitioning to an
9+
alternative implementation of the safe-exec API ( `_Codejail Service V2`_).
10+
You can opt-in to use this new implementation on Ulmo before it finally becomes
11+
the default on the Verawood release.
612

713
.. _Tutor: https://docs.tutor.overhang.io
814
.. _Codejail Service: https://github.com/eduNEXT/codejailservice
@@ -69,7 +75,13 @@ To customize the configuration, update the following settings in Tutor:
6975
- ``SERVICE_V2_VERSION``: (default: ``{{ OPENEDX_COMMON_VERSION }}``)
7076
- ``USE_SERVICE_V2``: (default: ``False``)
7177

72-
The ``CODEJAIL_V2_*`` settings are meant to be used only during the Ulmo release a
78+
The ``CODEJAIL_V2_*`` settings are meant to be used only during the Ulmo
79+
release and will be phased-out during the Verawood release.
80+
81+
To opt-in to the new implementation of the code-exec API set ``USE_SERVICE_V2``
82+
to ``True`` and re-deploy your environment. If you are using a a custom image
83+
for the codejail service you will need to rebuild it with ``USE_SERVICE_V2``
84+
set to ``True`.
7385
7486
Custom Image
7587
~~~~~~~~~~~~

tutorcodejail/patches/local-docker-compose-services

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ codejail-apparmor-loader:
3838
- -v=2
3939
- /profiles
4040
volumes:
41-
- ../plugins/codejail/apps/profiles/docker-edx-sandbox:/profiles/docker-edx-sandbox:ro
41+
- ../plugins/codejail/apps/profiles/:/profiles/:ro
4242
- /sys:/sys
4343
- /etc/apparmor.d:/etc/apparmor.d

tutorcodejail/templates/codejail/build/codejail-service/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ FROM scratch AS sandbox-dependencies
77
# Where to get the Python dependencies lockfile for installing
88
# packages into the sandbox environment. Defaults to the codejail
99
# dependencies in edx-platform.
10-
ARG SANDBOX_DEPS_REPO=openedx/edx-platform
10+
ARG SANDBOX_DEPS_REPO={{ EDX_PLATFORM_REPOSITORY }}
1111
ARG SANDBOX_DEPS_VERSION={{ CODEJAIL_SERVICE_V2_VERSION }}
1212
# Path to the lockfile in the deps repo, as dir + filename.
1313
#
1414
# The path base.txt will get the latest dependencies, but this needs
1515
# to be coordinated with SANDBOX_PY_VER as each release has a
1616
# different Python support window.
1717
ARG SANDBOX_DEPS_SRC_DIR=requirements/edx-sandbox
18-
ADD https://github.com/${SANDBOX_DEPS_REPO}.git#${SANDBOX_DEPS_VERSION}:${SANDBOX_DEPS_SRC_DIR} /
18+
ADD ${SANDBOX_DEPS_REPO}#${SANDBOX_DEPS_VERSION}:${SANDBOX_DEPS_SRC_DIR} /
1919

2020
FROM docker.io/ubuntu:24.04 AS app
2121
ARG APP_PY_VER=3.12

0 commit comments

Comments
 (0)