15370: Bump docker API version to 1.35.
authorTom Clegg <tom@curii.com>
Thu, 2 Jun 2022 15:56:33 +0000 (11:56 -0400)
committerTom Clegg <tom@curii.com>
Thu, 2 Jun 2022 15:56:33 +0000 (11:56 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

cmd/arvados-package/build.go
cmd/arvados-package/install.go
lib/crunchrun/docker.go

index 68dda8a5e296069abd42905186d66c16c5a8c7af..9841c890b78a9f8363817d135e915bea29c6b472 100644 (file)
@@ -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
        }
index 437a1ad21bf43f60c054da1f256c09d4f0e4e84a..d8dbdcc4a066c18bb8df7fdcba31eb3cd8a8d45e 100644 (file)
@@ -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
        }
index eee8f1d76a7c4dd86bcf63e8958b38042a432139..54d0e680fe6af83494707f58298629db74ded486 100644 (file)
@@ -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
        }