This repository was archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev): add script to run auto-reloading celery workers
The single script starts celery scheduler, analytics worker and alerts worker. It also stops all 3 of them on doing ctrl-c. Added a new dependency `watchdog` to watch files and restart workers when there's a code change. TODO: have a flag to disable auto-reload.
- Loading branch information
Showing
5 changed files
with
18 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env sh | ||
|
||
source .venv/bin/activate | ||
|
||
(trap 'kill 0' SIGINT EXIT; \ | ||
./scripts/celery/dev_scheduler.sh & \ | ||
./scripts/celery/dev_worker-analytics.sh & \ | ||
./scripts/celery/dev_worker-alerts.sh ) |
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,2 @@ | ||
#!/usr/bin/env sh | ||
watchmedo auto-restart --directory=./ --pattern=*.py --recursive -- celery -A run.celery beat --loglevel=DEBUG |
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,2 @@ | ||
#!/usr/bin/env sh | ||
watchmedo auto-restart --directory=./ --pattern=*.py --recursive -- celery -A run.celery worker --loglevel=INFO --concurrency=2 -P processes -Q alerts |
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,2 @@ | ||
#!/usr/bin/env sh | ||
watchmedo auto-restart --directory=./ --pattern=*.py --recursive -- celery -A run.celery worker --loglevel=INFO --concurrency=2 -P processes -Q anomaly-rca |