Commit Graph

3639 Commits (a813906e858eef6f3ffd0884dcd578ff0e7cb432)

Author SHA1 Message Date
Alex Couture-Beil c55a0b888c
use newer MatchesUsingParentResults
switch to using newer MatchesUsingParentResults methods which were
introduced in https://github.com/moby/moby/pull/43037

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2021-12-08 09:41:55 -08:00
Alex Couture-Beil 197f619956
update fsutil and docker
update fsutil to include this patch: d952e50eae

docker also had to be updated due to 2d121ce88f

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2021-12-08 09:41:52 -08:00
Tõnis Tiigi 90690ca0c9
Merge pull request #2509 from tonistiigi/archutil-bullseye
archutil: update generator
2021-12-07 20:39:38 -08:00
Tõnis Tiigi 70d7ac4ced
Merge pull request #2489 from thisismydesign/patch-1
Clarify Export cache docs
2021-12-07 20:39:28 -08:00
Tõnis Tiigi bfd3cfb6a0
Merge pull request #2507 from sipsma/mobymerge
Update tests for consistency w/ dockerd.
2021-12-07 10:34:18 -08:00
Tonis Tiigi 86b4bdbca4 archutil: update generator
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-12-06 22:25:25 -08:00
Erik Sipsma 0539181757 Update tests for consistency w/ dockerd.
When vendored into moby, the local exporter uses a user map that results
in all files being given at most 755 permissions. This change updates
the test to use permissions less than or equal to that to make tests
equivalent whether running w/ dockerd worker or any other type.

Additionally, add assertions that exported images also have the expected
contents, which helps ensures consistency between images created by
dockerd and those created by vanilla buildkit.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-12-06 19:18:16 -08:00
Akihiro Suda 539558b58d
Merge pull request #2506 from tonistiigi/update-actions-cache
vendor: update go-actions-cache to 96427041
2021-12-06 14:26:24 +09:00
Csaba Apagyi 44fe33967e Clarify export cache docs
Signed-off-by: Csaba Apagyi <csaba.apagyi@gmail.com>
2021-12-04 16:25:37 +01:00
Tonis Tiigi f0c28eaf00 vendor: update go-actions-cache to 96427041
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-12-03 15:57:46 -08:00
Tõnis Tiigi f24f0a87b5
Merge pull request #2505 from thaJeztah/update_crypto_ssh
go.mod: golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
2021-12-03 10:33:14 -08:00
Sebastiaan van Stijn 367ae027cf
go.mod: golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
full diff: 0c34fe9e7d...5770296d90

includes a fix in golang.org/x/crypto/ssh for CVE-2021-43565

- golang/go#49932
- 5770296d90

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-03 09:09:16 +01:00
Tõnis Tiigi d68e5d8d10
Merge pull request #2499 from djds/master
hack: update install-buildx
2021-12-02 18:20:12 -08:00
Tonis Tiigi 71316c6f29 split warning message into short and detail
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-12-02 18:17:35 -08:00
Tõnis Tiigi 188b696ac3
Merge pull request #2493 from ktock/bump-stargz-snapshotter-v0.10.1 2021-12-02 13:41:45 -08:00
Erik Sipsma c64578c23f
Merge pull request #2503 from sipsma/fix-merge-blobchainid
Fix merge blobchainid
2021-12-02 13:11:18 -08:00
Erik Sipsma 441f1e7b27 cache: log missing providers for blobchainID ref
Before this, if you try to get a ref with an equal blobchain in
GetByBlob but hit a missing provider, the error was just returned. While
we never expect this situation to happen (you shouldn't be able to hit
this line if you didn't already have providers for each blob in the
chain), it technically shouldn't fail the build as you can just continue
on without re-using the ref with equal blobchainID.

Now, we log this at error level but allow the build to continue.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-12-02 12:28:28 -08:00
Erik Sipsma 5872bf3dd1 cache: fix merge ref chain IDs.
This fixes an issue where merge refs were incorrectly setting their
chain IDs to their last input's ID. This resulted in errors where
GetByBlob thought the merge ref and the final input ref were equivalent.

Now, merge refs have their chain IDs computed by digesting each blob in
the full chain.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-12-02 12:21:44 -08:00
Kohei Tokunaga ae565231a0 Bump up github.com/containerd/stargz-snapshotter to v0.10.1
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-12-02 13:51:22 +09:00
Tõnis Tiigi dea9a4a9da
Merge pull request #2500 from thaJeztah/lint_nits
util/sshutil: minor linting / warning nits
2021-12-01 12:35:36 -08:00
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