@@ -7,17 +7,6 @@ This plugin configures and runs a remote CodeJail Service instance that
77implements the safe-exec API used by the Open edX platform to offer more
88advanced capabilities to course authors.
99
10- Starting from the Ulmo release, the codejail plugin is transitioning to an
11- alternative implementation of the safe-exec API (
12- [ Codejail Service V2] ( https://github.com/openedx/codejail-service ) ). You can
13- opt-in to use this new implementation on Ulmo before it finally becomes the
14- default on the Verawood release.
15-
16- > [ !NOTE]
17- > The new CodeJail Service implementation is based on Django instead of Flask,
18- > therefore settings changed with the ` codejail-*-settings ` patches must be
19- > adjusted accordingly.
20-
2110## Installation
2211
2312To install the latest version, run:
@@ -47,38 +36,35 @@ aa-enabled
4736To customize the configuration, update the following settings in Tutor:
4837
4938- ` CODEJAIL_APPARMOR_DOCKER_IMAGE ` : (default: ` docker.io/ednxops/codejail_apparmor_loader:latest ` )
50- - ` CODEJAIL_DOCKER_IMAGE_V2 ` : (default: ` {{ CODEJAIL_DOCKER_IMAGE }}-v2 ` )
5139- ` CODEJAIL_DOCKER_IMAGE ` : (default: ` docker.io/ednxops/codejailservice:{{__version__}} ` )
5240- ` CODEJAIL_ENABLE_K8S_DAEMONSET ` (default: ` False ` )
53- - ` CODEJAIL_ENFORCE_APPARMOR ` (default: ` True ` )
5441- ` CODEJAIL_EXTRA_PIP_REQUIREMENTS ` (default: ` [] ` )
55- - ` CODEJAIL_SANDBOX_PYTHON_VERSION ` (default: ` 3.11.9 ` )
56- - ` CODEJAIL_SERVICE_REPOSITORY ` (default: ` https://github.com/edunext/codejailservice .git ` \ ` )
42+ - ` CODEJAIL_SANDBOX_PYTHON_VERSION ` (default: ` 3.12 ` )
43+ - ` CODEJAIL_SERVICE_REPOSITORY ` (default: ` https://github.com/openedx/codejail-service .git ` )
5744- ` CODEJAIL_SERVICE_VERSION ` (default: ` {{ OPENEDX_COMMON_VERSION }} ` ),
58- - ` CODEJAIL_SERVICE_V2_REPOSITORY ` : (default: ` https://github.com/openedx/codejail-service.git ` )
59- - ` CODEJAIL_SERVICE_V2_VERSION ` : (default: ` {{ OPENEDX_COMMON_VERSION }} ` )
60- - ` CODEJAIL_USE_SERVICE_V2 ` : (default: ` False ` )
61-
62- The ` CODEJAIL_*_SERVICE_V2 ` settings are meant to be used only during the Ulmo
63- release and will be phased-out during the Verawood release.
64-
65- To opt-in to the new implementation of the code-exec API set
66- ` CODEJAIL_USE_SERVICE_V2 ` to ` True ` and re-deploy your environment. If you are
67- using a a custom image for the codejail service you will need to rebuild
68- it with ` CODEJAIL_USE_SERVICE_V2 ` set to ` True ` .
6945
7046### Custom Image
7147
7248In most cases, you can work with the provided Docker image for the
73- release. You will need to build a custom image if you either:
74-
75- - Need additional packages installed in the sandbox environment. Use the setting
76- ` CODEJAIL_EXTRA_PIP_REQUIREMENTS ` to define the list of additional packages.
77- - Need to run the sandbox environment under a different Python version. The
78- default Python version of the sandbox might get updated between releases,
79- potentially breaking instructor generated code. You can set
80- ` CODEJAIL_SANDBOX_PYTHON_VERSION ` to an older version to avoid disruption
81- while figuring out a migration plan.
49+ release. However, there might be cases when a custom image will be necessary:
50+
51+ - If you need additional packages installed in the sandbox environment. Use the
52+ setting ` CODEJAIL_EXTRA_PIP_REQUIREMENTS ` to define the list of additional
53+ packages.
54+ - If you need to run the sandbox environment under a different Python version
55+ you can use ` CODEJAIL_SANDBOX_PYTHON_VERSION ` . This is particularly useful
56+ when the sandbox version is upgraded between releases but you need to figure
57+ out a migration plan for instructor code.
58+ - If you need a completely different set of packages in the sandbox virtual
59+ environment. In this case you will need to point to a requirements file using
60+ the following docker build arguments: ` SANDBOX_DEPS_REPO ` ,
61+ ` SANDBOX_DEPS_VERSION ` , ` SANDBOX_DEPS_SRC_DIR ` and ` SANDBOX_DEPS_SRC_FILE ` .
62+ Their current default values are
63+ ` https://github.com/openedx/codejail-service.git ` , `{{ OPENEDX_COMMON_VERSION
64+ }}` , ` requirements/sandbox` and ` base.txt`. This will point to
65+ https://github.com/openedx/codejail-service/blob/release/verawood.1/requirements/base.txt
66+ for the Verawood release. You can provide the arguments to Tutor as follows
67+ ` tutor images build codejail -a SANDBOX_DEPS_VERSION=ulmo2 ` .
8268
8369## Kubernetes Support
8470
@@ -94,10 +80,6 @@ and has successfully loaded the profile.
9480You can enable a helper Daemon Set that will load the profile onto all the nodes
9581by setting ` CODEJAIL_ENABLE_K8S_DAEMONSET ` to true.
9682
97- If you choose to run the service without enforcing the AppArmor profile
98- (absolutely discouraged, and not possible on the newer implementation of
99- codejail-service), you can set ` CODEJAIL_ENFORCE_APPARMOR ` to ` False ` .
100-
10183More info about this discussion can be found on [ this
10284issue] ( https://github.com/eduNEXT/tutor-contrib-codejail/issues/24 ) .
10385
@@ -117,8 +99,24 @@ width="725px"}
11799In this case, the section\' s content will render correctly and work as
118100specified in the instructions of the problem.
119101
102+ ## New CodeJail Service implementation
103+
104+ The Ulmo release introduced support for deploying a new
105+ implementation of the remote CodeJail service (openedx/codejail-service). The
106+ Verawood release completely removes support for deploying the old version of the
107+ service (edunext/codejailservice). Users should be mindful of the following
108+ points when upgrading:
109+
110+ 1 . The new CodeJail service ** requires** AppArmor 4 on the host machine.
111+ AppArmor 4 is available on relatively new Debian based distributions (ubuntu
112+ 24.04, Debian Trixie, etc).
113+ 2 . AppArmor enforcement is no longer optional. The new CodeJail service performs
114+ startup checks to ensure the sandbox is properly isolated and will not start
115+ if the AppArmor profile is not loaded and configured.
116+ 3 . The new CodeJail service implementation is based on Django instead of Flask.
117+ Any usage of the ` codejail-*-settings ` must be adjusted accordingly.
118+
120119## License
121120
122121This software is licensed under the terms of the AGPLv3. See the LICENSE
123122file for details.
124-
0 commit comments