Skip to content

Commit 2960ad3

Browse files
chore: add portal-designer to devstack
2 parents 523ec82 + 3701a2b commit 2960ad3

File tree

11 files changed

+84
-2
lines changed

11 files changed

+84
-2
lines changed

.github/workflows/provisioning-tests.yml

Lines changed: 1 addition & 1 deletion
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, enterprise-catalog+enterprise-access+lms, license-manager+lms]
33+
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue, analyticsapi+insights+lms, designer+lms, enterprise-catalog+enterprise-access+lms, license-manager+lms]
3434
fail-fast: false # some services can be flaky; let others run to completion even if one fails
3535

3636
steps:

check.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ if should_check edx_notes_api; then
138138
"curl --fail -L http://localhost:18120/heartbeat"
139139
fi
140140

141+
if should_check designer; then
142+
echo "Checking designer health:"
143+
run_check designer_heartbeat designer \
144+
"curl --fail -L http://localhost:18808/health/"
145+
fi
146+
141147
if should_check credentials; then
142148
echo "Checking credentials heartbeat:"
143149
run_check credentials_heartbeat credentials \

docker-compose-host.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ services:
5353
volumes:
5454
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
5555
- ${PWD}/py_configuration_files/registrar.py:/edx/app/registrar/registrar/registrar/settings/devstack.py
56+
designer:
57+
volumes:
58+
- ${DEVSTACK_WORKSPACE}/portal-designer:/edx/app/designer
59+
- ${PWD}/py_configuration_files/portal_designer.py:/edx/app/designer/designer/settings/devstack.py
5660
registrar-worker:
5761
volumes:
5862
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar

docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,32 @@ services:
935935
depends_on:
936936
- lms
937937

938+
designer:
939+
image: edxops/designer-dev:latest
940+
container_name: edx.devstack.designer
941+
hostname: designer.devstack.edx
942+
volumes:
943+
- .:/edx/app/designer
944+
command: bash -c 'while true; do python /edx/app/designer/manage.py runserver 0.0.0.0:18808; sleep 2; done'
945+
ports:
946+
- "18808:18808"
947+
depends_on:
948+
- mysql80
949+
networks:
950+
default:
951+
aliases:
952+
- edx.devstack.designer
953+
stdin_open: true
954+
tty: true
955+
environment:
956+
DJANGO_SETTINGS_MODULE: designer.settings.devstack
957+
ENABLE_DJANGO_TOOLBAR: 1
958+
DB_HOST: "edx.devstack.mysql80"
959+
DB_NAME: "designer"
960+
DB_PASSWORD: "password"
961+
DB_PORT: "3306"
962+
DB_USER: "designer001"
963+
938964
frontend-app-profile:
939965
extends:
940966
file: microfrontend.yml

docs/service_list.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Instead of a service name or list, you can also run commands like ``make dev.pro
6767
+------------------------------------+-------------------------------------+----------------+--------------+
6868
| `frontend-app-ora-grading`_ | http://localhost:1993 | MFE (React.js) | Extra |
6969
+------------------------------------+-------------------------------------+----------------+--------------+
70+
| `designer`_ | http://localhost:18808 | Python/Django | Extra |
71+
+------------------------------------+-------------------------------------+----------------+--------------+
7072
| `enterprise-catalog`_ | http://localhost:18160/ | Python/Django | Extra |
7173
+------------------------------------+-------------------------------------+----------------+--------------+
7274
| `enterprise-access`_ | http://localhost:18270 | Python/Django | Extra |
@@ -104,6 +106,7 @@ Some common service combinations include:
104106
.. _frontend-app-ora-grading: https://github.com/edx/frontend-app-ora-grading
105107
.. _insights: https://github.com/edx/edx-analytics-dashboard
106108
.. _analyticsapi: https://github.com/edx/edx-analytics-data-api
109+
.. _designer: https://github.com/edx/portal-designer
107110
.. _enterprise-catalog: https://github.com/openedx/enterprise-catalog
108111
.. _license-manager: https://github.com/openedx/license-manager
109112
.. _enterprise-access: https://github.com/openedx/enterprise-access

options.mk

Lines changed: 1 addition & 1 deletion
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+codejail+credentials+cms+cms-worker+cms_watcher+discovery+ecommerce+edx_notes_api+enterprise-access+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
70+
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+designer+enterprise-access
7171

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

provision-designer.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name="designer"
2+
port="18808"
3+
4+
docker compose up -d $name --build
5+
docker compose up -d lms
6+
7+
# Install requirements
8+
# Can be skipped right now because we're using the --build flag on docker compose. This will need to be changed once we move to devstack.
9+
10+
# Wait for MySQL
11+
echo "Waiting for MySQL"
12+
until docker exec -i edx.devstack.mysql80 mysql -u root -se "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = 'root')" &> /dev/null
13+
do
14+
printf "."
15+
sleep 1
16+
done
17+
sleep 5
18+
19+
echo -e "${GREEN}Installing requirements for ${name}...${NC}"
20+
docker compose exec -T ${name} bash -e -c 'cd /edx/app/designer/ && make requirements' -- f"$name"
21+
22+
# Run migrations
23+
echo -e "${GREEN}Running migrations for ${name}...${NC}"
24+
docker compose exec -T ${name} bash -e -c -c "cd /edx/app/${name}/ && make migrate"
25+
26+
# Create superuser
27+
echo -e "${GREEN}Creating super-user for ${name}...${NC}"
28+
docker compose exec -T ${name} bash -e -c -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/${name}/manage.py shell"
29+
30+
./provision-ida-user.sh ${name} ${name} ${port}
31+
32+
# Restart designer app
33+
make dev.restart-devserver.designer

provision-mysql80.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ CREATE DATABASE IF NOT EXISTS discovery;
1414
CREATE USER IF NOT EXISTS 'discov001'@'%' IDENTIFIED BY 'password';
1515
GRANT ALL ON discovery.* TO 'discov001'@'%';
1616

17+
CREATE DATABASE IF NOT EXISTS designer;
18+
CREATE USER IF NOT EXISTS 'designer001'@'%' IDENTIFIED BY 'password';
19+
GRANT ALL ON designer.* TO 'designer001'@'%';
20+
1721
CREATE DATABASE IF NOT EXISTS ecommerce;
1822
CREATE USER IF NOT EXISTS 'ecomm001'@'%' IDENTIFIED BY 'password';
1923
GRANT ALL ON ecommerce.* TO 'ecomm001'@'%';

provision.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ insights \
5151
analyticsapi \
5252
enterprise-catalog \
5353
license-manager \
54+
designer \
5455
enterprise-access \
5556
"
5657

provision.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ GRANT ALL ON `reports_v1`.* TO 'analytics001'@'%' IDENTIFIED BY 'password';
3939
CREATE DATABASE IF NOT EXISTS `enterprise_catalog`;
4040
GRANT ALL ON `enterprise_catalog`.* TO 'catalog001'@'%' IDENTIFIED BY 'password';
4141

42+
CREATE DATABASE IF NOT EXISTS designer;
43+
GRANT ALL ON discovery.* TO 'designer001'@'%' IDENTIFIED BY 'password';
44+
4245
CREATE DATABASE IF NOT EXISTS license_manager;
4346
GRANT ALL ON license_manager.* TO 'license_manager001'@'%' IDENTIFIED BY 'password';
4447

0 commit comments

Comments
 (0)