Commit Graph

406 Commits

Author SHA1 Message Date
Tõnis Tiigi
399c615e50 Merge pull request #6254 from crazy-max/hack-slsa-v1
hack: enable SLSA provenance v1 for buildkit and frontend images
2025-10-13 08:38:44 -07:00
CrazyMax
373f658d67 hack: fix no-cache-filter on release
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-01 10:26:55 +02:00
CrazyMax
61c3a9e1cd hack: enable SLSA provenance v1 for buildkit and frontend images
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-30 13:34:56 +02:00
Jonathan A. Sternberg
916074cfc5 hack: update hack/compose with newer otel collector
Modifies the hack/compose script to use a newer otel collector and try
to suppress miscellaneous logs when it fails to export traces. Disable
jaeger, prometheus, and grafana by default.

It also adds a metrics pipeline that goes to a nop exporter. This is
force the otel collector to start the metrics service and prevent an
error when buildkit exports metrics to the otel collector related to the
metrics service being missing.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-09-23 10:49:24 -05: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
Tonis Tiigi
04dbf0ba44 update go to 1.25
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-09 15:14:18 -07:00
CrazyMax
060be8484d hack: modernize-fix bake target
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-09 14:00:26 +02:00
CrazyMax
e70ed65cbc update alpine to 3.22
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-27 11:34:46 +02:00
CrazyMax
628d5cb2cb dockerfile: update govulncheck to v1.1.4
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-23 10:00:51 +02:00
Tonis Tiigi
9fcedf9807 update gopls to go1.24 compatible version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-07 18:23:20 -07:00
Tonis Tiigi
3e5d4dcdf8 update to go1.24
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-07 16:59:15 -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
Jonathan A. Sternberg
4fc3a2d435 hack: aggregate protobuf includes to a separate stage
This moves the aggregation of the various protobuf includes (binaries
and include files) to a separate stage so the files can be retrieved
more easily by external tools.

Since the canonical way of retrieving the protobuf dependencies is to
use this file and the dependencies can be quite complicated to retrieve,
this makes it easier for outside contributors to retrieve the
dependencies and copy them into their own repositories.

This was possible before by using the `tools` target, but that would
also include the entire `golang` image. Now you can retrieve just the
`protobuf` target to get the binaries and the include files.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-04-14 11:00:14 -05:00
CrazyMax
08633159ad ci: fix freebsd package repository
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-04-08 11:03:47 +02:00
Tonis Tiigi
630067bb9a hack: allow building golangci from source for custom versions
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-17 17:43:49 -07:00
Tonis Tiigi
b5286f8dcb apply x/tools/modernize fixes
Autogenerated with couple of manual patches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-07 08:18:45 -08:00
CrazyMax
1df5e2892d hack(images): set EXPORT_BASE and BUILDKITD_TAGS args
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-25 11:50:07 +01:00
CrazyMax
1c917b4290 test: handle gha cache v2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-18 19:07:45 +01:00
Tonis Tiigi
33088c1a56 hack: allow passing config file to test and shell script
One should not use their regular docker credentials here
but make a special config file with only public readonly
token inside.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-01-30 19:00:29 -08:00
CrazyMax
2a1cc96230 hack: mount docker config on gha
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-30 17:17:26 -08:00
Jonathan A. Sternberg
174fb8ad5c cache: convert prune loop from recursive invocation to iterative
The prune logic would prune multiple times because one prune could cause
more things to be capable of pruning and change the logic. This was done
through a recursive invocation.

Since go doesn't have support for function tail calls, this would result
in a new stack entry for each loop. This unrolls the logic so the prune
function is invoked iteratively rather than recursively.

`prune` and `pruneOnce` have also had their names swapped. In general,
`pruneOnce` implies that it runs a single prune while `prune` sounds
like the top level function. The current code had this reversed and
`pruneOnce` would call `prune` and `prune` would call itself
recursively.

I've also updated a section in the controller that invoked prune on each
worker. In older versions of Go, the current version was correct because
those versions of Go would reuse the location for each loop which would
cause goroutines to all reference the same worker instead of different
workers.

