Skip to content

Commit

Permalink
support arm64 for more tests/examples
Browse files Browse the repository at this point in the history
  • Loading branch information
everpeace committed Sep 5, 2024
1 parent 3d1cfb2 commit b6c213c
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 20 deletions.
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

export STAGINGVERSION ?= $(shell git describe --long --tags --match='v*' --dirty 2>/dev/null || git rev-list -n1 HEAD)
export BUILD_DATE ?= $(shell date --iso-8601=minutes)
export BUILD_DATE ?= $(shell date +"%Y-%m-%dT%H:%M:%S%z")
BINDIR ?= bin
LDFLAGS ?= -s -w -X main.version=${STAGINGVERSION} -X main.builddate=${BUILD_DATE} -extldflags '-static'

Expand All @@ -33,7 +33,12 @@ ifneq ("$(shell docker buildx build --help | grep 'provenance')", "")
DOCKER_BUILD_ARGS += --provenance=false
endif

ARCH = $(shell dpkg --print-architecture)
uname_m = $(shell uname -m)
ifeq ($(uname_m),aarch64)
ARCH = arm64
else
ARCH = $(uname_m)
endif
BUILDX_BUILDER = mfcp-builder

LOAD_TO_KIND ?= false
Expand Down Expand Up @@ -113,10 +118,6 @@ push-example-$(1)-$(2):
--platform linux/amd64,linux/arm64 .
endef

ifeq ("$(ARCH)", "arm64")
$(eval $(call example-template,proxy,sshfs))
$(eval $(call example-template,starter,sshfs))
else
$(eval $(call example-template,proxy,mountpoint-s3))
$(eval $(call example-template,proxy,goofys))
$(eval $(call example-template,proxy,s3fs))
Expand All @@ -125,7 +126,7 @@ $(eval $(call example-template,proxy,gcsfuse))
$(eval $(call example-template,proxy,sshfs))
$(eval $(call example-template,starter,ros3fs))
$(eval $(call example-template,starter,sshfs))
endif


.PHONY: build-examples
build-examples: $(BUILD_EXAMPLES)
Expand All @@ -145,18 +146,13 @@ test-example-$(1)-$(2):
./examples/check.sh ./$1/$2 mfcp-example-$1-$2 $3 $4 $5 $6
endef

ifeq ("$(ARCH)", "arm64")
$(eval $(call test-example-template,proxy,sshfs,starter,/root/sshfs-example/test.txt,busybox,/data/test.txt))
$(eval $(call test-example-template,starter,sshfs,starter,/root/sshfs-example/test.txt,busybox,/data/test.txt))
else
$(eval $(call test-example-template,proxy,mountpoint-s3,starter,/test.txt,busybox,/data/test.txt))
$(eval $(call test-example-template,proxy,goofys,starter,/test.txt,busybox,/data/test.txt))
$(eval $(call test-example-template,proxy,s3fs,starter,/test.txt,busybox,/data/test.txt))
$(eval $(call test-example-template,proxy,ros3fs,starter,/test.txt,busybox,/data/test.txt))
$(eval $(call test-example-template,proxy,sshfs,starter,/root/sshfs-example/test.txt,busybox,/data/test.txt))
$(eval $(call test-example-template,starter,ros3fs,starter,/test.txt,busybox,/data/test.txt))
$(eval $(call test-example-template,starter,sshfs,starter,/root/sshfs-example/test.txt,busybox,/data/test.txt))
endif

.PHONY: test-examples
test-examples: $(EXAMPLE_TESTS)
Expand Down
5 changes: 3 additions & 2 deletions examples/proxy/gcsfuse/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ ADD . .
RUN make fusermount3-proxy BINDIR=/bin

FROM ubuntu:22.04
ARG TARGETARCH

RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3

# prepare for MinIO
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/bin/mc && chmod +x /usr/bin/mc
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc -O /usr/bin/mc && chmod +x /usr/bin/mc

COPY <<EOF /test.txt
This is a test file for minio
Expand All @@ -25,7 +26,7 @@ set -eux
EOF
RUN chmod +x /configure_minio.sh

RUN wget https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v1.1.0/gcsfuse_1.1.0_amd64.deb -O gcsfuse.deb && dpkg -i gcsfuse.deb
RUN wget https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v2.4.0/gcsfuse_2.4.0_${TARGETARCH}.deb -O gcsfuse.deb && dpkg -i gcsfuse.deb

COPY --from=fusermount3-proxy-builder /bin/fusermount3-proxy /bin/fusermount3
RUN ln -sf /bin/fusermount3 /bin/fusermount
3 changes: 2 additions & 1 deletion examples/proxy/goofys/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ ADD . .
RUN make fusermount3-proxy BINDIR=/bin

FROM ubuntu:22.04
ARG TARGETARCH

RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3

# prepare for MinIO
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/bin/mc && chmod +x /usr/bin/mc
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc -O /usr/bin/mc && chmod +x /usr/bin/mc

COPY <<EOF /test.txt
This is a test file for minio
Expand Down
5 changes: 3 additions & 2 deletions examples/proxy/mountpoint-s3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ ADD . .
RUN make fusermount3-proxy BINDIR=/bin

FROM ubuntu:22.04
ARG TARGETARCH

RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3

# prepare for MinIO
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/bin/mc && chmod +x /usr/bin/mc
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc -O /usr/bin/mc && chmod +x /usr/bin/mc

COPY <<EOF /test.txt
This is a test file for minio
Expand All @@ -25,7 +26,7 @@ set -eux
EOF
RUN chmod +x /configure_minio.sh

RUN wget https://s3.amazonaws.com/mountpoint-s3-release/1.0.1/x86_64/mount-s3-1.0.1-x86_64.deb -O mount-s3.deb && dpkg -i mount-s3.deb
RUN wget https://s3.amazonaws.com/mountpoint-s3-release/latest/${TARGETARCH}/mount-s3.deb -O mount-s3.deb && dpkg -i mount-s3.deb

COPY --from=fusermount3-proxy-builder /bin/fusermount3-proxy /bin/fusermount3
RUN ln -sf /bin/fusermount3 /bin/fusermount
3 changes: 2 additions & 1 deletion examples/proxy/ros3fs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ ADD . .
RUN make fusermount3-proxy BINDIR=/bin

FROM ubuntu:22.04
ARG TARGETARCH

RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3

# prepare for MinIO
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/bin/mc && chmod +x /usr/bin/mc
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc -O /usr/bin/mc && chmod +x /usr/bin/mc

COPY <<EOF /test.txt
This is a test file for minio
Expand Down
3 changes: 2 additions & 1 deletion examples/proxy/s3fs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ RUN make fusermount3-proxy BINDIR=/bin

FROM ubuntu:22.04

ARG TARGETARCH
RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3

# prepare for MinIO
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/bin/mc && chmod +x /usr/bin/mc
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc -O /usr/bin/mc && chmod +x /usr/bin/mc

COPY <<EOF /test.txt
This is a test file for minio
Expand Down
1 change: 1 addition & 0 deletions examples/proxy/sshfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ADD . .
RUN make fusermount3-proxy BINDIR=/bin

FROM ubuntu:22.04
ARG TARGETARCH

RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3
Expand Down
3 changes: 2 additions & 1 deletion examples/starter/ros3fs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ ADD . .
RUN make fuse-starter BINDIR=/bin

FROM ubuntu:22.04
ARG TARGETARCH

RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3

# prepare for MinIO
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/bin/mc && chmod +x /usr/bin/mc
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc -O /usr/bin/mc && chmod +x /usr/bin/mc

COPY <<EOF /test.txt
This is a test file for minio
Expand Down
1 change: 1 addition & 0 deletions examples/starter/sshfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ADD . .
RUN make fuse-starter BINDIR=/bin

FROM ubuntu:22.04
ARG TARGETARCH

RUN apt update && apt upgrade -y
RUN apt install -y ca-certificates wget libfuse2 fuse3
Expand Down

0 comments on commit b6c213c

Please sign in to comment.