Skip to content

Commit 6164812

Browse files
committed
fix: Many fixes for enterprise IDAs
It seems like the various enterprise-specific devstack settings are a mix of legacy stuff combined with failed attempts to port repo-specific devstack configs into this central devstack repo. As a result, the various hostnames and paths are completely broken. This hasn't impacted us because we normally don't use enterprise inside of devstack, but this is will hopefully be our future.
1 parent fa6c178 commit 6164812

File tree

7 files changed

+41
-38
lines changed

7 files changed

+41
-38
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ dev.shell.insights:
406406
docker compose exec insights env TERM=$(TERM) bash -c 'eval $$(source /edx/app/insights/insights_env; echo PATH="$$PATH";) && /bin/bash'
407407

408408
dev.shell.%: ## Run a shell on the specified service's container.
409-
docker compose exec $* /bin/bash
409+
docker compose exec -u 0 $* /bin/bash
410410

411411
dev.dbshell:
412412
docker compose exec mysql80 bash -c "mysql"

docker-compose-host.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ services:
2424
volumes:
2525
- ${DEVSTACK_WORKSPACE}/enterprise-access:/edx/app/enterprise-access/
2626
- ${DEVSTACK_WORKSPACE}/src:/edx/src
27-
- ${PWD}/py_configuration_files/enterprise_access.py:/edx/app/enterprise-access/license_manager/settings/devstack.py
27+
- ${PWD}/py_configuration_files/enterprise_access.py:/edx/app/enterprise-access/enterprise_access/settings/devstack.py
2828
enterprise-access-worker:
2929
volumes:
3030
- ${DEVSTACK_WORKSPACE}/enterprise-access:/edx/app/enterprise-access/
31+
- ${DEVSTACK_WORKSPACE}/src:/edx/src
32+
- ${PWD}/py_configuration_files/enterprise_access.py:/edx/app/enterprise-access/enterprise_access/settings/devstack.py
3133
forum:
3234
volumes:
3335
- ${DEVSTACK_WORKSPACE}/cs_comments_service:/edx/app/forum/cs_comments_service
@@ -98,15 +100,15 @@ services:
98100

99101
enterprise-catalog:
100102
volumes:
101-
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog
102-
- ${PWD}/py_configuration_files/enterprise_catalog.py:/edx/app/enterprise_catalog/enterprise_catalog/settings/devstack.py
103+
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise-catalog
104+
- ${PWD}/py_configuration_files/enterprise_catalog.py:/edx/app/enterprise-catalog/enterprise_catalog/settings/devstack.py
103105
enterprise-catalog-worker:
104106
volumes:
105-
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog
106-
- ${PWD}/py_configuration_files/enterprise_catalog.py:/edx/app/enterprise_catalog/enterprise_catalog/settings/devstack.py
107+
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise-catalog
108+
- ${PWD}/py_configuration_files/enterprise_catalog.py:/edx/app/enterprise-catalog/enterprise_catalog/settings/devstack.py
107109
enterprise-catalog-curations-worker:
108110
volumes:
109-
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise_catalog/enterprise_catalog
111+
- ${DEVSTACK_WORKSPACE}/enterprise-catalog:/edx/app/enterprise-catalog
110112
license-manager:
111113
volumes:
112114
- ${DEVSTACK_WORKSPACE}/license-manager:/edx/app/license_manager

docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ services:
744744
image: edxops/enterprise-catalog-dev
745745
container_name: edx.devstack.enterprise-catalog
746746
hostname: enterprise-catalog.devstack.edx
747-
command: bash -c 'while true; do python /edx/app/enterprise_catalog/enterprise_catalog/manage.py runserver 0.0.0.0:18160; sleep 2; done'
747+
command: bash -c 'while true; do python /edx/app/enterprise-catalog/manage.py runserver 0.0.0.0:18160; sleep 2; done'
748748
ports:
749749
- "18160:18160"
750750
depends_on:
@@ -774,9 +774,10 @@ services:
774774

775775
enterprise-catalog-worker:
776776
image: edxops/enterprise-catalog-dev
777-
command: bash -c 'cd /edx/app/enterprise_catalog/enterprise_catalog && celery -A enterprise_catalog worker -Q enterprise_catalog.default -l DEBUG'
777+
command: bash -c 'cd /edx/app/enterprise-catalog && celery -A enterprise_catalog worker -Q enterprise_catalog.default -l DEBUG'
778778
container_name: edx.devstack.enterprise.catalog.worker
779779
depends_on:
780+
- memcached
780781
- mysql80
781782
environment:
782783
CELERY_ALWAYS_EAGER: 'false'
@@ -796,7 +797,7 @@ services:
796797

797798
enterprise-catalog-curations-worker:
798799
image: edxops/enterprise-catalog-dev
799-
command: bash -c 'cd /edx/app/enterprise_catalog/enterprise_catalog && celery -A enterprise_catalog worker -Q enterprise_catalog.curations -l DEBUG'
800+
command: bash -c 'cd /edx/app/enterprise-catalog && celery -A enterprise_catalog worker -Q enterprise_catalog.curations -l DEBUG'
800801
container_name: enterprise.catalog.curations
801802
depends_on:
802803
- mysql80

