Commit baaa23fc by Eric Fischer

Fix for asset watcher containers.

When paired with https://github.com/edx/edx-platform/pull/16051,
fixes the excesssive CPU usage in watcher containers by increasing
the polling interval of watchdog's PollingObserver.
parent 82a0f198
########################################################################################################################
#
# When adding a new target:
# - If you are adding a new service make sure the dev.clean target will fully reset said service.
# - If you are adding a new service make sure the dev.reset target will fully reset said service.
#
########################################################################################################################
.DEFAULT_GOAL := help
......@@ -38,6 +38,11 @@ dev.repo.reset: ## Attempts to reset the local repo checkouts to the master work
dev.up: | check-memory ## Bring up all services with host volumes
docker-compose -f docker-compose.yml -f docker-compose-host.yml up -d
dev.up.watchers: | check-memory ## Bring up asset watcher containers
docker-compose docker-compose-watchers.yml up -d
dev.up.all: | dev.up dev.up.asset_watchers ## Bring up all services with host volumes, including watchers
dev.sync.daemon.start: ## Start the docker-sycn daemon
docker-sync start
......@@ -54,11 +59,16 @@ provision: | dev.provision ## This command will be deprecated in a future releas
stop: ## Stop all services
(test -d .docker-sync && docker-sync stop) || true ## Ignore failure here
docker-compose stop
docker-compose -f docker-compose.yml stop
stop.watchers: ## Stop asset watchers
docker-compose -f docker-compose-watchers.yml stop
stop.all: | stop stop.watchers ## Stop all containers, including asset watchers
down: ## Remove all service containers and networks
(test -d .docker-sync && docker-sync clean) || true ## Ignore failure here
docker-compose down
docker-compose -f docker-compose.yml -f docker-compose-watchers.yml down
destroy: ## Remove all devstack-related containers, networks, and volumes
./destroy.sh
......@@ -119,12 +129,21 @@ update-db: | studio-update-db lms-update-db discovery-update-db ecommerce-update
lms-shell: ## Run a shell on the LMS container
docker exec -it edx.devstack.lms env TERM=$(TERM) /edx/app/edxapp/devstack.sh open
lms-watcher-shell: ## Run a shell on the LMS watcher container
docker exec -it edx.devstack.lms_watcher env TERM=$(TERM) /edx/app/edxapp/devstack.sh open
lms-attach: ## Attach to the LMS container process to use the debugger & see logs.
docker attach `docker ps -aqf "name=edx.devstack.lms$$"`
docker attach edx.devstack.lms
studio-shell: ## Run a shell on the Studio container
docker exec -it edx.devstack.studio env TERM=$(TERM) /edx/app/edxapp/devstack.sh open
studio-watcher-shell: ## Run a shell on the studio watcher container
docker exec -it edx.devstack.studio_watcher env TERM=$(TERM) /edx/app/edxapp/devstack.sh open
studio-attach: ## Attach to the Studio container process to use the debugger & see logs.
docker attach edx.devstack.studio
%-static: ## Rebuild static assets for the specified service container
docker exec -t edx.devstack.$* bash -c 'source /edx/app/$*/$*_env && cd /edx/app/$*/$*/ && make static'
......@@ -139,9 +158,6 @@ studio-static: ## Rebuild static assets for the Studio container
static: | credentials-static discovery-static ecommerce-static lms-static studio-static ## Rebuild static assets for all service containers
studio-attach: ## Attach to the Studio container process to use the debugger & see logs.
docker attach `docker ps -aqf "name=edx.devstack.studio$$"`
healthchecks: ## Run a curl against all services' healthcheck endpoints to make sure they are up. This will eventually be parameterized
./healthchecks.sh
......
......@@ -14,16 +14,10 @@ services:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached
- ${DEVSTACK_WORKSPACE}/src:/edx/src:cached
lms_watcher:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached
studio:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached
- ${DEVSTACK_WORKSPACE}/src:/edx/src:cached
studio_watcher:
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached
forum:
volumes:
- ${DEVSTACK_WORKSPACE}/cs_comments_service:/edx/app/forum/cs_comments_service:cached
......
version: "2.1"
services:
lms_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.devstack.lms_watcher
environment:
BOK_CHOY_HOSTNAME: edx.devstack.lms_watcher
ASSET_WATCHER_TIMEOUT: 12
image: edxops/edxapp:latest
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached
- edxapp_lms_assets:/edx/var/edxapp/staticfiles/
studio_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.devstack.studio_watcher
environment:
BOK_CHOY_HOSTNAME: edx.devstack.studio_watcher
ASSET_WATCHER_TIMEOUT: 12
image: edxops/edxapp:latest
volumes:
- edxapp_studio_assets:/edx/var/edxapp/staticfiles/
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform:cached
volumes:
edxapp_lms_assets:
edxapp_studio_assets:
......@@ -149,15 +149,6 @@ services:
volumes:
- edxapp_lms_assets:/edx/var/edxapp/staticfiles/
lms_watcher:
command: bash -c 'cd /edx/app/edxapp/edx-platform && source ../edxapp_env && while true; do paver watch_assets; sleep 2; done'
container_name: edx.devstack.lms_watcher
environment:
BOK_CHOY_HOSTNAME: edx.devstack.lms_watcher
image: edxops/edxapp:latest
volumes:
- edxapp_lms_assets:/edx/var/edxapp/staticfiles/
studio:
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.devstack.studio
......@@ -183,15 +174,6 @@ services:
volumes:
- edxapp_studio_assets:/edx/var/edxapp/staticfiles/
studio_watcher:
command: bash -c 'cd /edx/app/edxapp/edx-platform && source ../edxapp_env && while true; do paver watch_assets; sleep 2; done'
container_name: edx.devstack.studio_watcher
environment:
BOK_CHOY_HOSTNAME: edx.devstack.studio_watcher
image: edxops/edxapp:latest
volumes:
- edxapp_studio_assets:/edx/var/edxapp/staticfiles/
forum:
command: bash -c 'source /edx/app/forum/ruby_env && source /edx/app/forum/devstack_forum_env && cd /edx/app/forum/cs_comments_service && while true; do ruby app.rb -o 0.0.0.0 ; sleep 2; done'
container_name: edx.devstack.forum
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment