Skip to content

Commit

Permalink
Merge pull request #23 from alexzhc/main
Browse files Browse the repository at this point in the history
ARM64 (aarch64) support and kylin10 support
  • Loading branch information
alexzhc authored Sep 29, 2022
2 parents 6c455e8 + 6668c49 commit 6f91a1f
Show file tree
Hide file tree
Showing 31 changed files with 626 additions and 284 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release-drbd9-amd64-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release DRBD9 Images AMD64

on:
push:
branches: [ "main" ]
paths:
- 'docker-drbd9/**'

jobs:

build:

runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout
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: Build official DRBD9 images
run: make drbd9 ARCH=linux/amd64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' )

- name: Login registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push images
run: |
make push ARCH=linux/amd64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) IMG="rhel7 rhel8 rhel9 bionic focal jammy kylin10"
40 changes: 40 additions & 0 deletions .github/workflows/release-drbd9-arm64-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release DRBD9 Images ARM64

on:
push:
branches: [ "main" ]
paths:
- 'docker-drbd9/**'

jobs:

build:

runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout
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: Build official DRBD9 images
run: make drbd9 ARCH=linux/arm64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' )

- name: Login registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push images
run: |
make push ARCH=linux/arm64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) IMG="rhel7 rhel8 rhel9 bionic focal jammy kylin10"
32 changes: 0 additions & 32 deletions .github/workflows/release-drbd9-images.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/release-shipper-amd64-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Shipper Image AMD64

on:
push:
branches: [ "main" ]
paths:
- 'docker-shipper/*'

jobs:

build:

runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout
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: Build shipper images
run: make shipper ARCH=linux/amd64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' )

- name: Login registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push images
run: |
make push ARCH=linux/amd64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) IMG=shipper
41 changes: 41 additions & 0 deletions .github/workflows/release-shipper-arm64-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Shipper Image ARM64

on:
push:
branches: [ "main" ]
paths:
- 'docker-shipper/*'

jobs:

build:

runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout
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: Build shipper images
run: make shipper ARCH=linux/arm64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' )

- name: Login registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push images
run: |
make push ARCH=linux/arm64 REG=ghcr.io/$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' ) IMG=shipper
32 changes: 0 additions & 32 deletions .github/workflows/release-shipper-images.yaml

This file was deleted.

127 changes: 80 additions & 47 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
CHART_VER ?= 0.3.3
SHELL := /bin/bash
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

CHART_VER ?= 0.3.4
DRBD_VER ?= 9.0.32-1# another tested value is: 9.1.11
DRBD_UTILS_VER ?= 9.12.1# another tested value is: 9.21.4

Expand All @@ -9,41 +12,67 @@ DRBD_HEADERS_SHA ?= c757cf357edef67751b8f45a6ea894d287180087# for utils 9.12.1
KVER := $(shell uname -r)
DIST ?= rhel7
ENTRY ?= /pkgs/entrypoint.adapter.sh
IMG ?= shipper rhel7 rhel8 rhel9 bionic focal jammy
REG ?= daocloud.io/daocloud# Test-only Registry

ARCH ?= linux/amd64,linux/arm64
IMG ?= shipper rhel7 rhel8 rhel9 bionic focal jammy kylin10

# Default test registry
REG ?= daocloud.io/daocloud

update_chart:
if sed --version | grep -iw gnu; then \
sed -i 's/version:.*/version: $(CHART_VER)/' ./helm/drbd-adapter/Chart.yaml; \
else \
sed -i '' 's/version:.*/version: $(CHART_VER)/' ./helm/drbd-adapter/Chart.yaml; \
fi
grep ^version ./helm/drbd-adapter/Chart.yaml

drbd9:
cd docker-drbd9 && \
./build.sh $(DRBD_VER) rhel7 rhel8 rhel9 bionic focal jammy
./build.sh $(DRBD_VER) $(ARCH) $(REG) $(IMG)