py_configuration_files/enterprise_access.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
'default': {
55
'ENGINE': 'django.db.backends.mysql',
66
'NAME': os.environ.get('DB_NAME', 'enterprise_access'),
7-
'USER': os.environ.get('DB_USER', 'root'),
8-
'PASSWORD': os.environ.get('DB_PASSWORD', ''),
9-
'HOST': os.environ.get('DB_HOST', 'enterprise_access.mysql80'),
7+
'USER': os.environ.get('DB_USER', 'enterprise_access001'),
8+
'PASSWORD': os.environ.get('DB_PASSWORD', 'password'),
9+
'HOST': os.environ.get('DB_HOST', 'edx.devstack.mysql80'),
1010
'PORT': os.environ.get('DB_PORT', 3306),
1111
'ATOMIC_REQUESTS': False,
1212
'CONN_MAX_AGE': 60,
@@ -17,7 +17,7 @@
1717
CACHES = {
1818
'default': {
1919
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
20-
'LOCATION': 'enterprise_access.memcache:11211',
20+
'LOCATION': 'edx.devstack.memcached:11211',
2121
}
2222
}
2323

@@ -26,8 +26,8 @@
2626
OAUTH2_PROVIDER_URL = 'http://edx.devstack.lms:18000/oauth2'
2727

2828
# OAuth2 variables specific to social-auth/SSO login use case.
29-
SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_KEY', 'enterprise_access-sso-key')
30-
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_SECRET', 'enterprise_access-sso-secret')
29+
SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_KEY', 'enterprise-access-sso-key')
30+
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_SECRET', 'enterprise-access-sso-secret')
3131
SOCIAL_AUTH_EDX_OAUTH2_ISSUER = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_ISSUER', 'http://localhost:18000')
3232
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT', 'http://edx.devstack.lms:18000')
3333
SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL', 'http://localhost:18000/logout')
@@ -37,9 +37,9 @@
3737

3838
# OAuth2 variables specific to backend service API calls.
3939
BACKEND_SERVICE_EDX_OAUTH2_KEY = os.environ.get(
40-
'BACKEND_SERVICE_EDX_OAUTH2_KEY', 'enterprise_access-backend-service-key')
40+
'BACKEND_SERVICE_EDX_OAUTH2_KEY', 'enterprise-access-backend-service-key')
4141
BACKEND_SERVICE_EDX_OAUTH2_SECRET = os.environ.get(
42-
'BACKEND_SERVICE_EDX_OAUTH2_SECRET', 'enterprise_access-backend-service-secret')
42+
'BACKEND_SERVICE_EDX_OAUTH2_SECRET', 'enterprise-access-backend-service-secret')
4343

