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

chore: add portal-designer to devstack #82

Merged
merged 6 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/provisioning-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
os:
- ubuntu-20.04 # Ubuntu 20.04 "Focal Fossa"
python-version: [ '3.11' ]
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]
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]
fail-fast: false # some services can be flaky; let others run to completion even if one fails

steps:
Expand Down
6 changes: 6 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ if should_check edx_notes_api; then
"curl --fail -L http://localhost:18120/heartbeat"
fi

if should_check designer; then
echo "Checking designer health:"
run_check designer_heartbeat designer \
"curl --fail -L http://localhost:18808/health/"
fi

if should_check credentials; then
echo "Checking credentials heartbeat:"
run_check credentials_heartbeat credentials \
Expand Down
4 changes: 4 additions & 0 deletions docker-compose-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ services:
volumes:
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
- ${PWD}/py_configuration_files/registrar.py:/edx/app/registrar/registrar/registrar/settings/devstack.py
designer:
volumes:
- ${DEVSTACK_WORKSPACE}/portal-designer:/edx/app/designer
- ${PWD}/py_configuration_files/portal_designer.py:/edx/app/designer/designer/settings/devstack.py
registrar-worker:
volumes:
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
Expand Down
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,32 @@ services:
depends_on:
- lms

designer:
image: edxops/designer-dev:latest
container_name: edx.devstack.designer
hostname: designer.devstack.edx
volumes:
- .:/edx/app/designer
command: bash -c 'while true; do python /edx/app/designer/manage.py runserver 0.0.0.0:18808; sleep 2; done'
ports:
- "18808:18808"
depends_on:
- mysql80
networks:
default:
aliases:
- edx.devstack.designer
stdin_open: true
tty: true
environment:
DJANGO_SETTINGS_MODULE: designer.settings.devstack
ENABLE_DJANGO_TOOLBAR: 1
DB_HOST: "edx.devstack.mysql80"
DB_NAME: "designer"
DB_PASSWORD: "password"
DB_PORT: "3306"
DB_USER: "designer001"

frontend-app-profile:
extends:
file: microfrontend.yml
Expand Down
3 changes: 3 additions & 0 deletions docs/service_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Instead of a service name or list, you can also run commands like ``make dev.pro
+------------------------------------+-------------------------------------+----------------+--------------+
| `frontend-app-ora-grading`_ | http://localhost:1993 | MFE (React.js) | Extra |
+------------------------------------+-------------------------------------+----------------+--------------+
| `designer`_ | http://localhost:18808 | Python/Django | Extra |
+------------------------------------+-------------------------------------+----------------+--------------+
| `enterprise-catalog`_ | http://localhost:18160/ | Python/Django | Extra |
+------------------------------------+-------------------------------------+----------------+--------------+
| `enterprise-access`_ | http://localhost:18270 | Python/Django | Extra |
Expand Down Expand Up @@ -104,6 +106,7 @@ Some common service combinations include:
.. _frontend-app-ora-grading: https://github.com/edx/frontend-app-ora-grading
.. _insights: https://github.com/edx/edx-analytics-dashboard
.. _analyticsapi: https://github.com/edx/edx-analytics-data-api
.. _designer: https://github.com/edx/portal-designer
.. _enterprise-catalog: https://github.com/openedx/enterprise-catalog
.. _license-manager: https://github.com/openedx/license-manager
.. _enterprise-access: https://github.com/openedx/enterprise-access
2 changes: 1 addition & 1 deletion options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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+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
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

# Services with database migrations.
# Should be a subset of $(EDX_SERVICES).
Expand Down
33 changes: 33 additions & 0 deletions provision-designer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name="designer"
port="18808"

docker compose up -d $name --build
docker compose up -d lms

# Install requirements
# 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.

# Wait for MySQL
echo "Waiting for MySQL"
until docker exec -i edx.devstack.mysql80 mysql -u root -se "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = 'root')" &> /dev/null
do
printf "."
sleep 1
done
sleep 5

echo -e "${GREEN}Installing requirements for ${name}...${NC}"
docker compose exec -T ${name} bash -e -c 'cd /edx/app/designer/ && make requirements' -- f"$name"

# Run migrations
echo -e "${GREEN}Running migrations for ${name}...${NC}"
docker compose exec -T ${name} bash -e -c -c "cd /edx/app/${name}/ && make migrate"

# Create superuser
echo -e "${GREEN}Creating super-user for ${name}...${NC}"
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\", \"edx@example.com\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None' | python /edx/app/${name}/manage.py shell"

./provision-ida-user.sh ${name} ${name} ${port}

# Restart designer app
make dev.restart-devserver.designer
4 changes: 4 additions & 0 deletions provision-mysql80.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ CREATE DATABASE IF NOT EXISTS discovery;
CREATE USER IF NOT EXISTS 'discov001'@'%' IDENTIFIED BY 'password';
GRANT ALL ON discovery.* TO 'discov001'@'%';

CREATE DATABASE IF NOT EXISTS designer;
CREATE USER IF NOT EXISTS 'designer001'@'%' IDENTIFIED BY 'password';
GRANT ALL ON designer.* TO 'designer001'@'%';

CREATE DATABASE IF NOT EXISTS ecommerce;
CREATE USER IF NOT EXISTS 'ecomm001'@'%' IDENTIFIED BY 'password';
GRANT ALL ON ecommerce.* TO 'ecomm001'@'%';
Expand Down
1 change: 1 addition & 0 deletions provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ insights \
analyticsapi \
enterprise-catalog \
license-manager \
designer \
enterprise-access \
"

Expand Down
3 changes: 3 additions & 0 deletions provision.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ GRANT ALL ON `reports_v1`.* TO 'analytics001'@'%' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS `enterprise_catalog`;
GRANT ALL ON `enterprise_catalog`.* TO 'catalog001'@'%' IDENTIFIED BY 'password';

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

CREATE DATABASE IF NOT EXISTS license_manager;
GRANT ALL ON license_manager.* TO 'license_manager001'@'%' IDENTIFIED BY 'password';

Expand Down
2 changes: 2 additions & 0 deletions repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ repos=(
"https://github.com/edx/edx-analytics-dashboard.git"
"https://github.com/edx/edx-analytics-data-api.git"
"https://github.com/openedx/enterprise-catalog.git"
"https://github.com/edx/portal-designer.git"
"https://github.com/openedx/license-manager.git"
"https://github.com/openedx/codejail-service.git"
"https://github.com/openedx/enterprise-access.git"
Expand Down Expand Up @@ -71,6 +72,7 @@ ssh_repos=(
"git@github.com:openedx/frontend-app-publisher.git"
"git@github.com:edx/edx-analytics-dashboard.git"
"git@github.com:edx/edx-analytics-data-api.git"
"git@github.com:edx/portal-designer.git"
"git@github.com:openedx/license-manager.git"
"git@github.com:openedx/codejail-service.git"
"git@github.com:openedx/enterprise-access.git"
Expand Down
Loading