Multi Arch test images
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
# Copyright 2017 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.
|
||||
@@ -12,19 +12,29 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
.PHONY: all image push clean
|
||||
REGISTRY ?= gcr.io/k8s-e2e-images
|
||||
GOARM=7
|
||||
QEMUVERSION=v2.7.0
|
||||
GOLANG_VERSION=1.8.3
|
||||
export
|
||||
|
||||
TAG = 1.2
|
||||
PREFIX = gcr.io/google_containers
|
||||
ifndef WHAT
|
||||
$(error WHAT is a required variable, ex: make all WHAT=net)
|
||||
endif
|
||||
|
||||
# Build code.
|
||||
#
|
||||
# Args:
|
||||
# WHAT: Directory names to build.
|
||||
#
|
||||
# Example:
|
||||
# make all WHAT=clusterapi-tester
|
||||
all: all-container
|
||||
|
||||
all: push
|
||||
all-container:
|
||||
./image-util.sh build $(WHAT)
|
||||
|
||||
image:
|
||||
docker build --pull -t $(PREFIX)/hostexec:$(TAG) .
|
||||
all-push: all-container
|
||||
./image-util.sh push $(WHAT)
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/hostexec:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f hostexec
|
||||
.PHONY: all all-push all-container
|
5
test/images/clusterapi-tester/BASEIMAGE
Normal file
5
test/images/clusterapi-tester/BASEIMAGE
Normal file
@@ -0,0 +1,5 @@
|
||||
amd64=busybox
|
||||
arm=arm32v6/busybox
|
||||
arm64=arm64v8/busybox
|
||||
ppc64le=ppc64le/busybox
|
||||
s390x=s390x/busybox
|
@@ -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",
|
||||
|
@@ -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"]
|
||||
|
@@ -12,20 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
all: push
|
||||
BIN=clusterapi-tester
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
# 0.0 shouldn't clobber any released builds
|
||||
TAG = 1.0
|
||||
PREFIX = gcr.io/google_containers/clusterapi-tester
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/clusterapi-tester && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN)"
|
||||
|
||||
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
|
||||
|
1
test/images/clusterapi-tester/NAME
Normal file
1
test/images/clusterapi-tester/NAME
Normal file
@@ -0,0 +1 @@
|
||||
clusterapi-tester
|
1
test/images/clusterapi-tester/VERSION
Normal file
1
test/images/clusterapi-tester/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
1.1
|
4
test/images/dnsutils/BASEIMAGE
Normal file
4
test/images/dnsutils/BASEIMAGE
Normal file
@@ -0,0 +1,4 @@
|
||||
amd64=alpine:3.6
|
||||
arm=arm32v6/alpine:3.6
|
||||
arm64=arm64v8/alpine:3.6
|
||||
ppc64le=ppc64le/alpine:3.6
|
@@ -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
|
||||
|
1
test/images/dnsutils/NAME
Normal file
1
test/images/dnsutils/NAME
Normal file
@@ -0,0 +1 @@
|
||||
dnsutils
|
1
test/images/dnsutils/VERSION
Normal file
1
test/images/dnsutils/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
1.1
|
@@ -12,19 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TAG = 0.1
|
||||
PREFIX = kubernetes
|
||||
BIN=ep
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: push
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/entrypoint-tester && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
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
|
||||
|
1
test/images/entrypoint-tester/NAME
Normal file
1
test/images/entrypoint-tester/NAME
Normal file
@@ -0,0 +1 @@
|
||||
ep
|
1
test/images/entrypoint-tester/VERSION
Normal file
1
test/images/entrypoint-tester/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.2
|
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
FROM scratch
|
||||
ADD GITHASH.txt /
|
||||
ADD gitserver /
|
||||
ENTRYPOINT ["/gitserver"]
|
||||
COPY GITHASH.txt /
|
||||
COPY fakegitserver /
|
||||
ENTRYPOINT ["/fakegitserver"]
|
||||
|
||||
|
@@ -12,21 +12,17 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
.PHONY: all image push clean
|
||||
BIN=fakegitserver
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
TAG = 0.1
|
||||
PREFIX = gcr.io/google_containers
|
||||
IMAGE = fakegitserver
|
||||
ARCH = amd64
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/fakegitserver && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
@echo $(shell git rev-parse HEAD) > $(TARGET)/GITHASH.txt
|
||||
|
||||
image:
|
||||
./prepare.sh $(ARCH)
|
||||
docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/$(IMAGE):$(TAG)
|
||||
|
||||
all: push
|
||||
|
||||
clean:
|
||||
rm -f gitserver GITHASH.txt
|
||||
.PHONY: bin
|
||||
|
1
test/images/fakegitserver/NAME
Normal file
1
test/images/fakegitserver/NAME
Normal file
@@ -0,0 +1 @@
|
||||
fakegitserver
|
1
test/images/fakegitserver/VERSION
Normal file
1
test/images/fakegitserver/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.2
|
@@ -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
|
@@ -12,19 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TAG = 0.1
|
||||
PREFIX = gcr.io/google_containers
|
||||
BIN=goproxy
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: push
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/goproxy && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
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
|
||||
|
1
test/images/goproxy/NAME
Normal file
1
test/images/goproxy/NAME
Normal file
@@ -0,0 +1 @@
|
||||
goproxy
|
1
test/images/goproxy/VERSION
Normal file
1
test/images/goproxy/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.2
|
4
test/images/hostexec/BASEIMAGE
Normal file
4
test/images/hostexec/BASEIMAGE
Normal file
@@ -0,0 +1,4 @@
|
||||
amd64=alpine:3.6
|
||||
arm=arm32v6/alpine:3.6
|
||||
arm64=arm64v8/alpine:3.6
|
||||
ppc64le=ppc64le/alpine:3.6
|
@@ -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 </fifo
|
||||
|
1
test/images/hostexec/NAME
Normal file
1
test/images/hostexec/NAME
Normal file
@@ -0,0 +1 @@
|
||||
hostexec
|
1
test/images/hostexec/VERSION
Normal file
1
test/images/hostexec/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
1.3
|
112
test/images/image-util.sh
Executable file
112
test/images/image-util.sh
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2017 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 -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
TASK=$1
|
||||
IMAGE=$2
|
||||
|
||||
# Mapping of go ARCH to actual architectures shipped part of multiarch/qemu-user-static project
|
||||
declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["ppc64le"]="ppc64le" ["s390x"]="s390x" )
|
||||
|
||||
# Returns list of all supported architectures from BASEIMAGE file
|
||||
listArchs() {
|
||||
cut -d "=" -f 1 ${IMAGE}/BASEIMAGE
|
||||
}
|
||||
|
||||
# Returns baseimage need to used in Dockerfile for any given architecture
|
||||
getBaseImage() {
|
||||
arch=$1
|
||||
echo $(grep "${arch}=" BASEIMAGE | cut -d= -f2)
|
||||
}
|
||||
|
||||
# This function will build test image for all the architectures
|
||||
# mentioned in BASEIMAGE file. In the absence of BASEIMAGE file,
|
||||
# it will build for all the supported arch list - amd64, arm,
|
||||
# arm64, ppc64le, s390x
|
||||
build() {
|
||||
if [[ -f ${IMAGE}/BASEIMAGE ]]; then
|
||||
archs=$(listArchs)
|
||||
else
|
||||
archs=${!QEMUARCHS[@]}
|
||||
fi
|
||||
|
||||
for arch in ${archs}; do
|
||||
echo "Building image for ${IMAGE} ARCH: ${arch}..."
|
||||
|
||||
# Create a temporary directory for every architecture and copy the image content
|
||||
# and build the image from temporary directory
|
||||
temp_dir=$(mktemp -d)
|
||||
cp -r ${IMAGE}/* ${temp_dir}
|
||||
if [[ -f ${IMAGE}/Makefile ]]; then
|
||||
# make bin will take care of all the prerequisites needed
|
||||
# for building the docker image
|
||||
make -C ${IMAGE} bin ARCH=${arch} TARGET=${temp_dir}
|
||||
fi
|
||||
pushd ${temp_dir}
|
||||
# image tag
|
||||
TAG=$(<VERSION)
|
||||
# image name
|
||||
IMAGENAME=$(<NAME)
|
||||
|
||||
if [[ -f BASEIMAGE ]]; then
|
||||
BASEIMAGE=$(getBaseImage ${arch})
|
||||
sed -i "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile
|
||||
fi
|
||||
|
||||
# copy the qemu-*-static binary to docker image to build the multi architecture image on x86 platform
|
||||
if [[ $(grep "CROSS_BUILD_" Dockerfile) ]]; then
|
||||
if [[ "${arch}" == "amd64" ]]; then
|
||||
sed -i "/CROSS_BUILD_/d" Dockerfile
|
||||
else
|
||||
sed -i "s|QEMUARCH|${QEMUARCHS[$arch]}|g" Dockerfile
|
||||
# Register qemu-*-static for all supported processors except the current one
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/${QEMUVERSION}/x86_64_qemu-${QEMUARCHS[$arch]}-static.tar.gz | tar -xz -C ${temp_dir}
|
||||
sed -i "s/CROSS_BUILD_//g" Dockerfile
|
||||
fi
|
||||
fi
|
||||
|
||||
docker build --pull -t ${REGISTRY}/${IMAGENAME}-${arch}:${TAG} .
|
||||
|
||||
# Image without any arch postfix will point to amd64 by default.
|
||||
if [[ "${arch}" == "amd64" ]]; then
|
||||
docker tag ${REGISTRY}/${IMAGENAME}-${arch}:${TAG} ${REGISTRY}/${IMAGENAME}:${TAG}
|
||||
fi
|
||||
popd
|
||||
done
|
||||
}
|
||||
|
||||
# This function will push the docker images
|
||||
push() {
|
||||
if [[ -f ${IMAGE}/BASEIMAGE ]]; then
|
||||
archs=$(listArchs)
|
||||
else
|
||||
archs=${!QEMUARCHS[@]}
|
||||
fi
|
||||
for arch in ${archs}; do
|
||||
IMAGENAME=$(<${IMAGE}/NAME)
|
||||
TAG=$(<${IMAGE}/VERSION)
|
||||
gcloud docker -- push ${REGISTRY}/${IMAGENAME}-${arch}:${TAG}
|
||||
if [[ "${arch}" == "amd64" ]]; then
|
||||
gcloud docker -- push ${REGISTRY}/${IMAGENAME}:${TAG}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
eval ${TASK}
|
4
test/images/iperf/BASEIMAGE
Normal file
4
test/images/iperf/BASEIMAGE
Normal file
@@ -0,0 +1,4 @@
|
||||
amd64=gcr.io/google_containers/ubuntu-slim:0.12
|
||||
arm=gcr.io/google_containers/ubuntu-slim-arm:0.12
|
||||
arm64=gcr.io/google_containers/ubuntu-slim-arm64:0.12
|
||||
ppc64le=gcr.io/google_containers/ubuntu-slim-ppc64le:0.12
|
@@ -12,7 +12,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM gcr.io/google_containers/ubuntu-slim:0.6
|
||||
FROM BASEIMAGE
|
||||
|
||||
CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends iperf bash \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
|
@@ -1,31 +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.
|
||||
|
||||
TAG = e2e
|
||||
PREFIX = gcr.io/google_containers
|
||||
IMAGE = iperf
|
||||
|
||||
all: push
|
||||
|
||||
container: image
|
||||
|
||||
image:
|
||||
docker build --pull -t $(PREFIX)/${IMAGE} . # Build new image and automatically tag it as latest
|
||||
docker tag $(PREFIX)/${IMAGE} $(PREFIX)/${IMAGE}:$(TAG) # Add the version tag to the latest image
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/${IMAGE} # Push image tagged as latest to repository
|
||||
gcloud docker -- push $(PREFIX)/${IMAGE}:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)
|
||||
|
||||
clean:
|
1
test/images/iperf/NAME
Normal file
1
test/images/iperf/NAME
Normal file
@@ -0,0 +1 @@
|
||||
iperf
|
1
test/images/iperf/VERSION
Normal file
1
test/images/iperf/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.1
|
4
test/images/jessie-dnsutils/BASEIMAGE
Normal file
4
test/images/jessie-dnsutils/BASEIMAGE
Normal file
@@ -0,0 +1,4 @@
|
||||
amd64=debian:jessie
|
||||
arm=arm32v7/debian:jessie
|
||||
arm64=arm64v8/debian:jessie
|
||||
ppc64le=ppc64le/debian:jessie
|
@@ -12,7 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM debian:jessie
|
||||
FROM BASEIMAGE
|
||||
|
||||
CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/
|
||||
|
||||
RUN apt-get -q update && \
|
||||
apt-get install -y dnsutils && \
|
||||
|
@@ -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)/jessie-dnsutils .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/jessie-dnsutils
|
||||
|
||||
clean:
|
1
test/images/jessie-dnsutils/NAME
Normal file
1
test/images/jessie-dnsutils/NAME
Normal file
@@ -0,0 +1 @@
|
||||
jessie-dnsutils
|
1
test/images/jessie-dnsutils/VERSION
Normal file
1
test/images/jessie-dnsutils/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.1
|
4
test/images/logs-generator/BASEIMAGE
Normal file
4
test/images/logs-generator/BASEIMAGE
Normal file
@@ -0,0 +1,4 @@
|
||||
amd64=busybox
|
||||
arm=arm32v6/busybox
|
||||
arm64=arm64v8/busybox
|
||||
ppc64le=ppc64le/busybox
|
@@ -12,11 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM gcr.io/google_containers/ubuntu-slim:0.6
|
||||
FROM BASEIMAGE
|
||||
|
||||
ENV LOGS_GENERATOR_LINES_TOTAL 1
|
||||
ENV LOGS_GENERATOR_DURATION 1s
|
||||
|
||||
COPY logs-generator /
|
||||
|
||||
CMD /logs-generator --logtostderr \
|
||||
--log-lines-total=${LOGS_GENERATOR_LINES_TOTAL} \
|
||||
--run-duration=${LOGS_GENERATOR_DURATION}
|
||||
CMD ["sh", "-c", "/logs-generator --logtostderr --log-lines-total=${LOGS_GENERATOR_LINES_TOTAL} --run-duration=${LOGS_GENERATOR_DURATION}"]
|
||||
|
@@ -12,21 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TAG = v0.1.1
|
||||
PREFIX = gcr.io/google_containers
|
||||
BIN=logs-generator
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: build
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/logs-generator && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
build: binary container
|
||||
|
||||
binary:
|
||||
go build -a --ldflags '-w' -o logs-generator .
|
||||
|
||||
container:
|
||||
docker build --pull -t $(PREFIX)/logs-generator:$(TAG) .
|
||||
|
||||
push:
|
||||
gcloud docker -- push $(PREFIX)/logs-generator:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f logs-generator
|
||||
.PHONY: bin
|
||||
|
1
test/images/logs-generator/NAME
Normal file
1
test/images/logs-generator/NAME
Normal file
@@ -0,0 +1 @@
|
||||
logs-generator
|
1
test/images/logs-generator/VERSION
Normal file
1
test/images/logs-generator/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
v0.1.2
|
5
test/images/mount-tester-user/BASEIMAGE
Normal file
5
test/images/mount-tester-user/BASEIMAGE
Normal file
@@ -0,0 +1,5 @@
|
||||
amd64=gcr.io/google_containers/mounttest-amd64:0.9
|
||||
arm=gcr.io/google_containers/mounttest-arm:0.9
|
||||
arm64=gcr.io/google_containers/mounttest-arm64:0.9
|
||||
ppc64le=gcr.io/google_containers/mounttest-ppc64le:0.9
|
||||
s390x=gcr.io/google_containers/mounttest-s390x:0.9
|
@@ -12,5 +12,5 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM gcr.io/google_containers/mounttest:0.8
|
||||
FROM BASEIMAGE
|
||||
USER 1001
|
||||
|
@@ -1,26 +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.
|
||||
|
||||
TAG = 0.5
|
||||
PREFIX = gcr.io/google_containers
|
||||
|
||||
all: push
|
||||
|
||||
image:
|
||||
sudo docker build --pull -t $(PREFIX)/mounttest-user:$(TAG) .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/mounttest-user:$(TAG)
|
||||
|
||||
clean:
|
1
test/images/mount-tester-user/NAME
Normal file
1
test/images/mount-tester-user/NAME
Normal file
@@ -0,0 +1 @@
|
||||
mounttest-user
|
1
test/images/mount-tester-user/VERSION
Normal file
1
test/images/mount-tester-user/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.6
|
@@ -13,5 +13,5 @@
|
||||
# limitations under the License.
|
||||
|
||||
FROM scratch
|
||||
ADD mt mt
|
||||
ENTRYPOINT ["/mt"]
|
||||
COPY mounttest /
|
||||
ENTRYPOINT ["/mounttest"]
|
||||
|
@@ -12,20 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TAG = 0.8
|
||||
PREFIX = gcr.io/google_containers
|
||||
BIN=mounttest
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: push
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/mount-tester && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
mt: mt.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./mt.go && \
|
||||
chmod a+rx mt
|
||||
|
||||
image: mt
|
||||
sudo docker build --pull -t $(PREFIX)/mounttest:$(TAG) .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/mounttest:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f mt
|
||||
.PHONY: bin
|
||||
|
1
test/images/mount-tester/NAME
Normal file
1
test/images/mount-tester/NAME
Normal file
@@ -0,0 +1 @@
|
||||
mounttest
|
1
test/images/mount-tester/VERSION
Normal file
1
test/images/mount-tester/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.9
|
5
test/images/n-way-http/BASEIMAGE
Normal file
5
test/images/n-way-http/BASEIMAGE
Normal file
@@ -0,0 +1,5 @@
|
||||
amd64=busybox
|
||||
arm=arm32v6/busybox
|
||||
arm64=arm64v8/busybox
|
||||
ppc64le=ppc64le/busybox
|
||||
s390x=s390x/busybox
|
@@ -12,6 +12,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM busybox
|
||||
ADD server server
|
||||
ENTRYPOINT ["/server"]
|
||||
FROM BASEIMAGE
|
||||
COPY n-way-http /
|
||||
ENTRYPOINT ["/n-way-http"]
|
||||
|
@@ -12,20 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
all: push
|
||||
BIN=n-way-http
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
# 0.0 shouldn't clobber any released builds
|
||||
TAG = 0.0
|
||||
PREFIX = gcr.io/google_containers/n-way-http
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/n-way-http && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
server: server.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go
|
||||
|
||||
container: server
|
||||
docker build --pull -t $(PREFIX):$(TAG) .
|
||||
|
||||
push: container
|
||||
gcloud docker -- push $(PREFIX):$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f server
|
||||
.PHONY: bin
|
||||
|
1
test/images/n-way-http/NAME
Normal file
1
test/images/n-way-http/NAME
Normal file
@@ -0,0 +1 @@
|
||||
n-way-http
|
1
test/images/n-way-http/VERSION
Normal file
1
test/images/n-way-http/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
1.1
|
4
test/images/net/BASEIMAGE
Normal file
4
test/images/net/BASEIMAGE
Normal file
@@ -0,0 +1,4 @@
|
||||
amd64=alpine:3.6
|
||||
arm=arm32v6/alpine:3.6
|
||||
arm64=arm64v8/alpine:3.6
|
||||
ppc64le=ppc64le/alpine:3.6
|
@@ -12,6 +12,9 @@
|
||||
# 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/
|
||||
|
||||
COPY net /net
|
||||
RUN apk update && apk add curl
|
||||
|
@@ -12,28 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ARCH := amd64
|
||||
PREFIX ?= gcr.io/google_containers
|
||||
TAG ?= 1.0
|
||||
IMAGE ?= e2e-net-$(ARCH)
|
||||
BIN=net
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
SRCS := $(shell find . -name \*.go)
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/net && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
all: image
|
||||
|
||||
net: $(SRCS)
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w'
|
||||
|
||||
image: test net
|
||||
docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/$(IMAGE):$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f net
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
.PHONY: all clean image push test
|
||||
.PHONY: bin
|
||||
|
1
test/images/net/NAME
Normal file
1
test/images/net/NAME
Normal file
@@ -0,0 +1 @@
|
||||
e2e-net
|
1
test/images/net/VERSION
Normal file
1
test/images/net/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
1.1
|
5
test/images/netexec/BASEIMAGE
Normal file
5
test/images/netexec/BASEIMAGE
Normal file
@@ -0,0 +1,5 @@
|
||||
amd64=busybox
|
||||
arm=arm32v6/busybox
|
||||
arm64=arm64v8/busybox
|
||||
ppc64le=ppc64le/busybox
|
||||
s390x=s390x/busybox
|
@@ -12,10 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM busybox
|
||||
FROM BASEIMAGE
|
||||
|
||||
CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/
|
||||
|
||||
ADD netexec netexec
|
||||
ADD netexec.go netexec.go
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
|
@@ -12,22 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
.PHONY: all netexec image push clean
|
||||
BIN=netexec
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
TAG = 1.7
|
||||
PREFIX = gcr.io/google_containers
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/netexec && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
|
||||
all: push
|
||||
|
||||
netexec: netexec.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./netexec.go
|
||||
|
||||
image: netexec
|
||||
docker build --pull -t $(PREFIX)/netexec:$(TAG) .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/netexec:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f netexec
|
||||
.PHONY: bin
|
||||
|
1
test/images/netexec/NAME
Normal file
1
test/images/netexec/NAME
Normal file
@@ -0,0 +1 @@
|
||||
netexec
|
1
test/images/netexec/VERSION
Normal file
1
test/images/netexec/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
1.8
|
@@ -16,7 +16,7 @@ go_binary(
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["webserver.go"],
|
||||
srcs = ["nettest.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
||||
|
@@ -13,6 +13,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
FROM scratch
|
||||
ADD webserver webserver
|
||||
COPY nettest /
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/webserver"]
|
||||
ENTRYPOINT ["/nettest"]
|
||||
|
@@ -12,21 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TAG = 1.9
|
||||
PREFIX = gcr.io/google_containers
|
||||
BIN=nettest
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: push
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/network-tester && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
webserver: webserver.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./webserver.go
|
||||
|
||||
container: image
|
||||
|
||||
image: webserver
|
||||
docker build --pull -t $(PREFIX)/nettest:$(TAG) .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/nettest:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f webserver
|
||||
.PHONY: bin
|
||||
|
1
test/images/network-tester/NAME
Normal file
1
test/images/network-tester/NAME
Normal file
@@ -0,0 +1 @@
|
||||
nettest
|
1
test/images/network-tester/VERSION
Normal file
1
test/images/network-tester/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
2.0
|
@@ -12,19 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TAG = 1.2
|
||||
PREFIX = gcr.io/google_containers
|
||||
BIN=portforwardtester
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: push
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/port-forward-tester && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
portforwardtester: portforwardtester.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./portforwardtester.go
|
||||
|
||||
image: portforwardtester
|
||||
docker build --pull -t $(PREFIX)/portforwardtester:$(TAG) .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/portforwardtester:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f portforwardtester
|
||||
.PHONY: bin
|
||||
|
1
test/images/port-forward-tester/NAME
Normal file
1
test/images/port-forward-tester/NAME
Normal file
@@ -0,0 +1 @@
|
||||
portforwardtester
|
1
test/images/port-forward-tester/VERSION
Normal file
1
test/images/port-forward-tester/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
1.3
|
@@ -12,36 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Use:
|
||||
#
|
||||
# `make porter` will build porter.
|
||||
# `make tag` will suggest a tag.
|
||||
# `make image` will build an image-- you must supply a tag.
|
||||
# `make push` will push the image-- you must supply a tag.
|
||||
BIN=porter
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
# This image does not tag in the normal way
|
||||
# TAG =
|
||||
PREFIX = gcr.io/google_containers
|
||||
SUGGESTED_TAG = $(shell git rev-parse --verify HEAD)
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/porter && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
porter: porter.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./porter.go
|
||||
|
||||
tag:
|
||||
@echo "If all relevant changes are committed, suggest using TAG=$(SUGGESTED_TAG)"
|
||||
@echo "$$ make container TAG=$(SUGGESTED_TAG)"
|
||||
@echo "or"
|
||||
@echo "$$ make push TAG=$(SUGGESTED_TAG)"
|
||||
|
||||
container: image
|
||||
|
||||
image:
|
||||
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
|
||||
docker build --pull -t $(PREFIX)/porter:$(TAG) .
|
||||
|
||||
push:
|
||||
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
|
||||
gcloud docker -- push $(PREFIX)/porter:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f porter
|
||||
.PHONY: bin
|
||||
|
1
test/images/porter/NAME
Normal file
1
test/images/porter/NAME
Normal file
@@ -0,0 +1 @@
|
||||
porter
|
1
test/images/porter/VERSION
Normal file
1
test/images/porter/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.1
|
3
test/images/resource-consumer/.gitignore
vendored
Normal file
3
test/images/resource-consumer/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
consumer
|
||||
consume-cpu/consume-cpu
|
||||
controller/controller
|
4
test/images/resource-consumer/BASEIMAGE
Normal file
4
test/images/resource-consumer/BASEIMAGE
Normal file
@@ -0,0 +1,4 @@
|
||||
amd64=gcr.io/google-containers/ubuntu-slim-amd64:0.12
|
||||
arm=gcr.io/google-containers/ubuntu-slim-arm:0.12
|
||||
arm64=gcr.io/google-containers/ubuntu-slim-arm64:0.12
|
||||
ppc64le=gcr.io/google-containers/ubuntu-slim-ppc64le:0.12
|
@@ -12,7 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM jess/stress
|
||||
FROM BASEIMAGE
|
||||
|
||||
CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends stress && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ADD consumer /consumer
|
||||
ADD consume-cpu /consume-cpu
|
||||
EXPOSE 8080
|
||||
|
@@ -12,30 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TAG = beta4
|
||||
PREFIX = gcr.io/google_containers
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: clean consumer
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/resource-consumer && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/consumer ."
|
||||
|
||||
consumer:
|
||||
CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go
|
||||
CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o consumer .
|
||||
CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o controller/controller ./controller/controller.go
|
||||
|
||||
container: image
|
||||
|
||||
image:
|
||||
sudo docker build --pull -t $(PREFIX)/resource_consumer:$(TAG) .
|
||||
sudo docker build --pull -t $(PREFIX)/resource_consumer/controller:$(TAG) controller
|
||||
|
||||
run_container:
|
||||
docker run --publish=8080:8080 $(PREFIX)/resource_consumer:$(TAG)
|
||||
|
||||
push:
|
||||
gcloud docker -- push ${PREFIX}/resource_consumer:${TAG}
|
||||
gcloud docker -- push ${PREFIX}/resource_consumer/controller:${TAG}
|
||||
|
||||
clean:
|
||||
rm -f consumer
|
||||
rm -f consume-cpu/consume-cpu
|
||||
rm -f controller/controller
|
||||
.PHONY: bin
|
||||
|
1
test/images/resource-consumer/NAME
Normal file
1
test/images/resource-consumer/NAME
Normal file
@@ -0,0 +1 @@
|
||||
resource_consumer
|
1
test/images/resource-consumer/VERSION
Normal file
1
test/images/resource-consumer/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.1
|
5
test/images/resource-consumer/controller/BASEIMAGE
Normal file
5
test/images/resource-consumer/controller/BASEIMAGE
Normal file
@@ -0,0 +1,5 @@
|
||||
amd64=busybox
|
||||
arm=arm32v6/busybox
|
||||
arm64=arm64v8/busybox
|
||||
ppc64le=ppc64le/busybox
|
||||
s390x=s390x/busybox
|
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM busybox
|
||||
FROM BASEIMAGE
|
||||
ADD controller /controller
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/controller"]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
# Copyright 2017 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.
|
||||
@@ -12,16 +12,14 @@
|
||||
# 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
|
||||
BIN=controller
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
all: push
|
||||
|
||||
image:
|
||||
docker build --pull -t $(PREFIX)/dnsutils .
|
||||
|
||||
push: image
|
||||
gcloud docker -- push $(PREFIX)/dnsutils
|
||||
|
||||
clean:
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /go/src/k8s.io/kubernetes/test/images/resource-consumer/controller && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
1
test/images/resource-consumer/controller/NAME
Normal file
1
test/images/resource-consumer/controller/NAME
Normal file
@@ -0,0 +1 @@
|
||||
resource_consumer/controller
|
1
test/images/resource-consumer/controller/VERSION
Normal file
1
test/images/resource-consumer/controller/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.1
|
5
test/images/serve_hostname/BASEIMAGE
Normal file
5
test/images/serve_hostname/BASEIMAGE
Normal file
@@ -0,0 +1,5 @@
|
||||
amd64=busybox
|
||||
arm=arm32v6/busybox
|
||||
arm64=arm64v8/busybox
|
||||
ppc64le=ppc64le/busybox
|
||||
s390x=s390x/busybox
|
@@ -13,6 +13,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
FROM BASEIMAGE
|
||||
ADD serve_hostname /serve_hostname
|
||||
COPY serve_hostname /
|
||||
EXPOSE 9376
|
||||
ENTRYPOINT ["/serve_hostname"]
|
||||
|
@@ -12,91 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Cross-build the serve_hostname image
|
||||
#
|
||||
# Usage:
|
||||
# [TAG=v1.7] [PREFIX=gcr.io/google_containers] [TEST_REGISTRY=gcr.io/k8s-authenticated-test] [ARCH=amd64] [BASEIMAGE=busybox] make all
|
||||
|
||||
.PHONY: all push container clean
|
||||
|
||||
TAG ?= v1.7
|
||||
|
||||
REGISTRY ?= gcr.io/google-containers
|
||||
TEST_REGISTRY ?= gcr.io/k8s-authenticated-test
|
||||
|
||||
# Architectures supported: amd64, arm, arm64, ppc64le and s390x
|
||||
BIN=serve_hostname
|
||||
ARCH ?= amd64
|
||||
TARGET ?= $(CURDIR)
|
||||
GOLANG_VERSION ?= latest
|
||||
|
||||
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
||||
|
||||
GOARM=7
|
||||
TEMP_DIR := $(shell mktemp -d)
|
||||
GOLANG_VERSION=1.8.3
|
||||
|
||||
BIN = serve_hostname
|
||||
SRCS = serve_hostname.go
|
||||
|
||||
IMAGE = $(REGISTRY)/$(BIN)-$(ARCH)
|
||||
TEST_IMAGE = $(TEST_REGISTRY)/$(BIN)-$(ARCH)
|
||||
|
||||
# Set default base image dynamically for each arch
|
||||
ifeq ($(ARCH),amd64)
|
||||
BASEIMAGE?=busybox
|
||||
endif
|
||||
ifeq ($(ARCH),arm)
|
||||
BASEIMAGE?=armhf/busybox
|
||||
endif
|
||||
ifeq ($(ARCH),arm64)
|
||||
BASEIMAGE?=aarch64/busybox
|
||||
endif
|
||||
ifeq ($(ARCH),ppc64le)
|
||||
BASEIMAGE?=ppc64le/busybox
|
||||
endif
|
||||
ifeq ($(ARCH),s390x)
|
||||
BASEIMAGE?=s390x/busybox
|
||||
endif
|
||||
|
||||
# If you want to build AND push all containers, see the 'all-push' rule.
|
||||
all: all-container
|
||||
|
||||
sub-container-%:
|
||||
$(MAKE) ARCH=$* container
|
||||
|
||||
sub-push-%:
|
||||
$(MAKE) ARCH=$* push
|
||||
|
||||
all-container: $(addprefix sub-container-,$(ALL_ARCH))
|
||||
|
||||
all-push: $(addprefix sub-push-,$(ALL_ARCH))
|
||||
|
||||
build: bin/$(BIN)-$(ARCH)
|
||||
|
||||
bin/$(BIN)-$(ARCH): $(SRCS)
|
||||
# Copy the content in this dir to the temp dir
|
||||
cp ./* $(TEMP_DIR)
|
||||
|
||||
docker run -it -v $(TEMP_DIR):/build \
|
||||
bin:
|
||||
docker run --rm -it -v $(TARGET):$(TARGET):Z -v `pwd`/../../../:/go/src/k8s.io/kubernetes:Z \
|
||||
golang:$(GOLANG_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /build && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(BIN) ./$(SRCS)"
|
||||
cd /go/src/k8s.io/kubernetes/test/images/serve_hostname && \
|
||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(TARGET)/$(BIN) ."
|
||||
|
||||
container: .container-$(ARCH)
|
||||
.container-$(ARCH): bin/$(BIN)-$(ARCH)
|
||||
# Set the base image
|
||||
cd $(TEMP_DIR) && sed -i.bak 's|BASEIMAGE|$(BASEIMAGE)|g' Dockerfile
|
||||
|
||||
docker build --pull -t $(IMAGE):$(TAG) $(TEMP_DIR)
|
||||
if [ -n "$(TEST_REGISTRY)" ]; then \
|
||||
docker tag $(IMAGE):$(TAG) $(TEST_IMAGE):$(TAG) ;\
|
||||
fi
|
||||
|
||||
push: .push-$(ARCH)
|
||||
.push-$(ARCH): .container-$(ARCH)
|
||||
gcloud docker -- push $(IMAGE):$(TAG)
|
||||
if [ -n "$(TEST_REGISTRY)" ]; then \
|
||||
gcloud docker -- push $(TEST_IMAGE):$(TAG) ;\
|
||||
fi
|
||||
|
||||
clean:
|
||||
rm -rf $(BIN)
|
||||
.PHONY: bin
|
||||
|
1
test/images/serve_hostname/NAME
Normal file
1
test/images/serve_hostname/NAME
Normal file
@@ -0,0 +1 @@
|
||||
serve_hostname
|
1
test/images/serve_hostname/VERSION
Normal file
1
test/images/serve_hostname/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
v1.7
|
Reference in New Issue
Block a user