compiler-centos7:
cd docker-shipper && \
docker build . -f Dockerfile.compiler.centos7 \
--build-arg HTTP_PROXY=${http_proxy} \
--build-arg HTTPS_PROXY=${https_proxy} \
--build-arg FTP_PROXY=${ftp_proxy} \
--build-arg DRBD_VER=$(DRBD_VER) \
-t drbd9-compiler-centos7:v$(DRBD_VER)
for a in $(shell echo $(ARCH) | tr ',' ' '); do \
docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \
--platform $$a \
--progress tty \
--target compiler-centos7 \
--build-arg DRBD_VER=$(DRBD_VER) \
-t $(REG)/drbd9-compiler-centos7:v$(DRBD_VER)_$${a/\//-}; \
done

compiler-centos8:
cd docker-shipper && \
docker build . -f Dockerfile.compiler.centos8 \
--build-arg HTTP_PROXY=${http_proxy} \
--build-arg HTTPS_PROXY=${https_proxy} \
--build-arg FTP_PROXY=${ftp_proxy} \
--build-arg DRBD_VER=$(DRBD_VER) \
-t drbd9-compiler-centos8:v$(DRBD_VER)

shipper:
cd docker-shipper && \
docker build . -f Dockerfile.shipper \
--build-arg HTTP_PROXY=${http_proxy} \
--build-arg HTTPS_PROXY=${https_proxy} \
--build-arg FTP_PROXY=${ftp_proxy} \
--build-arg DRBD_VER=$(DRBD_VER) \
--build-arg DRBD_UTILS_VER=$(DRBD_UTILS_VER) \
--build-arg DRBD_HEADERS_SHA=$(DRBD_HEADERS_SHA) \
-t drbd9-shipper:v$(DRBD_VER)_$(CHART_VER)
for a in $(shell echo $(ARCH) | tr ',' ' '); do \
docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \
--platform $$a \
--progress tty \
--target compiler-centos8 \
--build-arg DRBD_VER=$(DRBD_VER) \
-t $(REG)/drbd9-compiler-centos8:v$(DRBD_VER)_$${a/\//-}; \
done

compiler-utils:
for a in $(shell echo $(ARCH) | tr ',' ' '); do \
docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \
--platform $$a \
--progress tty \
--target compiler-utils \
--build-arg DRBD_VER=$(DRBD_VER) \
--build-arg DRBD_UTILS_VER=$(DRBD_UTILS_VER) \
--build-arg DRBD_HEADERS_SHA=$(DRBD_HEADERS_SHA) \
-t $(REG)/drbd9-compiler-utils:v$(DRBD_VER)_$${a/\//-}; \
done

shipper: update_chart
for a in $(shell echo $(ARCH) | tr ',' ' '); do \
docker build docker-shipper/ -f docker-shipper/Dockerfile.shipper \
--platform $$a \
--progress tty \
--build-arg DRBD_VER=$(DRBD_VER) \
--build-arg DRBD_UTILS_VER=$(DRBD_UTILS_VER) \
--build-arg DRBD_HEADERS_SHA=$(DRBD_HEADERS_SHA) \
-t $(REG)/drbd9-shipper:v$(DRBD_VER)_$(CHART_VER)_$${a/\//-}; \
done

cleanup:
docker volume rm pkgs || true
Expand All @@ -62,16 +91,16 @@ test-docker:
drbd9-shipper:v$(DRBD_VER)_$(CHART_VER)
docker run --rm \
-v pkgs:/pkgs \
--privileged \
-v /etc/os-release:/etc/host-release:ro \
-v /etc/centos-release:/etc/centos-release:ro \
-v /usr/src:/usr/src:ro \
-v /lib/modules:/lib/modules:rw \
-v /usr/local/bin:/usr-local-bin:rw \
-v /etc/modules-load.d:/etc/modules-load.d:rw \
-e LB_DROP=yes \
-it --entrypoint $(ENTRY) \
drbd9-$(DIST):v$(DRBD_VER)
--privileged \
-v /etc/os-release:/etc/host-release:ro \
-v /etc/centos-release:/etc/centos-release:ro \
-v /usr/src:/usr/src:ro \
-v /lib/modules:/lib/modules:rw \
-v /usr/local/bin:/usr-local-bin:rw \
-v /etc/modules-load.d:/etc/modules-load.d:rw \
-e LB_DROP=yes \
-it --entrypoint $(ENTRY) \
$(REG)/drbd9-$(DIST):v$(DRBD_VER)

test:
helm install drbd-adapter helm/drbd-adapter \
Expand All @@ -81,13 +110,17 @@ test:
--set registry=daocloud.io/daocloud

push:
for i in $(REG) ; do \
for j in $(IMG); do \
[ $$j = "shipper" ] && ver=$(DRBD_VER)_$(CHART_VER) || ver=$(DRBD_VER); \
docker tag drbd9-$$j:v$${ver} $$i/drbd9-$$j:v$${ver}; \
docker push $$i/drbd9-$$j:v$${ver}; \
done \
set -x; \
for i in $(IMG); do \
[ $$i = "shipper" ] && ver=$(DRBD_VER)_$(CHART_VER) || ver=$(DRBD_VER); \
docker manifest rm $(REG)/drbd9-$$i:v$${ver}; \
for a in $(shell echo $(ARCH) | tr ',' ' ' ); do \
docker push $(REG)/drbd9-$$i:v$${ver}_$${a/\//-} || \
docker push $(REG)/drbd9-$$i:v$${ver}_$${a/\//-}; \
docker manifest create --amend $(REG)/drbd9-$$i:v$${ver} $(REG)/drbd9-$$i:v$${ver}_$${a/\//-}; \
done; \
docker manifest push --purge $(REG)/drbd9-$$i:v$${ver}; \
docker manifest inspect $(REG)/drbd9-$$i:v$${ver}; \
done


all: drbd9 compiler-centos7 compiler-centos8 shipper push
all: drbd9 shipper push
Loading

0 comments on commit 6f91a1f

Please sign in to comment.