-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding ARM testing in E2E test suite (#46)
* Adding arm to e2e testing
- Loading branch information
Showing
8 changed files
with
169 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,12 @@ ARG MOUNTPOINT_VERSION=1.1.0 | |
# Download and verify the mountpoint's RPM and DEB in this container | ||
FROM --platform=$BUILDPLATFORM public.ecr.aws/amazonlinux/amazonlinux:2023 as mp_builder | ||
ARG MOUNTPOINT_VERSION | ||
|
||
ARG TARGETARCH | ||
ARG TARGETPLATFORM | ||
# We need the full version of GnuPG | ||
RUN dnf install -y --allowerasing wget gnupg2 | ||
|
||
RUN MP_ARCH=`uname -p | sed s/aarch64/arm64/` && \ | ||
RUN MP_ARCH=`echo ${TARGETARCH} | sed s/amd64/x86_64/` && \ | ||
wget -q "https://s3.amazonaws.com/mountpoint-s3-release/${MOUNTPOINT_VERSION}/$MP_ARCH/mount-s3-${MOUNTPOINT_VERSION}-$MP_ARCH.rpm" && \ | ||
wget -q "https://s3.amazonaws.com/mountpoint-s3-release/${MOUNTPOINT_VERSION}/$MP_ARCH/mount-s3-${MOUNTPOINT_VERSION}-$MP_ARCH.rpm.asc" && \ | ||
wget -q "https://s3.amazonaws.com/mountpoint-s3-release/${MOUNTPOINT_VERSION}/$MP_ARCH/mount-s3-${MOUNTPOINT_VERSION}-$MP_ARCH.deb" && \ | ||
|
@@ -33,35 +34,29 @@ RUN gpg --import KEYS && \ | |
(gpg --fingerprint [email protected] | grep "673F E406 1506 BB46 9A0E F857 BE39 7A52 B086 DA5A") | ||
|
||
# Verify the downloaded binary | ||
RUN MP_ARCH=`uname -p | sed s/aarch64/arm64/` && \ | ||
RUN MP_ARCH=`echo ${TARGETARCH} | sed s/amd64/x86_64/` && \ | ||
gpg --verify mount-s3-${MOUNTPOINT_VERSION}-$MP_ARCH.rpm.asc && \ | ||
gpg --verify mount-s3-${MOUNTPOINT_VERSION}-$MP_ARCH.deb.asc && \ | ||
mv mount-s3-${MOUNTPOINT_VERSION}-$MP_ARCH.rpm /mount-s3.rpm && \ | ||
mv mount-s3-${MOUNTPOINT_VERSION}-$MP_ARCH.deb /mount-s3.deb | ||
|
||
# Build driver | ||
FROM --platform=$BUILDPLATFORM golang:1.21.1-bullseye as builder | ||
|
||
ARG TARGETARCH | ||
WORKDIR /go/src/github.com/awslabs/mountpoint-s3-csi-driver | ||
COPY . . | ||
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod \ | ||
make bin | ||
TARGETARCH=${TARGETARCH} make bin | ||
|
||
FROM --platform=$BUILDPLATFORM public.ecr.aws/amazonlinux/amazonlinux:2023 AS linux-amazon | ||
FROM --platform=$TARGETPLATFORM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-csi:latest-al2 AS linux-amazon | ||
ARG MOUNTPOINT_VERSION | ||
ENV MOUNTPOINT_VERSION=${MOUNTPOINT_VERSION} | ||
|
||
RUN yum install util-linux -y | ||
|
||
# MP Installer | ||
COPY --from=mp_builder /mount-s3.rpm /mount-s3.rpm | ||
COPY --from=mp_builder /mount-s3.deb /mount-s3.deb | ||
COPY ./cmd/install-mp.sh /install-mp.sh | ||
|
||
RUN dnf upgrade -y && \ | ||
dnf install -y ./mount-s3.rpm && \ | ||
dnf clean all | ||
|
||
# Install driver | ||
COPY --from=builder /go/src/github.com/awslabs/mountpoint-s3-csi-driver/bin/aws-s3-csi-driver /bin/aws-s3-csi-driver | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ images: | |
- name: csi-driver | ||
newName: 151381207180.dkr.ecr.eu-west-1.amazonaws.com/s3-csi-driver | ||
newTag: v0.1.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 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. | ||
|
||
# There is no reliable way to check if a buildx installation supports | ||
# --provenance other than trying to execute it. You cannot even rely | ||
# on the version, because buildx's own installation docs will result | ||
# in installations of buildx that do not correctly report their version | ||
# via `docker buildx version`. | ||
# | ||
# Additionally, if the local buildkit worker is the Docker daemon, | ||
# attestation should not be supported and must be disabled. | ||
# | ||
# Thus, this script echos back the flag `--provenance=false` if and only | ||
# if the local buildx installation supports it. If not, it exits silently. | ||
|
||
BUILDX_TEST=`docker buildx build --provenance=false 2>&1` | ||
if [[ "${BUILDX_TEST}" == *"See 'docker buildx build --help'."* ]]; then | ||
if [[ "${BUILDX_TEST}" == *"requires exactly 1 argument"* ]] && ! docker buildx inspect | grep -qE "^Driver:\s*docker$"; then | ||
echo "--provenance=false" | ||
fi | ||
else | ||
echo "Local buildx installation broken?" >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.