Skip to content

Commit cdec3d2

Browse files
authored
Merge pull request #595 from andyzhangx/arm64-2
feat: support arm64
2 parents 30fddf2 + 6d418ea commit cdec3d2

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ GOBIN ?= $(GOPATH)/bin
4141
DOCKER_CLI_EXPERIMENTAL = enabled
4242
export GOPATH GOBIN GO111MODULE DOCKER_CLI_EXPERIMENTAL
4343

44+
# The current context of image building
45+
# The architecture of the image
46+
ARCH ?= amd64
4447
# Output type of docker buildx build
4548
OUTPUT_TYPE ?= registry
4649

47-
ALL_ARCH.linux = amd64 #arm64
50+
ALL_ARCH.linux = amd64 arm64
4851
ALL_OS_ARCH = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch))
4952

5053
all: blob blobfuse-proxy
@@ -93,7 +96,7 @@ e2e-teardown:
9396

9497
.PHONY: blob
9598
blob: blobfuse-proxy
96-
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/blobplugin ./pkg/blobplugin
99+
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/${ARCH}/blobplugin ./pkg/blobplugin
97100

98101
.PHONY: blob-windows
99102
blob-windows:
@@ -121,7 +124,9 @@ ifeq ($(CLOUD), AzureStackCloud)
121124
docker run --privileged --name buildx_buildkit_container-builder0 -d --mount type=bind,src=/etc/ssl/certs,dst=/etc/ssl/certs moby/buildkit:latest || true
122125
endif
123126
# enable qemu for arm64 build
124-
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
127+
# https://github.com/docker/buildx/issues/464#issuecomment-741507760
128+
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-aarch64
129+
docker run --rm --privileged tonistiigi/binfmt --install all
125130
for arch in $(ALL_ARCH.linux); do \
126131
ARCH=$${arch} $(MAKE) blob; \
127132
ARCH=$${arch} $(MAKE) container-linux; \

pkg/blobplugin/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
# limitations under the License.
1414

1515
FROM k8s.gcr.io/build-image/debian-base:bullseye-v1.0.0
16-
COPY ./_output/blobplugin /blobplugin
16+
17+
ARG ARCH=amd64
18+
COPY ./_output/${ARCH}/blobplugin /blobplugin
19+
1720
RUN apt update && apt-mark unhold libcap2
1821
RUN clean-install ca-certificates libfuse-dev libcurl4-gnutls-dev libgnutls28-dev uuid-dev libgcrypt20-dev util-linux mount udev wget e2fsprogs nfs-common netbase
1922
# install updated packages to fix CVE issues
@@ -23,7 +26,8 @@ COPY ./_output/blobfuse-proxy.deb /blobfuse-proxy/
2326
# for compatibility, remove this after v1.6.0 release (todo)
2427
COPY deploy/blobfuse-proxy/v0.1.0/blobfuse-proxy-v0.1.0.deb /blobfuse-proxy/
2528
RUN wget -O /blobfuse-proxy/packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
26-
RUN dpkg -i /blobfuse-proxy/packages-microsoft-prod.deb && apt update && apt install blobfuse fuse -y
29+
ARG ARCH=amd64
30+
RUN if [ "$ARCH" = "amd64" ] ; then dpkg -i /blobfuse-proxy/packages-microsoft-prod.deb && apt update && apt install blobfuse fuse -y; fi
2731
RUN apt remove wget -y
2832
LABEL maintainers="andyzhangx"
2933
LABEL description="Azure Blob Storage CSI driver"

test/integration/run-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ readonly cloud="$5"
3434
echo "Begin to run integration test on $cloud..."
3535

3636
# Run CSI driver as a background service
37-
_output/blobplugin --endpoint "$endpoint" --nodeid CSINode --enable-blob-mock-mount -v=5 &
37+
_output/amd64/blobplugin --endpoint "$endpoint" --nodeid CSINode --enable-blob-mock-mount -v=5 &
3838
trap cleanup EXIT
3939

4040
if [[ "$cloud" == "AzureChinaCloud" ]]; then

test/sanity/run-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ if [[ "$#" -gt 0 ]] && [[ -n "$1" ]]; then
3232
nodeid="$1"
3333
fi
3434

35-
_output/blobplugin --endpoint "$controllerendpoint" -v=5 &
36-
_output/blobplugin --endpoint "$nodeendpoint" --nodeid "$nodeid" --enable-blob-mock-mount -v=5 &
35+
_output/amd64/blobplugin --endpoint "$controllerendpoint" -v=5 &
36+
_output/amd64/blobplugin --endpoint "$nodeendpoint" --nodeid "$nodeid" --enable-blob-mock-mount -v=5 &
3737

3838
echo "Begin to run sanity test..."
3939
readonly CSI_SANITY_BIN='csi-sanity'

0 commit comments

Comments
 (0)