-
Notifications
You must be signed in to change notification settings - Fork 81
/
Dockerfile.kubetest2
59 lines (58 loc) · 2.53 KB
/
Dockerfile.kubetest2
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
FROM public.ecr.aws/amazonlinux/amazonlinux:2 AS builder
ARG TARGETOS
ARG TARGETARCH
RUN yum install -y git tar gzip make unzip gcc rsync wget jq
ARG GO_MINOR_VERSION="1.23"
RUN curl https://go.dev/dl/?mode=json | jq -r .[].version | grep "^go${GO_MINOR_VERSION}" | head -n1 > go-version.txt
RUN wget -O go.tar.gz https://go.dev/dl/$(cat go-version.txt).${TARGETOS}-${TARGETARCH}.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go.tar.gz
ENV GOPATH=/usr/local/go
ENV PATH=$PATH:$GOPATH/bin
ENV GOPROXY=direct
ARG KUBETEST2_VERSION=v0.0.0-20231113220322-d7fcb799ce84
RUN go install sigs.k8s.io/kubetest2/...@${KUBETEST2_VERSION}
WORKDIR $GOPATH/src/github.com/aws/aws-k8s-tester/kubetest2
COPY kubetest2/ .
RUN go install ./...
WORKDIR $GOPATH/src/github.com/aws/aws-k8s-tester/e2e2
COPY e2e2/ .
RUN go test -c ./test/cases/nvidia -o $GOPATH/bin/e2e-nvidia
RUN go test -c ./test/cases/netpol -o $GOPATH/bin/e2e-netpol
RUN go test -c ./test/cases/quick -o $GOPATH/bin/e2e-quick
RUN go test -c ./test/cases/neuron -o $GOPATH/bin/e2e-neuron
RUN go test -c ./test/cases/inference -o $GOPATH/bin/e2e-inference
RUN go test -c ./test/cases/nvidia-training -o $GOPATH/bin/e2e-nvidia-training
FROM public.ecr.aws/amazonlinux/amazonlinux:2
ARG TARGETOS
ARG TARGETARCH
WORKDIR /workdir
RUN yum install -y tar gzip unzip wget openssh
RUN wget -O awscli.zip https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip && \
unzip awscli.zip && \
./aws/install
# we need gsutil from the gcloud CLI for kubetest-tester-ginkgo
RUN amazon-linux-extras install python3.8
ARG GCLOUD_SDK_URL=https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
RUN wget -O google-cloud-sdk.tar.gz -q $GCLOUD_SDK_URL && \
tar xzf google-cloud-sdk.tar.gz -C / && \
rm google-cloud-sdk.tar.gz && \
/google-cloud-sdk/install.sh \
--disable-installation-options \
--bash-completion=false \
--path-update=false \
--usage-reporting=false
ENV PATH=$PATH:/google-cloud-sdk/bin
ARG EKSCTL_VERSION=latest
RUN wget -O eksctl.tar.gz "https://github.com/eksctl-io/eksctl/releases/${EKSCTL_VERSION}/download/eksctl_Linux_${TARGETARCH}.tar.gz" && \
tar xzf eksctl.tar.gz -C /bin/ && \
rm eksctl.tar.gz
ARG KUBERNETES_MINOR_VERSION
COPY hack/download-kubernetes-binaries.sh .
RUN ./download-kubernetes-binaries.sh "${KUBERNETES_MINOR_VERSION}" "${TARGETOS}" "${TARGETARCH}"
RUN mkdir /info
ENV PATH=$PATH:/info
RUN cp kubernetes-version.txt /info/
RUN mv kubernetes/*/bin/* /bin/
RUN rm -rf /workdir
COPY --from=builder /usr/local/go/bin/* /bin/