Skip to content

Commit

Permalink
Add pdb-compatible script and documentation (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
brilee authored Oct 25, 2023
1 parent 94d86a1 commit ec96344
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ npm run format --workspace web/lib
npm run format --workspace web/blueprint
```

### Debug Lilac using pdb

To attach PDB to the Lilac server:

```sh
./run_server_pdb.sh
```

This starts the Lilac webserver in a single-threaded mode, ready to accept requests and respond to
PDB breakpoints. Pro-tip: Chrome's inspector can take logged network requests and Copy > Copy as
CURL command, which can be used to replay an API call to the Lilac server.

### Testing

Run all the checks before mailing:
Expand Down
4 changes: 4 additions & 0 deletions run_server_pdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

export LILAC_PROJECT_DIR='./data'
poetry run python -c "import lilac.server; import uvicorn; uvicorn.run(lilac.server.app, host='0.0.0.0', port=5173)"

0 comments on commit ec96344

Please sign in to comment.