145 Commits

Author SHA1 Message Date
CrazyMax
3490181812
tests: create remote with container helper
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit b1490ed5ce6fc62b3731abeae8c7103f2a71e512)
2024-03-12 09:35:19 -07:00
Tonis Tiigi
19dbf2f7c4
remote: fix connhelpers with custom dialer
With the new dial-stdio command the dialer is split
from `Client` function in order to access it directly.

This breaks the custom connhelpers functionality
as support for connhelpers is a feature of the default
dialer. If client defines a custom dialer then only
it is used without extra modifications. This means
that remote driver dialer needs to detect the
connhelpers on its own.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 8f576e579024eae301eef1fc04402352648df1f2)
2024-03-12 09:35:08 -07:00
Paweł Gronowski
04f0fc5871
Replace deprecated docker types usage
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-03-01 12:29:54 +01:00
Ian King'ori
d40c4bb046 remote: use winio DialPipeContext for named pipes
Signed-off-by: Ian King'ori <kingorim.ian@gmail.com>
2024-02-28 16:19:58 +03:00
CrazyMax
e008b846bb
driver: set network.host entitlement by default for container drivers
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-02-23 22:23:27 +01:00
CrazyMax
56fc68eb7e
driver: make buildkitd "config" and "flags" names consistent
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-02-22 10:26:18 +01:00
Tõnis Tiigi
481384b185
Merge pull request #2112 from cpuguy83/dialstdio
Add dial-stdio command
2024-02-09 17:13:46 -08:00
Brian Goff
760244ee3e Add dial-stdio command
This allows the buildx CLI to act a proxy to the configured instance.
It allows external code to use buildx itself as a driver for connecting
to buildkitd instances.

Instance and node selection should follow the same semantics as as
`buildx build`, including taking into account the `BUILDX_BUILDER` env
var and the `--builder` global flag.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-02-08 22:16:00 +00:00
CrazyMax
d0177c6da3
Merge pull request #1271 from crazy-max/ctn-restart
docker-container: restart-policy opt
2024-02-08 19:31:57 +01:00
Ian King'ori
981cc8c2aa add npipe url scheme support
- enables remote builder and buildx create on windows
Signed-off-by: Ian King'ori <kingorim.ian@gmail.com>
2024-02-07 13:47:12 +03:00
CrazyMax
9822409b67
docker-container: restart-policy opt
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-02-06 14:33:36 +01:00
CrazyMax
57d737a13c
driver(container): fix conditional statement for error handling
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-01-05 16:35:09 +01:00
Laura Brehm
0f45b629ad
deps: update buildkit, vendor changes
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-19 14:01:05 +00:00
Tõnis Tiigi
0962fdbb04
Merge pull request #2130 from jsternberg/remote-bootstrap-timeout
driver: add status reporting and a timeout to the remote driver bootstrap
2023-11-17 14:12:33 -08:00
Jonathan A. Sternberg
1f5562315b
driver: add status reporting and a timeout to the remote driver bootstrap
This adds status reporting for the remote driver so it shows the length
of time it is spending waiting for the connection. If the service is
already present, this logger isn't shown but it should help provide a
message to show the user why the build is stalled.

A timeout of 20 seconds has been added to the bootstrap.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2023-11-17 15:33:28 -06:00
David Karlsson
1326634c7d chore: add docs reminder comments for driver opts
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-11-16 17:00:37 +01:00
Sebastiaan van Stijn
898a8eeddf
vendor: github.com/docker/docker, github.com/docker/cli v25.0.0-beta.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-11-15 15:55:37 +01:00
Tõnis Tiigi
0408f3ac45
Merge pull request #2093 from jsternberg/rootless-init-config
driver: docker-container driver uses --config correctly in rootless mode
2023-11-13 09:10:07 -08:00
Jonathan A. Sternberg
3f423468df
driver: docker-container driver uses --config correctly in rootless mode
The `docker-container` driver relies on the default config file location
for buildkit when writing the configuration file. When run in a rootless
version of docker (dind), the default location is different.

Instead of trying to figure out where the appropriate default location
is, this just writes the files to the same location and sets the
`--config` parameter explicitly. This flag is placed first so a
user-specified config option in `--buildkitd-flags` will take precedence
over the implicit config parameter.

