From c7abf5e171568f383d13d3c89e6d77905edfebd4 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Tue, 21 Jan 2025 19:08:16 +0000 Subject: [PATCH] feat: Add codejail service The image specified here is not yet available, but should be the right name for after merges. I've tested with a local tag. This is part of https://github.com/edx/edx-arch-experiments/issues/894 --- docker-compose-host.yml | 5 +++++ docker-compose.yml | 11 +++++++++++ docs/service_list.rst | 3 +++ options.mk | 2 +- py_configuration_files/codejail.py | 3 +++ repo.sh | 2 ++ 6 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 py_configuration_files/codejail.py diff --git a/docker-compose-host.yml b/docker-compose-host.yml index 7690fc5a..b3635d32 100644 --- a/docker-compose-host.yml +++ b/docker-compose-host.yml @@ -61,6 +61,11 @@ services: cms-worker: volumes: - ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform + codejail: + volumes: + - ${DEVSTACK_WORKSPACE}/codejail-service:/app + - ${DEVSTACK_WORKSPACE}/src:/edx/src + - ${PWD}/py_configuration_files/codejail.py:/app/codejail_service/settings/devstack.py insights: volumes: - ${DEVSTACK_WORKSPACE}/edx-analytics-dashboard:/edx/app/insights/insights diff --git a/docker-compose.yml b/docker-compose.yml index a155675a..e1418805 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -657,6 +657,17 @@ services: # Dangerous to run Celery as root normally, but it's how we do things in devstack for some reason C_FORCE_ROOT: "true" + codejail: + container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.codejail" + hostname: codejail.devstack.edx + stdin_open: true + tty: true + image: edxops/codejail-dev:latest + environment: + DJANGO_SETTINGS_MODULE: codejail_service.settings.devstack + ports: + - "18030:8080" + xqueue: container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.xqueue" image: edxops/xqueue-dev:latest diff --git a/docs/service_list.rst b/docs/service_list.rst index 93046575..fa70a75b 100644 --- a/docs/service_list.rst +++ b/docs/service_list.rst @@ -41,6 +41,8 @@ Instead of a service name or list, you can also run commands like ``make dev.pro +------------------------------------+-------------------------------------+----------------+--------------+ | `frontend-app-authn`_ | http://localhost:1999/ | MFE (React.js) | Default | +------------------------------------+-------------------------------------+----------------+--------------+ +| `codejail`_ | http://localhost:18030/ | Python/Django | Extra | ++------------------------------------+-------------------------------------+----------------+--------------+ | `registrar`_ | http://localhost:18734/api-docs/ | Python/Django | Extra | +------------------------------------+-------------------------------------+----------------+--------------+ | `frontend-app-program-console`_ | http://localhost:1976/ | MFE (React.js) | Extra | @@ -84,6 +86,7 @@ Some common service combinations include: .. _frontend-app-gradebook: https://github.com/openedx/frontend-app-gradebook .. _lms: https://github.com/openedx/edx-platform .. _frontend-app-program-console: https://github.com/edx/frontend-app-program-console +.. _codejail: https://github.com/openedx/codejail-service .. _registrar: https://github.com/edx/registrar .. _cms: https://github.com/openedx/edx-platform .. _frontend-app-learner-dashboard: https://github.com/openedx/frontend-app-learner-dashboard diff --git a/options.mk b/options.mk index bf3b0cd7..031a947f 100644 --- a/options.mk +++ b/options.mk @@ -67,7 +67,7 @@ credentials+discovery+ecommerce+edx_notes_api+forum+frontend-app-authn+frontend- # Separated by plus signs. # Separated by plus signs. Listed in alphabetical order for clarity. EDX_SERVICES ?= \ -analyticsapi+credentials+cms+cms-worker+cms_watcher+discovery+ecommerce+edx_notes_api+forum+frontend-app-account+frontend-app-learner-dashboard+frontend-app-learner-record+frontend-app-profile+frontend-app-authn+frontend-app-course-authoring+frontend-app-gradebook+frontend-app-ora-grading+frontend-app-learning+frontend-app-library-authoring+frontend-app-payment+frontend-app-program-console+frontend-app-publisher+insights+lms+lms-worker+lms_watcher+registrar+registrar-worker+xqueue+xqueue_consumer+enterprise-catalog+license-manager +analyticsapi+codejail+credentials+cms+cms-worker+cms_watcher+discovery+ecommerce+edx_notes_api+forum+frontend-app-account+frontend-app-learner-dashboard+frontend-app-learner-record+frontend-app-profile+frontend-app-authn+frontend-app-course-authoring+frontend-app-gradebook+frontend-app-ora-grading+frontend-app-learning+frontend-app-library-authoring+frontend-app-payment+frontend-app-program-console+frontend-app-publisher+insights+lms+lms-worker+lms_watcher+registrar+registrar-worker+xqueue+xqueue_consumer+enterprise-catalog+license-manager # Services with database migrations. # Should be a subset of $(EDX_SERVICES). diff --git a/py_configuration_files/codejail.py b/py_configuration_files/codejail.py new file mode 100644 index 00000000..7e466d1b --- /dev/null +++ b/py_configuration_files/codejail.py @@ -0,0 +1,3 @@ +"""Settings for devstack use.""" + +from codejail_service.settings.local import * # pylint: disable=wildcard-import diff --git a/repo.sh b/repo.sh index 7a31b729..638e8d6c 100755 --- a/repo.sh +++ b/repo.sh @@ -38,6 +38,7 @@ repos=( "https://github.com/edx/edx-analytics-data-api.git" "https://github.com/openedx/enterprise-catalog.git" "https://github.com/openedx/license-manager.git" + "https://github.com/openedx/codejail-service.git" ) non_release_repos=( @@ -70,6 +71,7 @@ ssh_repos=( "git@github.com:edx/edx-analytics-dashboard.git" "git@github.com:edx/edx-analytics-data-api.git" "git@github.com:openedx/license-manager.git" + "git@github.com:openedx/codejail-service.git" ) non_release_ssh_repos=(