Skip to content
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 docs/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
* [Python packages](workloads/dependencies/python-packages.md)
* [System packages](workloads/dependencies/system-packages.md)
* [Custom images](workloads/dependencies/images.md)
* [Debugging](workloads/debugging.md)

## Clients

Expand Down
23 changes: 23 additions & 0 deletions docs/workloads/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Debugging

You can test and debug your handler implementation and image by running your API container locally.

The `cortex prepare-debug` command will generate a debugging configuration file named `<api_name>.debug.json` based on your api spec, and it will print out a corresponding `docker run` command that can be used to run the container locally.

For example:

```bash
cortex prepare-debug cortex.yaml iris-classifier

> docker run -p 9000:8888 \
> -e "CORTEX_VERSION=master" \
> -e "CORTEX_API_SPEC=/mnt/project/iris-classifier.debug.json" \
> -v /home/ubuntu/iris-classifier:/mnt/project \
> quay.io/cortexlabs/python-handler-cpu:master
```

Make a request to the api container:

```bash
curl localhost:9000 -X POST -H "Content-Type: application/json" -d @sample.json
```