Commit Graph

3669 Commits (9004de880471f193b927c5aeb2e87a8f12d1efd7)

Author SHA1 Message Date
Sebastiaan van Stijn 314bedc808
util/sshutil: minor linting / warning nits
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-01 17:01:15 +01:00
Davis Schirmer a507923951
Update buildx version 0.5.1 => 0.7.1
https://github.com/docker/buildx/releases/tag/v0.7.1
Signed-off-by: Davis Schirmer <djds@bghost.xyz>
2021-12-01 02:36:32 -05:00
Davis Schirmer b479dc75c6
Fix unbound var error for BINDIR, PREFIX
Signed-off-by: Davis Schirmer <djds@bghost.xyz>
2021-12-01 02:36:31 -05:00
Tonis Tiigi 0dd260bcf5 progessui: return warnings from printer
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-30 21:58:37 -08:00
Tonis Tiigi d100814aad progressui: show warnings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-30 21:58:37 -08:00
Tonis Tiigi 50963e289e dockerfile: show redirect parser warnings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-30 21:58:37 -08:00
Tonis Tiigi 7ee783e90c add source mapping support to warnings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-30 21:58:37 -08:00
Tõnis Tiigi 2d63c3559a
Merge pull request #2482 from tonistiigi/warnings
support setting warnings from frontends
2021-11-30 21:58:22 -08:00
Erik Sipsma 159bb1e677
Merge pull request #2480 from sipsma/overlay-diff-file-fix
overlay differ: Do file comparison in some cases.
2021-11-24 18:24:45 -08:00
Erik Sipsma 18292913c4 overlay differ: Do file comparison in some cases.
This change results in the overlay differ comparing files to determine
if they are actually part of the diff. This is needed to resolve
differences between the blobs created by the overlay differ and the
double-walking differ.

