Skip to content

Commit 09c7fde

Browse files
chore: add enterprise catalog in devstack
1 parent 4255f6a commit 09c7fde

File tree

16 files changed

+134
-17
lines changed

16 files changed

+134
-17
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]
33+
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue, analyticsapi+insights+lms, enterprise-catalog+lms]
3434
fail-fast: false # some services can be flaky; let others run to completion even if one fails
3535

3636
steps:

docker-compose-host.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,16 @@ 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-
74+
enterprise-catalog:
75+
volumes:
76+
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog
77+
enterprise-catalog-worker:
78+
volumes:
79+
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog
80+
- ${PWD}/py_configuration_files/enterprise_catalog.py:/edx/app/enterprise_catalog/enterprise_catalog/settings/devstack.py
81+
enterprise-catalog-curations-worker:
82+
volumes:
83+
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog
7584
# Note that frontends mount `src` to /edx/app/src instead of /edx/src.
7685
# See ADR #5 for rationale.
7786
frontend-app-account:

docker-compose.yml

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

696+
enterprise-catalog:
697+
image: edxops/enterprise-catalog-dev
698+
container_name: edx.devstack.enterprise-catalog
699+
hostname: enterprise-catalog.devstack.edx
700+
command: bash -c 'while true; do python /edx/app/enterprise_catalog/enterprise_catalog/manage.py runserver 0.0.0.0:18160; sleep 2; done'
701+
ports:
702+
- "18160:18160"
703+
depends_on:
704+
- memcached
705+
- mysql80
706+
- enterprise-catalog-worker
707+
networks:
708+
default:
709+
aliases:
710+
- edx.devstack.enterprise-catalog
711+
# Allows attachment to this container using 'docker attach <containerID>'.
712+
stdin_open: true
713+
tty: true
714+
environment:
715+
CELERY_ALWAYS_EAGER: 'false'
716+
CELERY_BROKER_TRANSPORT: redis
717+
CELERY_BROKER_HOSTNAME: edx.devstack.redis:6379
718+
CELERY_BROKER_VHOST: 0
719+
CELERY_BROKER_PASSWORD: password
720+
DJANGO_SETTINGS_MODULE: enterprise_catalog.settings.devstack
721+
ENABLE_DJANGO_TOOLBAR: 1
722+
DB_HOST: edx.devstack.mysql80
723+
DB_NAME: enterprise_catalog
724+
DB_PORT: 3306
725+
DB_USER: catalog001
726+
DB_PASSWORD: 'password'
727+
728+
enterprise-catalog-worker:
729+
image: edxops/enterprise-catalog-dev
730+
command: bash -c 'cd /edx/app/enterprise_catalog/enterprise_catalog && celery -A enterprise_catalog worker -Q enterprise_catalog.default -l DEBUG'
731+
container_name: edx.devstack.enterprise.catalog.worker
732+
depends_on:
733+
- mysql80
734+
environment:
735+
CELERY_ALWAYS_EAGER: 'false'
736+
CELERY_BROKER_TRANSPORT: redis
737+
CELERY_BROKER_HOSTNAME: edx.devstack.redis:6379
738+
CELERY_BROKER_VHOST: 0
739+
CELERY_BROKER_PASSWORD: password
740+
DJANGO_SETTINGS_MODULE: enterprise_catalog.settings.devstack
741+
COLUMNS: 80
742+
hostname: worker.catalog.enterprise
743+
ports:
744+
- "18161:18161"
745+
restart: always
746+
# Allows attachment to this container using 'docker attach <containerID>'.
747+
stdin_open: true
748+
tty: true
749+
750+
enterprise-catalog-curations-worker:
751+
image: edxops/enterprise-catalog-dev
752+
command: bash -c 'cd /edx/app/enterprise_catalog/enterprise_catalog && celery -A enterprise_catalog worker -Q enterprise_catalog.curations -l DEBUG'
753+
container_name: enterprise.catalog.curations
754+
depends_on:
755+
- mysql80
756+
environment:
757+
CELERY_ALWAYS_EAGER: 'false'
758+
CELERY_BROKER_TRANSPORT: redis
759+
CELERY_BROKER_HOSTNAME: edx.devstack.redis:6379
760+
CELERY_BROKER_VHOST: 0
761+
CELERY_BROKER_PASSWORD: password
762+
DJANGO_SETTINGS_MODULE: enterprise_catalog.settings.devstack
763+
COLUMNS: 80
764+
hostname: curations.catalog.enterprise
765+
ports:
766+
- "18162:18162"
767+
restart: always
768+
# Allows attachment to this container using 'docker attach <containerID>'.
769+
stdin_open: true
770+
tty: true
771+
696772
# ==========================================================================
697773
# edX Microfrontends
698774
#

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+
| `enterprise-catalog`_ | http://localhost:18160/ | 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+
.. _enterprise-catalog: https://github.com/openedx/enterprise-catalog

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+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_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
7171

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

provision-enterprise-catalog.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name="enterprise-catalog"
2+
port="18160"
3+
4+
docker compose up -d $name
5+
6+
# Run migrations
7+
echo -e "${GREEN}Running migrations for ${name}...${NC}"
8+
docker compose exec -T ${name} bash -c "cd /edx/app/${name}/${name}/ && make migrate"
9+
10+
echo -e "${GREEN}Installing requirements for ${name}...${NC}"
11+
docker compose exec -T ${name} bash -e -c 'cd /edx/app/enterprise-catalog/ && make requirements' -- "$name"
12+
13+
# Create superuser
14+
echo -e "${GREEN}Creating super-user for ${name}...${NC}"
15+
docker compose exec -T ${name} 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}/${name}/manage.py shell"
16+
17+
./provision-ida-user.sh ${name} ${name} ${port}
18+
19+
# Restart enterprise.catalog app and worker containers
20+
docker compose restart enterprise-catalog enterprise-catalog-worker

provision-mysql80.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ CREATE DATABASE IF NOT EXISTS credentials;
66
CREATE USER IF NOT EXISTS 'credentials001'@'%' IDENTIFIED BY 'password';
77
GRANT ALL ON credentials.* TO 'credentials001'@'%';
88

9+
CREATE DATABASE IF NOT EXISTS enterprise_catalog;
10+
CREATE USER IF NOT EXISTS 'catalog001'@'%' IDENTIFIED BY 'password';
11+
GRANT ALL ON enterprise_catalog.* TO 'catalog001'@'%';
12+
913
CREATE DATABASE IF NOT EXISTS discovery;
1014
CREATE USER IF NOT EXISTS 'discov001'@'%' IDENTIFIED BY 'password';
1115
GRANT ALL ON discovery.* TO 'discov001'@'%';

provision.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This script will provision the services specified in the argument list,
44
# or all services if no arguments are provided.
55
#
6-
# Non-existant services will be ignored.
6+
# Non-existent services will be ignored.
77
# Specifying services more than once will cause them to be provisioned more
88
# than once.
99
#
@@ -49,6 +49,7 @@ xqueue \
4949
coursegraph \
5050
insights \
5151
analyticsapi \
52+
enterprise-catalog \
5253
"
5354

5455
# What should we provision?

provision.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@ 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 `enterprise_catalog`;
37+
GRANT ALL ON `enterprise_catalog`.* TO 'catalog001'@'%' IDENTIFIED BY 'password';
3638

3739
FLUSH PRIVILEGES;
File renamed without changes.

0 commit comments

Comments
 (0)