Merge pull request #89152 from claudiubelu/image-promoter/reenable-windows

Image promoter: Reenable Windows test image building
This commit is contained in:
Kubernetes Prow Robot 2020-04-15 11:35:46 -07:00 committed by GitHub
commit a06d735829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 50 additions and 23 deletions

View File

@ -14,6 +14,7 @@
REGISTRY ?= gcr.io/kubernetes-e2e-test-images
GOARM ?= 7
DOCKER_CERT_BASE_PATH ?=
QEMUVERSION=v2.9.1
GOLANG_VERSION=1.13.9
export

View File

@ -0,0 +1,2 @@
approvers:
- claudiubelu

View File

@ -40,7 +40,7 @@ For example, let's consider the following `pod.yaml` file:
containers:
- args:
- dns-suffix
image: us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11
image: us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14
name: agnhost
dnsConfig:
nameservers:
@ -207,7 +207,7 @@ Usage:
```console
guestbook="test/e2e/testing-manifests/guestbook"
sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11|"
sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14|"
# create the services.
kubectl create -f ${guestbook}/frontend-service.yaml
@ -290,14 +290,14 @@ Examples:
```console
docker run -i \
us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
logs-generator --log-lines-total 10 --run-duration 1s
```
```console
kubectl run logs-generator \
--generator=run-pod/v1 \
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
--restart=Never \
-- logs-generator -t 10 -d 1s
```
@ -464,7 +464,7 @@ Usage:
```console
kubectl run test-agnhost \
--generator=run-pod/v1 \
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
--restart=Never \
--env "POD_IP=<POD_IP>" \
--env "NODE_IP=<NODE_IP>" \
@ -519,7 +519,7 @@ Usage:
```console
kubectl run test-agnhost \
--generator=run-pod/v1 \
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11 \
--image=us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14 \
--restart=Never \
--env "BIND_ADDRESS=localhost" \
--env "BIND_PORT=8080" \
@ -647,6 +647,6 @@ The Windows `agnhost` image includes a `nc` binary that is 100% compliant with i
## Image
The image can be found at `us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.11` for both Linux and
The image can be found at `us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.14` for both Linux and
Windows containers (based on `mcr.microsoft.com/windows/servercore:ltsc2019`,
`mcr.microsoft.com/windows/servercore:1903`, and `mcr.microsoft.com/windows/servercore:1909`).

View File

@ -1 +1 @@
2.13
2.14

View File

@ -49,7 +49,7 @@ import (
)
func main() {
rootCmd := &cobra.Command{Use: "app", Version: "2.13"}
rootCmd := &cobra.Command{Use: "app", Version: "2.14"}
rootCmd.AddCommand(auditproxy.CmdAuditProxy)
rootCmd.AddCommand(connect.CmdConnect)

View File

@ -0,0 +1,2 @@
approvers:
- claudiubelu

View File

@ -7,6 +7,7 @@ timeout: 5400s
# or any new substitutions added in the future.
options:
substitution_option: ALLOW_LOOSE
machineType: 'N1_HIGHCPU_8'
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4'
entrypoint: make
@ -17,6 +18,10 @@ steps:
- BASE_REF=$_PULL_BASE_REF
- WHAT=$_WHAT
- REGISTRY=gcr.io/k8s-staging-e2e-test-images
- DOCKER_CERT_BASE_PATH=/root
- REMOTE_DOCKER_URL_1809=tcp://img-promoter-1809.eastus.cloudapp.azure.com:2376
- REMOTE_DOCKER_URL_1903=tcp://img-promoter-1903.eastus.cloudapp.azure.com:2376
- REMOTE_DOCKER_URL_1909=tcp://img-promoter-1909.eastus.cloudapp.azure.com:2376
# TODO(claudiub): Readd the REMOTE_DOCKER_URL_${os_version} to reenable the Windows test image building process.
args:
- all-build-and-push

View File

@ -21,6 +21,11 @@ set -o pipefail
TASK=$1
WHAT=$2
# Connecting to a Remote Docker requires certificates for authentication, which can be found
# at this path. By default, they can be found in the ${HOME} folder. We're expecting to find
# here ".docker-${os_version}" folders which contains the necessary certificates.
DOCKER_CERT_BASE_PATH="${DOCKER_CERT_BASE_PATH:-${HOME}}"
KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
source "${KUBE_ROOT}/hack/lib/logging.sh"
source "${KUBE_ROOT}/hack/lib/util.sh"
@ -150,8 +155,8 @@ build() {
# The node requires TLS authentication, and thus it is expected that the
# ca.pem, cert.pem, key.pem files can be found in the ${HOME}/.docker-${os_version} folder.
# TODO(claudiub): add "build --isolation=hyperv" once GCE introduces Hyper-V support.
docker --tlsverify --tlscacert "${HOME}/.docker-${os_version}/ca.pem" \
--tlscert "${HOME}/.docker-${os_version}/cert.pem" --tlskey "${HOME}/.docker-${os_version}/key.pem" \
docker --tlsverify --tlscacert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/ca.pem" \
--tlscert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/cert.pem" --tlskey "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/key.pem" \
-H "${REMOTE_DOCKER_URL}" build --pull -t "${REGISTRY}/${image}:${TAG}-${os_name}-${arch}-${os_version}" \
--build-arg BASEIMAGE="${BASEIMAGE}" -f $dockerfile_name .
fi
@ -187,8 +192,8 @@ push() {
docker push "${REGISTRY}/${image}:${TAG}-${os_name}-${arch}"
elif [[ -n "${REMOTE_DOCKER_URL:-}" ]]; then
# NOTE(claudiub): We're pushing the image we built on the remote Windows node.
docker --tlsverify --tlscacert "${HOME}/.docker-${os_version}/ca.pem" \
--tlscert "${HOME}/.docker-${os_version}/cert.pem" --tlskey "${HOME}/.docker-${os_version}/key.pem" \
docker --tlsverify --tlscacert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/ca.pem" \
--tlscert "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/cert.pem" --tlskey "${DOCKER_CERT_BASE_PATH}/.docker-${os_version}/key.pem" \
-H "${REMOTE_DOCKER_URL}" push "${REGISTRY}/${image}:${TAG}-${os_name}-${arch}-${os_version}"
else
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."

View File

@ -1,5 +1,8 @@
linux/amd64=REGISTRY/agnhost:2.13-linux-amd64
linux/arm=REGISTRY/agnhost:2.13-linux-arm
linux/arm64=REGISTRY/agnhost:2.13-linux-arm64
linux/ppc64le=REGISTRY/agnhost:2.13-linux-ppc64le
linux/s390x=REGISTRY/agnhost:2.13-linux-s390x
linux/amd64=REGISTRY/agnhost:2.14-linux-amd64
linux/arm=REGISTRY/agnhost:2.14-linux-arm
linux/arm64=REGISTRY/agnhost:2.14-linux-arm64
linux/ppc64le=REGISTRY/agnhost:2.14-linux-ppc64le
linux/s390x=REGISTRY/agnhost:2.14-linux-s390x
windows/amd64/1809=REGISTRY/agnhost:2.14-windows-amd64-1809
windows/amd64/1903=REGISTRY/agnhost:2.14-windows-amd64-1903
windows/amd64/1909=REGISTRY/agnhost:2.14-windows-amd64-1909

View File

@ -0,0 +1,3 @@
approvers:
- claudiubelu
- mkumatag

View File

@ -1,5 +1,8 @@
linux/amd64=REGISTRY/agnhost:2.13-linux-amd64
linux/arm=REGISTRY/agnhost:2.13-linux-arm
linux/arm64=REGISTRY/agnhost:2.13-linux-arm64
linux/ppc64le=REGISTRY/agnhost:2.13-linux-ppc64le
linux/s390x=REGISTRY/agnhost:2.13-linux-s390x
linux/amd64=REGISTRY/agnhost:2.14-linux-amd64
linux/arm=REGISTRY/agnhost:2.14-linux-arm
linux/arm64=REGISTRY/agnhost:2.14-linux-arm64
linux/ppc64le=REGISTRY/agnhost:2.14-linux-ppc64le
linux/s390x=REGISTRY/agnhost:2.14-linux-s390x
windows/amd64/1809=REGISTRY/agnhost:2.14-windows-amd64-1809
windows/amd64/1903=REGISTRY/agnhost:2.14-windows-amd64-1903
windows/amd64/1909=REGISTRY/agnhost:2.14-windows-amd64-1909

View File

@ -0,0 +1,3 @@
approvers:
- claudiubelu
- mkumatag