buildx icon indicating copy to clipboard operation
buildx copied to clipboard

add timeout parameter to cli and driver

Open avoidik opened this issue 1 year ago • 3 comments

hello,

this is an attempt to make timeout settings consistent

(please consider this contribution under any appropriate permissive and open-source friendly license)

avoidik avatar Jul 10 '24 14:07 avoidik

here is how to change timeout of the remote driver

$ docker buildx create \
  --name remote-builder \
  --node linux-amd64 \
  --platform linux/amd64 \
  --bootstrap \
  --use \
  --driver-opt timeout=10s \
  ssh://127.0.0.2
[+] Building 10.0s (1/1) FINISHED
 => ERROR [internal] waiting for connection                                                                                                                              10.0s
------
 > [internal] waiting for connection:
------
ERROR: context deadline exceeded

without the timeout property

docker buildx create \
  --name remote-builder \
  --node linux-amd64 \
  --platform linux/amd64 \
  --bootstrap \
  --use \
  ssh://127.0.0.2
[+] Building 120.0s (1/1) FINISHED
 => ERROR [internal] waiting for connection                                                                                                                             120.0s
------
 > [internal] waiting for connection:
------
ERROR: context deadline exceeded

in case of CLI commands

$ BUILDX_TIMEOUT=5s docker buildx ...

avoidik avatar Jul 10 '24 15:07 avoidik

CLI timeout consistency info

Command Has timeout logic implemented Inherits global timeout
buildx bake No No
buildx build No No
buildx create Yes Yes
buildx dial-stdio No No
buildx du No No
buildx imagetools create No No
buildx imagetools inspect No No
buildx inspect Yes Yes
buildx ls Yes Yes
buildx prune No No
buildx rm Yes Yes
buildx stop No No
buildx install N/A N/A
buildx uninstall N/A N/A
buildx use N/A N/A
buildx version N/A N/A

Drivers timeout consistency info

Driver Default timeout Timeout can be changed using --driver-opt
docker 120s No
docker-container 120s No
kubernetes 120s Yes, timeout=60s
remote 120s Yes, timeout=60s

avoidik avatar Oct 03 '24 10:10 avoidik

I took over this PR at https://github.com/docker/buildx/pull/3159

CamJN avatar Apr 26 '25 17:04 CamJN