1400 Commits

Author SHA1 Message Date
Justin Chadwell
0b8f0264b0 controller: move image id file writing to client
Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-23 15:46:37 +00:00
Justin Chadwell
5c31d855fd controller: return solve response through api
Now clients can access the result of the solve, specifically the image
id output. This is a useful refactor, as well as being required if we
want to allow bake to invoke through the controller api.

This also allows us to remove the quiet option from the API, since we
can compute the required progress type outside of the controller, and
can print the image id from the result of the solve.

As a follow-up, we should also be able to remove the image id file
output from the controller api, now that the client has access to it.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-23 15:46:37 +00:00
Justin Chadwell
90d7fb5e77 controller: strongly type the controller api
Strongly typing the API allows us to perform all command line parsing
fully on the client-side, where we have access to the client local
directory and all the client environment variables, which may not be
available on the remote server.

Additionally, the controller api starts to look a lot like
build.Options, so at some point in the future there may be an
oppportunity to merge the two, which would allow both build and bake to
execute through the controller, instead of needing to maintain multiple
code paths.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-23 15:43:15 +00:00
Justin Chadwell
c4ad930e2a
Merge pull request #1644 from crazy-max/update-frontend
Dockerfile: align frontend version
2023-02-23 11:00:13 +00:00
CrazyMax
3d0c88695e
Merge pull request #1646 from docker/dependabot/go_modules/golang.org/x/net-0.7.0
build(deps): Bump golang.org/x/net from 0.5.0 to 0.7.0
2023-02-23 11:36:36 +01:00
dependabot[bot]
7332140fdf
build(deps): Bump golang.org/x/net from 0.5.0 to 0.7.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-22 19:50:31 +00:00
CrazyMax
132fababb0
Dockerfile: align frontend version
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-22 17:47:48 +01:00
CrazyMax
71507c0b58
Merge pull request #1643 from crazy-max/go-1.20
update to go 1.20
2023-02-22 17:42:59 +01:00
CrazyMax
7888fdee58
fix lint issue
should drop = nil from declaration of var n; it is the zero value

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-22 14:57:29 +01:00
CrazyMax
fb61fde581
fix cannot set environment variables in parallel tests
> FAIL: TestReadTargets/ArgsOverrides/leaf (0.00s)
> panic: testing: t.Setenv called after t.Parallel; cannot set environment variables in parallel tests

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-22 14:56:46 +01:00
CrazyMax
5258e44030
remove deprecated golangci-lint linters
Linters 'deadcode' and 'varcheck' are deprecated since v1.49.0
and had been replaced by 'unused'

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-22 14:40:14 +01:00
CrazyMax
e16c1b289b
update golangci-lint to v1.51.1
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-22 14:38:17 +01:00
CrazyMax
376b73f078
update to go 1.20
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-22 14:37:50 +01:00
Justin Chadwell
1c6060f27d
Merge pull request #1612 from cpuguy83/env_no_provenance
Add env var to disable default attestations
2023-02-22 11:36:35 +00:00
Justin Chadwell
ed4fd965ff
Merge pull request #1620 from jedevc/remote-controller-fixes
Improvements for remote controller code
2023-02-21 10:52:58 +00:00
Brian Goff
bc9cb2c66a Add env var to disable default attestations
For certain cases we need to build with `--provenance=false`.
However not all build envs (especially in the OSS ethos) have the latest
buildx so just blanket setting `--provenance=false` will fail in these
cases.

Having an env var allows people to set the value without having to worry
about if the buildx version has the `--provenance` flag.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-02-16 17:25:40 +00:00
CrazyMax
aa05f4c207
Merge pull request #1584 from dvdksn/docs/build-platform-local
docs: added --platform=local example
2023-02-16 18:08:25 +01:00
CrazyMax
62fbef22d0
Merge pull request #1177 from crazy-max/build-display-builder
build: print instance being used
2023-02-16 18:07:30 +01:00
David Karlsson
2563685d27 docs: added --platform=local example
Signed-off-by: David Karlsson <david.karlsson@docker.com>
2023-02-16 17:24:45 +01:00
CrazyMax
598f1f0a62
build: print instance being used
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-16 14:56:46 +01:00
CrazyMax
8311b0963a
vendor: update buildkit
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-16 14:56:46 +01:00
CrazyMax
b1949b7388
Merge pull request #1634 from dgageot/fix-1633
build: fix git ambiguous argument
2023-02-16 14:05:32 +01:00
CrazyMax
3341bd1740
Merge pull request #1610 from thaJeztah/update_docker
vendor: github.com/docker/docker, github.com/docker/cli v23.0.0
2023-02-16 13:43:12 +01:00
Justin Chadwell
74f64f88a7
Merge pull request #1617 from jedevc/process-multiple-attestation-annotations
imagetools: process `com.docker.reference.*` annotations
2023-02-16 12:05:20 +00:00
David Gageot
d4a4aaf509
Remove git warning: buildx/1633
Signed-off-by: David Gageot <david.gageot@docker.com>
2023-02-16 07:36:24 +01:00
Justin Chadwell
1f73f4fd5d
Merge pull request #1630 from jedevc/debug-help-message-typo
monitor: fix typo in help message
2023-02-16 00:06:06 +00:00
Justin Chadwell
77f83d4171 monitor: fix typo in help message
Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-15 14:48:56 +00:00
Justin Chadwell
642f28f439 imagetools: process com.docker.reference.* annotations
To give us the option later down the road of producing recommended OCI
names in BuildKit (using com instead of vnd, woops), we need to update
Buildx to be able to process both.

