Merge pull request #194 from ckan/debugpy-fix

update instructions, cache dir for VS Code debugging
This commit is contained in:
Brett Jones 2024-12-12 15:06:30 +01:00 committed by GitHub
commit 31e39c8806
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -165,6 +165,10 @@ development instance in your `.env` file:
USE_DEBUGPY_FOR_DEV=true USE_DEBUGPY_FOR_DEV=true
``` ```
Next run the install script to install debugpy:
docker compose -f docker-compose.dev.yml run -u root ckan-dev ./install_src.sh
Then start the containers in [development mode](#development-mode) and launch VS Code. Then start the containers in [development mode](#development-mode) and launch VS Code.
In VS Code: In VS Code:
@ -172,8 +176,9 @@ In VS Code:
1. Install the "Dev Container" extension: press CTRL+SHIFT+X, type "dev container", click "install" 1. Install the "Dev Container" extension: press CTRL+SHIFT+X, type "dev container", click "install"
2. Click the "Open a Remote Window" button in the bottom-left of the VS Code window 2. Click the "Open a Remote Window" button in the bottom-left of the VS Code window
3. Click "Attach to Running Container..." and select your ckan-dev container, e.g. "ckan-docker-ckan-dev-1" 3. Click "Attach to Running Container..." and select your ckan-dev container, e.g. "ckan-docker-ckan-dev-1"
4. Click the "Run and Debug" icon on the left panel then "create a launch.json", select "Python Debugger", "Remote Attach", host "localhost" and port "5678" 4. Click the "Run and Debug" icon on the left panel and choose to install the "Python Debugger"
5. Press F5 or click the "Run" menu and "Start Debugging" 5. Click "create a launch.json", select "Python Debugger", "Remote Attach", host "localhost" and port "5678"
6. Press F5 or click the "Run" menu and "Start Debugging"
You can now set breakpoints and remote debug your CKAN development instance. You can now set breakpoints and remote debug your CKAN development instance.

View File

@ -5,7 +5,7 @@ volumes:
pip_cache: pip_cache:
site_packages: site_packages:
local_bin: local_bin:
vscode_server: home_dir:
services: services:
@ -29,7 +29,7 @@ services:
- pip_cache:/root/.cache/pip - pip_cache:/root/.cache/pip
- site_packages:/usr/local/lib/python3.10/site-packages - site_packages:/usr/local/lib/python3.10/site-packages
- local_bin:/usr/local/bin - local_bin:/usr/local/bin
- vscode_server:/root/.vscode-server - home_dir:/srv/app/
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"] test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]