Recent versions of Go have changed the behavior so this is no longer
needed.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-01-13 10:26:54 -06:00
Akihiro Suda
03033045bc Merge pull request #5594 from tonistiigi/dockerfile-test-versioning
test: allow testing frontends from different version
2025-01-08 03:40:05 +09:00
Tonis Tiigi
9a2d75f2b7 hack: remove loong64 validation in archutil
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-16 09:42:10 -08:00
Tonis Tiigi
69034c34df test: allow testing frontends from different version
This allows running Dockerfile tests so that the Dockerfile
version and the BuildKit version are from different commits so
that we can test that old Dockerfile releases remain compatible
with the latest BuildKit.

The tests are based on the commit of the Dockerfile frontend as
we can't expect that new test would work on old frontends. In future
we might consider doing it the other way as well but then we need
a way to mark tests that can be ignored if they are not expected to
pass because of a new feature dependency.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-13 20:14:17 -08:00
Tonis Tiigi
6126614b5c update Alpine to v3.21
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-09 19:06:40 -08:00
Tonis Tiigi
e276044245 update xx to v1.6.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-09 19:06:34 -08:00
Tõnis Tiigi
be6f193e01 Merge pull request #5492 from crazy-max/go-1.23
update to go 1.23
2024-11-07 13:29:37 -08:00
CrazyMax
e5186004f0 dockerfile: missing updates of xx to 1.5.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-07 11:19:22 +01:00
CrazyMax
8f81390c1c update to go 1.23
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-07 11:09:26 +01:00
Tonis Tiigi
41f9ca6ff2 hack: update protolint
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-04 18:13:05 -08:00
Tonis Tiigi
0fe016fee7 hack: update gopls to 0.26
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-04 17:33:30 -08:00
Tonis Tiigi
6cb3aafd5a fixes for dockerfile checks
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-08 16:05:46 -07:00
CrazyMax
6e826f00d7 Revert "dockerfile: pin dockerfile frontend image"
This reverts commit c5de0b9020.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-08 15:53:47 -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
CrazyMax
c5de0b9020 dockerfile: pin dockerfile frontend image
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-09-27 15:33:57 +02: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
CrazyMax
49142c5fdf ci: switch to ubuntu runner for freebsd job
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-09-24 12:51:26 +02:00
Alberto Garcia Hierro
892e756394 debug: add trace flight recorder
Use golang.org/x/exp/trace to implement an trace recorder that saves the trace
to a circular buffer and can be retrieved at any time.

Debug endpoints have been added under /debug/flight to start and stop the trace
as well as to set its period.

Due to golang.org/x/exp/trace, the minimum go version has been bumped to 1.22

Signed-off-by: Alberto Garcia Hierro <damaso.hierro@docker.com>
2024-09-23 21:01:19 +01:00
Tonis Tiigi
87e0f4bf08 hack: update golangci-lint to 1.61
Unblock CI with the schema verify error in 1.60

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-09-09 14:22:27 -07:00
CrazyMax
b0e83682d2 hack: do not cache rootless stage on release
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-09-05 13:24:24 +02:00
Marat Radchenko
c8c5024758 Cleanup Linux-isms in code
appdefaults_unix.go, constants_unix.go:
/run is a thing only for Linux. Other Unixes use /var/run.

diffapply_linux.go and source_linux.go:
These files use Linux-only API.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2024-08-26 11:21:12 +03:00
Tonis Tiigi
df0d9d791d ci: update golangci-lint to v1.60.1
Previous version runs out of memory on go1.23

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-08-14 16:29:22 +03:00
Tonis Tiigi
b8f3379ae9 ci: enable validating all Dockerfiles
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-08-13 11:13:33 +03:00
Tõnis Tiigi
d1e6c916e5 Merge pull request #5222 from crazy-max/fix-nocachefilter
hack: fix no-cache-filter on release
2024-08-12 11:42:45 +03:00
CrazyMax
255b223e0a hack: ensure SARIF output has results field defined for govulncheck
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-08-09 10:49:49 +02:00
CrazyMax
799f175f8f hack: fix no-cache-filter on release
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-08-08 10:14:02 +02:00
CrazyMax
d138ca0f8a govulncheck to report known vulnerabilities
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-30 12:55:38 +02:00
Craig Andrews
06a1708bfb ci: add OCI image annotations to docker images
See: https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
Closes: https://github.com/moby/buildkit/issues/3553

Signed-off-by: Craig Andrews <candrews@integralblue.com>
2024-07-23 22:26:57 -04:00
CrazyMax
8397d0b9f7 Merge pull request #5004 from crazy-max/ci-gha-rest
ci: set gha cache repository and token
2024-06-28 01:00:18 +02:00