Skip to content

Commit

Permalink
Merge pull request #72 from edx/huniafatima/add-devstack-config
Browse files Browse the repository at this point in the history
chore: add devstack configuration file for all IDAs
  • Loading branch information
UsamaSadiq authored Nov 21, 2024
2 parents 3c79ad3 + 7ab32f9 commit 4255f6a
Show file tree
Hide file tree
Showing 18 changed files with 2,117 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docker-compose-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ services:
- discovery_node_modules:/edx/app/discovery/discovery/node_modules
- discovery_tox:/edx/app/discovery/discovery/.tox
- ${DEVSTACK_WORKSPACE}/src:/edx/src
- ${PWD}/py_configuration_files/course_discovery.py:/edx/app/discovery/discovery/course_discovery/settings/devstack.py
ecommerce:
volumes:
- ${DEVSTACK_WORKSPACE}/ecommerce:/edx/app/ecommerce/ecommerce
- ecommerce_node_modules:/edx/app/ecommerce/ecommerce/node_modules
- ecommerce_tox:/edx/app/ecommerce/ecommerce/.tox
- ${DEVSTACK_WORKSPACE}/src:/edx/src
- ${PWD}/py_configuration_files/ecommerce.py:/edx/app/ecommerce/ecommerce/ecommerce/settings/devstack.py
forum:
volumes:
- ${DEVSTACK_WORKSPACE}/cs_comments_service:/edx/app/forum/cs_comments_service
Expand All @@ -29,16 +31,20 @@ services:
- edxapp_tox:/edx/app/edxapp/edx-platform/.tox
- edxapp_uploads:/edx/var/edxapp/uploads
- ${DEVSTACK_WORKSPACE}/src:/edx/src
- ${PWD}/py_configuration_files/cms.py:/edx/app/edxapp/edx-platform/cms/envs/devstack.py
- ${PWD}/py_configuration_files/lms.py:/edx/app/edxapp/edx-platform/lms/envs/devstack.py
lms-worker:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform
edx_notes_api:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-notes-api:/edx/app/notes/
- ${DEVSTACK_WORKSPACE}/src:/edx/src
- ${PWD}/py_configuration_files/edx_notes_api.py:/edx/app/notes/notesserver/settings/devstack.py
registrar:
volumes:
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
- ${PWD}/py_configuration_files/registrar.py:/edx/app/registrar/registrar/registrar/settings/devstack.py
registrar-worker:
volumes:
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
Expand All @@ -50,17 +56,21 @@ services:
- edxapp_tox:/edx/app/edxapp/edx-platform/.tox
- edxapp_uploads:/edx/var/edxapp/uploads
- ${DEVSTACK_WORKSPACE}/src:/edx/src
- ${PWD}/py_configuration_files/cms.py:/edx/app/edxapp/edx-platform/cms/envs/devstack.py
- ${PWD}/py_configuration_files/lms.py:/edx/app/edxapp/edx-platform/lms/envs/devstack.py
cms-worker:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform
insights:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-analytics-dashboard:/edx/app/insights/insights
- insights_node_modules:/edx/app/insights/insights/node_modules
- ${PWD}/py_configuration_files/analytics_dashboard.py:/edx/app/insights/edx_analytics_dashboard/edx_analytics_dashboard/settings/devstack.py
analyticsapi:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-analytics-data-api:/edx/app/analytics_api/analytics_api
- ${DEVSTACK_WORKSPACE}/src:/edx/src
- ${PWD}/py_configuration_files/analytics_data_api.py:/edx/app/analytics_api/analytics_api/analyticsdataserver/settings/devstack.py

# Note that frontends mount `src` to /edx/app/src instead of /edx/src.
# See ADR #5 for rationale.
Expand Down
55 changes: 55 additions & 0 deletions py_configuration_files/analytics_data_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"""Devstack settings."""

import os

from analyticsdataserver.settings.local import *

