-
Notifications
You must be signed in to change notification settings - Fork 82
/
Dockerfile
73 lines (67 loc) · 3.85 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ARG GO_VERSION
ARG AL_VERSION
FROM golang:${GO_VERSION} AS aws-k8s-tester-builder
ARG GOPROXY
ARG RELEASE_VERSION
RUN go version
ADD ./ /go/src/github.com/aws/aws-k8s-tester
WORKDIR /go/src/github.com/aws/aws-k8s-tester
RUN GOPROXY=${GOPROXY} RELEASE_VERSION=${RELEASE_VERSION} ./hack/build.sh
FROM golang:${GO_VERSION} AS clusterloader2-builder
ARG GOPROXY
ARG OS_TARGET
ARG OS_ARCH
RUN go version
RUN git clone https://github.com/kubernetes/perf-tests.git /perf-tests
WORKDIR /perf-tests/clusterloader2
RUN GOPROXY=${GOPROXY} GOOS=${OS_TARGET} GOARCH=${OS_ARCH} go mod tidy && go build -o ./clusterloader2 ./cmd
FROM amazonlinux:${AL_VERSION} AS sonobuoy-builder
ARG SONOBUOY_VERSION
ARG OS_TARGET
ARG OS_ARCH
RUN yum update -y && yum install -y tar gzip
RUN curl -o /sonobuoy.tar.gz -LO https://github.com/vmware-tanzu/sonobuoy/releases/download/${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION:1}_${OS_TARGET}_${OS_ARCH}.tar.gz
RUN tar zxvf /sonobuoy.tar.gz
FROM amazonlinux:${AL_VERSION}
ARG K8S_VERSION
ARG RELEASE_VERSION
ARG OS_TARGET
ARG OS_ARCH
RUN yum update -y && yum install -y which python3 python3-pip && yum clean all && pip3 install awscli --upgrade --user
ENV PATH=/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN echo ${PATH}
RUN aws --version
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/aws-k8s-tester-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /aws-k8s-tester
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/ec2-utils-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /ec2-utils
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/ecr-utils-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /ecr-utils
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/eks-utils-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /eks-utils
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/etcd-utils-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /etcd-utils
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/cw-utils-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /cw-utils
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/s3-utils-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /s3-utils
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/bin/sts-utils-${RELEASE_VERSION}-${OS_TARGET}-${OS_ARCH} /sts-utils
# must copy all files from https://github.com/kubernetes/perf-tests/tree/master/clusterloader2/testing/load
# the main config.yaml reads other resource spec (e.g. job.yaml) from the same directory
# RUN curl -o /clusterloader2-test-config.yaml -LO https://raw.githubusercontent.com/kubernetes/perf-tests/master/clusterloader2/testing/load/config.yaml
COPY --from=clusterloader2-builder /perf-tests/clusterloader2/testing/load /clusterloader2-testing-load
COPY --from=clusterloader2-builder /perf-tests/clusterloader2/testing/load/config.yaml /clusterloader2-test-config.yaml
COPY --from=clusterloader2-builder /perf-tests/clusterloader2/clusterloader2 /clusterloader2
COPY --from=aws-k8s-tester-builder /go/src/github.com/aws/aws-k8s-tester/eks /eks
RUN rm -rf /go/src/github.com/aws/aws-k8s-tester
RUN chmod +x /aws-k8s-tester /cw-utils /ec2-utils /eks-utils /etcd-utils /s3-utils /sts-utils /clusterloader2
WORKDIR /
COPY --from=sonobuoy-builder /sonobuoy /tmp/sonobuoy
RUN curl -o /kubectl -LO https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/${OS_TARGET}/${OS_ARCH}/kubectl && chmod +x /kubectl && cp /kubectl /usr/local/bin/kubectl
RUN ls /
RUN ls /*.yaml
RUN aws --version
RUN /aws-k8s-tester version
RUN /cw-utils version
RUN /ec2-utils version
RUN /ecr-utils version
RUN /eks-utils version
RUN /etcd-utils version
RUN /s3-utils version
RUN /sts-utils version
RUN cat /clusterloader2-test-config.yaml
RUN /clusterloader2 --help || true
RUN kubectl version --client=true