96 Commits

Author SHA1 Message Date
CrazyMax
e4d0dbaf3f chore: update generated files
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-06-12 09:44:45 +02:00
Tõnis Tiigi
c6626669bc Merge pull request #6740 from tonistiigi/exec-net-proxy
solver: add proxy network mode
2026-06-08 10:09:34 -07:00
Sebastiaan van Stijn
94dcaca630 update protoc to v3.14.0
Updating to the lowest release that includes [protobuf@dfab275], which
removed use of the github.com/golang/protobuf/ptypes/timestamp.Timestamp
type alias (deprecated).

[protobuf@dfab275]: dfab275eca

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-06-05 18:01:59 +02:00
Tonis Tiigi
3254832159 solver: add proxy network mode
Add a build request option that rewrites default exec networking to an
internal proxy network while preserving explicit none networking.

Route HTTP and HTTPS traffic through a BuildKit-owned proxy namespace, enforce
source policy checks for proxied requests, and inject a temporary CA into Linux
rootfs trust bundles for HTTPS interception.

Share namespace pooling between CNI and proxy providers, and cover proxy mode
with unit and integration tests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-06-04 11:23:00 -07:00
Tonis Tiigi
1890989989 version: expose Dockerfile frontend version
Expose the builtin Dockerfile frontend version in BuildKit version
APIs and buildctl debug output.

Move Dockerfile version logic into frontend/dockerfile/version and
validate that the builtin version constant matches release tags.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-05-06 10:42:32 -07:00
Tonis Tiigi
5fde446dee solver: add compatibility-version support
Add solve-wide compatibility-version support for image and oci
exports, with historical goldens and release compatibility tests.

Backfill version 10 for v0.13-v0.14 git artifact behavior, keep
version 20 as current, and reject unsupported zstd on v10.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-04-10 09:24:11 -07:00
CrazyMax
18ad342e57 Merge pull request #6460 from tonistiigi/golint-v2.8.0-update
hack: golangci v2.8.0 and gopls v0.38.0 update
2026-01-14 15:44:19 +01:00
Tonis Tiigi
a8b83196f3 ci: update golangci to v2.8.0
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-13 22:09:20 -08:00
Tonis Tiigi
ddeb26c5e1 vendor: update outdated patch versions of dependencies
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-13 22:08:15 -08:00
Tonis Tiigi
f79f1a98c4 policysession: dynamic source policy support
Add support for dynamic source policies via client session.

Client session can allow or deny specific source or
ask additional metadata information via sourcemetaresolver if
that is needed to make the decision.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-05 14:28:13 -08:00
Tonis Tiigi
09426caaae vendor: update containerd to v2.2.0-rc.0
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-03 11:11:53 -08:00
Jonathan A. Sternberg
f4339fd00b tools: utilize the new tool functionality introduced in go 1.24
Removes the `tools/tools.go` file used as a hack to get `go.mod` to
track tools in favor of the new method introduced in go 1.24 of being
formally supported in the `go.mod` file. This will allow the tools to be
managed with the new `go get tool` and `go install tool` commands.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-09-10 10:08:03 -05:00
CrazyMax
d31230ea96 lint: gopls fixes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-09 14:13:04 +02:00
Tonis Tiigi
9a5dff09b5 vendor: update to containerd v2.1.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-21 09:09:33 -06:00
Tonis Tiigi
2307fb7d12 allow duration based filters on diskusage requests
Allows similar time-based filter that is allowed for
prune requests so that DiskUsage request can be used to
check which records would be candidates for pruning.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-18 20:30:18 -07:00
Tonis Tiigi
f1f56c2b77 golangci-lint: v2 upgrade
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:17 -07:00
Tonis Tiigi
58faf412f3 exporter: add session exporter capability
This allows client to defer exporter selection to
the the time where build has completed.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-04-10 22:15:19 -07:00
Tonis Tiigi
f61e01c14c llbsolver: on-demand CDI devices with automatic setup
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-11 11:21:48 +01:00
Tonis Tiigi
9b39b0d82c allow listing devices
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-11 11:21:45 +01:00
Tonis Tiigi
83cd1c59df llbsolver: add filters to history listen
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-04 17:08:37 -08:00
Sebastiaan van Stijn
d709e4bb1c vendor: google.golang.org/protobuf v1.35.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-14 14:03:31 +01:00
Tonis Tiigi
c9a25c4d8a pb: regenerate protobuf
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-28 12:56:03 -07:00
Tonis Tiigi
31f984bb93 fix merge conflict in generated proto
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-08 10:01:35 -07:00
Tõnis Tiigi
6860c8097d Merge pull request #5359 from tonistiigi/gc-free-max-support
update default and basic gc control to use free and max storage
2024-10-08 08:28:40 -07:00
Tonis Tiigi
d45a506aac cache: rename new prune/gc control fields
Naming that was chosen during review was
reservedSpace, maxUsedSpace and minFreeSpace.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-04 17:23:04 -07:00
Tonis Tiigi
a73e1b09c6 update default and basic gc control to use free and max storage
Update default policy to include maximum and free storage controls.

New default policy is combination of all three controls.

