Commit Graph

3642 Commits (78bb7137eeafd3bdcf9cf0f2f7126754daad4dcf)

Author SHA1 Message Date
Brian Goff 78bb7137ee Do not re-tag non-distributable blob descriptors
Before this change buildkit was changing the media type for
non-distributable layers to normal layers.
It was also clearing out the urls to get those blobs.

Now the layer mediatype and URL's are preserved.
If a layer blob is seen more than once, if it has extra URL's they will
be appended to the stored value.

On export there is now a new exporter option to preserve the
non-distributable data values.
All URL's seen by buildkit will be added to the exported content.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-02-10 01:12:42 +00:00
Erik Sipsma 2f996517bc
Merge pull request #2611 from sipsma/source-map-panic
Work around concurrent map write issue in tests.
2022-02-08 17:59:36 -08:00
Erik Sipsma 21d6b1258f Work around concurrent map write issue in tests.
The merge diff tests were using some common LLB state objects across
multiple test cases, which each have their own buildkit client and ran
in parallel. The LLB client library does not appear to currently work
with such use cases where LLB states are shared, with errors about
concurrent map writes to marshal state constraints occasionally being
hit during test runs.

Until that issue is addressed (or it's made explicit that the LLB client
library is not expected to work in such a way), this works around the
problem by not sharing states and instead using common funcs that return
distinct state instances.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-08 17:19:00 -08:00
Tõnis Tiigi a813906e85
Merge pull request #2600 from ktock/fixconversionfailure
Resolver: ensure `WithSession` to pass the session to the resolver
2022-02-08 16:33:53 -08:00
Tõnis Tiigi 81c4d7423f
Merge pull request #2513 from sipsma/lazy-progress
Lazy progress + Progress Groups
2022-02-08 16:24:15 -08:00
Erik Sipsma ae245ff349 solver: use unique vertex progress IDs.
This fixes an issue where if a vertex rapidly had progress updates (such
as the case where CacheMap runs in succession for multiple indexes),
then progress updates were all using the same ID and could incorrectly
override one another, resulting in missing vertex updates.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-08 12:00:21 -08:00
Erik Sipsma 2dfec01fed progress: support vertex start/stop intervals.
Previously, vertexes sent to progress might have multiple intervals in
which they started+stopped, but the output only knew about the most
recent interval. Now, all the intervals are tracked and the total time
spent on each (after accounting for overlaps) is displayed. This is
implemented both for normal vertexes and progress group vertexes.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-08 11:27:51 -08:00
Erik Sipsma 0566b9a345 Add support for progress groups.
This allows clients to specify that LLB states should be grouped in
progress output under a custom name. Status updates for all vertexes in
the group will show up under a single vertex in the output.

