Skip to content

Commit 94ffe58

Browse files
committed
Image promoter: Reenable Windows test image building
The build times are a bit high for the image builder (~50 minutes), and it will a bit more when Windows support will be added to the other test images. This commit changes the machineType to N1_HIGHCPU_8. Reenables Windows test image building. Added DOCKER_CERT_BASE_PATH (default value: $HOME), which will contain the path where the certificates needed for Remote Docker Connection can be found. If a REMOTE_DOCKER_URL was not set for a particular OS version, exclude that image from the manifest list. This fixes an issue where, if REMOTE_DOCKER_URL was not set for Windows Server 1909, the Windows were completely excluded from the manifest list, including for Windows Server 1809 and 1903 which could have been built and pushed. Sets "test-webserver" as the default CMD for kitten and nautilus. Since they are now based on agnhost, they should be set to run test-webserver to maintain previous behaviour. Bumps the agnhost version to 2.13, as 2.12 has already been promoted. 2.13 will contain Windows support. Adds Windows support for the kitten and nautilus images, so they can promoted together with agnhost (they were not previously promoted). Adds OWNERS files to: agnhost, busybox, kitten, nautilus.
1 parent c1f1b1b commit 94ffe58

File tree

14 files changed

+54
-30
lines changed

14 files changed

+54
-30
lines changed

test/images/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
REGISTRY ?= gcr.io/kubernetes-e2e-test-images
1616
GOARM ?= 7
17+
DOCKER_CERT_BASE_PATH ?=
1718
QEMUVERSION=v2.9.1
1819
GOLANG_VERSION=1.13.9
1920
export

test/images/agnhost/OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
approvers:
2+
- claudiubelu

test/images/agnhost/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ For example, let's consider the following `pod.yaml` file:
4040
containers:
4141
- args:
4242
- dns-suffix
43-
image: us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11
43+
image: us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14
4444
name: agnhost
4545
dnsConfig:
4646
nameservers:
@@ -207,7 +207,7 @@ Usage:
207207

