From: Tom Clegg Date: Thu, 2 Jun 2022 15:56:33 +0000 (-0400) Subject: 15370: Bump docker API version to 1.35. X-Git-Tag: 2.5.0~142^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/bac1772ab074713e3c50632a4cad3cc1ce50d0ec 15370: Bump docker API version to 1.35. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/cmd/arvados-package/build.go b/cmd/arvados-package/build.go index 68dda8a5e2..9841c890b7 100644 --- a/cmd/arvados-package/build.go +++ b/cmd/arvados-package/build.go @@ -16,6 +16,7 @@ import ( "path/filepath" "strings" + "git.arvados.org/arvados.git/lib/crunchrun" "git.arvados.org/arvados.git/sdk/go/ctxlog" "github.com/docker/docker/api/types" "github.com/docker/docker/client" @@ -137,7 +138,7 @@ func build(ctx context.Context, opts opts, stdin io.Reader, stdout, stderr io.Wr } func dockerRm(ctx context.Context, name string) error { - cli, err := client.NewClient(client.DefaultDockerHost, "1.21", nil, nil) + cli, err := client.NewClient(client.DefaultDockerHost, crunchrun.DockerAPIVersion, nil, nil) if err != nil { return err } diff --git a/cmd/arvados-package/install.go b/cmd/arvados-package/install.go index 437a1ad21b..d8dbdcc4a0 100644 --- a/cmd/arvados-package/install.go +++ b/cmd/arvados-package/install.go @@ -14,6 +14,7 @@ import ( "path/filepath" "strings" + "git.arvados.org/arvados.git/lib/crunchrun" "github.com/docker/docker/api/types" "github.com/docker/docker/client" ) @@ -134,7 +135,7 @@ exec arvados-server boot -listen-host=0.0.0.0 -no-workbench2=false $bootargs } func dockerImageExists(ctx context.Context, name string) (bool, error) { - cli, err := client.NewClient(client.DefaultDockerHost, "1.21", nil, nil) + cli, err := client.NewClient(client.DefaultDockerHost, crunchrun.DockerAPIVersion, nil, nil) if err != nil { return false, err } diff --git a/lib/crunchrun/docker.go b/lib/crunchrun/docker.go index eee8f1d76a..54d0e680fe 100644 --- a/lib/crunchrun/docker.go +++ b/lib/crunchrun/docker.go @@ -23,6 +23,14 @@ import ( // Docker daemon won't let you set a limit less than ~10 MiB const minDockerRAM = int64(16 * 1024 * 1024) +// DockerAPIVersion is the API version we use to communicate with the +// docker service. The oldest OS we support is Ubuntu 18.04 (bionic) +// which originally shipped docker 1.17.12 / API 1.35 so there is no +// reason to use an older API version. See +// https://dev.arvados.org/issues/15370#note-38 and +// https://docs.docker.com/engine/api/. +const DockerAPIVersion = "1.35" + type dockerExecutor struct { containerUUID string logf func(string, ...interface{}) @@ -37,7 +45,7 @@ type dockerExecutor struct { func newDockerExecutor(containerUUID string, logf func(string, ...interface{}), watchdogInterval time.Duration) (*dockerExecutor, error) { // API version 1.21 corresponds to Docker 1.9, which is // currently the minimum version we want to support. - client, err := dockerclient.NewClient(dockerclient.DefaultDockerHost, "1.21", nil, nil) + client, err := dockerclient.NewClient(dockerclient.DefaultDockerHost, DockerAPIVersion, nil, nil) if watchdogInterval < 1 { watchdogInterval = time.Minute }