Skip to content

Commit

Permalink
Merge pull request #11 from self-five/buildkit-noclip
Browse files Browse the repository at this point in the history
Apply patches to disable BuildKit log clipping by default
  • Loading branch information
tianon authored Mar 4, 2024
2 parents ab48cca + 222eafc commit 17784e1
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
7 changes: 7 additions & 0 deletions moby-engine/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
moby-engine (20.10.27-2) UNRELEASED; urgency=medium

* Backport https://github.com/moby/buildkit/commit/18821ec794e870693763a6fb314064e70efe7969
* Apply patch to disable BuildKit log clipping by default

-- Tianon Gravi <[email protected]> Mon, 04 Mar 2024 15:42:26 -0800

moby-engine (20.10.27-1) unstable; urgency=medium

* Update to 20.10.27
Expand Down
28 changes: 28 additions & 0 deletions moby-engine/debian/patches/buildkit-fixclip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Description: fix buildkit clipping configuration
Applied-Upstream: https://github.com/moby/buildkit/commit/18821ec794e870693763a6fb314064e70efe7969, 21+ (buildkit 0.9+)

diff --git a/vendor/github.com/moby/buildkit/util/progress/logs/logs.go b/vendor/github.com/moby/buildkit/util/progress/logs/logs.go
index da82c6923eba..73c1a26b50ac 100644
--- a/vendor/github.com/moby/buildkit/util/progress/logs/logs.go
+++ b/vendor/github.com/moby/buildkit/util/progress/logs/logs.go
@@ -71,15 +71,16 @@ func (sw *streamWriter) checkLimit(n int) int {
maxSize = int(math.Ceil(time.Since(sw.created).Seconds())) * defaultMaxLogSpeed
sw.clipReasonSpeed = true
}
- if maxSize > defaultMaxLogSize {
+ if maxSize == -1 || maxSize > defaultMaxLogSize {
maxSize = defaultMaxLogSize
sw.clipReasonSpeed = false
}
- if maxSize < oldSize {
- return 0
- }

if maxSize != -1 {
+ if maxSize < oldSize {
+ return 0
+ }
+
if sw.size > maxSize {
return maxSize - oldSize
}
19 changes: 19 additions & 0 deletions moby-engine/debian/patches/buildkit-noclip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: disable buildkit's default log clipping
Author: Tianon Gravi <[email protected]>
Forwarded: no (upstream's defaults are intentional, Tianon just disagrees with them)

diff --git a/vendor/github.com/moby/buildkit/util/progress/logs/logs.go b/vendor/github.com/moby/buildkit/util/progress/logs/logs.go
index bfecdda6b3..079d7e561a 100644
--- a/vendor/github.com/moby/buildkit/util/progress/logs/logs.go
+++ b/vendor/github.com/moby/buildkit/util/progress/logs/logs.go
@@ -18,8 +18,8 @@ import (
"github.com/tonistiigi/units"
)

-var defaultMaxLogSize = 2 * 1024 * 1024
-var defaultMaxLogSpeed = 200 * 1024 // per second
+var defaultMaxLogSize = -1
+var defaultMaxLogSpeed = -1

const (
stdout = 1
2 changes: 2 additions & 0 deletions moby-engine/debian/patches/series
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
containerd-arm64-v8.patch
buildkit-fixclip.patch
buildkit-noclip.patch

0 comments on commit 17784e1

Please sign in to comment.