########## DATABASE CONFIGURATION
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'analytics-api',
'USER': 'api001',
'PASSWORD': 'password',
'HOST': 'edx.devstack.mysql',
'PORT': '3306',
},
'analytics_v1': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'reports_v1',
'USER': 'api001',
'PASSWORD': 'password',
'HOST': 'edx.devstack.mysql',
'PORT': '3306',
},
'analytics': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'reports',
'USER': 'reports001',
'PASSWORD': 'password',
'HOST': 'edx.devstack.mysql',
'PORT': '3306',
}
}

ANALYTICS_DATABASE_V1 = 'analytics_v1'

DB_OVERRIDES = dict(
USER=os.environ.get('DB_USER', DATABASES['default']['USER']),
PASSWORD=os.environ.get('DB_PASSWORD', DATABASES['default']['PASSWORD']),
HOST=os.environ.get('DB_HOST', DATABASES['default']['HOST']),
PORT=os.environ.get('DB_PORT', DATABASES['default']['PORT']),
)

for override, value in DB_OVERRIDES.items():
DATABASES['default'][override] = value
DATABASES['analytics'][override] = value
DATABASES['analytics_v1'][override] = value

DATABASE_ROUTERS = ['analyticsdataserver.router.AnalyticsAPIRouter', 'analyticsdataserver.router.AnalyticsModelsRouter']

########## END DATABASE CONFIGURATION

ALLOWED_HOSTS += ['edx.devstack.analyticsapi']

LMS_BASE_URL = "http://edx.devstack.lms:18000/"
47 changes: 47 additions & 0 deletions py_configuration_files/anayltics_dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""django settings for development on devstack"""

from analytics_dashboard.settings.dev import *

DB_OVERRIDES = {
"PASSWORD": os.environ.get('DB_PASSWORD', DATABASES['default']['PASSWORD']),
"USER": os.environ.get('DB_USER', DATABASES['default']['USER']),
"NAME": os.environ.get('DB_NAME', DATABASES['default']['NAME']),
"HOST": os.environ.get('DB_HOST', DATABASES['default']['HOST']),
"PORT": os.environ.get('DB_PORT', DATABASES['default']['PORT']),
}

for override, value in DB_OVERRIDES.items():
DATABASES['default'][override] = value

DATA_API_URL = os.environ.get("API_SERVER_URL", 'http://edx.devstack.analyticsapi:19001/api/v0')
DATA_API_V1_ENABLED = True
DATA_API_URL_V1 = os.environ.get("API_SERVER_URL", 'http://edx.devstack.analyticsapi:19001/api/v1')

ENROLLMENT_AGE_AVAILABLE = True

# Set these to the correct values for your OAuth2/OpenID Connect provider (e.g., devstack)
SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_KEY', 'insights-sso-key')
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_SECRET', 'insights-sso-secret')
SOCIAL_AUTH_EDX_OAUTH2_ISSUER = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_ISSUER', 'http://localhost:18000')
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT', 'http://edx.devstack.lms:18000')
SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL', 'http://localhost:18000/logout')
SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT = os.environ.get(
'SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT', 'http://localhost:18000',
)

BACKEND_SERVICE_EDX_OAUTH2_KEY = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_KEY', 'insights-backend-service-key')
BACKEND_SERVICE_EDX_OAUTH2_SECRET = os.environ.get(
'BACKEND_SERVICE_EDX_OAUTH2_SECRET', 'insights-backend-service-secret'
)
BACKEND_SERVICE_EDX_OAUTH2_PROVIDER_URL = os.environ.get(
'BACKEND_SERVICE_EDX_OAUTH2_PROVIDER_URL', 'http://edx.devstack.lms:18000/oauth2',
)

COURSE_API_URL = 'http://edx.devstack.lms:18000/api/courses/v1/'
GRADING_POLICY_API_URL = 'http://edx.devstack.lms:18000/api/grades/v1/'

MODULE_PREVIEW_URL = 'http://edx.devstack.lms:18000/xblock'

JWT_AUTH = {
'JWT_AUTH_HEADER_PREFIX': 'JWT',
}
Loading

0 comments on commit 4255f6a

Please sign in to comment.