From 592972596cd936d1b0cc657ced0fcf4f5fe42d00 Mon Sep 17 00:00:00 2001 From: alexzhc Date: Tue, 11 Oct 2022 14:52:11 +0800 Subject: [PATCH] fix arm64 compiling Signed-off-by: alexzhc --- .github/workflows/release-drbd9-images.yml | 9 ++++++++- .github/workflows/release-shipper-images.yml | 8 +++++++- Makefile | 6 +----- docker-drbd9/README.md | 2 +- docker-drbd9/build.sh | 6 +----- docker-shipper/kernel-devels.centos7 | 3 +-- docker_daemon.json | 12 ++++++++++++ helm/drbd-adapter/templates/daemonset.yaml | 6 ++---- 8 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 docker_daemon.json diff --git a/.github/workflows/release-drbd9-images.yml b/.github/workflows/release-drbd9-images.yml index 2b9aaba..1661379 100644 --- a/.github/workflows/release-drbd9-images.yml +++ b/.github/workflows/release-drbd9-images.yml @@ -20,17 +20,24 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Set up QEMU id: qemu uses: docker/setup-qemu-action@v1 with: image: tonistiigi/binfmt:latest platforms: all + - name: Available platforms run: echo ${{ steps.qemu.outputs.platforms }} + - name: Configure Docker + run: | + sudo cp -vf docker_daemon.json /etc/docker/daemon.json + sudo systemctl restart docker + - name: Build official DRBD9 images - run: make drbd9 CACHE=--no-cache REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) + run: make drbd9 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) - name: Login registry run: | diff --git a/.github/workflows/release-shipper-images.yml b/.github/workflows/release-shipper-images.yml index b561bdd..6702b34 100644 --- a/.github/workflows/release-shipper-images.yml +++ b/.github/workflows/release-shipper-images.yml @@ -27,11 +27,17 @@ jobs: with: image: tonistiigi/binfmt:latest platforms: all + - name: Available platforms run: echo ${{ steps.qemu.outputs.platforms }} + - name: Configure Docker + run: | + sudo cp -vf docker_daemon.json /etc/docker/daemon.json + sudo systemctl restart docker + - name: Build shipper images - run: make shipper CACHE=--no-cache REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) + run: make shipper REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) - name: Login registry run: | diff --git a/Makefile b/Makefile index 87f76ac..9419493 100644 --- a/Makefile +++ b/Makefile @@ -29,12 +29,11 @@ update_chart: drbd9: cd docker-drbd9 && \ - ./build.sh $(DRBD_VER) $(ARCH) $(REG) $(CACHE) $(IMG) + ./build.sh $(DRBD_VER) $(ARCH) $(REG) $(IMG) compiler-centos7: for a in $(shell echo $(ARCH) | tr ',' ' '); do \ docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \ - $(CACHE) \ --platform $$a \ --progress tty \ --target compiler-centos7 \ @@ -45,7 +44,6 @@ compiler-centos7: compiler-centos8: for a in $(shell echo $(ARCH) | tr ',' ' '); do \ docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \ - $(CACHE) \ --platform $$a \ --progress tty \ --target compiler-centos8 \ @@ -56,7 +54,6 @@ compiler-centos8: compiler-utils: for a in $(shell echo $(ARCH) | tr ',' ' '); do \ docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \ - $(CACHE) \ --platform $$a \ --progress tty \ --target compiler-utils \ @@ -69,7 +66,6 @@ compiler-utils: shipper: update_chart for a in $(shell echo $(ARCH) | tr ',' ' '); do \ docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \ - $(CACHE) \ --platform $$a \ --progress tty \ --build-arg DRBD_VER=$(DRBD_VER) \ diff --git a/docker-drbd9/README.md b/docker-drbd9/README.md index fc1fd9f..65b725d 100644 --- a/docker-drbd9/README.md +++ b/docker-drbd9/README.md @@ -12,4 +12,4 @@ Alex Zheng ## LICENCE -GPL-2.0 +GPL-2.0 \ No newline at end of file diff --git a/docker-drbd9/build.sh b/docker-drbd9/build.sh index 8437027..7006780 100755 --- a/docker-drbd9/build.sh +++ b/docker-drbd9/build.sh @@ -3,8 +3,6 @@ DRBD_VER=${1:-9.0.32-1} ARCH=${2:-linux/amd64} REG=${3:-daocloud.io/daocloud} -CACHE=${4:- } - [ -z "$DRBD_VER" ] && echo "Need a DRBD version !" && exit 1 @@ -18,17 +16,15 @@ cp -vf drbd-${DRBD_VER}.tar.gz drbd.tar.gz echo $ARCH | sed "s#,# #g" -shift 4 +shift 3 for i in $@; do df="Dockerfile.${i}" [ -f "$df" ] || continue for a in ${ARCH//,/ }; do sed "s/^ENV DRBD_VERSION.*/ENV DRBD_VERSION ${DRBD_VER}/" "$df" | \ docker build . -f - \ - ${CACHE} \ --platform $a \ --progress tty \ - --build-arg ARCH=${ARCH} \ -t ${REG}/drbd9-${i##*.}:v${DRBD_VER}_${a/\//-} \ || exit 1 done diff --git a/docker-shipper/kernel-devels.centos7 b/docker-shipper/kernel-devels.centos7 index 6ea590a..aa80a60 100644 --- a/docker-shipper/kernel-devels.centos7 +++ b/docker-shipper/kernel-devels.centos7 @@ -12,5 +12,4 @@ rhel7.0 3.10.0-123 https://vault.centos.org/7.0.1406/os/x86_64/Packages/kernel- # # aarch64 # rhel7.9 5.4.72-200 http://mirror.centos.org/altarch/7.9.2009/kernel/aarch64/Packages/kernel-devel-5.4.72-200.el7.aarch64.rpm -# rhel7.8 4.18.0-147.8.1 https://vault.centos.org/altarch/7.8.2003/os/aarch64/Packages/kernel-devel-4.18.0-147.8.1.el7.aarch64.rpm -# \ No newline at end of file +# rhel7.8 4.18.0-147.8.1 https://vault.centos.org/altarch/7.8.2003/os/aarch64/Packages/kernel-devel-4.18.0-147.8.1.el7.aarch64.rpm \ No newline at end of file diff --git a/docker_daemon.json b/docker_daemon.json new file mode 100644 index 0000000..0198e8f --- /dev/null +++ b/docker_daemon.json @@ -0,0 +1,12 @@ +{ + "experimental": true, + "builder": { + "gc": { + "defaultKeepStorage": "20GB", + "enabled": true + } + }, + "features": { + "buildkit": true + } +} \ No newline at end of file diff --git a/helm/drbd-adapter/templates/daemonset.yaml b/helm/drbd-adapter/templates/daemonset.yaml index 218b9c2..6de8264 100644 --- a/helm/drbd-adapter/templates/daemonset.yaml +++ b/helm/drbd-adapter/templates/daemonset.yaml @@ -29,12 +29,10 @@ spec: {{- range $index, $node := (lookup "v1" "Node" "" "").items }} {{- $osImage := lower $node.status.nodeInfo.osImage }} {{- with . -}} - {{- if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*7" $osImage }} + {{- if regexMatch "(red hat enterprise|centos) .*7" $osImage }} {{- $distros = append $distros "rhel7" }} - {{- else if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*8" $osImage }} + {{- else if regexMatch "(red hat enterprise|centos) .*8" $osImage }} {{- $distros = append $distros "rhel8" }} - {{- else if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*9" $osImage }} - {{- $distros = append $distros "rhel9" }} {{- else if regexMatch "ubuntu .*18" $osImage }} {{- $distros = append $distros "bionic" }} {{- else if regexMatch "ubuntu .*20" $osImage }}