Add Python debugging support#2205
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2205 +/- ##
==========================================
+ Coverage 58.6% 59.06% +0.45%
==========================================
Files 188 189 +1
Lines 7805 7924 +119
==========================================
+ Hits 4574 4680 +106
- Misses 2859 2866 +7
- Partials 372 378 +6
Continue to review full report at Codecov.
|
pkg/skaffold/debug/transform.go
Outdated
| } | ||
| if len(supportFilesRequired) > 0 { | ||
| logrus.Infof("Configuring installation of debugging support files") | ||
| supportVolume := v1.Volume{Name: "debugging-support-files", VolumeSource: v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}}} |
There was a problem hiding this comment.
"debugging-support-files" is used on multiple lines. Extract to constant?
loosebazooka
left a comment
There was a problem hiding this comment.
Just some stuff to clarify things for me?
|
PTAL @loosebazooka @ILMTitan |
|
@quoctruong PTAL |
loosebazooka
left a comment
There was a problem hiding this comment.
Just some language stuff I'm not sure about, feel free to ignore or whatever.
|
Also might be worth doing a ux study with the team to see if we can all follow the instructions 🛩️ |
There was a problem hiding this comment.
LGTM.
Re Approvals: you had changes in a main util file hence our review was required. Also more "debug" related files were changed for integration testing that weren't owned by you, so I added those to the CODEOWNERS in #2292
This patch adds support to
skaffold debugfor Python 2.7 and 3.x debugging. Python requires additional debugging runtime support files, which are fetched and installed using aninitContainerbase.These debugging runtime support files are installed via
initContainersfrom images defined in https://github.com/GoogleContainerTools/container-debug-support/. These images are currently manually pushed togcr.io/gcp-dev-tools/duct-tape/XXXwhere XXX is a runtime-specific identifier likepython(supports both Python 2.7 and 3.7).The Python image installs the
ptvsdmodule, a wrapper that uses the IDE/editor-agnostic debug adapter protocol (DAP). This protocol has become a de facto standard for interacting with remote runtimes.Manual Testing
For manual testing, you'll need to use VS Code or Eclipse with LSP4e, or some other editor that supports the DAP. I had to launch my debug session with the following launch parameters, to map the local file system to the remote file system in the container:
{"pathMappings": [ { "localRoot": "_/your/local/path_", "remoteRoot": "/app" }]}The debugger is on port 5678.
Fixes #2173