Before this change, the overlay differ always just assumed that if a
file was in the upperdir it must be part of the diff and included it as
an add or a modify change. However, there are situations in which files
can appear in the upperdir without having been modified or even opened.
For example, if "foo" is a file or dir present in the lowerdirs of an
overlay mount and you run "mv foo footmp; mv footmp foo", then the
upperdir will contain foo (in addition to any files found under foo if
it's a dir). In this situation, the double-walking differ would not
include foo as part of the diff, but the overlay differ would.

This meant that the overlay differ would potentially include extra files
in each blob for such diffs relative to the double-walking differ. As of
now, while this does increase image size, it doesn't result in any
inconsistencies in terms of the contents of images because it just
results in files/dirs getting duplicated on top of their equivalents.

However, for the upcoming DiffOp support, this inconsistency could
actually result in the same operation producing mounts with different
contents depending on which differ is used. This change is therefore
necessary in order to enforce DiffOp consistency (on top of the possible
improvements to exported image size).

The main concern here is that this could undo the performance benefits
that the overlay differ was intended to fix. However, in practice the
situations where this has worse performance are quite obscure and the
benefits should still be present.

First, consider the case where foo is a directory and the user does the
equivalent of "mv foo footmp; mv footmp foo". Even before this change,
the overlay differ would see that foo is marked as opaque and thus fall
back to using the double-walking differ. So there's no performance
regression in this case as the double-walking differ does the same
file comparisons as were added in this commit.

For the case where the user shuffles a file back and forth, there will
potentially be a slow file content based comparison if the underlying
file has a truncated nanosecond timestamp (i.e. it was unpacked from a
tar file). However, the situations in which you shuffle an individual
file without changing it (or open it for writing but then write nothing)
that is large enough in size for content comparisons to be slow are
obscure. Additionally, while the content comparison may be slow, there
will be time saved during export because the file won't be included
unnecessarily in the exported blob, so it's a tradeoff rather than a
pure loss.

In situations where the user actually did change a file and it shows up
in the upperdir, it should be extremely rare that the content comparison
code path is followed. It would require that the user changed no other
metadata of the file, including size, and both mod timestamps were the
same (which could only really happen if their underlying filesystem
lacked support for nanosecond precision and they modified the file
within 1 second of its modification in the lowerdir or they manually
changed the modtime with chtimes).

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-24 11:27:32 -08:00
Tonis Tiigi 6cad384e93 support setting warnings from frontends
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-24 00:19:43 -08:00
Akihiro Suda 79ac30b979
Merge pull request #2481 from alexcb/acb/update-containerd-continuity
update containerd to latest version (v1.6.0-beta.3)
2021-11-24 10:56:09 +09:00
Alex Couture-Beil cb63ca84fa
update containerd to latest version (v1.6.0-beta.3)
This updates containerd to v1.6.0-beta.3; done by running:

    go get -u github.com/containerd/containerd
    ./hack/update-vendor

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2021-11-23 15:50:03 -08:00
Tõnis Tiigi d5b7ce35d8
Merge pull request #2473 from afbjorklund/systemd-rootless
Add systemd support for rootless buildkitd
2021-11-22 16:43:45 -08:00
Tõnis Tiigi f9cb2b7b4a
Merge pull request #2456 from sunchunming/fix_grpc_message_overflow
limit vertex size with 50000 to avoid huge grpc message making client…
2021-11-19 00:01:33 -08:00
Anders F Björklund 4d6a45bfae Isolate systemd user network namespace from host
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-11-19 07:59:19 +01:00
sunchunming bb24010f6e limit log vertex size with 1M to avoid huge grpc message making client buffer overflow
Signed-off-by: sunchunming <sunchunming1@jd.com>
2021-11-19 14:49:31 +08:00
Tõnis Tiigi 3a9963bf0e
Merge pull request #2475 from aaronlehmann/ticker-leak
Fix ticker leak in DisplaySolveStatus
2021-11-18 17:37:39 -08:00
Aaron Lehmann f71293f5de Fix ticker leak in DisplaySolveStatus
The "defer" is bound to the original value of the ticker, and won't stop
a ticker that's created later in the function. Example:
https://play.golang.org/p/puat5JEf5Jw

Ran into this in a health checker that periodically created buildkit
clients.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-11-18 15:36:46 -08:00
Tõnis Tiigi 8d02e473a4
Merge pull request #2474 from sipsma/file-rm-no-follow
Remove symlink, not target, in FileOp.Rm.
2021-11-18 14:08:22 -08:00
Erik Sipsma 43a74261b3 Remove symlink, not target, in FileOp.Rm.
Before this change, if the path provided to FileOp.Rm was a symlink then
the target of the symlink would be removed instead of the symlink
itself. Now, the symlink will be removed instead. However, any symlinks
present in the parent dirs of the specified path will still be resolved
before calling os.Remove; this change only results in the base of the
specified path not being followed.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-18 12:44:12 -08:00
Tõnis Tiigi fce4a32258
Merge pull request #2335 from sipsma/mergeop-impl
MergeOp
2021-11-18 11:52:15 -08:00
Anders F Björklund 149400aa7e Add systemd support for rootless buildkitd
Also add systemd notify support, for both.

Use proxy and access all, for rootlesskit.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-11-18 20:34:55 +01:00
Erik Sipsma d73e62f878 Add initial MergeOp implementation.
This consists of just the base MergeOp with support for merging LLB
results that include deletions using hardlinks as the efficient path
and copies as fallback.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-18 11:10:48 -08:00
Akihiro Suda 009bf4dd68
Merge pull request #2469 from tonistiigi/mediatype-detection
imageutil: make mediatype detection more stricter
2021-11-18 16:47:01 +09:00
Tõnis Tiigi 345c677b85
Merge pull request #2397 from tonistiigi/git-deterministic
git: make fetch with keep-git-dir more deterministic
2021-11-17 22:39:33 -08:00
Tonis Tiigi b449431019 imageutil: make mediatype detection more stricter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-17 15:44:18 -08:00
Erik Sipsma 9321ec2f82 Refactor cache record mount cache.
This is mostly just preparation for merge-op. The existing
Extract method is updated to be usable for unlazying any type of refs
rather than just lazy blobs. The way views are created is simplified and
centralized in one location.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-17 11:02:16 -08:00
Erik Sipsma 03ed0548ef cache: Replace Parent method with LayerChain.
The Parent method will no longer make sense with forthcoming Merge and
Diff support as refs will become capable of having multiple parents. It
was also only ever used externally to get the full chain of refs for
each layer in the ref's chain.

The newly added LayerChain method replaces Parents with a method that
just returns a slice of refs for each layer in the ref's chain. This
will work more seamlessly with Merge and Diff (in which case it returns
the "flattened" ancestors of the ref) in addition to being a bit easier
to use for the exiting cases anyways.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-17 11:02:16 -08:00
Erik Sipsma 2fcce87cf4 Include DescHandler CacheOpts during export.
Before this, descriptor handlers were not included with calls to the
exporter, which then sometimes called LoadRef and failed to get a ref
because it was lazy. This change results in the DescHandlers of the
already loaded refs to get plugged into context so they can be re-used
by the exporter if it needs to load the ref again.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-17 11:02:16 -08:00
Tõnis Tiigi bb2e7ce8a6
Merge pull request #2466 from ktock/bump-containerd-1.6.x
Bump up containerd to the latest 1.6
2021-11-16 22:05:04 -08:00
Kohei Tokunaga eb711680a3 Bump up containerd to the latest
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-11-17 13:36:57 +09:00
Tõnis Tiigi 324fc9333b
Merge pull request #2464 from sipsma/overlay-utils
Move overlay diff to util package.
2021-11-15 17:27:46 -08:00
Erik Sipsma 982f4b8687 Move overlay diff to util package.
This allows the overlay diff logic to be re-used by the snapshot package
as part of merge+diff op.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-15 14:19:37 -08:00
Akihiro Suda 357524943f
Merge pull request #2461 from tonistiigi/pusher-workaround-wrap
push: workaround deadlock in containerd pusher
2021-11-14 18:27:28 +09:00
Tonis Tiigi faf5ad9e96 push: workaround deadlock in containerd pusher
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-12 17:33:08 -08:00
Tõnis Tiigi f421e24291
Merge pull request #2455 from AkihiroSuda/doc-rootless-20211110
update rootless docs
2021-11-10 15:14:28 -08:00
Akihiro Suda 57659ca24a
update rootless docs
Kernel-mode overlayfs is now widely available, so we can simplify docs/rootless.md

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-11-10 21:31:52 +09:00
Akihiro Suda a87b801ca0
Merge pull request #2443 from tonistiigi/frontend-def
gateway: allow access to current frontend definition
2021-11-10 13:25:37 +09:00
Tõnis Tiigi 083dfc9f63
Merge pull request #2452 from crazy-max/update-hashstructure
update to github.com/mitchellh/hashstructure v2.0.2
2021-11-09 16:14:13 -08:00
CrazyMax d81e79540b
update to github.com/mitchellh/hashstructure v2.0.2
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-09 09:56:10 +01:00
Tonis Tiigi 0364e00aac gateway: allow access to current frontend definition
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-11-05 20:27:50 -07:00
Tõnis Tiigi 0ad26d49f2
Merge pull request #2448 from thaJeztah/bump_moby_sys
go.mod: github.com/moby/sys/mount v0.3.0, mountinfo v0.5.0, signal v0.6.0
2021-11-05 20:22:33 -07:00
Sebastiaan van Stijn 5b489dc25c
go.mod: github.com/moby/sys/signal v0.6.0
full diff: https://github.com/moby/sys/compare/8a51b5cc8879...signal/v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 13:28:54 +01:00
Sebastiaan van Stijn 17a0e3ed12
go.mod: github.com/moby/sys/mount v0.3.0, mountinfo v0.5.0
- diff: https://github.com/moby/sys/compare/mount/v0.2.0...mount/v0.3.0
- diff: https://github.com/moby/sys/compare/mountinfo/v0.4.1...mount/v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 13:26:59 +01:00
Sebastiaan van Stijn 98f9c412e1
go.mod: golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359
full diff: ed5796bab1...69cdffdb93

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 13:23:26 +01:00
CrazyMax fae6ef5031
Merge pull request #2445 from crazy-max/fix-ci
ci: fix git protocol
2021-11-02 18:50:22 +01:00
CrazyMax b434e7314b
ci: fix git protocol
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-02 18:02:32 +01:00
Akihiro Suda 0279989d7f
Merge pull request #2433 from tonistiigi/gha-export-fix
gha: fix handling removed blobs on reexport
2021-11-01 13:23:57 +09:00
Akihiro Suda d47b46cf2a
Merge pull request #2432 from crazy-max/gofmt
go fmt: add //go:build
2021-10-29 12:32:52 +09:00