Skip to content
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

add some info on how to do remote debugging with Visual Studio Code #192

Merged
merged 1 commit into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pages/kb/open-source/dev-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Windows users: while it should be possible to run Redash on a Windows machine, w
## Setup

* [Docker Based Developer Installation Guide]({% link _kb/open-source/dev-guide/docker.md %}) (recommended for beginners)
* [Debugging a Redash Server on Docker Using Visual Studio Code]({% link _kb/open-source/dev-guide/debugging.md %})
* [Developer Installation Guide]({% link _kb/open-source/dev-guide/setup.md %}) (recommended for experienced developers)
* [Using a remote server and installing locally only the frontend dependencies]({% link _kb/open-source/dev-guide/remote-server.md %})

Expand Down
22 changes: 22 additions & 0 deletions src/pages/kb/open-source/dev-guide/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
category: dev-guide
parent_category: open-source
title: Debugging a Redash Server on Docker Using Visual Studio Code
slug: debugging
---

If you've followed [Docker Based Developer Installation Guide]({% link _kb/open-source/dev-guide/docker.md %}), your Redash server is running inside a Docker container and cannot be debugged directly. If you wish to debug server code, you will need to use remote debugging.

## Initial Setup
1. Make sure you have the [Python Extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-python.python) installed.
2. Install ptvsd: `pip install ptvsd`

## Starting a Debugging Session
1. In a terminal window, run `docker-compose stop server && docker-compose run --rm --service-ports server debug && docker-compose start server`
2. Switch over to Visual Studio Code and select "View -> Debug"
3. Select the "Python: Remote Attach" configuration
4. Start debugging (F5)

## Notes
* Once you hit Ctrl+C, the regular development server (with autoreload) will relaunch.
* Code reloading is not supported during a debugging session, so if you'd like to make changes, hit Ctrl+C in the terminal and restart from step 1.
4 changes: 4 additions & 0 deletions src/pages/kb/open-source/dev-guide/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ Before running tests for the first time, you need to create a database for tests
docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
```

### Debugging

See [Debugging a Redash Server on Docker Using Visual Studio Code]({% link _kb/open-source/dev-guide/debugging.md %})

## Configuration

TBD.