Skip to content

Commit a10f9fd

Browse files
committed
feat!: support for verawood
1 parent c5af584 commit a10f9fd

16 files changed

Lines changed: 309 additions & 498 deletions

File tree

CHANGELOG.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ See the fragment files in the [changelog.d/ directory](./changelog.d).
1313

1414
<!-- scriv-insert-here -->
1515

16+
<a id='changelog-22.0.0'></a>
17+
## 22.0.0 — 2026-08-12
18+
19+
### Added
20+
21+
- Support for the Verawood release.
22+
23+
### Changed
24+
25+
- The default AppArmor Profile now requires AppArmor 4, which available on
26+
ubuntu 24.04 or newer.
27+
- AppArmor enforcement is now a requirement and can not be turned off.
28+
- The container name and internal services for kubernetes and docker was changed
29+
from `codejailservice` to `codejail`.
30+
31+
### Removed
32+
33+
- Support for the old remote service implementation of codejail service
34+
([codejailservice](https://github.com/edunext/codejailservice.git)] has been
35+
dropped.
36+
1637
<a id='changelog-21.0.1'></a>
1738
## 21.0.1 — 2026-05-08
1839

@@ -25,7 +46,7 @@ See the fragment files in the [changelog.d/ directory](./changelog.d).
2546
## 21.0.0 - 2025-11-04
2647

2748
- feat!: add support for the Ulmo release
28-
49+
2950
This changes also include support for openedx/codejail-service as an
3051
alternative implementation of the safe_exec REST API.
3152

@@ -44,14 +65,14 @@ See the fragment files in the [changelog.d/ directory](./changelog.d).
4465
appropriate labels.
4566

4667
- feat: use an "init service" to load the apparmor profile (#63)
47-
68+
4869
This follows the same logic as the "permissions" service used by tutor
4970
core. The `codejail-apparmor-loader` service runs the command used
5071
previously by the init job.
51-
72+
5273
It makes more sense to handling loading of the apparmor profile with an
5374
init service:
54-
75+
5576
- The profile is ephemeral, rebooting the host will require to load it
5677
again.
5778
- The profile is a dependency for the container to start. Things like
@@ -147,7 +168,7 @@ See the fragment files in the [changelog.d/ directory](./changelog.d).
147168
- Add support for Olive release (#28).
148169
- Adds mantainer group.
149170

150-
## 14.1.0 - 2022-09-26
171+
## 14.1.0 - 2022-09-26
151172

152173
### Added
153174

@@ -163,14 +184,14 @@ See the fragment files in the [changelog.d/ directory](./changelog.d).
163184

164185
- Bump version according tutor practices for Nutmeg release.
165186

166-
## 13.0.0 - 2022-05-02
187+
## 13.0.0 - 2022-05-02
167188

168189
### Added
169190

170191
- Add repo documentation.
171192
- Bump version according tutor practices for Maple release.
172193

173-
## 12.0.2 - 2022-04-29
194+
## 12.0.2 - 2022-04-29
174195

175196
### Added
176197

README.md

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ This plugin configures and runs a remote CodeJail Service instance that
77
implements the safe-exec API used by the Open edX platform to offer more
88
advanced 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

2312
To install the latest version, run:
@@ -47,38 +36,35 @@ aa-enabled
4736
To 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

7248
In 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.
9480
You can enable a helper Daemon Set that will load the profile onto all the nodes
9581
by 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-
10183
More info about this discussion can be found on [this
10284
issue](https://github.com/eduNEXT/tutor-contrib-codejail/issues/24).
10385

@@ -117,8 +99,24 @@ width="725px"}
11799
In this case, the section\'s content will render correctly and work as
118100
specified 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

122121
This software is licensed under the terms of the AGPLv3. See the LICENSE
123122
file for details.
124-

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "tutor-contrib-codejail"
3-
version = "21.0.1"
3+
version = "22.0.0"
44
description = "Codejail plugin for Tutor"
55
readme = "README.md"
66
license-files = ["LICENSE"]
@@ -9,7 +9,7 @@ authors = [
99
]
1010
requires-python = ">=3.10"
1111
dependencies = [
12-
"tutor~=21.0"
12+
"tutor~=22.0"
1313
]
1414
classifiers = [
1515
"Development Status :: 3 - Alpha",

tutorcodejail/patches/cms-env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ENABLE_CODEJAIL_REST_SERVICE: true
2-
CODE_JAIL_REST_SERVICE_HOST: "http://{{ CODEJAIL_HOST }}:8550"
2+
CODE_JAIL_REST_SERVICE_HOST: "http://codejail:8000"
33
CODE_JAIL_REST_SERVICE_CONNECT_TIMEOUT: 0.5
44
CODE_JAIL_REST_SERVICE_READ_TIMEOUT: 3.5

tutorcodejail/patches/k8s-deployments

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
---
2-
{% if CODEJAIL_USE_SERVICE_V2 %}
32
apiVersion: apps/v1
43
kind: Deployment
54
metadata:
6-
name: codejailservice
5+
name: codejail
76
labels:
8-
app.kubernetes.io/name: codejailservice
7+
app.kubernetes.io/name: codejail
98
spec:
109
selector:
1110
matchLabels:
12-
app.kubernetes.io/name: codejailservice
11+
app.kubernetes.io/name: codejail
1312
template:
1413
metadata:
1514
labels:
16-
app.kubernetes.io/name: codejailservice
15+
app.kubernetes.io/name: codejail
1716
spec:
1817
securityContext:
1918
appArmorProfile:
2019
type: Localhost
2120
localhostProfile: openedx_codejail_service
2221
containers:
23-
- name: codejailservice
24-
image: {{ CODEJAIL_DOCKER_IMAGE_V2 }}
22+
- name: codejail
23+
image: {{ CODEJAIL_DOCKER_IMAGE }}
2524
ports:
2625
- containerPort: 8550
2726
env:
@@ -35,45 +34,6 @@ spec:
3534
- name: settings-codejail
3635
configMap:
3736
name: settings-codejail
38-
{% else %}
39-
apiVersion: apps/v1
40-
kind: Deployment
41-
metadata:
42-
name: codejailservice
43-
labels:
44-
app.kubernetes.io/name: codejailservice
45-
spec:
46-
selector:
47-
matchLabels:
48-
app.kubernetes.io/name: codejailservice
49-
template:
50-
metadata:
51-
labels:
52-
app.kubernetes.io/name: codejailservice
53-
spec:
54-
{% if CODEJAIL_ENFORCE_APPARMOR %}
55-
securityContext:
56-
appArmorProfile:
57-
type: Localhost
58-
localhostProfile: docker-edx-sandbox
59-
{% endif %}
60-
containers:
61-
- name: codejailservice
62-
image: {{ CODEJAIL_DOCKER_IMAGE }}
63-
ports:
64-
- containerPort: 8550
65-
env:
66-
- name: FLASK_APP_SETTINGS
67-
value: codejailservice.tutor.ProductionConfig
68-
volumeMounts:
69-
- mountPath: /openedx/codejailservice/codejailservice/tutor.py
70-
name: settings-codejail
71-
subPath: tutor.py
72-
volumes:
73-
- name: settings-codejail
74-
configMap:
75-
name: settings-codejail
76-
{% endif %}
7737
{% if CODEJAIL_ENABLE_K8S_DAEMONSET %}
7838
---
7939
apiVersion: apps/v1

tutorcodejail/patches/k8s-services

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
apiVersion: v1
33
kind: Service
44
metadata:
5-
name: codejailservice
5+
name: codejail
66
labels:
7-
app.kubernetes.io/name: codejailservice
7+
app.kubernetes.io/name: codejail
88
spec:
99
type: ClusterIP
1010
ports:
11-
- port: 8550
11+
- port: 8000
1212
protocol: TCP
13+
name: http
1314
selector:
14-
app.kubernetes.io/name: codejailservice
15+
app.kubernetes.io/name: codejail
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
- name: codejail-profile
22
files:
3-
- plugins/codejail/apps/profiles/docker-edx-sandbox.profile
43
- plugins/codejail/apps/profiles/openedx-codejail-service.profile
54
options:
65
labels:
76
app.kubernetes.io/name: codejail-aa-loader
8-
- name: settings-codejail
7+
- name: codejail-settings
98
files:
10-
{% if CODEJAIL_USE_SERVICE_V2 %}
11-
- plugins/codejail/apps/codejail-service-v2/tutor.py
12-
{% else %}
139
- plugins/codejail/apps/codejail/tutor.py
14-
{% endif %}
1510
options:
1611
labels:
17-
app.kubernetes.io/name: codejailservice
12+
app.kubernetes.io/name: codejail

tutorcodejail/patches/lms-env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ENABLE_CODEJAIL_REST_SERVICE: true
2-
CODE_JAIL_REST_SERVICE_HOST: "http://{{ CODEJAIL_HOST }}:8550"
2+
CODE_JAIL_REST_SERVICE_HOST: "http://codejail:8000"
33
CODE_JAIL_REST_SERVICE_CONNECT_TIMEOUT: 0.5
44
CODE_JAIL_REST_SERVICE_READ_TIMEOUT: 3.5
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
codejailservice:
2-
command: flask run --host 0.0.0.0 --port 8550
3-
environment:
4-
FLASK_ENV: development
5-
FLASK_APP_SETTINGS: codejailservice.tutor.DevelopmentConfig
6-
ports:
7-
- "8550:8550"
8-
restart: unless-stopped

tutorcodejail/patches/local-docker-compose-services

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,16 @@
11
#############Codejail service
2-
{% if CODEJAIL_USE_SERVICE_V2 %}
3-
codejailservice:
4-
image: {{ CODEJAIL_DOCKER_IMAGE_V2 }}
5-
ports:
6-
- 8550:8550
2+
codejail:
3+
image: {{ CODEJAIL_DOCKER_IMAGE }}
74
environment:
85
DJANGO_SETTINGS_MODULE: codejail_service.settings.tutor
96
security_opt:
107
- apparmor:openedx_codejail_service
118
volumes:
12-
- ../plugins/codejail/apps/codejail-service-v2/tutor.py:/app/codejail_service/settings/tutor.py:ro
13-
restart: unless-stopped
14-
depends_on:
15-
codejail-apparmor-loader:
16-
condition: service_completed_successfully
17-
{% else %}
18-
codejailservice:
19-
image: {{ CODEJAIL_DOCKER_IMAGE }}
20-
environment:
21-
FLASK_APP_SETTINGS: codejailservice.tutor.ProductionConfig
22-
{% if CODEJAIL_ENFORCE_APPARMOR %}
23-
security_opt:
24-
- apparmor:docker-edx-sandbox
25-
{% endif %}
26-
volumes:
27-
- ../plugins/codejail/apps/codejail/tutor.py:/openedx/codejailservice/codejailservice/tutor.py:ro
9+
- ../plugins/codejail/apps/codejail/tutor.py:/app/codejail_service/settings/tutor.py:ro
2810
restart: unless-stopped
2911
depends_on:
3012
codejail-apparmor-loader:
3113
condition: service_completed_successfully
32-
{% endif %}
3314

3415
codejail-apparmor-loader:
3516
image: {{ CODEJAIL_APPARMOR_DOCKER_IMAGE }}

0 commit comments

Comments
 (0)