Ideally, if a Buildx/BuildKit release hadn't been made we could just
switch over, but since we have, we'd need to support both (at least for
a while, eventually we could consider deprecating+removing the vnd
variant).

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-14 11:24:40 +00:00
Justin Chadwell
54f4dc8f6e controller: set absolute path of server binary before execution
Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-14 11:21:18 +00:00
CrazyMax
04804ff355
Merge pull request #1557 from crazy-max/gomod-1.19
go.mod: bump to Go 1.19
2023-02-11 22:47:51 +01:00
Justin Chadwell
ed9ea2476d controller: use unique files per buildx version
This ensures that we should never accidentally connect to a server with
a mismatched version, while also allowing us to run multiple buildx
servers at a time.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-10 14:41:23 +00:00
Justin Chadwell
d0d29168a5 controller: use grpc with contexts for improved timeouts
This patch improves timeout logic for testing and creating a buildx
server. Instead of needing to have a custom loop, we can just use the
primitives provided by go and grpc for easier handling.

Additionally, without the explicit time.Sleeps, we defer to GRPCs
exponential backoff algorithm which should provide substantially better
results.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-10 14:41:19 +00:00
Justin Chadwell
abda257763 controller: exit cleanly on SIGTERM
This signal may be sent using an external tool such as pkill, and since
we can handle it neatly, we should.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-10 14:41:15 +00:00
Justin Chadwell
1b91bc2e02 controller: add more informative server exit messages
When exiting, we should ideally always print a message, and give details
as to exactly what error we received.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-10 14:40:26 +00:00
Justin Chadwell
56b9e785e5 build: don't kill remote controller after build
We don't know if other builds might be running, etc, so we should allow
the server to decide when to exit.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-10 14:40:25 +00:00
Sebastiaan van Stijn
081447c9b1
vendor: github.com/docker/cli v23.0.0
full diff: https://github.com/docker/cli/compare/v23.0.0-rc.1...v23.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:32:57 +01:00
Sebastiaan van Stijn
260117289b
vendor: github.com/docker/docker v23.0.0
full diff: https://github.com/docker/docker/compare/v23.0.0-rc.1...v23.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:30:17 +01:00
Sebastiaan van Stijn
73dca749ca
vendor: golang.org/x/oauth2 v0.1.0
no changes in vendored code

full diff: https://github.com/golang/oauth2/compare/6fdb5e3db783...v0.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:26:17 +01:00
Sebastiaan van Stijn
8ac380bfb3
vendor: golang.org/x/net v0.5.0
full diff: https://github.com/golang/net/compare/v0.4.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:21:05 +01:00
Sebastiaan van Stijn
aeac7e08f9
vendor: golang.org/x/term v0.4.0
no changes in vendored code

full diff: https://github.com/golang/term/compare/v0.3.0...v0.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:20:00 +01:00
Sebastiaan van Stijn
7c9cdc4353
vendor: golang.org/x/text v0.6.0
no changes in vendored code

full diff: https://github.com/golang/text/compare/v0.5.0...v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:19:53 +01:00
Sebastiaan van Stijn
67572785cf
vendor: golang.org/x/sys v0.4.0
full diff: https://github.com/golang/sys/compare/v0.3.0...v0.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:12:32 +01:00
Sebastiaan van Stijn
8a70e7634d
vendor: github.com/google/certificate-transparency-go v1.1.4
full diff:

- https://github.com/google/certificate-transparency-go/compare/v1.0.21...v1.1.4
- https://github.com/kubernetes/klog/compare/v2.30.0...v2.80.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 15:03:26 +01:00
Sebastiaan van Stijn
6dd5589a9c
vendor: github.com/containerd/containerd v1.6.16
full diff: https://github.com/containerd/containerd/compare/1709cfe273d9...v1.6.16

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 14:55:44 +01:00
CrazyMax
78058ce5f3
Merge pull request #1592 from crazy-max/fix-build-git
build: check reachable git commits
2023-02-08 14:23:52 +01:00
CrazyMax
fd5884189c
build: check reachable git commits
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-08 12:46:04 +01:00
Justin Chadwell
ab7a9f008d
Merge pull request #1607 from jedevc/bake-fix-error-traces
bake: avoid nesting error diagnostics
2023-02-07 13:20:07 +00:00
CrazyMax
a8eb2a7fbe
gitutil: override the locale to ensure consistent output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-07 13:26:28 +01:00
Justin Chadwell
fbb4f4dec8 bake: avoid nesting error diagnostics
With changes to the lazy evaluation, the evaluation order is no longer
fixed - this means that we can follow long and confusing paths to get to
an error.

Because of the co-recursive nature of the lazy evaluation, we need to
take special care that the original HCL diagnostics are not discarded
and are preserved so that the original source of the error can be
detected. Preserving the full trace is not necessary, and probably not
useful to the user - all of the file that is not lazily loaded will be
eagerly loaded after all struct blocks are loaded - so the error would
be found regardless.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-02-07 11:40:20 +00:00
Justin Chadwell
46fd0a61ba
Merge pull request #1605 from jedevc/bake-fix-errors
bake: avoid early-exit for resolution failures
2023-02-07 10:36:05 +00:00