forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add enterprise catalog in devstack
- Loading branch information
1 parent
3c79ad3
commit 343b4cd
Showing
27 changed files
with
2,243 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name="enterprise-catalog" | ||
port="18160" | ||
|
||
docker compose up -d $name | ||
|
||
# Run migrations | ||
echo -e "${GREEN}Running migrations for ${name}...${NC}" | ||
docker exec -t enterprise.catalog.app bash -c "cd /edx/app/${name}/${name}/ && make migrate" | ||
|
||
# Create superuser | ||
echo -e "${GREEN}Creating super-user for ${name}...${NC}" | ||
docker exec -t enterprise.catalog.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}/${name}/manage.py shell" | ||
|
||
# Provision IDA User in LMS | ||
echo -e "${GREEN}Provisioning ${name}_worker in LMS...${NC}" | ||
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" | ||
|
||
# Create the DOT applications - one for single sign-on and one for backend service IDA-to-IDA authentication. | ||
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" | ||
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" | ||
|
||
# Restart enterprise.catalog app and worker containers | ||
docker-compose restart app worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
} |
Oops, something went wrong.