Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
feat!: Rename studio service to cms (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq authored and nsprenkle committed Nov 21, 2023
1 parent acad735 commit afc92d0
Show file tree
Hide file tree
Showing 25 changed files with 117 additions and 118 deletions.
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# and SERVICES is a plus-sign-separated list of services.
# Examples:
# make dev.attach.credentials
# make dev.pull.registrar+studio
# make dev.pull.registrar+cms
# make dev.up.lms
# make dev.up.without-deps.lms+forum+discovery+mysql57+elasticsearch+memcached
# make dev.restart-container.mysql57+lms
Expand Down Expand Up @@ -45,15 +45,15 @@
create-test-course dev.attach dev.backup dev.cache-programs dev.check \
dev.check-memory dev.checkout dev.clone dev.clone.https dev.clone.ssh \
dev.dbshell dev.destroy dev.down dev.drop-db dev.kill dev.logs \
dev.migrate dev.migrate.lms dev.migrate.studio \
dev.migrate dev.migrate.lms dev.migrate.cms \
devpi-password dev.provision dev.ps dev.pull dev.pull.without-deps \
dev.reset dev.reset-repos dev.restart-container dev.restart-devserver \
dev.restart-devserver.forum dev.restore dev.rm-stopped dev.shell \
dev.shell.credentials dev.shell.discovery \
dev.shell.ecommerce dev.shell.lms dev.shell.lms_watcher \
dev.shell.registrar dev.shell.studio \
dev.shell.studio_watcher dev.shell.xqueue dev.shell.xqueue_consumer \
dev.static dev.static.lms dev.static.studio dev.stats dev.status \
dev.shell.registrar dev.shell.cms \
dev.shell.cms_watcher dev.shell.xqueue dev.shell.xqueue_consumer \
dev.static dev.static.lms dev.static.cms dev.stats dev.status \
dev.stop dev.up dev.up.attach dev.up.shell \
dev.up.without-deps dev.up.without-deps.shell dev.up.with-programs \
dev.up.with-watchers dev.validate docs \
Expand Down Expand Up @@ -254,9 +254,9 @@ $(foreach db_service,$(DB_SERVICES_LIST),\

dev.migrate: | $(_db_migration_targets) ## Run migrations for applicable default services.

dev.migrate.studio:
docker-compose exec -T -u root studio bash -e -c '/edx/app/edxapp/venvs/edxapp/bin/python manage.py cms showmigrations --database default --traceback --pythonpath=. --settings devstack_docker'
docker-compose exec -T -u root studio bash -e -c '/edx/app/edxapp/venvs/edxapp/bin/python manage.py cms migrate --database default --noinput --traceback --pythonpath=. --settings devstack_docker'
dev.migrate.cms:
docker-compose exec -T -u root cms bash -e -c '/edx/app/edxapp/venvs/edxapp/bin/python manage.py cms showmigrations --database default --traceback --pythonpath=. --settings devstack_docker'
docker-compose exec -T -u root cms bash -e -c '/edx/app/edxapp/venvs/edxapp/bin/python manage.py cms migrate --database default --noinput --traceback --pythonpath=. --settings devstack_docker'

dev.migrate.lms:
docker-compose exec -T -u root lms bash -e -c '/edx/app/edxapp/venvs/edxapp/bin/python manage.py lms showmigrations --database default --traceback --pythonpath=. --settings devstack_docker'
Expand Down Expand Up @@ -293,11 +293,11 @@ dev.up.with-programs: dev.up dev.cache-programs ## Bring up default services + c

dev.up.with-programs.%: dev.up.$* dev.cache-programs ## Bring up services and their dependencies + cache programs in LMS.

dev.up.with-watchers: dev.up.$(DEFAULT_SERVICES)+lms_watcher+studio_watcher ## Bring up default services + asset watcher containers.
dev.up.with-watchers: dev.up.$(DEFAULT_SERVICES)+lms_watcher+cms_watcher ## Bring up default services + asset watcher containers.

dev.up.with-watchers.%: ## Bring up services and their dependencies + asset watcher containers.
make dev.up.$*
make dev.up.lms_watcher+studio_watcher
make dev.up.lms_watcher+cms_watcher

dev.up.without-deps: _expects-service-list.dev.up.without-deps

Expand Down Expand Up @@ -442,11 +442,11 @@ dev.shell.lms:
dev.shell.lms_watcher:
docker-compose exec lms_watcher env TERM=$(TERM) bash -c '/bin/bash'

dev.shell.studio:
docker-compose exec studio env TERM=$(TERM) bash -c '/bin/bash'
dev.shell.cms:
docker-compose exec cms env TERM=$(TERM) bash -c '/bin/bash'

dev.shell.studio_watcher:
docker-compose exec studio_watcher env TERM=$(TERM) bash -c '/bin/bash'
dev.shell.cms_watcher:
docker-compose exec cms_watcher env TERM=$(TERM) bash -c '/bin/bash'

dev.shell.xqueue_consumer:
docker-compose exec xqueue_consumer env TERM=$(TERM) /bin/bash
Expand Down Expand Up @@ -479,8 +479,8 @@ dev.static: | $(_asset_compilation_targets)
dev.static.lms:
docker-compose exec -T lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && paver update_assets lms'

dev.static.studio:
docker-compose exec -T studio bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && paver update_assets studio'
dev.static.cms:
docker-compose exec -T cms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && paver update_assets cms'

dev.static.%: ## Rebuild static assets for the specified service's container.
docker-compose exec -T $* bash -c 'source /edx/app/$*/$*_env && cd /edx/app/$*/$*/ && make static'
Expand Down Expand Up @@ -574,7 +574,7 @@ _expects-service-list.%:
@echo "For example:"
@echo " make $*.lms"
@echo "Or:"
@echo " make $*.registrar+ecommerce+studio"
@echo " make $*.registrar+ecommerce+cms"

_expects-database.%:
@echo "'make $*' on its own has no effect."
Expand Down Expand Up @@ -617,11 +617,11 @@ devpi-password: ## Get the root devpi password for the devpi container.
hadoop-application-logs-%: ## View hadoop logs by application Id.
docker-compose exec nodemanager yarn logs -applicationId $*

create-test-course: ## Provisions studio, and ecommerce with course(s) in test-course.json.
$(WINPTY) bash ./course-generator/create-courses.sh --studio --ecommerce course-generator/test-course.json
create-test-course: ## Provisions cms, and ecommerce with course(s) in test-course.json.
$(WINPTY) bash ./course-generator/create-courses.sh --cms --ecommerce course-generator/test-course.json

build-courses: ## Build course and provision studio, and ecommerce with it.
build-courses: ## Build course and provision cms, and ecommerce with it.
# Modify test-course.json before running this make target to generate a custom course
$(WINPTY) bash ./course-generator/build-course-json.sh course-generator/tmp-config.json
$(WINPTY) bash ./course-generator/create-courses.sh --studio --ecommerce course-generator/tmp-config.json
$(WINPTY) bash ./course-generator/create-courses.sh --cms --ecommerce course-generator/tmp-config.json
rm course-generator/tmp-config.json
4 changes: 2 additions & 2 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ if should_check lms; then
run_check lms_heartbeat lms \
"curl --fail -L http://localhost:18000/heartbeat"

echo "Checking Studio heartbeat:"
run_check studio_heartbeat lms \
echo "Checking CMS heartbeat:"
run_check cms_heartbeat lms \
"curl --fail -L http://localhost:18010/heartbeat"

echo "Validating LMS volume:"
Expand Down
12 changes: 6 additions & 6 deletions compatibility.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
healthchecks lms-restart \
lms-watcher-shell logs provision pull \
pull.xqueue restore static stats stop stop.all \
stop.watchers stop.xqueue studio-restart \
studio-watcher-shell validate \
stop.watchers stop.xqueue cms-restart \
cms-watcher-shell validate \
xqueue_consumer-restart xqueue-restart

#####################################################################
Expand Down Expand Up @@ -53,7 +53,7 @@ dev.repo.reset: dev.reset-repos

dev.up.all: dev.up.with-watchers

dev.up.watchers: dev.up.lms_watcher+studio_watcher
dev.up.watchers: dev.up.lms_watcher+cms_watcher

down: dev.down

Expand Down Expand Up @@ -81,13 +81,13 @@ stop.all: dev.stop

stop: dev.stop

stop.watchers: dev.stop.lms_watcher+studio_watcher
stop.watchers: dev.stop.lms_watcher+cms_watcher

stop.xqueue: dev.stop.xqueue+xqueue_consumer

studio-restart: dev.restart-devserver.studio
cms-restart: dev.restart-devserver.cms

studio-watcher-shell: dev.shell.studio_watcher
cms-watcher-shell: dev.shell.cms_watcher

validate: dev.validate

Expand Down
18 changes: 9 additions & 9 deletions course-generator/create-courses.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash
# Script that provisions studio, and ecommerce with courses
# USAGE: ./create-courses [--studio] [--ecommerce] course-config.json
studio=false
# Script that provisions cms, and ecommerce with courses
# USAGE: ./create-courses [--cms] [--ecommerce] course-config.json
cms=false
ecommerce=false
echo "Parsing options"
container_error=false
for arg in "$@"; do
if [ $arg == "--studio" ]; then
if [ ! "$(docker-compose exec lms bash -c 'echo "Course will be created for studio"; exit $?')" ]; then
echo "Issue with studio container"
if [ $arg == "--cms" ]; then
if [ ! "$(docker-compose exec lms bash -c 'echo "Course will be created for cms"; exit $?')" ]; then
echo "Issue with cms container"
container_error=true
else
studio=true
cms=true
fi
elif [ $arg == "--ecommerce" ]; then
if [ ! "$(docker-compose exec ecommerce bash -c 'echo "Course will be created for ecommerce"; exit $?')" ]; then
Expand Down Expand Up @@ -40,8 +40,8 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
course_json=$course_json${line/"\"number\": null"/"\"number\": \""$RANDOM"\""}
done < "${@: -1}"

if $studio ; then
echo "Creating courses on studio."
if $cms ; then
echo "Creating courses on cms."
docker-compose exec lms bash -c "source /edx/app/edxapp/edxapp_env && python /edx/app/edxapp/edx-platform/manage.py cms --settings=devstack_docker generate_courses '$course_json'"
fi

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
registrar-worker:
volumes:
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
studio:
cms:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform
- edxapp_media:/edx/var/edxapp/media
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-themes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ services:
lms:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-themes:/edx/app/edx-themes
studio:
cms:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-themes:/edx/app/edx-themes
12 changes: 6 additions & 6 deletions docker-compose-watchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ services:
aliases:
- edx.devstack.lms_watcher

studio_watcher:
cms_watcher:
command: bash -c 'cd /edx/app/edxapp/edx-platform && source ../edxapp_env && while true; do paver watch_assets --w=$$ASSET_WATCHER_TIMEOUT; sleep 2; done'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.studio_watcher"
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.cms_watcher"
environment:
BOK_CHOY_HOSTNAME: edx.devstack.studio_watcher
BOK_CHOY_HOSTNAME: edx.devstack.cms_watcher
ASSET_WATCHER_TIMEOUT: 12
image: openedx/lms-dev:${OPENEDX_RELEASE:-latest}
volumes:
- edxapp_studio_assets:/edx/var/edxapp/staticfiles/
- edxapp_cms_assets:/edx/var/edxapp/staticfiles/
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform
- edxapp_node_modules:/edx/app/edxapp/edx-platform/node_modules
- ${DEVSTACK_WORKSPACE}/src:/edx/src
- ${DEVSTACK_WORKSPACE}/edx-themes:/edx/app/edx-themes
networks:
default:
aliases:
- edx.devstack.studio_watcher
- edx.devstack.cms_watcher

volumes:
edxapp_lms_assets:
edxapp_studio_assets:
edxapp_cms_assets:
edxapp_node_modules:
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,22 +656,22 @@ services:
volumes:
- /edx/var/registrar/

studio:
cms:
command: bash -c 'source /edx/app/edxapp/edxapp_env && while true; do python /edx/app/edxapp/edx-platform/manage.py cms runserver 0.0.0.0:18010 --settings devstack_docker; sleep 2; done'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.studio"
hostname: studio.devstack.edx
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.cms"
hostname: cms.devstack.edx
depends_on:
- devpi
- elasticsearch710
- lms
- memcached
- mongo
- mysql57
# Allows attachment to the Studio service using 'docker attach <containerID>'.
# Allows attachment to the CMS service using 'docker attach <containerID>'.
stdin_open: true
tty: true
environment:
BOK_CHOY_HOSTNAME: edx.devstack.studio
BOK_CHOY_HOSTNAME: edx.devstack.cms
BOK_CHOY_LMS_PORT: 18103
BOK_CHOY_CMS_PORT: 18131
EDXAPP_TEST_MONGO_HOST: edx.devstack.mongo
Expand All @@ -686,15 +686,15 @@ services:
networks:
default:
aliases:
- edx.devstack.studio
- studio.devstack.edx
- edx.devstack.cms
- cms.devstack.edx
ports:
- "18010:18010"
- "19877:19877" # JS test debugging
# - "18103:18103"
# - "18131:18131"
volumes:
- edxapp_studio_assets:/edx/var/edxapp/staticfiles/
- edxapp_cms_assets:/edx/var/edxapp/staticfiles/

xqueue:
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.xqueue"
Expand Down Expand Up @@ -796,7 +796,7 @@ services:
ports:
- "2001:2001"
depends_on:
- studio
- cms

frontend-app-gradebook:
extends:
Expand Down Expand Up @@ -857,7 +857,7 @@ services:
- "3001:3001"
depends_on:
- lms
- studio
- cms

frontend-app-payment:
extends:
Expand Down Expand Up @@ -910,7 +910,7 @@ volumes:
discovery_assets:
devpi_data:
edxapp_lms_assets:
edxapp_studio_assets:
edxapp_cms_assets:
elasticsearch_data:
elasticsearch7_data:
elasticsearch710_data:
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/0001-avoid-default-service-set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Approved
Context
-------

Commands like ``make dev.pull`` and ``make dev.up`` operate by default on a large subset of the services that devstack supports (via overridable variable ``DEFAULT_SERVICES``). There are also variants such as ``make dev.up.studio+credentials`` which will operate on a more constrained subset. However, many developers are not aware of these variants or are not in the habit of using them. By not constraining the command to selected services, developers pull down Docker images that they do not need for their current workflow, or find that devstack is using more memory and CPU than needed due to running unnecessary services. These issues have been repeatedly observed in supporting fellow edX devs in internal communications, and are likely an issue in the community as well. We also see people run into bugs in unrelated services, distracting them from their main task.
Commands like ``make dev.pull`` and ``make dev.up`` operate by default on a large subset of the services that devstack supports (via overridable variable ``DEFAULT_SERVICES``). There are also variants such as ``make dev.up.cms+credentials`` which will operate on a more constrained subset. However, many developers are not aware of these variants or are not in the habit of using them. By not constraining the command to selected services, developers pull down Docker images that they do not need for their current workflow, or find that devstack is using more memory and CPU than needed due to running unnecessary services. These issues have been repeatedly observed in supporting fellow edX devs in internal communications, and are likely an issue in the community as well. We also see people run into bugs in unrelated services, distracting them from their main task.

Several people and teams have made efforts to improve the documentation and offer these better-scoped commands, but we still see complaints about memory, CPU, and network usage that can be solved by avoiding the default set.

Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/0004-backends-depend-on-frontends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ However, it can be argued that the opposite dependency relationship also makes s
Decision
========

Whichever dependency direction (frontends depend on backends, or vice versa) is more logically sound, we conclude that, for the purposes of Devstack, *asserting that backends depend on frontends is more useful to developers*. Specifically, it is beneficial to current and future developer workflows if ``make dev.up.lms`` automatically starts and learning-related frontends, ``make dev.up.studio`` automatically starts all authoring-related frontends, ``make dev.up.ecommerce`` starts all purchasing-related frontends, and so on.
Whichever dependency direction (frontends depend on backends, or vice versa) is more logically sound, we conclude that, for the purposes of Devstack, *asserting that backends depend on frontends is more useful to developers*. Specifically, it is beneficial to current and future developer workflows if ``make dev.up.lms`` automatically starts and learning-related frontends, ``make dev.up.cms`` automatically starts all authoring-related frontends, ``make dev.up.ecommerce`` starts all purchasing-related frontends, and so on.

A necessary corollary to this decision is that *all micro-frontends required for default functionality must be included in devstack*. While it is encouraged that *all* new and existing micro-frontends are added to devstack using the pattern described above, it is absolutely necessary that MFEs which are required for out-of-the-box functionality be added to devstack.

Expand Down
6 changes: 3 additions & 3 deletions docs/devpi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ could not be done while offline due to not being able to contact PyPI.
To help speed up those tasks and bring us close to being able to use
Devstack entirely offline we have introduced a devpi PyPI cache container
to Devstack. Currently it is only configured as a package cache for LMS
and Studio, but the hope is to expand its use to the other Devstack
and CMS, but the hope is to expand its use to the other Devstack
applications and to move to a state where it comes pre-populated with the
requirements of all Devstack applications.

Expand All @@ -28,7 +28,7 @@ https://www.devpi.net/
What is cached?
---------------

devpi will cache anything that LMS or Studio pull from PyPI via pip,
devpi will cache anything that LMS or CMS pull from PyPI via pip,
including things from the various requirements files. It will not cache
requirements given as URLs (ex. ``git+https`` style links) or local
packages (ex. ``-e common/lib/calc``). When these types of packages are
Expand All @@ -52,7 +52,7 @@ Disabling devpi
---------------

To temporarily remove devpi caching from an edxapp container, start a
shell (``dev.shell.lms`` or ``dev.shell.studio``) and move or delete
shell (``dev.shell.lms`` or ``dev.shell.cms``) and move or delete
``/root/.pip/pip.conf``. This will be undone on the next container
restart unless the container state is persisted.

Expand Down
Loading

0 comments on commit afc92d0

Please sign in to comment.