Improve tty error logging when buildkit vertex is unknown (#2188)

* Improve tty error logging when buildkit vertex is unknown

Creates a generic "system" group in the tty output which captures
buildkit events that report a non-dagger vertex name. This happens
currently when using core.#Dockerfile actions since Dagger delegates the
LLB generation to buildkit through it's frontend and we don't get
meaningful events that we can correlate from Dagger's side

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Nils
2022-04-18 21:50:34 -03:00
committed by GitHub
parent 437f4517b6
commit 27d878456f
8 changed files with 163 additions and 87 deletions

View File

@@ -25,9 +25,11 @@ const (
defaultDisplayTimeout = 100 * time.Millisecond
)
type VertexPrintFunc func(v *client.Vertex, index int)
type StatusPrintFunc func(v *client.Vertex, format string, a ...interface{})
type LogPrintFunc func(v *client.Vertex, stream int, partial bool, format string, a ...interface{})
type (
VertexPrintFunc func(v *client.Vertex, index int)
StatusPrintFunc func(v *client.Vertex, format string, a ...interface{})
LogPrintFunc func(v *client.Vertex, stream int, partial bool, format string, a ...interface{})
)
func PrintSolveStatus(ctx context.Context, ch chan *client.SolveStatus, vertexPrintCb VertexPrintFunc, statusPrintCb StatusPrintFunc, logPrintCb LogPrintFunc) error {
printer := &textMux{
@@ -148,8 +150,10 @@ func DisplaySolveStatus(ctx context.Context, phase string, c console.Console, w
}
}
const termHeight = 6
const termPad = 10
const (
termHeight = 6
termPad = 10
)
type displayInfo struct {
startTime time.Time

View File

@@ -11,10 +11,12 @@ import (
"github.com/tonistiigi/units"
)
const antiFlicker = 5 * time.Second
const maxDelay = 10 * time.Second
const minTimeDelta = 5 * time.Second
const minProgressDelta = 0.05 // %
const (
antiFlicker = 5 * time.Second
maxDelay = 10 * time.Second
minTimeDelta = 5 * time.Second
minProgressDelta = 0.05 // %
)
type lastStatus struct {
Current int64