Update e2e image (#4883)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-01-04 20:29:49 -03:00 committed by GitHub
parent 38fae75286
commit 8fb2695d54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 95 additions and 50 deletions

View file

@ -30,7 +30,7 @@ function cleanup {
} }
trap cleanup EXIT trap cleanup EXIT
E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v12182019-870be3bcd E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v01042020-d05149a70
DOCKER_OPTS=${DOCKER_OPTS:-} DOCKER_OPTS=${DOCKER_OPTS:-}

View file

@ -7,8 +7,8 @@ e2e | Image to run e2e tests
e2e-prow | Image to launch Prow jobs e2e-prow | Image to launch Prow jobs
fastcgi-helloserver | FastCGI application for e2e tests fastcgi-helloserver | FastCGI application for e2e tests
grpc-fortune-teller | grpc server application for the nginx-ingress grpc example grpc-fortune-teller | grpc server application for the nginx-ingress grpc example
httpbin | A simple HTTP Request & Response Service httpbin | A simple HTTP Request & Response Service for e2e tests
mkdocs | Image to build the static documentation mkdocs | Image to build the static documentation
nginx | OpenResty base image using [debian-base](https://quay.io/kubernetes-ingress-controller/debian-base-amd64) nginx | NGINX base image using [alpine linux](https://www.alpinelinux.org)
:bangbang: Only the nginx image is meant to be published. The others are used as examples for some feature of the ingress controller or to run e2e tests. :bangbang: Only the nginx image is meant to be published. The others are used as examples for some feature of the ingress controller or to run e2e tests.

View file

@ -12,59 +12,98 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM quay.io/kubernetes-ingress-controller/nginx-amd64:870be3bcd88c267f14fd82da82303472f383cd14 FROM quay.io/kubernetes-ingress-controller/nginx-amd64:422f554ba9cb291b4402306d77e218dff63ffab4
RUN clean-install \ ARG GOLANG_VERSION
g++ \ ARG GOLANG_SHA
gcc \
git \
libc6-dev \
make \
wget \
python \
parallel \
pkg-config
ENV GOLANG_VERSION 1.13.4 ARG RESTY_CLI_VERSION
ENV GO_ARCH linux-amd64 ARG RESTY_CLI_SHA
ENV GOLANG_SHA 692d17071736f74be04a72a06dab9cac1cd759377bd85316e52b2227604c004c
RUN set -eux; \ ARG K8S_RELEASE
url="https://golang.org/dl/go${GOLANG_VERSION}.${GO_ARCH}.tar.gz"; \ ARG ETCD_VERSION
wget -O go.tgz "$url"; \
echo "${GOLANG_SHA} *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
export PATH="/usr/local/go/bin:$PATH"; \
go version
ENV GOPATH /go ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
ENV RESTY_CLI_VERSION 0.25rc2 RUN apk add --no-cache \
ENV RESTY_CLI_SHA a38d850441384fa037a5922ca012dcce8708d0e4abe34ad2fe4164a01b28bdfb bash \
ca-certificates \
parallel \
wget \
make \
gcc \
git \
musl-dev \
openssl
RUN set -eux; \ RUN set -eux; \
apk add --no-cache --virtual .build-deps \
g++ \
python \
pkgconfig \
openssl \
unzip \
perl \
go \
; \
export \
# set GOROOT_BOOTSTRAP such that we can actually build Go
GOROOT_BOOTSTRAP="$(go env GOROOT)" \
# ... and set "cross-building" related vars to the installed system's values so that we create a build targeting the proper arch
# (for example, if our build host is GOARCH=amd64, but our build env/image is GOARCH=386, our build needs GOARCH=386)
GOOS="$(go env GOOS)" \
GOARCH="$(go env GOARCH)" \
GOHOSTOS="$(go env GOHOSTOS)" \
GOHOSTARCH="$(go env GOHOSTARCH)" \
; \
# also explicitly set GO386 and GOARM if appropriate
# https://github.com/docker-library/golang/issues/184
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
armhf) export GOARM='6' ;; \
armv7) export GOARM='7' ;; \
x86) export GO386='387' ;; \
esac; \
\
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
echo "$GOLANG_SHA *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
\
cd /usr/local/go/src; \
./make.bash; \
\
rm -rf \
# https://github.com/golang/go/blob/0b30cf534a03618162d3015c8705dd2231e34703/src/cmd/dist/buildtool.go#L121-L125
/usr/local/go/pkg/bootstrap \
# https://golang.org/cl/82095
# https://github.com/golang/build/blob/e3fe1605c30f6a3fd136b561569933312ede8782/cmd/release/releaselet.go#L56
/usr/local/go/pkg/obj \
; \
\
export PATH="/usr/local/go/bin:$PATH"; \
go version \
; \
url="https://github.com/openresty/resty-cli/archive/v${RESTY_CLI_VERSION}.tar.gz"; \ url="https://github.com/openresty/resty-cli/archive/v${RESTY_CLI_VERSION}.tar.gz"; \
wget -O resty_cli.tgz "$url"; \ wget -O resty_cli.tgz "$url"; \
echo "${RESTY_CLI_SHA} *resty_cli.tgz" | sha256sum -c -; \ echo "${RESTY_CLI_SHA} *resty_cli.tgz" | sha256sum -c -; \
tar -C /tmp -xzf resty_cli.tgz; \ tar -C /tmp -xzf resty_cli.tgz; \
rm resty_cli.tgz; \ rm resty_cli.tgz; \
mv /tmp/resty-cli-${RESTY_CLI_VERSION}/bin/* /usr/local/bin/; \ mv /tmp/resty-cli-${RESTY_CLI_VERSION}/bin/* /usr/local/bin/; \
resty -V resty -V \
; \
RUN luarocks install luacheck \ luarocks install luacheck; \
&& luarocks install busted luarocks install busted \
; \
RUN go get github.com/onsi/ginkgo/ginkgo \ go get github.com/onsi/ginkgo/ginkgo; \
&& go get golang.org/x/lint/golint go get golang.org/x/lint/golint \
; \
ARG K8S_RELEASE apk del .build-deps;
ARG ETCD_VERSION
RUN wget https://storage.googleapis.com/kubernetes-release/release/${K8S_RELEASE}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl \ RUN wget https://storage.googleapis.com/kubernetes-release/release/${K8S_RELEASE}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
@ -72,8 +111,10 @@ RUN wget https://storage.googleapis.com/kubernetes-release/release/${K8S_RELEASE
RUN wget https://storage.googleapis.com/kubernetes-release/release/${K8S_RELEASE}/bin/linux/amd64/kube-apiserver -O /usr/local/bin/kube-apiserver \ RUN wget https://storage.googleapis.com/kubernetes-release/release/${K8S_RELEASE}/bin/linux/amd64/kube-apiserver -O /usr/local/bin/kube-apiserver \
&& chmod +x /usr/local/bin/kube-apiserver && chmod +x /usr/local/bin/kube-apiserver
RUN curl -L https://storage.googleapis.com/etcd/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VERSION}-linux-amd64.tar.gz \ RUN wget https://storage.googleapis.com/etcd/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz -O /tmp/etcd-${ETCD_VERSION}-linux-amd64.tar.gz \
&& mkdir -p /tmp/etcd-download \ && mkdir -p /tmp/etcd-download \
&& tar xzvf /tmp/etcd-${ETCD_VERSION}-linux-amd64.tar.gz -C /tmp/etcd-download --strip-components=1 \ && tar xzvf /tmp/etcd-${ETCD_VERSION}-linux-amd64.tar.gz -C /tmp/etcd-download --strip-components=1 \
&& cp /tmp/etcd-download/etcd /usr/local/bin \ && cp /tmp/etcd-download/etcd /usr/local/bin \
&& rm -rf /tmp/etcd-download && rm -rf /tmp/etcd-download
WORKDIR $GOPATH

View file

@ -23,8 +23,12 @@ all: docker-build docker-push
docker-build: docker-build:
$(DOCKER) build \ $(DOCKER) build \
--pull \ --pull \
--build-arg K8S_RELEASE=v1.15.3 \ --build-arg K8S_RELEASE=v1.15.7 \
--build-arg ETCD_VERSION=v3.3.15 \ --build-arg ETCD_VERSION=v3.3.18 \
--build-arg GOLANG_VERSION=1.13.5 \
--build-arg GOLANG_SHA=27d356e2a0b30d9983b60a788cf225da5f914066b37a6b4f69d457ba55a626ff \
--build-arg RESTY_CLI_VERSION=0.25rc2 \
--build-arg RESTY_CLI_SHA=a38d850441384fa037a5922ca012dcce8708d0e4abe34ad2fe4164a01b28bdfb \
-t $(IMAGE):$(TAG) . -t $(IMAGE):$(TAG) .
docker-push: docker-push:

View file

@ -1,18 +1,16 @@
FROM quay.io/kubernetes-ingress-controller/e2e:v12182019-870be3bcd AS BASE FROM quay.io/kubernetes-ingress-controller/e2e:v01042020-d05149a70 AS BASE
FROM quay.io/kubernetes-ingress-controller/debian-base-amd64:0.1 FROM alpine:3.11
RUN clean-install \ RUN apk add -U --no-cache \
ca-certificates \ ca-certificates \
bash \ bash \
curl \ curl \
tzdata tzdata \
openssl
RUN curl -Lo /usr/local/bin/kubectl \
https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl \
&& chmod +x /usr/local/bin/kubectl
COPY --from=BASE /go/bin/ginkgo /usr/local/bin/ COPY --from=BASE /go/bin/ginkgo /usr/local/bin/
COPY --from=BASE /usr/local/bin/kubectl /usr/local/bin/
COPY e2e.sh /e2e.sh COPY e2e.sh /e2e.sh
COPY cloud-generic /cloud-generic COPY cloud-generic /cloud-generic

View file

@ -1,9 +1,11 @@
.PHONY: all .PHONY: all
all: container all: container
DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
.PHONY: container .PHONY: container
container: container:
make -C ../../ e2e-test-binary ${DIR}/../../build/run-in-docker.sh make e2e-test-binary
cp ../e2e/e2e.test . cp ../e2e/e2e.test .
cp ../e2e/wait-for-nginx.sh . cp ../e2e/wait-for-nginx.sh .