Commit Graph

3787 Commits (23ac84a557dc0585c45efae8ba8cc7b46e8f2723)

Author SHA1 Message Date
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
Tonis Tiigi dd992414a3 resolver: set buildkit own user-agent
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-02-05 19:40:50 -08: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 9301b5f2e0 llbsolver: avoid embedded emulators for higher amd64 variants
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-31 11:28:08 -08:00
Tonis Tiigi 2f455f894c vendor: update containerd to a43703fcba
Needed for amd64 variants support

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-31 11:28:08 -08:00
Tonis Tiigi 9598fa243b archutil: amd64 variants support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-31 11:28:02 -08:00
Tonis Tiigi e38f34c7d4 archutil: refactor to return structs
Working with strings is error-prone because a platform
can be in multiple string forms and less flexible.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-31 11:28:02 -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
Tonis Tiigi 01e935cff5 hack: update linter to v1.43
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-19 11:48:57 -08:00
Akihiro Suda 9f2d744354
Merge pull request #2569 from tonistiigi/platforms-compare-fix
exec: check full platform vector when checking for emulator
2022-01-19 19:10:06 +09:00
Tõnis Tiigi e47e047569
Merge pull request #2564 from sipsma/fix-2557
cache: handle crash after snapshot commit
2022-01-19 00:41:04 -08:00
Tonis Tiigi 082c666bdb exec: check full platform vector when checking for emulator
Instead of doing a direct string comparison we should
use `platforms.Only` so that we can also detect the
variants that are compatible but don’t match directly.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-18 23:54:24 -08:00
Erik Sipsma eb935e525f cache: handle crash after snapshot commit
Before this, there could be crash during a call to finalize a ref that
occured after the snapshot was committed but before committing the
metadata that indicates the immutable ref no longer had an
equalMutable. This resulted in a situation where any future calls to
finalize that ref would fail.

Now, if that situation happens, the cache will notice when it's
initially loaded that the ref has an equalMutable that's missing its
snapshot and that its own snapshot exists. It will then just use the
correctly committed snapshot and clear the equalMutable field.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-01-18 12:22:52 -08:00