Minimum reserved storage: 10GB / 10% (10% was old default)
Maintain free storage: 20%
Maximum allowed storage: 100GB / 80%

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-04 17:21:50 -07:00
Jonathan A. Sternberg
41a0a0c37d protobuf: add vtproto as a supplemental marshaler
vtproto is an extra protobuf compiler that generates special methods
suffixed with `VT` that create typed and unrolled marshal and unmarshal
functions similar to gogo that can be used for performance sensitive
code. These extensions are optional for code to use but buildkit uses
them.

A codec is also included to utilize vtproto for grpc code. If the
package `github.com/moby/buildkit/util/grpcutil/encoding/proto` is
imported then vtproto will be used if it exists and otherwise it will
use the standard marshaling and unmarshaling methods.

This codec has an important difference from the default codec. The
default codec will always reset messages before unmarshaling. In most
cases, this is unnecessary and is only relevant for `RecvMsg` on
streams. In most cases, if we are passing in an existing message to this
method, we want to reuse the buffers. This codec will always merge the
message when unmarshaling instead of resetting the input message.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-10-04 12:52:15 -05:00
Jonathan A. Sternberg
ffd8ff490e protobuf: normalize how protobuf files are generated
The relative paths option for protoc generators doesn't work well when
it comes to dependencies. This simplifies the code generation to avoid
using `go generate` and to use one global command for protoc generation.

This is similar to https://github.com/docker/buildx/pull/2713 since the
same problems with code generation occur here too.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-10-03 17:40:53 -05:00
Jonathan A. Sternberg
1a3fc0aa15 protobuf: remove gogoproto
Remove gogoproto in favor of the standard protobuf compiler. This
removes any nonstandard extensions that were part of gogoproto such as
the custom types.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-09-26 12:57:45 -05:00
Jonathan A. Sternberg
0752b3f4d4 protobuf: add marshaling benchmarks for some protobuf messages
The benchmarks that are added are related to certain areas that are
considered hotspots for performance where many messages are marshaled.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-09-26 12:52:08 -05:00
Justin Chadwell
6382cf9e80 config: allow configuring free gc policies
Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-09-25 10:48:59 +01:00
CrazyMax
1aa17c046a history api: save number of warnings to build record
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-18 13:40:23 +02:00
Tonis Tiigi
3139b164d5 solver: allow finalizing history record traces
Client can send a finalize update to build record that
will complete saving the traces and block until the record
has been updated. If no request is sent then the traces will be
sent after a 3 second timeout as before.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-07-02 00:08:20 -07:00
Tonis Tiigi
6e38854262 llbsolver: move typed error to own blob in history
Avoid putting big error metadata to main history record
and instead write it to a separate blob.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-07-01 21:48:12 -07:00
Justin Chadwell
1c1777b7c0 exporter: use implicit ids for exporters
We can derive exporter ids from their place in the exporter array in a
SolveRequest - this removes the need to manually generate and handle
multiple sets of IDs.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-01-05 12:04:28 +00:00
Justin Chadwell
7fb54984ea control: add multiple exporters
This patch adds support for multiple exporters at the control API, and
propogates the resulting required changes through the client and the
solver.

A few notable changes:
- Each exporter instance now has an associated identifier
- Build records in the build history now have multiple possible
  descriptors to built content
- Exporter responses are all merged together (like we currently do with
  multiple cache exporters). We likely will need to revisit this design
  later, since now cache exporters do not line up one-to-one with
  exporters.

For backwards compatability, new clients will continue to produce
requests that contain the now deprecated exporter fields, as well as the
new ones. New servers will attempt to use deprecated fields if they
are present.

Co-authored-by: a-palchikov <deemok@gmail.com>
Co-authored-by: fahed dorgaa <fahed.dorgaa@gmail.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-01-05 12:04:28 +00:00
Justin Chadwell
c5402622bb lint: add protolint config
And tidy up the proto definitions to follow the new linting rules.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-08-10 13:11:18 +01:00
Tonis Tiigi
7f432bff38 history: save completed steps with cache stats
Otherwise the cache steps count values are useless
for canceled and errored builds.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-01-24 18:25:55 -08:00
Tonis Tiigi
853d56e56e add cache stats to the build history API
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-12-27 23:40:42 -08:00
Brian Goff
7526659ab0 Update source pinning to use proposed policy
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:01:54 -08:00
Akihiro Suda
0d3f71ee18 llbsolver: support pinning sources
Alternative to PR 2816 ("dockerfile: support Dockerfile.pin for pinning sources")

This version is implemented on the llbsolver side and agnostic to the LLB frontends.
See `solver/llbsolver/vertex.go:loadLLB()`.

See `docs/build-repro.md` for the usage.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-12-13 13:01:54 -08:00
Tonis Tiigi
fe0c8d352a history api: allow internal builds that are not tracked
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-12-12 22:15:40 -08:00
Tonis Tiigi
301ea54fb8 history api: deletion and pinning support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-12-12 22:15:40 -08:00
Tonis Tiigi
8a2addb899 history api: tracing storage support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-12-12 22:15:40 -08:00
Tonis Tiigi
dbee61670d add build history APIs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-11-22 23:59:33 -08:00
CrazyMax
d2a757f862 control: add buildkit version to worker record
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-04-08 13:06:22 +02:00
CrazyMax
859ad497fd control: add info service
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-22 13:43:31 +01: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
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
Tonis Tiigi
872518e334 update warning type definition
Detail is now an array and URL is a separate field.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-12-13 21:38:20 -08:00