-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Debugger for Docker Deployer #6528
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6528 +/- ##
==========================================
- Coverage 70.48% 69.86% -0.62%
==========================================
Files 515 520 +5
Lines 23150 23528 +378
==========================================
+ Hits 16317 16438 +121
- Misses 5776 6030 +254
- Partials 1057 1060 +3
Continue to review full report at Codecov.
|
2197615
to
46f40ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments from a first pass
2c8bd7f
to
1a62d42
Compare
1d80aa8
to
888c700
Compare
Can you please add instructions on how to test the Docker Deployer debugger against VSCode on any sample project? |
pkg/skaffold/deploy/docker/deploy.go
Outdated
@@ -67,18 +74,24 @@ func NewDeployer(ctx context.Context, cfg dockerutil.Config, labeller *label.Def | |||
return nil, err | |||
} | |||
|
|||
debugHelpersRegistry, err := config.GetDebugHelpersRegistry(cfg.GlobalConfig()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do this later, but IMHO this should be config.GetDebugHelpersRegistry()
with no argument, and the implementation should be looking into the global config. This deployer code should not need to know how the registry is being looked up.
@@ -53,12 +53,22 @@ var ( | |||
|
|||
type Config interface { | |||
Prune() bool | |||
GlobalConfig() string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment about how GlobalConfig
should be hidden as an implementation detail.
76e2421
to
4924335
Compare
All you'll need to do is add the following setting to your VSCode "cloudcode.autoDependencies": "off", VSCode will then use the skaffold binary on your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nits
f7c3fd5
to
f75ccfa
Compare
kokoro seems to be hanging but all other tests are passing, so self merging |
Fixes #6107
NOTE: This change also unhides the Docker deployer, making it publicly available for use.
Description
This change implements debug support for the Docker deployer, the final piece of the initial implementation for the Deployer.
Any containers created by the Docker deployer will go through the existing entrypoint rewriting logic in Skaffold, which will generate a set of modified applications containers along with a set of init containers. These init containers will be created before the application containers, and will create volumes in the local docker daemon that will be mounted into the application containers. These volumes function in a similar way to the ones created in the existing Kubernetes debug implementation, which contain the shared debugging files necessary to get the debugging binaries into the application containers.
A
DebugManager
object is created in the Deployer, which is primarily responsible for tracking the modified resources during a debug run. TheDebugManager
also tracks the support resources created to ensure smooth creation of init containers, as well as emitting events during the skaffold lifecycle.The port allocation logic from the existing debugging implementation has been slightly modified to consume a Deployer-specific implementation of the
isPortAvailable()
function, such that it can be reused across multiple packages.