Skip to content

Commit 88df714

Browse files
committed
feat: Add edx exams service to Devstack
1 parent 4255f6a commit 88df714

11 files changed

+73
-2
lines changed

.github/workflows/provisioning-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
os:
3131
- ubuntu-20.04 # Ubuntu 20.04 "Focal Fossa"
3232
python-version: [ '3.11' ]
33-
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue, analyticsapi+insights+lms]
33+
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue, analyticsapi+insights+lms, edx-exams+lms]
3434
fail-fast: false # some services can be flaky; let others run to completion even if one fails
3535

3636
steps:

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ dev.shell.analyticsapi:
407407
dev.shell.insights:
408408
docker compose exec insights env TERM=$(TERM) bash -c 'eval $$(source /edx/app/insights/insights_env; echo PATH="$$PATH";) && /bin/bash'
409409

410+
dev.shell.edx-exams:
411+
docker exec -it edx.devstack.edx_exams env TERM=$(TERM) bash -c '/bin/bash'
412+
410413
dev.shell.%: ## Run a shell on the specified service's container.
411414
docker compose exec $* /bin/bash
412415

check.sh

+6
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ if should_check analyticsapi; then
156156
"curl --fail -L http://localhost:19001/health/"
157157
fi
158158

159+
if should_check edx-exams; then
160+
echo "Running edX Exam Devstack tests: "
161+
run_check edx-exams_heartbeat edx-exams \
162+
"curl --fail -L http://localhost:18740/health/"
163+
fi
164+
159165
echo "Successful checks:${succeeded:- NONE}"
160166
echo "Failed checks:${failed:- NONE}"
161167
if [[ -z "$succeeded" ]] && [[ -z "$failed" ]]; then

docker-compose-host.yml

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ services:
7171
- ${DEVSTACK_WORKSPACE}/edx-analytics-data-api:/edx/app/analytics_api/analytics_api
7272
- ${DEVSTACK_WORKSPACE}/src:/edx/src
7373
- ${PWD}/py_configuration_files/analytics_data_api.py:/edx/app/analytics_api/analytics_api/analyticsdataserver/settings/devstack.py
74+
edx-exams:
75+
volumes:
76+
- ${DEVSTACK_WORKSPACE}/edx-exams:/edx/app/edx-exams
77+
7478

7579
# Note that frontends mount `src` to /edx/app/src instead of /edx/src.
7680
# See ADR #5 for rationale.

docker-compose.yml

+22
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,28 @@ services:
693693
aliases:
694694
- edx.devstack.xqueue_consumer
695695

696+
edx-exams:
697+
image: edxops/edx_exams
698+
container_name: edx.devstack.edx_exams
699+
hostname: edx_exams.devstack.edx
700+
depends_on:
701+
- lms
702+
- mysql80
703+
command: bash -c 'while true; do python /edx/app/edx-exams/manage.py runserver 0.0.0.0:18740; sleep 2; done'
704+
stdin_open: true
705+
tty: true
706+
environment:
707+
DB_HOST: edx.devstack.mysql80
708+
DB_PORT: 3306
709+
DB_USER: exams001
710+
DB_PASSWORD: password
711+
DJANGO_SETTINGS_MODULE: edx_exams.settings.devstack
712+
working_dir: /edx/app/edx-exams/
713+
ports:
714+
- "18740:18740"
715+
volumes:
716+
- /edx/var/edx-exams
717+
696718
# ==========================================================================
697719
# edX Microfrontends
698720
#

docs/service_list.rst

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Instead of a service name or list, you can also run commands like ``make dev.pro
6363
+------------------------------------+-------------------------------------+----------------+--------------+
6464
| `frontend-app-ora-grading`_ | http://localhost:1993 | MFE (React.js) | Extra |
6565
+------------------------------------+-------------------------------------+----------------+--------------+
66+
| `edx-exams`_ | http://localhost:18740 | Python/Django | Extra |
67+
+------------------------------------+-------------------------------------+----------------+--------------+
6668

6769
Some common service combinations include:
6870

@@ -95,3 +97,4 @@ Some common service combinations include:
9597
.. _frontend-app-ora-grading: https://github.com/edx/frontend-app-ora-grading
9698
.. _insights: https://github.com/edx/edx-analytics-dashboard
9799
.. _analyticsapi: https://github.com/edx/edx-analytics-data-api
100+
.. _edx-exams: https://github.com/edx/edx-exams

options.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ credentials+discovery+ecommerce+edx_notes_api+forum+frontend-app-authn+frontend-
6767
# Separated by plus signs.
6868
# Separated by plus signs. Listed in alphabetical order for clarity.
6969
EDX_SERVICES ?= \
70-
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
70+
analyticsapi+credentials+cms+cms-worker+cms_watcher+discovery+ecommerce+edx-exams+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
7171

7272
# Services with database migrations.
7373
# Should be a subset of $(EDX_SERVICES).

provision-edx-exams.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -eu -o pipefail
3+
4+
. scripts/colors.sh
5+
set -x
6+
7+
name="edx-exams"
8+
port="18740"
9+
10+
docker compose up -d lms
11+
docker compose up -d ${name}
12+
13+
# Run migrations
14+
echo -e "${GREEN}Running migrations for ${name}...${NC}"
15+
docker exec -t edx.devstack.edx_exams bash -c "cd /edx/app/edx-exams/ && make migrate"
16+
17+
# Create superuser
18+
echo -e "${GREEN}Creating super-user for ${name}...${NC}"
19+
docker exec -t edx.devstack.edx_exams bash -c "echo 'from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser(\"edx\", \"[email protected]\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None' | python /edx/app/edx-exams/manage.py shell"
20+
21+
# Provision IDA User in LMS and
22+
# create the DOT applications - one for single sign-on and one for backend service IDA-to-IDA authentication.
23+
echo -e "${GREEN}Provisioning ${name}_worker in LMS...${NC}"
24+
./provision-ida-user.sh ${name} ${name} ${port}
25+
26+
docker compose restart ${name}

provision-mysql80.sql

+4
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,8 @@ CREATE USER IF NOT EXISTS 'edxapp001'@'%' IDENTIFIED BY 'password';
4545
GRANT ALL ON edxapp.* TO 'edxapp001'@'%';
4646
GRANT ALL ON edxapp_csmh.* TO 'edxapp001'@'%';
4747

48+
CREATE DATABASE IF NOT EXISTS `edx_exams`;
49+
CREATE USER IF NOT EXISTS 'exams001'@'%' IDENTIFIED BY 'password';
50+
GRANT ALL ON `edx_exams`.* TO 'exams001'@'%';
51+
4852
FLUSH PRIVILEGES;

provision.sh

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ xqueue \
4949
coursegraph \
5050
insights \
5151
analyticsapi \
52+
edx-exams \
5253
"
5354

5455
# What should we provision?

repo.sh

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ non_release_repos=(
4848
"https://github.com/openedx/frontend-app-account.git"
4949
"https://github.com/openedx/frontend-app-profile.git"
5050
"https://github.com/openedx/frontend-app-ora-grading.git"
51+
"https://github.com/edx/edx-exams.git"
5152
)
5253

5354
ssh_repos=(
@@ -78,6 +79,7 @@ non_release_ssh_repos=(
7879
"[email protected]:openedx/frontend-app-account.git"
7980
"[email protected]:openedx/frontend-app-profile.git"
8081
"[email protected]:openedx/frontend-app-ora-grading.git"
82+
"[email protected]:edx/edx-exams.git"
8183
)
8284

8385
if [ -n "${OPENEDX_RELEASE}" ]; then

0 commit comments

Comments
 (0)