208208
```console
209209
guestbook="test/e2e/testing-manifests/guestbook"
210-
sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11|"
210+
sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14|"
211211

212212
# create the services.
213213
kubectl create -f ${guestbook}/frontend-service.yaml
@@ -290,14 +290,14 @@ Examples:
290290

291291
```console
292292
docker run -i \
293-
us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
293+
us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
294294
logs-generator --log-lines-total 10 --run-duration 1s
295295
```
296296

297297
```console
298298
kubectl run logs-generator \
299299
--generator=run-pod/v1 \
300-
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
300+
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
301301
--restart=Never \
302302
-- logs-generator -t 10 -d 1s
303303
```
@@ -464,7 +464,7 @@ Usage:
464464
```console
465465
kubectl run test-agnhost \
466466
--generator=run-pod/v1 \
467-
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
467+
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
468468
--restart=Never \
469469
--env "POD_IP=<POD_IP>" \
470470
--env "NODE_IP=<NODE_IP>" \
@@ -519,7 +519,7 @@ Usage:
519519
```console
520520
kubectl run test-agnhost \
521521
--generator=run-pod/v1 \
522-
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
522+
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
523523
--restart=Never \
524524
--env "BIND_ADDRESS=localhost" \
525525
--env "BIND_PORT=8080" \
@@ -647,6 +647,6 @@ The Windows `agnhost` image includes a `nc` binary that is 100% compliant with i
647647

648648
## Image
649649

650-
The image can be found at `us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11` for both Linux and
650+
The image can be found at `us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14` for both Linux and
651651
Windows containers (based on `mcr.microsoft.com/windows/servercore:ltsc2019`,
652652
`mcr.microsoft.com/windows/servercore:1903`, and `mcr.microsoft.com/windows/servercore:1909`).

test/images/agnhost/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.13
1+
2.14

test/images/agnhost/agnhost.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import (
4949
)
5050

5151
func main() {
52-
rootCmd := &cobra.Command{Use: "app", Version: "2.13"}
52+
rootCmd := &cobra.Command{Use: "app", Version: "2.14"}
5353

5454
rootCmd.AddCommand(auditproxy.CmdAuditProxy)
5555
rootCmd.AddCommand(connect.CmdConnect)

test/images/busybox/OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
approvers:
2+
- claudiubelu

test/images/cloudbuild.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ timeout: 5400s
77
# or any new substitutions added in the future.
88
options:
99
substitution_option: ALLOW_LOOSE
10+
machineType: 'N1_HIGHCPU_8'
1011
steps:
1112
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4'
1213
entrypoint: make
@@ -17,6 +18,10 @@ steps:
1718
- BASE_REF=$_PULL_BASE_REF
1819
- WHAT=$_WHAT
1920
- REGISTRY=gcr.io/k8s-staging-e2e-test-images
21+
- DOCKER_CERT_BASE_PATH=/root
22+
- REMOTE_DOCKER_URL_1809=tcp://img-promoter-1809.eastus.cloudapp.azure.com:2376
23+
- REMOTE_DOCKER_URL_1903=tcp://img-promoter-1903.eastus.cloudapp.azure.com:2376
24+
- REMOTE_DOCKER_URL_1909=tcp://img-promoter-1909.eastus.cloudapp.azure.com:2376
2025
# TODO(claudiub): Readd the REMOTE_DOCKER_URL_${os_version} to reenable the Windows test image building process.
2126
args:
2227
- all-build-and-push

test/images/image-util.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ set -o pipefail
2121
TASK=$1
2222
WHAT=$2
2323

24+
# Connecting to a Remote Docker requires certificates for authentication, which can be found
25+
# at this path. By default, they can be found in the ${HOME} folder. We're expecting to find
26+
# here ".docker-${os_version}" folders which contains the necessary certificates.
27+
DOCKER_CERT_BASE_PATH="${DOCKER_CERT_BASE_PATH:-${HOME}}"
28+
2429
KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
2530
source "${KUBE_ROOT}/hack/lib/logging.sh"
2631
source "${KUBE_ROOT}/hack/lib/util.sh"
@@ -135,8 +140,8 @@ build() {
135140
# The node requires TLS authentication, and thus it is expected that the
136141
# ca.pem, cert.pem, key.pem files can be found in the ${HOME}/.docker-${os_version} folder.
137142
# TODO(claudiub): add "build --isolation=hyperv" once GCE introduces Hyper-V support.
138-
docker --tlsverify --tlscacert "${HOME}/.docker-${os_version}/ca.pem" \
139-
--tlscert "${HOME}/.docker-${os_version}/cert.pem" --tlskey "${HOME}/.docker-${os_version}/key.pem" \
143+
docker --tlsverify --tlscacert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/ca.pem" \
144+
--tlscert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/cert.pem" --tlskey "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/key.pem" \
140145
-H "${REMOTE_DOCKER_URL}" build --pull -t "${REGISTRY}/${image}:${TAG}-${os_name}-${arch}-${os_version}" \
141146
--build-arg BASEIMAGE="${BASEIMAGE}" -f $dockerfile_name .
142147
else
@@ -192,21 +197,16 @@ push() {
192197
docker push "${REGISTRY}/${image}:${TAG}-${os_name}-${arch}"
193198
elif [[ -n "${REMOTE_DOCKER_URL:-}" ]]; then
194199
# NOTE(claudiub): We're pushing the image we built on the remote Windows node.
195-
docker --tlsverify --tlscacert "${HOME}/.docker-${os_version}/ca.pem" \
196-
--tlscert "${HOME}/.docker-${os_version}/cert.pem" --tlskey "${HOME}/.docker-${os_version}/key.pem" \
200+
docker --tlsverify --tlscacert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/ca.pem" \
201+
--tlscert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/cert.pem" --tlskey "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/key.pem" \
197202
-H "${REMOTE_DOCKER_URL}" push "${REGISTRY}/${image}:${TAG}-${os_name}-${arch}-${os_version}"
198203
else
199204
echo "Cannot push the image '${image}' for ${os_arch}. REMOTE_DOCKER_URL_${os_version} should be set, containing the URL to a Windows docker daemon."
205+
# we should exclude this image from the manifest list as well, we couldn't build / push it.
206+
os_archs=$(printf "%s\n" "$os_archs" | grep -v "$os_arch" || true)
200207
fi
201208
done
202209

203-
# NOTE(claudiub): if the REMOTE_DOCKER_URL var is not set, or it is an empty string, we mustn't include
204-
# Windows images into the manifest list.
205-
if test -z "${REMOTE_DOCKER_URL:-}" && printf "%s\n" "$os_archs" | grep -q '^windows'; then
206-
echo "Skipping pushing the image '${image}' for Windows. REMOTE_DOCKER_URL_\${os_version} should be set, containing the URL to a Windows docker daemon."
207-
os_archs=$(printf "%s\n" "$os_archs" | grep -v "^windows" || true)
208-
fi
209-
210210
if test -z "${os_archs}"; then
211211
# this can happen for Windows-only images if they have been skipped entirely.
212212
echo "No image for the manifest list. Skipping ${image}."

test/images/kitten/BASEIMAGE

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
linux/amd64=REGISTRY/agnhost:2.13-linux-amd64
2-
linux/arm=REGISTRY/agnhost:2.13-linux-arm
3-
linux/arm64=REGISTRY/agnhost:2.13-linux-arm64
4-
linux/ppc64le=REGISTRY/agnhost:2.13-linux-ppc64le
5-
linux/s390x=REGISTRY/agnhost:2.13-linux-s390x
1+
linux/amd64=REGISTRY/agnhost:2.14-linux-amd64
2+
linux/arm=REGISTRY/agnhost:2.14-linux-arm
3+
linux/arm64=REGISTRY/agnhost:2.14-linux-arm64
4+
linux/ppc64le=REGISTRY/agnhost:2.14-linux-ppc64le
5+
linux/s390x=REGISTRY/agnhost:2.14-linux-s390x
6+
windows/amd64/1809=REGISTRY/agnhost:2.14-windows-amd64-1809
7+
windows/amd64/1903=REGISTRY/agnhost:2.14-windows-amd64-1903
8+
windows/amd64/1909=REGISTRY/agnhost:2.14-windows-amd64-1909

test/images/kitten/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ ARG BASEIMAGE
1616
FROM $BASEIMAGE
1717
COPY html/kitten.jpg kitten.jpg
1818
COPY html/data.json data.json
19+
CMD ["test-webserver"]

0 commit comments

Comments
 (0)