Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move codejail to its own new service #31517

Open
1 of 6 tasks
jmbowman opened this issue Jan 10, 2023 · 6 comments
Open
1 of 6 tasks

Move codejail to its own new service #31517

jmbowman opened this issue Jan 10, 2023 · 6 comments
Labels
epic Large unit of work, consisting of multiple tasks

Comments

@jmbowman
Copy link
Contributor

jmbowman commented Jan 10, 2023

A/C:

  • Capa problems no longer execute user-provided Python code on LMS and CMS web servers, but on separate service
  • Codejail is removed from edxapp (code and requirements)
  • edx-platform requirements structure is simplified to match other services: requirements/edx-sandbox/ is removed, and contents of requirements/edx/ are lifted to requirements/

Currently the underlying implementation of the codejail for restricted execution of untrusted code lives in its own repository at https://github.com/openedx/codejail, but the configuration for actually running it as a service lives here in edx-platform. This means that the core LMS repository and its Docker images are burdened with the complexities of AppArmor and an assortment of scientific computing package dependencies not used elsewhere in the LMS or Studio. To simplify these core services (especially for production environments and development tasks that don't even need a codejail environment), we'd like to try moving this functionality from edx-platform to a new IDA (name to be determined). Before diving into implementation, please consult with at least @nedbat (who wrote most of the codejail package), @ormsbee from tCRIL (who may have the best grasp on how this feature is currently used across installations), and 2U SRE (who understand operational considerations) to help enumerate requirements to inform the design.

Plan

Preview Give feedback
@jmbowman
Copy link
Contributor Author

eduNEXT already did something that is essentially this: https://github.com/eduNEXT/codejailservice . Maybe we can use it as is? We should evaluate that and figure out if we can use it or at least learn from it.

@adzuci
Copy link
Contributor

adzuci commented Jan 17, 2023

I have a fair bit of context on this & would like to support this work if I can.

@jristau1984
Copy link
Contributor

I have created a T&L internal Jira ticket for this issue: https://2u-internal.atlassian.net/browse/TNL-10373

@ormsbee
Copy link
Contributor

ormsbee commented May 8, 2023

FWIW, I would love to see anything that moves some of those big dependencies (SciPy/NumPy) out of edx-platform. We do use numpy in a few other places in platform (grades, course quality rating, capa complex numbers, etc), but I think that we could use the stdlib equivalents for these without too much hassle. I think that people mostly used numpy because it was already there.

@timmc-edx
Copy link
Contributor

It wouldn't be hard to remove the remaining non-capa direct dependencies on numpy and scipy, but there are transitive dependencies on them via chem and openedx-calc.

@rgraber rgraber moved this to Prioritized in Arch-BOM Nov 20, 2023
@robrap robrap added the epic Large unit of work, consisting of multiple tasks label Nov 21, 2023
@jmbowman jmbowman moved this from Backlog to 2023 Q4 in Platform-Core Roadmap Nov 28, 2023
@timmc-edx
Copy link
Contributor

In #33753 I established that yes, we would be able to containerize LMS and CMS with codejail still in edxapp, if we wanted to. (Briefly, if we attach an apparmor profile to the container, that profile can have a subprofile for codejail confinement.) This doesn't change the desire to pull codejail out into a separate service, but it may change the urgency/timeline for deployers.

@jristau1984 jristau1984 moved this from Prioritized to Backlog in Arch-BOM Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Large unit of work, consisting of multiple tasks
Projects
None yet
Development

No branches or pull requests

6 participants