Coder Social home page Coder Social logo

robusta-dev / debug-toolkit Goto Github PK

View Code? Open in Web Editor NEW
57.0 7.0 3.0 75 KB

A modern code-injection framework for Python. Like Pyrasite but Kubernetes-aware.

Home Page: http://robusta.dev/

License: MIT License

Dockerfile 8.98% Python 87.97% Shell 3.05%

debug-toolkit's Introduction

TL;DR

A modern code-injection framework for Python + useful utilities.

This is like Pyrasite but without the bugs and Kubernetes-aware.

This powers many Robusta features. You should probably use Robusta instead of using this directly.

Overview

This repo contains source code for the docker container that powers the following Robusta features:

  1. Inject code into Python apps
  2. Attach a VSCode debugger to any Python application running on Kubernetes - this works by injecting debugpy
  3. Profile cpu and memory usage of Python apps - this works by wrapping PySpy (for CPU) and by injecting the tracemalloc library into the target process (for memory)
  4. List processes in any pod (not just Python)

Essentially, it is two things:

  1. A Pyrasite replacement that fixes deadlocks and other issues.
  2. A Docker container containing that Pyrasite replacement, which is used by Robusta to troubleshoot and debug containers

Adding new python injection payloads

  1. Add a new payload in src/debug_toolkit/payloads
    1. Make sure ALL of your code is inside the entrypoint function, even imports. Errors are not handled or reported for code outside of the entrypoint.
  2. Add a wrapper command in src/debug_toolkit/main.py

Releasing a new version

  1. Bump the version in pyproject.toml
  2. Run the following, replacing "v4" with the tag of the new release.
skaffold build --tag v4

That is all. We're not pushing versions to pypi right now.

debug-toolkit's People

Contributors

aantn avatar anfatum avatar avi-robusta avatar sheeproid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.