Skip to content

Commit

Permalink
add some info on how to do remote debugging with Visual Studio Code (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Lachish authored Feb 11, 2019
1 parent fe45e15 commit 95acb31
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
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.

0 comments on commit 95acb31

Please sign in to comment.