Skip to content

Commit 173e049

Browse files
chore: add portal-designer in devstack services
1 parent 3c79ad3 commit 173e049

File tree

10 files changed

+82
-1
lines changed

10 files changed

+82
-1
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
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.designer:
411+
docker exec -it edx.devstack.designer 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

docker-compose-host.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ services:
3939
registrar:
4040
volumes:
4141
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
42+
designer:
43+
volumes:
44+
- ${DEVSTACK_WORKSPACE}/portal-designer:/edx/app/designer
4245
registrar-worker:
4346
volumes:
4447
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar

docker-compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,32 @@ services:
693693
aliases:
694694
- edx.devstack.xqueue_consumer
695695

696+
designer:
697+
image: portal-designer-designer
698+
container_name: edx.devstack.designer
699+
volumes:
700+
- .:/edx/app/designer
701+
command: bash -c 'while true; do python /edx/app/designer/manage.py runserver 0.0.0.0:18808; sleep 2; done'
702+
ports:
703+
- "18809:18808"
704+
depends_on:
705+
- mysql80
706+
networks:
707+
default:
708+
aliases:
709+
- edx.devstack.designer
710+
# Allows attachment to this container using 'docker attach <containerID>'.
711+
stdin_open: true
712+
tty: true
713+
environment:
714+
DJANGO_SETTINGS_MODULE: designer.settings.devstack
715+
ENABLE_DJANGO_TOOLBAR: 1
716+
DB_HOST: edx.devstack.mysql80
717+
DB_NAME: designer
718+
DB_PORT: 3306
719+
DB_USER: designer001
720+
DB_PASSWORD: password
721+
696722
# ==========================================================================
697723
# edX Microfrontends
698724
#
@@ -910,3 +936,4 @@ volumes:
910936
mysql57_data:
911937
mysql80_data:
912938
redis_data:
939+
designer_mysql:

docs/service_list.rst

Lines changed: 3 additions & 0 deletions
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+
| `designer`_ | http://localhost:3307 | 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+
.. _designer: https://github.com/edx/portal-designer

options.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ALWAYS_CACHE_PROGRAMS ?= false
6161
# The current value was chosen such that it would not change the existing
6262
# Devstack behavior.
6363
DEFAULT_SERVICES ?= \
64-
credentials+discovery+ecommerce+edx_notes_api+forum+frontend-app-authn+frontend-app-gradebook+frontend-app-payment+frontend-app-publisher+frontend-app-learning+lms+cms
64+
credentials+discovery+ecommerce+edx_notes_api+forum+frontend-app-authn+frontend-app-gradebook+frontend-app-payment+frontend-app-publisher+frontend-app-learning+lms+cms+designer
6565

6666
# All edX services, whether or not they are run by default.
6767
# Separated by plus signs.

provision-designer.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name="designer"
2+
port="18808"
3+
4+
docker-compose up -d --build
5+
6+
# Install requirements
7+
# 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.
8+
9+
# Wait for MySQL
10+
echo "Waiting for MySQL"
11+
until docker exec -i designer.mysql mysql -u root -se "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = 'root')" &> /dev/null
12+
do
13+
printf "."
14+
sleep 1
15+
done
16+
sleep 5
17+
18+
# Run migrations
19+
echo -e "${GREEN}Running migrations for ${name}...${NC}"
20+
docker exec -t designer.app bash -c "cd /edx/app/${name}/ && make migrate"
21+
22+
# Create superuser
23+
echo -e "${GREEN}Creating super-user for ${name}...${NC}"
24+
docker exec -t designer.app 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/${name}/manage.py shell"
25+
26+
# Provision IDA User in LMS
27+
echo -e "${GREEN}Provisioning ${name}_worker in LMS...${NC}"
28+
docker exec -t edx.devstack.lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py lms --settings=devstack_docker manage_user ${name}_worker ${name}[email protected] --staff --superuser"
29+
30+
# Create the DOT applications - one for single sign-on and one for backend service IDA-to-IDA authentication.
31+
docker exec -t edx.devstack.lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py lms --settings=devstack_docker create_dot_application --grant-type authorization-code --skip-authorization --redirect-uris 'http://localhost:${port}/complete/edx-oauth2/' --client-id '${name}-sso-key' --client-secret '${name}-sso-secret' --scopes 'user_id' ${name}-sso ${name}_worker"
32+
docker exec -t edx.devstack.lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py lms --settings=devstack_docker create_dot_application --grant-type client-credentials --client-id '${name}-backend-service-key' --client-secret '${name}-backend-service-secret' ${name}-backend-service ${name}_worker"
33+
34+
# Restart designer app
35+
docker-compose stop designer

provision-mysql80.sql

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

13+
CREATE DATABASE IF NOT EXISTS designer;
14+
CREATE USER IF NOT EXISTS 'designer001'@'%' IDENTIFIED BY 'password';
15+
GRANT ALL ON designer.* TO 'designer001'@'%';
16+
1317
CREATE DATABASE IF NOT EXISTS ecommerce;
1418
CREATE USER IF NOT EXISTS 'ecomm001'@'%' IDENTIFIED BY 'password';
1519
GRANT ALL ON ecommerce.* TO 'ecomm001'@'%';

provision.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ xqueue \
4949
coursegraph \
5050
insights \
5151
analyticsapi \
52+
designer \
5253
"
5354

5455
# What should we provision?

provision.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,8 @@ GRANT ALL ON `reports`.* TO 'analytics001'@'%' IDENTIFIED BY 'password';
3333
CREATE DATABASE IF NOT EXISTS `reports_v1`;
3434
GRANT ALL ON `reports_v1`.* TO 'analytics001'@'%' IDENTIFIED BY 'password';
3535

36+
CREATE DATABASE IF NOT EXISTS designer;
37+
GRANT ALL ON discovery.* TO 'designer001'@'%' IDENTIFIED BY 'password';
38+
3639

3740
FLUSH PRIVILEGES;

repo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ repos=(
3636
"https://github.com/openedx/frontend-app-publisher.git"
3737
"https://github.com/edx/edx-analytics-dashboard.git"
3838
"https://github.com/edx/edx-analytics-data-api.git"
39+
"https://github.com/edx/portal-designer.git"
3940
)
4041

4142
non_release_repos=(
@@ -66,6 +67,7 @@ ssh_repos=(
6667
"[email protected]:openedx/frontend-app-publisher.git"
6768
"[email protected]:edx/edx-analytics-dashboard.git"
6869
"[email protected]:edx/edx-analytics-data-api.git"
70+
"[email protected]:edx/portal-designer.git"
6971
)
7072

7173
non_release_ssh_repos=(

0 commit comments

Comments
 (0)