Skip to content

A template for debugging long running, dockerized programs in python with vscode

Notifications You must be signed in to change notification settings

sam-watts/vscode-docker-debugging

Repository files navigation

Debugging dockerized python scripts with vscode

A template for debugging long running, containerized ML applications in python with vscode.

import debugpy

debugpy.listen(("0.0.0.0", 5678))
print("Waiting for client to attach...")
debugpy.wait_for_client()

See medium post for a full explanation: Debugging for Dockerized ML applications in Python

Running

  1. Set some breakpoints in main.py with either:
    • The vscode UI
    • Use the debugpy.breakpoint() function
  2. Run bash ./run_container.sh to build the docker image and run the container
  3. Once the container is running, select the Python: Docker Attach debugging configuration
  4. Debug away 😍

About

A template for debugging long running, dockerized programs in python with vscode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published