diff --git a/hack/.linted_packages b/hack/.linted_packages index 8b59a161dea..38be9e2ea27 100644 --- a/hack/.linted_packages +++ b/hack/.linted_packages @@ -472,14 +472,14 @@ test/images/entrypoint-tester test/images/fakegitserver test/images/goproxy test/images/logs-generator -test/images/mount-tester +test/images/mounttest test/images/n-way-http test/images/net test/images/net/common test/images/port-forward-tester test/images/porter test/images/resource-consumer/consume-cpu -test/images/serve_hostname +test/images/serve-hostname test/integration/apiserver test/integration/client test/integration/configmap diff --git a/test/images/BUILD b/test/images/BUILD index 4424ecf83c1..009d86244a1 100644 --- a/test/images/BUILD +++ b/test/images/BUILD @@ -23,17 +23,17 @@ filegroup( "//test/images/fakegitserver:all-srcs", "//test/images/goproxy:all-srcs", "//test/images/logs-generator:all-srcs", - "//test/images/mount-tester:all-srcs", + "//test/images/mounttest:all-srcs", "//test/images/n-way-http:all-srcs", "//test/images/net:all-srcs", "//test/images/netexec:all-srcs", - "//test/images/network-tester:all-srcs", + "//test/images/nettest:all-srcs", "//test/images/no-snat-test:all-srcs", "//test/images/no-snat-test-proxy:all-srcs", "//test/images/port-forward-tester:all-srcs", "//test/images/porter:all-srcs", "//test/images/resource-consumer:all-srcs", - "//test/images/serve_hostname:all-srcs", + "//test/images/serve-hostname:all-srcs", ], tags = ["automanaged"], ) diff --git a/test/images/nvidia-cuda/Makefile b/test/images/Makefile similarity index 57% rename from test/images/nvidia-cuda/Makefile rename to test/images/Makefile index 616f796c66f..450b17beb7c 100644 --- a/test/images/nvidia-cuda/Makefile +++ b/test/images/Makefile @@ -12,17 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -.PHONY: all push build +REGISTRY ?= gcr.io/kubernetes-e2e-test-images +GOARM=7 +QEMUVERSION=v2.7.0 +GOLANG_VERSION=1.8.3 +export -TAG ?= v0.1 +ifndef WHAT +$(error WHAT is a required variable, ex: make all WHAT=net) +endif -REGISTRY ?= gcr.io/google-containers -IMAGE = $(REGISTRY)/cuda-vector-add +# Build code. +# +# Args: +# WHAT: Directory names to build. +# +# Example: +# make all WHAT=clusterapi-tester +all: all-container -build: - docker build --pull -t $(IMAGE):$(TAG) . +all-container: + ./image-util.sh build $(WHAT) -push: - gcloud docker -- push $(IMAGE):$(TAG) +all-push: all-container + ./image-util.sh push $(WHAT) -all: build +.PHONY: all all-push all-container diff --git a/test/images/clusterapi-tester/BASEIMAGE b/test/images/clusterapi-tester/BASEIMAGE new file mode 100644 index 00000000000..44329aaa5b1 --- /dev/null +++ b/test/images/clusterapi-tester/BASEIMAGE @@ -0,0 +1,5 @@ +amd64=busybox +arm=arm32v6/busybox +arm64=arm64v8/busybox +ppc64le=ppc64le/busybox +s390x=s390x/busybox diff --git a/test/images/clusterapi-tester/BUILD b/test/images/clusterapi-tester/BUILD index 2e20ac80d0e..98c5c2c528c 100644 --- a/test/images/clusterapi-tester/BUILD +++ b/test/images/clusterapi-tester/BUILD @@ -16,7 +16,7 @@ go_binary( go_library( name = "go_default_library", - srcs = ["main.go"], + srcs = ["clusterapi-tester.go"], tags = ["automanaged"], deps = [ "//pkg/client/clientset_generated/internalclientset:go_default_library", diff --git a/test/images/clusterapi-tester/Dockerfile b/test/images/clusterapi-tester/Dockerfile index 9327d227545..cfb8401d859 100644 --- a/test/images/clusterapi-tester/Dockerfile +++ b/test/images/clusterapi-tester/Dockerfile @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM busybox -ADD main main -ENTRYPOINT ["/main"] +FROM BASEIMAGE +ADD clusterapi-tester /clusterapi-tester +ENTRYPOINT ["/clusterapi-tester"] diff --git a/test/images/clusterapi-tester/Makefile b/test/images/clusterapi-tester/Makefile index 02a0e5616b6..7e7d827fdc6 100644 --- a/test/images/clusterapi-tester/Makefile +++ b/test/images/clusterapi-tester/Makefile @@ -12,20 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -all: push +SRCS = clusterapi-tester +ARCH ?= amd64 +TARGET ?= $(CURDIR) +GOLANG_VERSION ?= latest +SRC_DIR = $(notdir $(shell pwd)) +export -# 0.0 shouldn't clobber any released builds -TAG = 1.0 -PREFIX = gcr.io/google_containers/clusterapi-tester +bin: + ../image-util.sh bin $(SRCS) -main: main.go - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o main ./main.go - -container: main - docker build --pull -t $(PREFIX):$(TAG) . - -push: container - gcloud docker -- push $(PREFIX):$(TAG) - -clean: - rm -f main +.PHONY: bin diff --git a/test/images/clusterapi-tester/VERSION b/test/images/clusterapi-tester/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/clusterapi-tester/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/clusterapi-tester/main.go b/test/images/clusterapi-tester/clusterapi-tester.go similarity index 100% rename from test/images/clusterapi-tester/main.go rename to test/images/clusterapi-tester/clusterapi-tester.go diff --git a/test/images/cuda-vector-add/BASEIMAGE b/test/images/cuda-vector-add/BASEIMAGE new file mode 100644 index 00000000000..a7b6d587069 --- /dev/null +++ b/test/images/cuda-vector-add/BASEIMAGE @@ -0,0 +1,2 @@ +amd64=nvidia/cuda:8.0-devel-ubuntu16.04 +ppc64le=nvidia/cuda-ppc64le:8.0-devel-ubuntu16.04 diff --git a/test/images/nvidia-cuda/Dockerfile b/test/images/cuda-vector-add/Dockerfile similarity index 90% rename from test/images/nvidia-cuda/Dockerfile rename to test/images/cuda-vector-add/Dockerfile index 2d68b97f5f7..c7b9cfdc31e 100644 --- a/test/images/nvidia-cuda/Dockerfile +++ b/test/images/cuda-vector-add/Dockerfile @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM nvidia/cuda:8.0-devel-ubuntu16.04 +FROM BASEIMAGE + +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ RUN apt-get update && apt-get install -y --no-install-recommends \ cuda-samples-$CUDA_PKG_VERSION && \ @@ -21,4 +23,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /usr/local/cuda/samples/0_Simple/vectorAdd RUN make -CMD ./vectorAdd \ No newline at end of file +CMD ./vectorAdd diff --git a/test/images/nvidia-cuda/README.md b/test/images/cuda-vector-add/README.md similarity index 100% rename from test/images/nvidia-cuda/README.md rename to test/images/cuda-vector-add/README.md diff --git a/test/images/cuda-vector-add/VERSION b/test/images/cuda-vector-add/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/cuda-vector-add/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/dnsutils/BASEIMAGE b/test/images/dnsutils/BASEIMAGE new file mode 100644 index 00000000000..114844f395e --- /dev/null +++ b/test/images/dnsutils/BASEIMAGE @@ -0,0 +1,4 @@ +amd64=alpine:3.6 +arm=arm32v6/alpine:3.6 +arm64=arm64v8/alpine:3.6 +ppc64le=ppc64le/alpine:3.6 diff --git a/test/images/dnsutils/Dockerfile b/test/images/dnsutils/Dockerfile index 2d037e9f843..d041c62703f 100644 --- a/test/images/dnsutils/Dockerfile +++ b/test/images/dnsutils/Dockerfile @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM alpine +FROM BASEIMAGE + +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ RUN apk add --no-cache bind-tools diff --git a/test/images/dnsutils/Makefile b/test/images/dnsutils/Makefile deleted file mode 100644 index 7155584f293..00000000000 --- a/test/images/dnsutils/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This image does not tag -TAG ?= -PREFIX ?= gcr.io/google_containers - -all: push - -image: - docker build --pull -t $(PREFIX)/dnsutils . - -push: image - gcloud docker -- push $(PREFIX)/dnsutils - -clean: diff --git a/test/images/dnsutils/VERSION b/test/images/dnsutils/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/dnsutils/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/entrypoint-tester/Makefile b/test/images/entrypoint-tester/Makefile index a15e6670582..79201cd4197 100644 --- a/test/images/entrypoint-tester/Makefile +++ b/test/images/entrypoint-tester/Makefile @@ -12,19 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -TAG = 0.1 -PREFIX = kubernetes +SRCS=ep +ARCH ?= amd64 +TARGET ?= $(CURDIR) +GOLANG_VERSION ?= latest +SRC_DIR = $(notdir $(shell pwd)) +export -all: push +bin: + ../image-util.sh bin $(SRCS) -ep: ep.go - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./ep.go - -image: ep - sudo docker build --pull -t $(PREFIX)/eptest:$(TAG) . - -push: image - sudo docker push $(PREFIX)/eptest:$(TAG) - -clean: - rm -f ep +.PHONY: bin diff --git a/test/images/entrypoint-tester/VERSION b/test/images/entrypoint-tester/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/entrypoint-tester/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/fakegitserver/Dockerfile b/test/images/fakegitserver/Dockerfile index 8ec3654f010..e25b13e1d6a 100644 --- a/test/images/fakegitserver/Dockerfile +++ b/test/images/fakegitserver/Dockerfile @@ -13,6 +13,7 @@ # limitations under the License. FROM scratch -ADD GITHASH.txt / -ADD gitserver / -ENTRYPOINT ["/gitserver"] +COPY GITHASH.txt / +COPY fakegitserver / +ENTRYPOINT ["/fakegitserver"] + diff --git a/test/images/fakegitserver/Makefile b/test/images/fakegitserver/Makefile index 98b19cfb1c7..34f07dc9da3 100644 --- a/test/images/fakegitserver/Makefile +++ b/test/images/fakegitserver/Makefile @@ -12,21 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -.PHONY: all image push clean +SRCS = fakegitserver +ARCH ?= amd64 +TARGET ?= $(CURDIR) +GOLANG_VERSION ?= latest +SRC_DIR = $(notdir $(shell pwd)) +export -TAG = 0.1 -PREFIX = gcr.io/google_containers -IMAGE = fakegitserver -ARCH = amd64 +IGNORE := $(shell git rev-parse HEAD > $(TARGET)/GITHASH.txt) -image: - ./prepare.sh $(ARCH) - docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) . +bin: + ../image-util.sh bin $(SRCS) -push: image - gcloud docker -- push $(PREFIX)/$(IMAGE):$(TAG) - -all: push - -clean: - rm -f gitserver GITHASH.txt +.PHONY: bin diff --git a/test/images/fakegitserver/VERSION b/test/images/fakegitserver/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/fakegitserver/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/fakegitserver/prepare.sh b/test/images/fakegitserver/prepare.sh deleted file mode 100755 index 414e0447974..00000000000 --- a/test/images/fakegitserver/prepare.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e -set -x - -ARCH=$1 - -# Build the binary. -CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -installsuffix cgo -ldflags '-w' ./gitserver.go - -# Write down the current commit hash. -echo $(git rev-parse HEAD) >> GITHASH.txt diff --git a/test/images/goproxy/Makefile b/test/images/goproxy/Makefile index f7408cbd95d..35282790f0e 100644 --- a/test/images/goproxy/Makefile +++ b/test/images/goproxy/Makefile @@ -12,19 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -TAG = 0.1 -PREFIX = gcr.io/google_containers +SRCS=goproxy +ARCH ?= amd64 +TARGET ?= $(CURDIR) +GOLANG_VERSION ?= latest +SRC_DIR = $(notdir $(shell pwd)) +export -all: push +bin: + ../image-util.sh bin $(SRCS) -goproxy: goproxy.go - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./goproxy.go - -image: goproxy - docker build --pull -t $(PREFIX)/goproxy:$(TAG) . - -push: image - gcloud docker -- push $(PREFIX)/goproxy:$(TAG) - -clean: - rm -f goproxy +.PHONY: bin diff --git a/test/images/goproxy/VERSION b/test/images/goproxy/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/goproxy/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/hostexec/BASEIMAGE b/test/images/hostexec/BASEIMAGE new file mode 100644 index 00000000000..114844f395e --- /dev/null +++ b/test/images/hostexec/BASEIMAGE @@ -0,0 +1,4 @@ +amd64=alpine:3.6 +arm=arm32v6/alpine:3.6 +arm64=arm64v8/alpine:3.6 +ppc64le=ppc64le/alpine:3.6 diff --git a/test/images/hostexec/Dockerfile b/test/images/hostexec/Dockerfile index 98f2565f7c2..af6a4cb6181 100644 --- a/test/images/hostexec/Dockerfile +++ b/test/images/hostexec/Dockerfile @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM alpine:3.2 +FROM BASEIMAGE + +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ # install necessary packages: # - curl, nc: used by a lot of e2e tests # - iproute2: includes ss used in NodePort tests -run apk --update add curl netcat-openbsd iproute2 && rm -rf /var/cache/apk/* +RUN apk --update add curl netcat-openbsd iproute2 && rm -rf /var/cache/apk/* # wait forever CMD rm -f /fifo && mkfifo /fifo && exec cat