Skip to content

Conversation

@MoisesGSalas
Copy link
Member

@MoisesGSalas MoisesGSalas commented Nov 24, 2025

This introduces support for https://github.com/openedx/codejail-service.

I decided to introduce a few variables that will only be available during the Ulmo release to ease the transition. Mainly CODEJAIL_USE_SERVICE_V2 that use the appropriate configuration for the new Django service and also build with the new dockerfile.

I took the Dockerfile from https://github.com/edx/public-dockerfiles/blob/main/dockerfiles/codejail-service.Dockerfile with some minor adjustements:

  1. I moved around the cloning of the code and the sandbox dependencies to a scratch layer in order to break less layers of cache.
  2. I used the jinja variables for some of the default values for the build arguments. Most of the time they will be enough, if needed you can further customize your build by adding the build arguments to the tutor command (e.g. tutor images build codejail -a SANDBOX_DEPS_SRC_FILE=release/quince.txt)
  3. I modified the useradd command to include --no-log-init to avoid creating extremely large images (see: Fix: Large DEV Image overhangio/tutor#918).
  4. I took the the apparmor profile in https://github.com/edx/public-dockerfiles/blob/main/apparmor/openedx_codejail_service.profile as is. The implication here is that the new service will only work on hosts with ubuntu 24.04 or later.

I tested this both on docker and kubernetes. Both hosts where using Ubuntu 24.04. I did two tests: I imported https://github.com/mitodl/mitx-grading-library/tree/master/course and check that a few units where working correctly. I also ran the tests in https://github.com/openedx/codejail-service/tree/main/api_tests and all of them passed.

@MoisesGSalas MoisesGSalas force-pushed the mgs/new-codejail-service branch from f47727f to a583455 Compare November 24, 2025 15:39
@MoisesGSalas MoisesGSalas force-pushed the ulmo branch 2 times, most recently from ff89a9c to 3804755 Compare November 25, 2025 15:55
@MoisesGSalas MoisesGSalas force-pushed the mgs/new-codejail-service branch from a583455 to 5d95d35 Compare November 25, 2025 18:04
@MoisesGSalas MoisesGSalas force-pushed the mgs/new-codejail-service branch 2 times, most recently from 38a1ccf to cdf49a4 Compare November 25, 2025 19:38
@MoisesGSalas MoisesGSalas force-pushed the mgs/new-codejail-service branch from cdf49a4 to ab1b57a Compare November 25, 2025 19:50
@MoisesGSalas MoisesGSalas marked this pull request as ready for review November 26, 2025 16:20
@MoisesGSalas
Copy link
Member Author

Hey @feanil, this are the changes that I made in order to support the new codejail-service made by 2U. I would say that the only thing to keep in mind would be forcing operators to run ubuntu 24.04, and also the 2U service is more strict regarding the AppArmor configuration, and won't even start if not properly secured.

FYI @timmc-edx

@timmc-edx
Copy link

Other compat notes: The 2U version also removes the unsafely option, and restricts the python_path and extra_files to take only a single optional file called python_lib.zip rather than arbitrary values/files.

@MoisesGSalas MoisesGSalas force-pushed the mgs/new-codejail-service branch from 8df5e58 to 0d0a4ff Compare December 2, 2025 22:03
@MoisesGSalas MoisesGSalas merged commit 8fe0898 into ulmo Dec 8, 2025
0 of 4 checks passed
@MoisesGSalas
Copy link
Member Author

I merged this into the Ulmo branch.

I asked on the BTR slack channel for this changes and the CODEJAIL_USE_SERVICE_V2 setting to be enabled on the Ulmo sandbox and everything ran correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants