Skip to content

Commit 091e37d

Browse files
committed
Update gha runners and engines used in e2e tests + cleanup
- gha runners updated to ubuntu 22.04 - e2e now runs against moby 23.0, 24.0 and 25.0 - dockerfile cleanups + using more best practices - minor test fixes Signed-off-by: Christopher Petito <[email protected]>
1 parent 2977049 commit 091e37d

13 files changed

Lines changed: 57 additions & 30 deletions

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919

2020
jobs:
2121
prepare:
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-22.04
2323
outputs:
2424
matrix: ${{ steps.platforms.outputs.matrix }}
2525
steps:
@@ -37,7 +37,7 @@ jobs:
3737
echo ${{ steps.platforms.outputs.matrix }}
3838
3939
build:
40-
runs-on: ubuntu-20.04
40+
runs-on: ubuntu-22.04
4141
needs:
4242
- prepare
4343
strategy:
@@ -90,7 +90,7 @@ jobs:
9090
if-no-files-found: error
9191

9292
bin-image:
93-
runs-on: ubuntu-20.04
93+
runs-on: ubuntu-22.04
9494
if: ${{ github.event_name != 'pull_request' && github.repository == 'docker/cli' }}
9595
steps:
9696
-
@@ -134,7 +134,7 @@ jobs:
134134
*.cache-to=type=gha,scope=bin-image,mode=max
135135
136136
prepare-plugins:
137-
runs-on: ubuntu-20.04
137+
runs-on: ubuntu-22.04
138138
outputs:
139139
matrix: ${{ steps.platforms.outputs.matrix }}
140140
steps:
@@ -152,7 +152,7 @@ jobs:
152152
echo ${{ steps.platforms.outputs.matrix }}
153153
154154
plugins:
155-
runs-on: ubuntu-20.04
155+
runs-on: ubuntu-22.04
156156
needs:
157157
- prepare-plugins
158158
strategy:

.github/workflows/e2e.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
e2e:
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-22.04
2020
strategy:
2121
fail-fast: false
2222
matrix:
@@ -28,11 +28,10 @@ jobs:
2828
- alpine
2929
- debian
3030
engine-version:
31-
# - 20.10-dind # FIXME: Fails on 20.10
32-
- stable-dind # TODO: Use 20.10-dind, stable-dind is deprecated
33-
include:
34-
- target: non-experimental
35-
engine-version: 19.03-dind
31+
# - 19.03 needs a look, doesn't work ubuntu 22.04 (cgroupv2 errors)
32+
- 23.0 # mirantis lts
33+
- 24.0
34+
- 25.0
3635
steps:
3736
-
3837
name: Checkout

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
ctn:
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-22.04
2020
steps:
2121
-
2222
name: Checkout

.github/workflows/validate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
validate:
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-22.04
2020
strategy:
2121
fail-fast: false
2222
matrix:
@@ -37,7 +37,7 @@ jobs:
3737

3838
# check that the generated Markdown and the checked-in files match
3939
validate-md:
40-
runs-on: ubuntu-20.04
40+
runs-on: ubuntu-22.04
4141
steps:
4242
-
4343
name: Checkout
@@ -57,7 +57,7 @@ jobs:
5757
fi
5858
5959
validate-make:
60-
runs-on: ubuntu-20.04
60+
runs-on: ubuntu-22.04
6161
strategy:
6262
fail-fast: false
6363
matrix:

docker.Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ifeq ($(DOCKER_CLI_GO_BUILD_CACHE),y)
2020
DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build"
2121
endif
2222
VERSION = $(shell cat VERSION)
23-
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS -e GOOS -e GOARCH -e GOARM -e TEST_ENGINE_VERSION=$(E2E_ENGINE_VERSION)
23+
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS -e GOOS -e GOARCH -e GOARM -e ENGINE_VERSION=$(E2E_ENGINE_VERSION)
2424

2525
# Some Dockerfiles use features that are only supported with BuildKit enabled
2626
export DOCKER_BUILDKIT=1
@@ -132,21 +132,21 @@ test-e2e: test-e2e-non-experimental test-e2e-experimental test-e2e-connhelper-ss
132132

133133
.PHONY: test-e2e-experimental
134134
test-e2e-experimental: build-e2e-image # run experimental e2e tests
135-
docker run --rm $(ENVVARS) -e DOCKERD_EXPERIMENTAL=1 -e TEST_ENGINE_VERSION=$(E2E_ENGINE_VERSION) \
135+
docker run --rm $(ENVVARS) -e DOCKERD_EXPERIMENTAL=1 -e ENGINE_VERSION=$(E2E_ENGINE_VERSION) \
136136
--mount type=bind,src=$(CURDIR)/build/coverage,dst=/tmp/coverage \
137137
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
138138
$(E2E_IMAGE_NAME)
139139

140140
.PHONY: test-e2e-non-experimental
141141
test-e2e-non-experimental: build-e2e-image # run non-experimental e2e tests
142-
docker run --rm $(ENVVARS) -e TEST_ENGINE_VERSION=$(E2E_ENGINE_VERSION) \
142+
docker run --rm $(ENVVARS) -e ENGINE_VERSION=$(E2E_ENGINE_VERSION) \
143143
--mount type=bind,src=$(CURDIR)/build/coverage,dst=/tmp/coverage \
144144
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
145145
$(E2E_IMAGE_NAME)
146146

147147
.PHONY: test-e2e-connhelper-ssh
148148
test-e2e-connhelper-ssh: build-e2e-image # run experimental SSH-connection helper e2e tests
149-
docker run --rm $(ENVVARS) -e DOCKERD_EXPERIMENTAL=1 -e TEST_ENGINE_VERSION=$(E2E_ENGINE_VERSION) -e TEST_CONNHELPER=ssh \
149+
docker run --rm $(ENVVARS) -e DOCKERD_EXPERIMENTAL=1 -e ENGINE_VERSION=$(E2E_ENGINE_VERSION) -e TEST_CONNHELPER=ssh \
150150
--mount type=bind,src=$(CURDIR)/build/coverage,dst=/tmp/coverage \
151151
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
152152
$(E2E_IMAGE_NAME)

e2e/compose-env.connhelper-ssh.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ services:
33
build:
44
context: ./testdata
55
dockerfile: Dockerfile.connhelper-ssh
6+
args:
7+
- ENGINE_VERSION
68
environment:
79
- TEST_CONNHELPER_SSH_ID_RSA_PUB

e2e/compose-env.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
services:
2+
23
registry:
34
image: 'registry:2'
45

56
engine:
6-
image: 'docker:${TEST_ENGINE_VERSION:-stable-dind}'
7+
image: 'docker:${ENGINE_VERSION:-stable}-dind'
78
privileged: true
89
command: ['--insecure-registry=registry:5000']
910
environment:
@@ -16,6 +17,7 @@ services:
1617
ports:
1718
- 4443:4443
1819
command: ['notary-server', '-config=/fixtures/notary-config.json']
20+
1921
evil-notary-server:
2022
build:
2123
context: ./testdata

e2e/container/run_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,6 @@ func TestRunWithCgroupNamespace(t *testing.T) {
146146
environment.SkipIfCgroupNamespacesNotSupported(t)
147147

148148
result := icmd.RunCommand("docker", "run", "--cgroupns=private", "--rm", fixtures.AlpineImage,
149-
"/bin/grep", "-q", "':memory:/$'", "/proc/1/cgroup")
149+
"cat", "/sys/fs/cgroup/cgroup.controllers")
150150
result.Assert(t, icmd.Success)
151151
}

e2e/image/build_test.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,19 @@ func TestBuildFromContextDirectoryWithTag(t *testing.T) {
4343

4444
result.Assert(t, icmd.Expected{Err: buildkitDisabledWarning})
4545
output.Assert(t, result.Stdout(), map[int]func(string) error{
46-
0: output.Prefix("Sending build context to Docker daemon"),
47-
1: output.Suffix("Step 1/4 : FROM registry:5000/alpine:frozen"),
48-
3: output.Suffix("Step 2/4 : COPY run /usr/bin/run"),
49-
5: output.Suffix("Step 3/4 : RUN run"),
50-
7: output.Suffix("running"),
51-
8: output.Contains("Removing intermediate container"),
46+
0: output.Prefix("Sending build context to Docker daemon"),
47+
1: output.Suffix("Step 1/4 : FROM registry:5000/alpine:frozen"),
48+
3: output.Suffix("Step 2/4 : COPY run /usr/bin/run"),
49+
5: output.Suffix("Step 3/4 : RUN run"),
50+
7: output.Suffix("running"),
51+
// TODO(krissetto): ugly, remove when no longer testing against moby 24. see https://github.com/moby/moby/pull/46270
52+
8: func(s string) error {
53+
err := output.Contains("Removed intermediate container")(s) // moby >= v25
54+
if err == nil {
55+
return nil
56+
}
57+
return output.Contains("Removing intermediate container")(s) // moby < v25
58+
},
5259
10: output.Suffix("Step 4/4 : COPY data /data"),
5360
12: output.Contains("Successfully built "),
5461
13: output.Suffix("Successfully tagged myimage:latest"),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Pull (1 of 1): registry:5000/trust-pull:latest@sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501
2-
sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501: Pulling from trust-pull
2+
registry:5000/trust-pull@sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501: Pulling from trust-pull
33
Digest: sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501
44
Status: Downloaded newer image for registry:5000/trust-pull@sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501
55
registry:5000/trust-pull:latest

0 commit comments

Comments
 (0)