10.2. Debugging Operator¶
10.2.1. Remote Debugging Python Application with VSCode¶
Using the feature, bundled segmentation operators are configured to support debugging while developing/testing operators locally.
(sdk folder)/clara-reference-app/Operators/ai includes
debug_app_docker.sh script to support debugging AI operator with VSCode.
USAGE: ./debug_app_docker.sh [-p <number>] [app_name] [model_name] -p <number> Remote debug port number to use (default: 3000) -h Help message Args app_name - application name (e.g., app_livertumor) model_name - model name (e.g., segmentation_liver_v1) Examples ./debug_app_docker.sh # Livertumor AI (default) ./debug_app_docker.sh app_braintumor segmentation_mri_brain_tumors_br16_t1c2tc_v1 # Braintumor AI ./debug_app_docker.sh app_vnet # Organ Segmentation AI
./debug_app_docker.sh would launch a VSCode window that app.py file is open. Breakpoints can be toggled by clicking on the editor margin or using
F9 on the current line (see https://code.visualstudio.com/docs/editor/debugging#_breakpoints).
Ctrl + C in the terminal or closing the VSCode window would terminate the app and dependent Docker containers/network.