This also fixes the `--config` option with the rootless image.
Previously, the config directory was being copied in a way that rendered
`/etc` unreadable and the configuration file wasn't readable either. It
also wasn't copied to the correct place. Now, `--config` is used to
specify the directory, `/etc` isn't included in the copied archive (so
the permissions aren't overwritten), and the directory is set as world
readable to be readable from the rootless buildkit process`.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2023-11-07 16:20:07 -06:00
CrazyMax
503d483731
fix lint issues after update
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-10-19 12:31:24 +02:00
CrazyMax
05af608774
Merge pull request #2018 from crazy-max/driver-client-meta
driver(docker): opt to set additional dial meta to the client
2023-10-16 16:14:34 -07:00
CrazyMax
511e41386f
driver(docker): opt to set additional dial meta to the client
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-10-17 01:01:17 +02:00
CrazyMax
5836c24e7d
driver: move Features and HostGatewayIP to specific driver
Adds a new HostGatewayIP entry in the Driver interface so we can
move Features and HostGatewayIP handling with cache to the very
specific driver (docker).

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-10-17 00:45:50 +02:00
Tõnis Tiigi
05b8821625
Merge pull request #2048 from doreamon-design/feat/support-memory-opt-for-docker-container
feat: support memory/cpu driver options for docker-container
2023-10-12 10:05:54 -07:00
Silvin Lubecki
22e9e3342b Revert "Introduce a client interface, to abstract from buildkit client."
This reverts commit 2aa6d52b065d0cb30b5a6b9d24d948e3f32defce.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2023-10-11 22:13:23 +02:00
Silvin Lubecki
2aa6d52b06 Introduce a client interface, to abstract from buildkit client.
This will allow further enhancement like caching remote driver responses.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2023-10-06 14:24:04 +02:00
Zero
cfcd1d9420 feat: support memory and cpu driver options for docker-container
Signed-off-by: Zero <tobewhatwewant@outlook.com>
2023-09-29 23:57:19 +08:00
Justin Chadwell
0bd6f3c7f5 remote: remove explicit backoff config from client opts
Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-09-27 11:06:18 +01:00
David Karlsson
bf5a70023c build: improve error messages for docker driver
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-09-12 09:39:51 +02:00
Tonis Tiigi
f54a67de6d
enable trace delegation for docker/remote driver
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-09-05 22:04:57 -07:00
Justin Chadwell
d37d483097 docker-container: avoid fail if container conflict
Fixes the race condition where two boots are executed simultaneously
across multiple processes.

We initially check to see if the container exists, but if during
container creation we get a name conflict, we don't treat this error as
a hard failure, and instead move immediately into waiting for the node
to boot.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-08-10 14:29:36 +01:00
Justin Chadwell
b8739d7441
Merge pull request #1934 from jedevc/use-buildkit-client-wait 2023-07-19 16:23:54 +01:00
Jonathan Piché
9c06f383ba allow custom annotations and labels into kubernetes manifests
Co-authored-by: Akihiro Suda <suda.kyoto@gmail.com>

Signed-off-by: Jonathan Piché <jpiche@coveo.com>
2023-07-19 07:48:26 -04:00
Justin Chadwell
e11c5e3e96 remote: use buildkit's client.Wait method to bootstrap
This native implementation uses GRPC level waiting, instead of starting
a busy loop. We also a manual max backoff of one second to improve
responsiveness.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-07-19 12:39:19 +01:00
Tõnis Tiigi
69421182ca
Merge pull request #1891 from droopy4096/auth-token
Add Bearer token support
2023-07-12 11:57:47 -07:00
CrazyMax
8cbb7a9319
build: fix host-gateway handling
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-06-24 17:47:48 +02:00
Dmitry Makovey
b986ce566b Add Bearer token
Signed-off-by: Dmitry Makovey <dmakovey@gitlab.com>
2023-06-16 14:55:09 -06:00
CrazyMax
2de333fdd3
check history api support once
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-06-13 10:29:22 +02:00
Tonis Tiigi
1138789f20
avoid extra client for history API detection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-06-12 17:39:09 -07:00
CrazyMax
6c9436fbd5
inspect: display builder features
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-06-05 23:11:58 +02:00
CrazyMax
f8fa526678
driver: update history api check
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-31 10:10:54 +02:00
CrazyMax
8c65e4fc1d
driver: add context to Features interface
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-30 20:13:18 +02:00
CrazyMax
d196ac347e
driver: cache features
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-30 20:13:18 +02:00
CrazyMax
9b723ece46
driver: check history capability
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-30 20:13:17 +02:00
Tonis Tiigi
b273db20c3
remote: allow docker exporter on remote driver
There is no reason why one can't make a docker tarball or
load to Docker instance from remote driver.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-05-26 00:18:57 -07:00
Sebastiaan van Stijn
d582a21acd
go.mod: update k8s deps to v0.26.2 (remove "replace" rule)
Replace rules are not inherited by consumers of buildx as a module, and as
such would default to use the v0.26.2 version. Removing the replace rules
also removes various (indirect) dependencies (although brings in some new
packages from k8s itself).

The "azure" and "gcp" authentication packages in k8s.io/go-client are now
no longer functional, so removing those imports.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-22 16:10:49 +02:00
CrazyMax
167340df17
Merge pull request #1780 from techvelocity/elranshefer/add-support-for-proxy-url
kubernetes driver: add support for proxy-url
2023-05-11 14:40:23 +02:00
CrazyMax
60e72ba989
driver: update BuildKit version constraint for docker driver
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-10 14:43:24 +02:00
Elran Shefer
29b427ce13
kubernetes driver: add support for proxy-url
Signed-off-by: Elran Shefer <elran.shefer@velocity.tech>
2023-05-10 08:36:39 +03:00
Tõnis Tiigi
4fa7cd1fc2
Merge pull request #1772 from tonistiigi/container-hang-fix
container-driver: avoid hanging on container panic
2023-05-09 10:27:11 -07:00