The intended use cases are for Dockerfile COPY's that use MergeOp as a
backend and for grouping some other internal vertexes during frontend
builds.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-08 11:27:49 -08:00
Erik Sipsma bb09f3c032 Improve progress output for merge+diff ops.
Now, when a merge or diff ref is unlazied, the progress will show up
under the vertex for the merge/diff ref. Additionally, any ancestors of
the op that also need to be unlazied as part of unlazying the merge/diff
will show status updates under its vertex in the progress.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-08 11:26:05 -08:00
Erik Sipsma 553d3eafda Use parentheses for merge+diff vertex names.
This is easier to read than quotes, which result in lots of escaping in
progress output.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-08 11:26:05 -08:00
Tõnis Tiigi e8f5f523aa
Merge pull request #2602 from tonistiigi/env-matches
shell: add function to detect what env were used
2022-02-08 10:10:42 -08:00
Tõnis Tiigi 17e01bac9a
Merge pull request #2579 from tonistiigi/secret-env
exec: allow mounting secret environment variables
2022-02-08 10:09:55 -08:00
Tõnis Tiigi fb38dd3714
Merge pull request #2601 from ktock/conversion-bufio
cache: write blob to the content store via bufio during conversion
2022-02-07 21:36:53 -08:00
Tõnis Tiigi dc32a321a0
Merge pull request #2606 from aaronlehmann/patterns-cap-fix
Fix missing capabilities in FileOp
2022-02-07 13:01:55 -08:00
Aaron Lehmann b92a6170cf Fix missing capabilities in FileOp
Marshal the constraints after the capabilities are added, not before.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2022-02-07 12:31:25 -08:00
Kohei Tokunaga 2d00773bd5 cache: write blob to the content store via bufio during conversion
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2022-02-07 20:24:07 +09:00
Tonis Tiigi 3bb514f923 shell: add function to detect what env were used
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-02-06 23:23:06 -08:00
Kohei Tokunaga 6b97f25d6f Resolver: ensure `WithSession` to pass the session to the resolver
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2022-02-07 13:02:07 +09:00
coryb a640b47cb1
Merge pull request #2590 from coryb/gateway-exec-signal
Allow signals to be sent to gateway exec containers
2022-02-03 08:39:59 -08:00
Tõnis Tiigi 2ea7bed1b2
Merge pull request #2591 from tonistiigi/compression-level-2
exporter: support for compression-level
2022-02-02 20:40:07 -08:00
Cory Bennett 559d079902 Allow signals to be sent to gateway exec containers
Signed-off-by: Cory Bennett <cbennett@netflix.com>
2022-02-02 16:57:10 +00:00
Tonis Tiigi cab33b1e31 exporter: support for compression-level
compression-level option can be set on export to
define the preferred speed vs compression ratio. The
value is a number dependent on the compression algorithm.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-02-01 15:21:46 -08:00
Tonis Tiigi 30a0b02479 exec: allow mounting secret environment variables
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-31 11:22:57 -08:00
Tõnis Tiigi 2633c96bac
Merge pull request #2442 from jedevc/heredoc-copy-symbols
Fix #2439 (`COPY` with Heredocs eats quotes)
2022-01-31 10:37:41 -08:00
Justin Chadwell 90ddf87a22 Fix combinations of quotes and heredocs
This adds a couple more integration tests to more fully define the
behavior of these interactions. Additionally, through this, a minor
difference to POSIX was discovered where quotes are supposed to be
properly preserved in a heredoc (since a heredoc is treated as a
double-quoted word).

To handle this, a new property, SkipProcessQuotes is added to the shell
lexer which simply treats quotes as ordinary characters. This is the
only behavioral change needed to actually get the new tests working.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-01-31 10:53:58 +00:00
Justin Chadwell 8005660443 Fix heredoc COPY/ADD expansion to preserve quotes
In the contents of COPY/ADD, we perform expansion on variables using a
lexer. However, this lexer, by default, removes quotes as well as
expanding variables - this isn't really the kind of behavior we're
after, as it feels quite unintuitive.

To fix this, we introduce a new ExpandRaw function, which commands can
implement that implement an alternative expansion that preserves quotes
(and possibly other characters/features in the future).

Additionally, we introduce new tests to more clearly define the desired
behavior. One major note is that backslashes are not passed directly,
and are processed, following normal escape rules (so that we can use `$`
symbols directly).

Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-01-31 10:53:58 +00:00
Justin Chadwell dcf62b1f3f Cleanup rawEscapes in lexer to be internally consistent
Previously, we'd only write raw escapes out as words, and not out to the
result. We weren't using or relying on this behaviour, but it could
easily have caused a bug if we were. This patch just cleans rawEscapes
to behave like rawQuotes.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-01-31 10:53:58 +00:00
Tõnis Tiigi 6b8cea792b
Merge pull request #2584 from crazy-max/update-containerd
Bump github.com/containerd/containerd from v1.6.0-beta.3 to v1.6.0-rc.1
2022-01-29 10:15:02 -08:00
Tõnis Tiigi 93cddb5fd5
Merge pull request #2585 from hinshun/local-sm-get
Local should use session ID in op and only fallback to session group
2022-01-29 10:14:40 -08:00
Tõnis Tiigi edfc3f0d89
Merge pull request #2570 from alexcb/fix-git-clone-tag
Add support for annotated git tags
2022-01-29 10:14:23 -08:00
CrazyMax e0e1c3d2ab
dockerfile: update stargz bin
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-01-29 09:08:22 +01:00
Edgar Lee b3e8c63a48 Local should use session ID in op and only fallback to session group if failed before transfer started
Signed-off-by: Edgar Lee <edgarl@netflix.com>
2022-01-28 15:18:43 -08:00
Alex Couture-Beil 9e1a9d24e8
Add support for git tags
This fixes errors such as:

    error: cannot update ref 'refs/heads/v2.30.0': trying to write non-commit object 2d9685d47a7e516281aa093bf0cddc8aafa72448 to branch 'refs/heads/v2.30.0'

