Skip to content

Commit

Permalink
Merge pull request #782 from xin3liang/fix-spdk-building-for-arm64
Browse files Browse the repository at this point in the history
build: remove install thrift explicitly
  • Loading branch information
xin3liang authored Aug 7, 2024
2 parents fd4b960 + 5d282d9 commit 817554e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ CMD []
#------------------------------------------------------------------------------
# Base image for NVMEOF_TARGET=gateway (nvmeof-gateway)
FROM quay.io/ceph/spdk:${NVMEOF_SPDK_VERSION:-NULL} AS base-gateway
RUN rpm -vih https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN \
--mount=type=cache,target=/var/cache/dnf \
--mount=type=cache,target=/var/lib/dnf \
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.spdk
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ RUN \
&& dnf install $DNF_OPTS -y \
rpm-build \
git-core \
&& rpm -vih https://buildlogs.centos.org/centos/9-stream/storage/x86_64/ceph-reef/Packages/t/thrift-0.15.0-3.el9s.x86_64.rpm \
epel-release \
epel-next-release \
&& scripts/pkgdep.sh $SPDK_PKGDEP_ARGS \
&& dnf $DNF_OPTS update -y

Expand Down Expand Up @@ -153,7 +154,7 @@ RUN \
--mount=type=cache,target=/var/lib/dnf \
rpm -vih $SPDK_CENTOS_BASE/centos-stream-repos-$SPDK_CENTOS_REPO_VER.noarch.rpm \
$SPDK_CENTOS_BASE/centos-gpg-keys-$SPDK_CENTOS_REPO_VER.noarch.rpm \
&& rpm -vih https://buildlogs.centos.org/centos/9-stream/storage/x86_64/ceph-reef/Packages/t/thrift-0.15.0-3.el9s.x86_64.rpm \
&& rpm -vih https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
&& dnf $DNF_OPTS install -y /rpm/$(uname -m)/*.rpm \
&& dnf $DNF_OPTS update -y

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Make config
MAKEFLAGS += --no-builtin-rules --no-builtin-variables
TARGET_ARCH := $(shell uname -m | sed -e 's/aarch64/arm64/')
.SUFFIXES:

# Includes
Expand Down Expand Up @@ -33,7 +34,7 @@ build: export SPDK_GIT_BRANCH != git -C spdk name-rev --name-only HEAD
build: export SPDK_GIT_COMMIT != git rev-parse HEAD:spdk
build: export BUILD_DATE != date -u +"%Y-%m-%d %H:%M:%S %Z"
build: export NVMEOF_GIT_MODIFIED_FILES != git status -s | grep -e "^ *M" | sed 's/^ *M //' | xargs
build: export CEPH_CLUSTER_CEPH_REPO_BASEURL != curl -s https://shaman.ceph.com/api/repos/ceph/$(CEPH_BRANCH)/$(CEPH_SHA)/centos/9/ | jq -r '.[] | select(.status == "ready" and .sha1 == "$(CEPH_SHA)" and .archs[] == "x86_64") | .url'
build: export CEPH_CLUSTER_CEPH_REPO_BASEURL != curl -s https://shaman.ceph.com/api/repos/ceph/$(CEPH_BRANCH)/$(CEPH_SHA)/centos/9/ | jq -r '.[] | select(.status == "ready" and .sha1 == "$(CEPH_SHA)" and .archs[] == "$(TARGET_ARCH)") | .url'
up: ## Launch services
up: SCALE?= 1 ## Number of gateways
up:
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,20 @@ To build the container images from the local sources:
make build
```

To build the container images for Arm64, you need to override the default values of `SPDK_TARGET_ARCH` and `SPDK_MAKEFLAGS`. For how to set the values for all the supported Arm64 SoCs see [the socs and implementer_xxx parts](https://github.com/DPDK/dpdk/blob/main/config/arm/meson.build#L674).
And override the values of [ceph-ci git repo](https://github.com/ceph/ceph-ci) `CEPH_BRANCH` and `CEPH_SHA` or `CEPH_CLUSTER_CEPH_REPO_BASEURL` if the default Ceph rpm repo doesn't contain Arm64 rpm.
E.g.
```bash
make build SPDK_TARGET_ARCH="armv8-a+crypto" \
SPDK_MAKEFLAGS="DPDKBUILD_FLAGS=-Dplatform=generic" \
CEPH_BRANCH=ceph-nvmeof-mon-arm64-testin \
CEPH_SHA=0adaeecf622b3867ee27e9fabeb939831c4967dc
make build SPDK_TARGET_ARCH="armv8.2-a+crypto" \
SPDK_MAKEFLAGS="DPDKBUILD_FLAGS=-Dplatform=kunpeng920" \
CEPH_CLUSTER_CEPH_REPO_BASEURL="https://uk.linaro.cloud/repo/ceph/9-stream"
```
The resulting images should be like these:
```bash
Expand Down

0 comments on commit 817554e

Please sign in to comment.