diff options
author | Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> | 2024-03-07 20:31:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 20:31:50 +0100 |
commit | 3f2f7b75a639da6fe5661d021260f82c8b300044 (patch) | |
tree | cc78bc8573826de3f112e71d43820675e459907d /tools/docker-compose | |
parent | AAP-12273 remove incorrect sentence conjugation (#14946) (diff) | |
download | awx-3f2f7b75a639da6fe5661d021260f82c8b300044.tar.xz awx-3f2f7b75a639da6fe5661d021260f82c8b300044.zip |
[developer productivity improvement] Running awx components in vscode debugger (#14942)
Enable VSCode debugger integration when attaching VSCode to with AWX docker-compose development environment container
- add debugpy launch target in `.vscode/launch.json` to enable launching awx processes with debugpy
- add vscode tasks in `.vscode/tasks.json` to facilitate shutting down corresponding supervisord managed processes while launching process with debugpy
- modify nginx conf to add django runserver as fallback to uwsgi (enable launching API server via debugpy)
Diffstat (limited to 'tools/docker-compose')
-rw-r--r-- | tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2 | 4 | ||||
-rw-r--r-- | tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2 b/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2 index 7115e15582..e0be152818 100644 --- a/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2 +++ b/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2 @@ -29,6 +29,10 @@ http { server localhost:8050; } + upstream runserver { + server localhost:8052; + } + upstream daphne { server localhost:8051; } diff --git a/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 b/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 index fd2b89a691..404be4ade2 100644 --- a/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 +++ b/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 @@ -38,4 +38,12 @@ location {{ ingress_path }} { uwsgi_read_timeout 120s; uwsgi_pass uwsgi; include /etc/nginx/uwsgi_params; + error_page 502 = @fallback; +} + +# Enable scenario where we shutdown uwsgi and launching runserver for debugging purposes +location @fallback { + # Add trailing / if missing + rewrite ^(.*)$http_host(.*[^/])$ $1$http_host$2/ permanent; + proxy_pass http://runserver; } |