Files
buildx/monitor/commands/next.go
Kohei Tokunaga bcf21dee44 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>
2023-06-30 22:05:06 +09:00

35 lines
676 B
Go

package commands
import (
"context"
"github.com/docker/buildx/monitor/types"
"github.com/pkg/errors"
)
type NextCmd struct {
m types.Monitor
}
func NewNextCmd(m types.Monitor) types.Command {
return &NextCmd{m}
}
func (cm *NextCmd) Info() types.CommandInfo {
return types.CommandInfo{
Name: "next",
HelpMessage: "resumes the build until the next vertex",
HelpMessageLong: `
Usage:
next
`,
}
}
func (cm *NextCmd) Exec(ctx context.Context, args []string) error {
if err := cm.m.GetWalkerController().Next(); err != nil {
return errors.Errorf("next: %s : If walker isn't runnig, might need to run \"continue\" command first", err)
}
return nil
}