mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
8
vendor/github.com/moby/buildkit/client/prune.go
generated
vendored
8
vendor/github.com/moby/buildkit/client/prune.go
generated
vendored
@ -59,10 +59,10 @@ type PruneOption interface {
|
||||
}
|
||||
|
||||
type PruneInfo struct {
|
||||
Filter []string
|
||||
All bool
|
||||
KeepDuration time.Duration
|
||||
KeepBytes int64
|
||||
Filter []string `json:"filter"`
|
||||
All bool `json:"all"`
|
||||
KeepDuration time.Duration `json:"keepDuration"`
|
||||
KeepBytes int64 `json:"keepBytes"`
|
||||
}
|
||||
|
||||
type pruneOptionFunc func(*PruneInfo)
|
||||
|
8
vendor/github.com/moby/buildkit/client/workers.go
generated
vendored
8
vendor/github.com/moby/buildkit/client/workers.go
generated
vendored
@ -13,10 +13,10 @@ import (
|
||||
|
||||
// WorkerInfo contains information about a worker
|
||||
type WorkerInfo struct {
|
||||
ID string
|
||||
Labels map[string]string
|
||||
Platforms []ocispecs.Platform
|
||||
GCPolicy []PruneInfo
|
||||
ID string `json:"id"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
Platforms []ocispecs.Platform `json:"platforms"`
|
||||
GCPolicy []PruneInfo `json:"gcPolicy"`
|
||||
}
|
||||
|
||||
// ListWorkers lists all active workers
|
||||
|
1
vendor/github.com/moby/buildkit/cmd/buildkitd/config/config.go
generated
vendored
1
vendor/github.com/moby/buildkit/cmd/buildkitd/config/config.go
generated
vendored
@ -70,6 +70,7 @@ type OCIConfig struct {
|
||||
// For use in storing the OCI worker binary name that will replace buildkit-runc
|
||||
Binary string `toml:"binary"`
|
||||
ProxySnapshotterPath string `toml:"proxySnapshotterPath"`
|
||||
DefaultCgroupParent string `toml:"defaultCgroupParent"`
|
||||
|
||||
// StargzSnapshotterConfig is configuration for stargz snapshotter.
|
||||
// We use a generic map[string]interface{} in order to remove the dependency
|
||||
|
3
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
3
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
@ -1,7 +1,6 @@
|
||||
package exptypes
|
||||
|
||||
import (
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
@ -16,8 +15,6 @@ const (
|
||||
ExporterPlatformsKey = "refs.platforms"
|
||||
)
|
||||
|
||||
const EmptyGZLayer = digest.Digest("sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1")
|
||||
|
||||
type Platforms struct {
|
||||
Platforms []Platform
|
||||
}
|
||||
|
57
vendor/github.com/moby/buildkit/util/progress/progressui/display.go
generated
vendored
57
vendor/github.com/moby/buildkit/util/progress/progressui/display.go
generated
vendored
@ -119,7 +119,6 @@ type trace struct {
|
||||
localTimeDiff time.Duration
|
||||
vertexes []*vertex
|
||||
byDigest map[digest.Digest]*vertex
|
||||
nextIndex int
|
||||
updates map[digest.Digest]struct{}
|
||||
modeConsole bool
|
||||
groups map[string]*vertexGroup // group id -> group
|
||||
@ -156,7 +155,7 @@ type vertex struct {
|
||||
// Interval start time in unix nano -> interval. Using a map ensures
|
||||
// that updates for the same interval overwrite their previous updates.
|
||||
intervals map[int64]interval
|
||||
mostRecentStart *time.Time
|
||||
mergedIntervals []interval
|
||||
|
||||
// whether the vertex should be hidden due to being in a progress group
|
||||
// that doesn't have any non-weak members that have started
|
||||
@ -171,17 +170,23 @@ func (v *vertex) update(c int) {
|
||||
v.count += c
|
||||
}
|
||||
|
||||
func (v *vertex) mostRecentInterval() *interval {
|
||||
if v.isStarted() {
|
||||
ival := v.mergedIntervals[len(v.mergedIntervals)-1]
|
||||
return &ival
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *vertex) isStarted() bool {
|
||||
return len(v.intervals) > 0
|
||||
return len(v.mergedIntervals) > 0
|
||||
}
|
||||
|
||||
func (v *vertex) isCompleted() bool {
|
||||
for _, ival := range v.intervals {
|
||||
if ival.stop == nil {
|
||||
return false
|
||||
}
|
||||
if ival := v.mostRecentInterval(); ival != nil {
|
||||
return ival.stop != nil
|
||||
}
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
type vertexGroup struct {
|
||||
@ -208,9 +213,6 @@ func (vg *vertexGroup) refresh() (changed, newlyStarted, newlyRevealed bool) {
|
||||
newlyStarted = true
|
||||
}
|
||||
vg.intervals[subVtx.Started.UnixNano()] = newInterval
|
||||
if vg.mostRecentStart == nil || subVtx.Started.After(*vg.mostRecentStart) {
|
||||
vg.mostRecentStart = subVtx.Started
|
||||
}
|
||||
|
||||
if !subVtx.ProgressGroup.Weak {
|
||||
vg.hidden = false
|
||||
@ -241,6 +243,12 @@ func (vg *vertexGroup) refresh() (changed, newlyStarted, newlyRevealed bool) {
|
||||
newlyRevealed = true
|
||||
}
|
||||
|
||||
var ivals []interval
|
||||
for _, ival := range vg.intervals {
|
||||
ivals = append(ivals, ival)
|
||||
}
|
||||
vg.mergedIntervals = mergeIntervals(ivals)
|
||||
|
||||
return changed, newlyStarted, newlyRevealed
|
||||
}
|
||||
|
||||
@ -410,7 +418,6 @@ func (t *trace) update(s *client.SolveStatus, termWidth int) {
|
||||
if v.ProgressGroup != nil {
|
||||
group, ok := t.groups[v.ProgressGroup.Id]
|
||||
if !ok {
|
||||
t.nextIndex++
|
||||
group = &vertexGroup{
|
||||
vertex: &vertex{
|
||||
Vertex: &client.Vertex{
|
||||
@ -419,7 +426,6 @@ func (t *trace) update(s *client.SolveStatus, termWidth int) {
|
||||
},
|
||||
byID: make(map[string]*status),
|
||||
statusUpdates: make(map[string]struct{}),
|
||||
index: t.nextIndex,
|
||||
intervals: make(map[int64]interval),
|
||||
hidden: true,
|
||||
},
|
||||
@ -441,11 +447,9 @@ func (t *trace) update(s *client.SolveStatus, termWidth int) {
|
||||
}
|
||||
prev, ok := t.byDigest[v.Digest]
|
||||
if !ok {
|
||||
t.nextIndex++
|
||||
t.byDigest[v.Digest] = &vertex{
|
||||
byID: make(map[string]*status),
|
||||
statusUpdates: make(map[string]struct{}),
|
||||
index: t.nextIndex,
|
||||
intervals: make(map[int64]interval),
|
||||
}
|
||||
if t.modeConsole {
|
||||
@ -468,9 +472,11 @@ func (t *trace) update(s *client.SolveStatus, termWidth int) {
|
||||
start: v.Started,
|
||||
stop: v.Completed,
|
||||
}
|
||||
if t.byDigest[v.Digest].mostRecentStart == nil || v.Started.After(*t.byDigest[v.Digest].mostRecentStart) {
|
||||
t.byDigest[v.Digest].mostRecentStart = v.Started
|
||||
var ivals []interval
|
||||
for _, ival := range t.byDigest[v.Digest].intervals {
|
||||
ivals = append(ivals, ival)
|
||||
}
|
||||
t.byDigest[v.Digest].mergedIntervals = mergeIntervals(ivals)
|
||||
}
|
||||
t.byDigest[v.Digest].jobCached = false
|
||||
}
|
||||
@ -479,7 +485,7 @@ func (t *trace) update(s *client.SolveStatus, termWidth int) {
|
||||
changed, newlyStarted, newlyRevealed := group.refresh()
|
||||
if newlyStarted {
|
||||
if t.localTimeDiff == 0 {
|
||||
t.localTimeDiff = time.Since(*group.mostRecentStart)
|
||||
t.localTimeDiff = time.Since(*group.mergedIntervals[0].start)
|
||||
}
|
||||
}
|
||||
if group.hidden {
|
||||
@ -539,8 +545,8 @@ func (t *trace) update(s *client.SolveStatus, termWidth int) {
|
||||
v.logs[len(v.logs)-1] = append(v.logs[len(v.logs)-1], dt...)
|
||||
} else {
|
||||
ts := time.Duration(0)
|
||||
if v.isStarted() {
|
||||
ts = l.Timestamp.Sub(*v.mostRecentStart)
|
||||
if ival := v.mostRecentInterval(); ival != nil {
|
||||
ts = l.Timestamp.Sub(*ival.start)
|
||||
}
|
||||
prec := 1
|
||||
sec := ts.Seconds()
|
||||
@ -653,15 +659,14 @@ func (t *trace) displayInfo() (d displayInfo) {
|
||||
}
|
||||
for _, w := range v.warnings {
|
||||
msg := "WARN: " + string(w.Short)
|
||||
mostRecentStart := v.mostRecentStart
|
||||
var mostRecentStop *time.Time
|
||||
if mostRecentStart != nil {
|
||||
mostRecentStop = v.intervals[mostRecentStart.UnixNano()].stop
|
||||
var mostRecentInterval interval
|
||||
if ival := v.mostRecentInterval(); ival != nil {
|
||||
mostRecentInterval = *ival
|
||||
}
|
||||
j := &job{
|
||||
intervals: []interval{{
|
||||
start: addTime(mostRecentStart, t.localTimeDiff),
|
||||
stop: addTime(mostRecentStop, t.localTimeDiff),
|
||||
start: addTime(mostRecentInterval.start, t.localTimeDiff),
|
||||
stop: addTime(mostRecentInterval.stop, t.localTimeDiff),
|
||||
}},
|
||||
name: msg,
|
||||
isCanceled: true,
|
||||
|
46
vendor/github.com/moby/buildkit/util/progress/progressui/printer.go
generated
vendored
46
vendor/github.com/moby/buildkit/util/progress/progressui/printer.go
generated
vendored
@ -27,10 +27,11 @@ type lastStatus struct {
|
||||
}
|
||||
|
||||
type textMux struct {
|
||||
w io.Writer
|
||||
current digest.Digest
|
||||
last map[string]lastStatus
|
||||
notFirst bool
|
||||
w io.Writer
|
||||
current digest.Digest
|
||||
last map[string]lastStatus
|
||||
notFirst bool
|
||||
nextIndex int
|
||||
}
|
||||
|
||||
func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
@ -43,6 +44,11 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
return
|
||||
}
|
||||
|
||||
if v.index == 0 {
|
||||
p.nextIndex++
|
||||
v.index = p.nextIndex
|
||||
}
|
||||
|
||||
if dgst != p.current {
|
||||
if p.current != "" {
|
||||
old := t.byDigest[p.current]
|
||||
@ -75,6 +81,7 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
}
|
||||
v.events = v.events[:0]
|
||||
|
||||
isOpenStatus := false // remote cache loading can currently produce status updates without active vertex
|
||||
for _, s := range v.statuses {
|
||||
if _, ok := v.statusUpdates[s.ID]; ok {
|
||||
doPrint := true
|
||||
@ -118,6 +125,8 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
}
|
||||
if s.Completed != nil {
|
||||
tm += " done"
|
||||
} else {
|
||||
isOpenStatus = true
|
||||
}
|
||||
fmt.Fprintf(p.w, "#%d %s%s%s\n", v.index, s.ID, bytes, tm)
|
||||
}
|
||||
@ -157,7 +166,7 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
}
|
||||
|
||||
p.current = dgst
|
||||
if v.Completed != nil {
|
||||
if v.isCompleted() && !isOpenStatus {
|
||||
p.current = ""
|
||||
v.count = 0
|
||||
|
||||
@ -174,8 +183,17 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
fmt.Fprintf(p.w, "#%d CACHED\n", v.index)
|
||||
} else {
|
||||
tm := ""
|
||||
if v.Started != nil {
|
||||
tm = fmt.Sprintf(" %.1fs", v.Completed.Sub(*v.Started).Seconds())
|
||||
var ivals []interval
|
||||
for _, ival := range v.intervals {
|
||||
ivals = append(ivals, ival)
|
||||
}
|
||||
ivals = mergeIntervals(ivals)
|
||||
if len(ivals) > 0 {
|
||||
var dt float64
|
||||
for _, ival := range ivals {
|
||||
dt += ival.duration().Seconds()
|
||||
}
|
||||
tm = fmt.Sprintf(" %.1fs", dt)
|
||||
}
|
||||
fmt.Fprintf(p.w, "#%d DONE%s\n", v.index, tm)
|
||||
}
|
||||
@ -190,7 +208,9 @@ func sortCompleted(t *trace, m map[digest.Digest]struct{}) []digest.Digest {
|
||||
out = append(out, k)
|
||||
}
|
||||
sort.Slice(out, func(i, j int) bool {
|
||||
return t.byDigest[out[i]].Completed.Before(*t.byDigest[out[j]].Completed)
|
||||
vtxi := t.byDigest[out[i]]
|
||||
vtxj := t.byDigest[out[j]]
|
||||
return vtxi.mostRecentInterval().stop.Before(*vtxj.mostRecentInterval().stop)
|
||||
})
|
||||
return out
|
||||
}
|
||||
@ -204,7 +224,11 @@ func (p *textMux) print(t *trace) {
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if v.Vertex.Completed != nil {
|
||||
if v.ProgressGroup != nil || v.hidden {
|
||||
// skip vtxs in a group (they are merged into a single vtx) and hidden ones
|
||||
continue
|
||||
}
|
||||
if v.isCompleted() {
|
||||
completed[dgst] = struct{}{}
|
||||
} else {
|
||||
rest[dgst] = struct{}{}
|
||||
@ -226,13 +250,13 @@ func (p *textMux) print(t *trace) {
|
||||
|
||||
if len(rest) == 0 {
|
||||
if current != "" {
|
||||
if v := t.byDigest[current]; v.Started != nil && v.Completed == nil {
|
||||
if v := t.byDigest[current]; v.isStarted() && !v.isCompleted() {
|
||||
return
|
||||
}
|
||||
}
|
||||
// make any open vertex active
|
||||
for dgst, v := range t.byDigest {
|
||||
if v.Started != nil && v.Completed == nil {
|
||||
if v.isStarted() && !v.isCompleted() {
|
||||
p.printVtx(t, dgst)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user