4444
JWT_AUTH.update({
4545
'JWT_SECRET_KEY': 'lms-secret',
@@ -91,13 +91,13 @@
9191
# END CSRF CONFIG
9292

9393
ECOMMERCE_URL = 'http://edx.devstack.ecommerce:18130'
94-
LICENSE_MANAGER_URL = 'http://license-manager.app:18170'
94+
LICENSE_MANAGER_URL = 'http://edx.devstack.license-manager:18170'
9595
LMS_URL = 'http://edx.devstack.lms:18000'
9696
DISCOVERY_URL = 'http://edx.devstack.discovery:18381'
9797
ENTERPRISE_LEARNER_PORTAL_URL = 'http://localhost:8734'
9898
ENTERPRISE_ADMIN_PORTAL_URL = 'http://localhost:1991'
99-
ENTERPRISE_CATALOG_URL = 'http://enterprise.catalog.app:18160'
100-
ENTERPRISE_SUBSIDY_URL = 'http://enterprise-subsidy.app:18280'
99+
ENTERPRISE_CATALOG_URL = 'http://edx.devstack.enterprise-catalog:18160'
100+
ENTERPRISE_SUBSIDY_URL = 'http://edx.devstack.enterprise-subsidy:18280'
101101
ENTERPRISE_ACCESS_URL = 'http://localhost:18270'
102102

103103
# shell_plus

py_configuration_files/enterprise_catalog.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
OAUTH2_PROVIDER_URL = 'http://edx.devstack.lms:18000/oauth2'
55

66
# OAuth2 variables specific to social-auth/SSO login use case.
7-
SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_KEY', 'enterprise_catalog-sso-key')
8-
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_SECRET', 'enterprise_catalog-sso-secret')
7+
SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_KEY', 'enterprise-catalog-sso-key')
8+
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_SECRET', 'enterprise-catalog-sso-secret')
99
SOCIAL_AUTH_EDX_OAUTH2_ISSUER = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_ISSUER', 'http://localhost:18000')
1010
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT', 'http://edx.devstack.lms:18000')
1111
SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL', 'http://localhost:18000/logout')
@@ -14,8 +14,8 @@
1414
)
1515

1616
# OAuth2 variables specific to backend service API calls.
17-
BACKEND_SERVICE_EDX_OAUTH2_KEY = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_KEY', 'enterprise_catalog-backend-service-key')
18-
BACKEND_SERVICE_EDX_OAUTH2_SECRET = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_SECRET', 'enterprise_catalog-backend-service-secret')
17+
BACKEND_SERVICE_EDX_OAUTH2_KEY = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_KEY', 'enterprise-catalog-backend-service-key')
18+
BACKEND_SERVICE_EDX_OAUTH2_SECRET = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_SECRET', 'enterprise-catalog-backend-service-secret')
1919

2020
JWT_AUTH.update({
2121
'JWT_SECRET_KEY': 'lms-secret',
@@ -39,9 +39,9 @@
3939
'default': {
4040
'ENGINE': 'django.db.backends.mysql',
4141
'NAME': os.environ.get('DB_NAME', 'enterprise_catalog'),
42-
'USER': os.environ.get('DB_USER', 'root'),
43-
'PASSWORD': os.environ.get('DB_PASSWORD', ''),
44-
'HOST': os.environ.get('DB_HOST', 'enterprise.catalog.mysql'),
42+
'USER': os.environ.get('DB_USER', 'enterprise_catalog001'),
43+
'PASSWORD': os.environ.get('DB_PASSWORD', 'password'),
44+
'HOST': os.environ.get('DB_HOST', 'edx.devstack.mysql80'),
4545
'PORT': os.environ.get('DB_PORT', 3306),
4646
'ATOMIC_REQUESTS': False,
4747
'CONN_MAX_AGE': 60,
@@ -84,7 +84,7 @@
8484
CACHES = {
8585
'default': {
8686
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
87-
'LOCATION': 'enterprise.catalog.memcached:11211',
87+
'LOCATION': 'edx.devstack.memcached:11211',
8888
}
8989
}
9090

py_configuration_files/enterprise_subsidy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
'default': {
1717
'ENGINE': 'django.db.backends.mysql',
1818
'NAME': os.environ.get('DB_NAME', 'enterprise_subsidy'),
19-
'USER': os.environ.get('DB_USER', 'root'),
20-
'PASSWORD': os.environ.get('DB_PASSWORD', ''),
21-
'HOST': os.environ.get('DB_HOST', 'enterprise-subsidy.mysql80'),
19+
'USER': os.environ.get('DB_USER', 'enterprise_subsidy001'),
20+
'PASSWORD': os.environ.get('DB_PASSWORD', 'password'),
21+
'HOST': os.environ.get('DB_HOST', 'edx.devstack.mysql80'),
2222
'PORT': os.environ.get('DB_PORT', 3306),
2323
'ATOMIC_REQUESTS': False,
2424
'CONN_MAX_AGE': 60,
@@ -77,7 +77,7 @@
7777
})
7878

7979
LMS_URL = 'http://edx.devstack.lms:18000'
80-
ENTERPRISE_CATALOG_URL = 'http://enterprise.catalog.app:18160'
80+
ENTERPRISE_CATALOG_URL = 'http://edx.devstack.enterprise-catalog:18160'
8181
ENTERPRISE_SUBSIDY_URL = 'http://localhost:18280'
8282
FRONTEND_APP_LEARNING_URL = 'http://localhost:2000'
8383

py_configuration_files/license_manager.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
}
1919

2020
# OAuth2 variables specific to social-auth/SSO login use case.
21-
SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_KEY', 'license_manager-sso-key')
22-
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_SECRET', 'license_manager-sso-secret')
21+
SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_KEY', 'license-manager-sso-key')
22+
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_SECRET', 'license-manager-sso-secret')
2323
SOCIAL_AUTH_EDX_OAUTH2_ISSUER = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_ISSUER', 'http://localhost:18000')
2424
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT', 'http://edx.devstack.lms:18000')
2525
SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL = os.environ.get('SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL', 'http://localhost:18000/logout')
@@ -28,8 +28,8 @@
2828
)
2929

3030
# OAuth2 variables specific to backend service API calls.
31-
BACKEND_SERVICE_EDX_OAUTH2_KEY = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_KEY', 'license_manager-backend-service-key')
32-
BACKEND_SERVICE_EDX_OAUTH2_SECRET = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_SECRET', 'license_manager-backend-service-secret')
31+
BACKEND_SERVICE_EDX_OAUTH2_KEY = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_KEY', 'license-manager-backend-service-key')
32+
BACKEND_SERVICE_EDX_OAUTH2_SECRET = os.environ.get('BACKEND_SERVICE_EDX_OAUTH2_SECRET', 'license-manager-backend-service-secret')
3333

3434
JWT_AUTH.update({
3535
'JWT_SECRET_KEY': 'lms-secret',
@@ -74,7 +74,7 @@
7474
# END CSRF CONFIG
7575

7676
ENTERPRISE_LEARNER_PORTAL_BASE_URL = 'http://localhost:8734'
77-
ENTERPRISE_CATALOG_URL = 'http://enterprise.catalog.app:18160'
77+
ENTERPRISE_CATALOG_URL = 'http://edx.devstack.enterprise-catalog:18160'
7878
LMS_URL = 'http://edx.devstack.lms:18000'
7979
SUPPORT_SITE_URL = 'https://support.edx.org'
8080

0 commit comments

Comments
 (0)