From 1fb565a1051a4ef08942c8a8ef4782bc1440cdc2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 30 Sep 2025 21:04:46 +0800 Subject: [PATCH] debian,ceph.spec: split ceph-osd into shared base and implementation packages Previously, ceph-osd packaging had two mutually exclusive flavors that could only be built one at a time: one with classic OSD and another with crimson OSD. Both provided /usr/bin/ceph-osd, making them impossible to coexist and confusing from a user perspective. This commit restructures the packaging to enable both implementations to coexist on the same system: - ceph-osd: Contains shared components (systemd units, sysctl configs, common executables like ceph-erasure-code-tool) and depends on exactly one OSD implementation - ceph-osd-classic: Contains the classic OSD implementation binary and classic-specific tools - ceph-osd-crimson: Contains the crimson OSD implementation binary and crimson-specific tools The two implementation packages conflict with each other but both depend on ceph-osd for shared resources. Changes: Debian packaging: - Revert e5f00d2f - Add ceph-crimson-osd package - Add Recommends: ceph-classic-osd to prefer classic on upgrades - Add Replaces/Breaks for smooth upgrades from old monolithic package - Create separate .install files for crimson and classic osd packages Enforce exact version matching using ${binary:Version} RPM packaging: - Use rich dependencies for OR requirement (classic or crimson) - Add Recommends: ceph-classic-osd for upgrade preference Upgrade behavior: Users upgrading from older versions will automatically get ceph-classic-osd due to the Recommends directive, maintaining backward compatibility. Users can explicitly choose crimson by installing ceph-osd-crimson, which will conflict out classic. Switching between implementations is supported via standard package operations, with the alternatives system ensuring /usr/bin/ceph-osd always points to the active implementation. Signed-off-by: Kefu Chai --- ceph.spec.in | 55 +++++++++++---- debian/ceph-classic-osd.install | 9 +++ debian/ceph-classic-osd.postinst | 13 ++++ debian/ceph-classic-osd.prerm | 12 ++++ debian/ceph-crimson-osd.install | 6 ++ debian/ceph-crimson-osd.postinst | 13 ++++ debian/ceph-crimson-osd.prerm | 12 ++++ debian/ceph-osd.install | 12 ---- debian/control | 113 ++++++++++++++++++++++++------- debian/rules | 8 +-- 10 files changed, 200 insertions(+), 53 deletions(-) create mode 100755 debian/ceph-classic-osd.install create mode 100644 debian/ceph-classic-osd.postinst create mode 100644 debian/ceph-classic-osd.prerm create mode 100755 debian/ceph-crimson-osd.install create mode 100644 debian/ceph-crimson-osd.postinst create mode 100644 debian/ceph-crimson-osd.prerm mode change 100755 => 100644 debian/ceph-osd.install diff --git a/ceph.spec.in b/ceph.spec.in index 6e9d3d509f9..b302fc4d2e2 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -912,18 +912,29 @@ Summary: Ceph Object Storage Daemon Group: System/Filesystems %endif Requires: ceph-base = %{_epoch_prefix}%{version}-%{release} +Requires: (ceph-classic-osd = %{_epoch_prefix}%{version}-%{release} or ceph-crimson-osd = %{_epoch_prefix}%{version}-%{release}) Requires: sudo Requires: libstoragemgmt -%if 0%{with crimson} -Requires: protobuf -%endif %if 0%{?weak_deps} Recommends: ceph-volume = %{_epoch_prefix}%{version}-%{release} %endif %description osd ceph-osd is the object storage daemon for the Ceph distributed file +system. It provides components shared between classic and crimson OSD +implementations. It requires either the classic or crimson OSD +to provide the core OSD daemon. + +%package classic-osd +Summary: Ceph Object Storage Daemon (classic) +%if 0%{?suse_version} +Group: System/Filesystems +%endif +Requires: ceph-osd = %{_epoch_prefix}%{version}-%{release} +%description classic-osd +classic-osd is the object storage daemon for the Ceph distributed file system. It is responsible for storing objects on a local file system and providing access to them over the network. +%endif %if 0%{with crimson} %package crimson-osd @@ -931,8 +942,9 @@ Summary: Ceph Object Storage Daemon (crimson) %if 0%{?suse_version} Group: System/Filesystems %endif -Requires: ceph-osd = %{_epoch_prefix}%{version}-%{release} +Requires: ceph-osd = %{_epoch_prefix}%{version}-%{release} Requires: binutils +Requires: protobuf %description crimson-osd crimson-osd is the object storage daemon for the Ceph distributed file system. It is responsible for storing objects on a local file system @@ -1563,10 +1575,9 @@ rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph popd %if 0%{with crimson} -# package crimson-osd with the name of ceph-osd -install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd -install -m 0755 %{buildroot}%{_bindir}/crimson-objectstore-tool %{buildroot}%{_bindir}/ceph-objectstore-tool +install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-crimson-osd %endif +install -m 0755 %{buildroot}%{_bindir}/ceph-osd %{buildroot}%{_bindir}/ceph-classic-osd install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} @@ -2279,17 +2290,12 @@ fi %files osd %{_bindir}/ceph-clsinfo -%{_bindir}/ceph-bluestore-tool %{_bindir}/ceph-erasure-code-tool -%{_bindir}/ceph-objectstore-tool -%{_bindir}/ceph-osd %{_libexecdir}/ceph/ceph-osd-prestart.sh %{_mandir}/man8/ceph-clsinfo.8* %{_mandir}/man8/ceph-osd.8* -%{_mandir}/man8/ceph-bluestore-tool.8* %{_unitdir}/ceph-osd@.service %{_unitdir}/ceph-osd.target -%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd %config(noreplace) %{_sysctldir}/90-ceph-osd.conf %post osd @@ -2328,12 +2334,37 @@ if [ $1 -ge 1 ] ; then fi fi +%files classic-osd +%{_bindir}/ceph-bluestore-tool +%{_bindir}/ceph-objectstore-tool +%{_bindir}/ceph-classic-osd +%{_mandir}/man8/ceph-bluestore-tool.8* +%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd + %if 0%{with crimson} %files crimson-osd %{_bindir}/crimson-osd %{_bindir}/crimson-objectstore-tool + +%post crimson-osd +%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \ + %{_bindir}/ceph-crimson-osd 50 + +%preun crimson-osd +if [ $1 -eq 0 ]; then + ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-crimson-osd +fi %endif +%post classic-osd +%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \ + %{_bindir}/ceph-classic-osd 100 + +%preun classic-osd +if [ $1 -eq 0 ]; then + ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-classic-osd +fi + %files volume %{_sbindir}/ceph-volume %{_sbindir}/ceph-volume-systemd diff --git a/debian/ceph-classic-osd.install b/debian/ceph-classic-osd.install new file mode 100755 index 00000000000..3d1feec8411 --- /dev/null +++ b/debian/ceph-classic-osd.install @@ -0,0 +1,9 @@ +#! /usr/bin/dh-exec + +usr/bin/ceph-bluestore-tool +usr/bin/ceph-objectstore-tool +usr/bin/ceph-osd => /usr/bin/ceph-classic-osd +usr/bin/ceph_objectstore_bench +usr/lib/libos_tp.so* +usr/lib/libosd_tp.so* +usr/share/man/man8/ceph-bluestore-tool.8 diff --git a/debian/ceph-classic-osd.postinst b/debian/ceph-classic-osd.postinst new file mode 100644 index 00000000000..956f222b57a --- /dev/null +++ b/debian/ceph-classic-osd.postinst @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +case "$1" in + configure) + update-alternatives --install /usr/bin/ceph-osd ceph-osd \ + /usr/bin/ceph-classic-osd 100 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ceph-classic-osd.prerm b/debian/ceph-classic-osd.prerm new file mode 100644 index 00000000000..3796cd56886 --- /dev/null +++ b/debian/ceph-classic-osd.prerm @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +case "$1" in + remove) + update-alternatives --remove ceph-osd /usr/bin/ceph-classic-osd + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ceph-crimson-osd.install b/debian/ceph-crimson-osd.install new file mode 100755 index 00000000000..9d0cf7fe9c8 --- /dev/null +++ b/debian/ceph-crimson-osd.install @@ -0,0 +1,6 @@ +#! /usr/bin/dh-exec + +usr/bin/crimson-objectstore-tool +usr/bin/crimson-osd => /usr/bin/ceph-crimson-osd +usr/bin/crimson-store-bench +usr/bin/crimson-store-nbd diff --git a/debian/ceph-crimson-osd.postinst b/debian/ceph-crimson-osd.postinst new file mode 100644 index 00000000000..9347aef5fe5 --- /dev/null +++ b/debian/ceph-crimson-osd.postinst @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +case "$1" in + configure) + update-alternatives --install /usr/bin/ceph-osd ceph-osd \ + /usr/bin/ceph-crimson-osd 50 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ceph-crimson-osd.prerm b/debian/ceph-crimson-osd.prerm new file mode 100644 index 00000000000..ff89d7a2182 --- /dev/null +++ b/debian/ceph-crimson-osd.prerm @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +case "$1" in + remove) + update-alternatives --remove ceph-osd /usr/bin/ceph-crimson-osd + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install old mode 100755 new mode 100644 index c99368609fb..19e1d5055b8 --- a/debian/ceph-osd.install +++ b/debian/ceph-osd.install @@ -1,19 +1,7 @@ -#! /usr/bin/dh-exec - {usr/,}lib/systemd/system/ceph-osd* -usr/bin/ceph-bluestore-tool usr/bin/ceph-clsinfo usr/bin/ceph-erasure-code-tool -usr/bin/ceph-objectstore-tool - usr/bin/crimson-store-nbd - usr/bin/crimson-objectstore-tool - usr/bin/crimson-store-bench -usr/bin/${CEPH_OSD_BASENAME} => /usr/bin/ceph-osd -usr/bin/ceph_objectstore_bench usr/libexec/ceph/ceph-osd-prestart.sh -usr/lib/libos_tp.so* -usr/lib/libosd_tp.so* usr/share/man/man8/ceph-clsinfo.8 usr/share/man/man8/ceph-osd.8 -usr/share/man/man8/ceph-bluestore-tool.8 etc/sysctl.d/30-ceph-osd.conf diff --git a/debian/control b/debian/control index 35c1dbe5bd2..f466236fdf2 100644 --- a/debian/control +++ b/debian/control @@ -31,8 +31,8 @@ Build-Depends: automake, libbabeltrace-ctf-dev, libbabeltrace-dev, libblkid-dev (>= 2.17), - libc-ares-dev , - libcrypto++-dev , + libc-ares-dev, + libcrypto++-dev, libcryptsetup-dev, libcap-ng-dev, libcap-dev, @@ -44,8 +44,8 @@ Build-Depends: automake, libfmt-dev (>= 6.1.2), libfuse-dev, libgoogle-perftools-dev [i386 amd64 arm64], - libgnutls28-dev , - libhwloc-dev , + libgnutls28-dev, + libhwloc-dev, libibverbs-dev, libicu-dev, librdmacm-dev, @@ -59,8 +59,8 @@ Build-Depends: automake, libnss3-dev, liboath-dev, libnuma-dev, - libpciaccess-dev , - libsctp-dev , + libpciaccess-dev, + libsctp-dev, libsnappy-dev, libsqlite3-dev, libssl-dev, @@ -84,13 +84,13 @@ Build-Depends: automake, libndctl-dev (>= 63) , libpmem-dev , libpmemobj-dev (>= 1.8) , - libprotobuf-dev , + libprotobuf-dev, ninja-build, nlohmann-json3-dev, patch, pkg-config, prometheus , - protobuf-compiler , + protobuf-compiler, python3-all-dev, python3-cherrypy3, python3-natsort, @@ -110,10 +110,10 @@ Build-Depends: automake, python3-sphinx, python3-venv, python3-yaml, - ragel , + ragel, socat , systemd, - systemtap-sdt-dev , + systemtap-sdt-dev, uuid-dev , uuid-runtime, valgrind, @@ -413,42 +413,109 @@ Description: debugging symbols for ceph-mon Package: ceph-osd Architecture: linux-any -Depends: ceph-base (= ${binary:Version}), +Depends: ceph-classic-osd (= ${binary:Version}) | ceph-osd-crimson (= ${binary:Version}), sudo, - ${misc:Depends}, ${python3:Depends}, + ${misc:Depends}, + ${shlibs:Depends}, +Recommends: ceph-osd-classic (= ${binary:Version}) +Description: OSD server for the ceph storage system - shared components + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + This package contains components shared between classic and crimson OSD implementations. + It ensures a Ceph OSD implementation is installed. By default, + it installs the classic OSD implementation (ceph-classic-osd). Users can + substitute with the experimental Crimson implementation (ceph-crimson-osd) + for improved performance and scalability. + +Package: ceph-osd-dbg +Architecture: linux-any +Section: debug +Priority: extra +Depends: ceph-osd (= ${binary:Version}), + ${misc:Depends}, +Description: debugging symbols for ceph-osd + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + This package contains the debugging symbols for ceph-osd. + +Package: ceph-classic-osd +Architecture: linux-any +Depends: ceph-base (= ${binary:Version}), + ${misc:Depends}, ${shlibs:Depends}, - libprotobuf23 , Replaces: ceph (<< 10), ceph-test (<< 12.2.2-14), - ceph-osd (<< 17.0.0) + ceph-osd (<< 20.1.1) Breaks: ceph (<< 10), ceph-test (<< 12.2.2-14), - ceph-osd (<< 17.0.0) + ceph-osd (<< 20.1.1) +Conflicts: ceph-crimson-osd Recommends: ceph-volume (= ${binary:Version}), nvme-cli, smartmontools, -Description: OSD server for the ceph storage system +Description: Classic OSD server for the ceph storage system Ceph is a massively scalable, open-source, distributed storage system that runs on commodity hardware and delivers object, block and file system storage. . - This package contains the Object Storage Daemon for the Ceph storage system. - It is responsible for storing objects on a local file system - and providing access to them over the network. + This package contains the classic Object Storage Daemon and + classic-specific components for the Ceph storage system. It is + responsible for storing objects on a local file system and providing + access to them over the network. -Package: ceph-osd-dbg +Package: ceph-classic-osd-dbg Architecture: linux-any Section: debug Priority: extra -Depends: ceph-osd (= ${binary:Version}), +Depends: ceph-classic-osd (= ${binary:Version}), ${misc:Depends}, -Description: debugging symbols for ceph-osd +Description: debugging symbols for ceph-classic-osd Ceph is a massively scalable, open-source, distributed storage system that runs on commodity hardware and delivers object, block and file system storage. . - This package contains the debugging symbols for ceph-osd. + This package contains the debugging symbols for ceph-classic-osd. + +Package: ceph-crimson-osd +Architecture: any +Depends: ceph-base (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends}, + libprotobuf23, +Conflicts: ceph-classic-osd +Recommends: ceph-volume (= ${binary:Version}), + nvme-cli, + smartmontools, +Description: Crimson OSD server for the ceph storage system + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + Crimson is the next generation of ceph-osd daemon featuring enhanced + performance on fast network and storage devices. + . + This package contains the Crimson Object Storage Daemon and + crimson-specific components for the Ceph storage system. It is + responsible for storing objects on a local file system and providing + access to them over the network. + +Package: ceph-crimson-osd-dbg +Architecture: linux-any +Section: debug +Priority: extra +Depends: ceph-crimson-osd (= ${binary:Version}), + ${misc:Depends}, +Description: debugging symbols for ceph-crimson-osd + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + This package contains the debugging symbols for ceph-crimson-osd. Package: ceph-volume Architecture: all diff --git a/debian/rules b/debian/rules index b935efaa8cd..46202733727 100755 --- a/debian/rules +++ b/debian/rules @@ -12,15 +12,9 @@ ifneq (,$(findstring WITH_STATIC_LIBSTDCXX,$(CEPH_EXTRA_CMAKE_ARGS))) # see http://tracker.ceph.com/issues/25209 export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions endif -ifeq (,$(findstring WITH_CRIMSON,$(CEPH_EXTRA_CMAKE_ARGS))) - export CEPH_OSD_BASENAME = ceph-osd -else - export CEPH_OSD_BASENAME = crimson-osd -endif ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),) extraopts += -DWITH_SYSTEM_ARROW=ON endif - extraopts += -DWITH_JAEGER=ON extraopts += -DWITH_SYSTEM_UTF8PROC=ON extraopts += -DWITH_OCF=ON -DWITH_LTTNG=ON @@ -35,6 +29,7 @@ ifeq ($(DEB_HOST_ARCH), amd64) else extraopts += -DWITH_RBD_RWL=OFF endif +extraopts += -DWITH_CRIMSON=ON extraopts += -DWITH_RBD_SSD_CACHE=ON # assumes that ceph is exmpt from multiarch support, so we override the libdir. extraopts += -DCMAKE_INSTALL_LIBDIR=/usr/lib @@ -77,6 +72,7 @@ override_dh_auto_clean: override_dh_auto_install: dh_auto_install --buildsystem=cmake --destdir=$(DESTDIR) + install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap install -D -m 644 etc/sysctl/90-ceph-osd.conf $(DESTDIR)/etc/sysctl.d/30-ceph-osd.conf -- 2.39.5