monitor: support step-by-step breakpoint debugger

This commit adds a set of commands to monitor for enabling breakpoint debugger.
This is implemented based on the walker utility for step-by-step LLB inspection.
For each vertex and breakpoint, monitor calls Solve API so the user can enter to
the debugger container on each vertex for inspection.

User can enter to the breakpoint debugger mode by --invoke=debug-step flag.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
Kohei Tokunaga
2023-06-30 21:24:39 +09:00
parent b1ae24df65
commit bcf21dee44
14 changed files with 495 additions and 26 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/docker/buildx/controller/control"
controllerapi "github.com/docker/buildx/controller/pb"
"github.com/docker/buildx/util/walker"
)
// Monitor provides APIs for attaching and controlling the buildx server.
@@ -34,6 +35,12 @@ type Monitor interface {
// AttachedSessionID returns the ID of the attached session.
AttachedSessionID() string
// RegisterWalkerController registers the specified walker to the monitor.
RegisterWalkerController(wc *walker.Controller)
// GetWalkerController returns the currently registered walker.
GetWalkerController() *walker.Controller
}
// CommandInfo is information about a command.