-
Notifications
You must be signed in to change notification settings - Fork 13
Update debugging support for Django and Celery #1048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9eea9ef
feat: add debugpy debugging support for Django and Celery
mihow 1d80beb
chore: add pipefail option to celery worker start as well
mihow 9950584
fix: ensure celeryworker doesn't reuse django ports
mihow bb2a2b6
feat: allow auto reload for celery worker even with debugger
mihow f22225a
chore: comments & cleanup
mihow 4fc5c0d
chore: rename example file so that linting works
mihow 160a24d
feat: allow debugger to work properly with Django
mihow 274b22d
chore: remove redunant launch config
mihow 7bf6582
chore: don't auto reload celery worker
mihow 5c37f03
chore: make script volume mount options consistent
mihow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,7 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -o errexit | ||
|
mihow marked this conversation as resolved.
|
||
| set -o pipefail | ||
| set -o nounset | ||
|
|
||
|
|
||
| exec watchfiles --filter python celery.__main__.main --args '-A config.celery_app worker -l INFO' | ||
| # Launch VS Code debug server if DEBUGGER environment variable is set to 1 | ||
| # Note that auto reloading is disabled when debugging, manual restart required for code changes. | ||
| if [ "${DEBUGGER:-0}" = "1" ]; then | ||
| # exec watchfiles --filter python 'python -m debugpy --listen 0.0.0.0:5679 -m celery -A config.celery_app worker -l INFO' | ||
| exec python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:5679 -m celery -A config.celery_app worker -l INFO | ||
| else | ||
| exec watchfiles --filter python celery.__main__.main --args '-A config.celery_app worker -l INFO' | ||
| fi | ||
|
mihow marked this conversation as resolved.
|
||
This file contains hidden or 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 hidden or 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,30 @@ | ||
| # Docker Compose Override File for Local Development | ||
| # | ||
| # This file can be used to enable debugging and other local development features (db volume location, etc.) | ||
| # without affecting the committed docker-compose.yml file. | ||
| # | ||
| # Setup Instructions: | ||
| # 1. Copy this file: cp docker-compose.override-example.yml docker-compose.override.yml | ||
| # 2. Start services: docker compose up | ||
| # 3. Attach debugger from VS Code using the launch configurations in .vscode/launch.json | ||
| # | ||
| # The docker-compose.override.yml file is git-ignored for local customization. | ||
|
|
||
| services: | ||
| django: | ||
| environment: | ||
| - DEBUGGER=1 | ||
| ports: | ||
| - "5678:5678" | ||
| volumes: | ||
| # allow modifying the start script without rebuilding the image | ||
| - ./compose/local/django/start:/start | ||
|
|
||
| celeryworker: | ||
| environment: | ||
| - DEBUGGER=1 | ||
| ports: | ||
| - "5679:5679" | ||
| volumes: | ||
| # allow modifying the start script without rebuilding the image | ||
| - ./compose/local/django/celery/worker/start:/start-celeryworker | ||
|
mihow marked this conversation as resolved.
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.