which occur when cloning a tag rather than branch.

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2022-01-28 11:51:19 -08:00
CrazyMax 07dea88ee0
otel: update semconv
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-01-28 10:19:00 +01:00
CrazyMax fd84771d6c
Bump github.com/containerd/stargz-snapshotter to v0.11.0
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-01-28 10:18:59 +01:00
CrazyMax 39f6b4e739
Bump github.com/containerd/containerd to v1.6.0-rc.1
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-01-28 10:18:59 +01:00
Akihiro Suda 8bc2977ced
Merge pull request #2583 from moby/dependabot/go_modules/github.com/opencontainers/runc-1.0.3
build(deps): bump github.com/opencontainers/runc from 1.0.2 to 1.0.3
2022-01-27 13:26:51 +09:00
Tõnis Tiigi 40c0091bd0
Merge pull request #2582 from AkihiroSuda/alpine315
Dockerfile: update Alpine to 3.15 (install shadow-uidmap from APK)
2022-01-26 09:57:18 -08:00
dependabot[bot] cc9fefe9cd
build(deps): bump github.com/opencontainers/runc from 1.0.2 to 1.0.3
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-26 17:18:52 +00:00
Tõnis Tiigi 08497dafaf
Merge pull request #2577 from tonistiigi/log-clip-buffer
keep buffer of logs to show on failure when regular logs are clipped
2022-01-26 09:17:20 -08:00
Tõnis Tiigi 77662095d8
Merge pull request #2576 from tonistiigi/cross-compile-name
dockerfile: show target platform on cross compiling
2022-01-26 09:17:00 -08:00
Akihiro Suda 323542d625
Dockerfile: update Alpine to 3.15 (install shadow-uidmap from APK)
Alpine 3.15 contains https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/25365 ,
so we can now install shadow-uidmap frok APK.

Close issue 2038
Close issue 2580

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-01-26 19:54:29 +09:00
Tonis Tiigi ffce8218e3 keep buffer of logs to show on failure when regular logs are clipped
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-24 21:30:46 -08:00
Tonis Tiigi 45d02301c2 dockerfile: show target platform on cross compiling
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-23 21:55:19 -08:00
Tõnis Tiigi c18af390ef
Merge pull request #2572 from tonistiigi/tracing-env-update
tracing: move to newer env names
2022-01-20 12:58:05 -08:00
CrazyMax 3df7865fbb
Merge pull request #2571 from tonistiigi/lint-update
hack: update linter to v1.43
2022-01-20 17:23:10 +01:00
Tonis Tiigi f5dbcf6e99 tracing: move to newer env names
open-telemetry/opentelemetry-specification#740 has decided to
promote different set of env for CLI propagation.

Switch to use them so we are more consistent with other
tools. Old ones should be removed in a future release.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-19 21:46:10 -08:00
Erik Sipsma eb473d0a62
Merge pull request #2563 from sipsma/diffref-fix
cache: improve diff ref release logic.
2022-01-19 14:28:14 -08:00
Erik Sipsma 417ba9e0ed cache: improve diff ref release logic.
Before this change, the lower and upper parents provided to the cache
manager Diff method were not cloned, which resulted in some code paths
incorrectly providing them directly as the parents of the returned ref.
This meant that if they were released after the call to Diff, the diff
ref could become incorrectly invalidated.

Now, the lower and upper are cloned and unit test coverage has been
added to test that ref release is handled correctly.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-01-19 14:03:49 -08:00
Tonis Tiigi dc21885891 hack: enable more linters
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-19 12:20:30 -08:00