]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
debian,ceph.spec: split ceph-osd into shared base and implementation packages ci/wip-build-crimson-osd-kefu
authorKefu Chai <k.chai@proxmox.com>
Tue, 30 Sep 2025 13:04:46 +0000 (21:04 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 1 Oct 2025 08:07:06 +0000 (16:07 +0800)
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 <k.chai@proxmox.com>
ceph.spec.in
debian/ceph-classic-osd.install [new file with mode: 0755]
debian/ceph-classic-osd.postinst [new file with mode: 0644]
debian/ceph-classic-osd.prerm [new file with mode: 0644]
debian/ceph-crimson-osd.install [new file with mode: 0755]
debian/ceph-crimson-osd.postinst [new file with mode: 0644]
debian/ceph-crimson-osd.prerm [new file with mode: 0644]
debian/ceph-osd.install [changed mode: 0755->0644]
debian/control
debian/rules

index 6e9d3d509f91c4dd5a366c8e91cd360af4f33efd..b302fc4d2e27720eb16edd91875f7b58c79ba469 100644 (file)
@@ -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 (executable)
index 0000000..3d1feec
--- /dev/null
@@ -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 (file)
index 0000000..956f222
--- /dev/null
@@ -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 (file)
index 0000000..3796cd5
--- /dev/null
@@ -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 (executable)
index 0000000..9d0cf7f
--- /dev/null
@@ -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 (file)
index 0000000..9347aef
--- /dev/null
@@ -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 (file)
index 0000000..ff89d7a
--- /dev/null
@@ -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
old mode 100755 (executable)
new mode 100644 (file)
index c993686..19e1d50
@@ -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
-<pkg.ceph.crimson> usr/bin/crimson-store-nbd
-<pkg.ceph.crimson> usr/bin/crimson-objectstore-tool
-<pkg.ceph.crimson> 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
index 35c1dbe5bd29ab0ce8a8d60e8812692c9929f27a..f466236fdf2230b159def3bf9a1571d3a4af5386 100644 (file)
@@ -31,8 +31,8 @@ Build-Depends: automake,
                libbabeltrace-ctf-dev,
                libbabeltrace-dev,
                libblkid-dev (>= 2.17),
-               libc-ares-dev <pkg.ceph.crimson>,
-               libcrypto++-dev <pkg.ceph.crimson>,
+               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 <pkg.ceph.crimson>,
-               libhwloc-dev <pkg.ceph.crimson>,
+               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 <pkg.ceph.crimson>,
-               libsctp-dev <pkg.ceph.crimson>,
+               libpciaccess-dev,
+               libsctp-dev,
                libsnappy-dev,
                libsqlite3-dev,
                libssl-dev,
@@ -84,13 +84,13 @@ Build-Depends: automake,
                libndctl-dev (>= 63) <pkg.ceph.pmdk>,
                libpmem-dev <pkg.ceph.pmdk>,
                libpmemobj-dev (>= 1.8) <pkg.ceph.pmdk>,
-               libprotobuf-dev <pkg.ceph.crimson>,
+               libprotobuf-dev,
                ninja-build,
                nlohmann-json3-dev,
                patch,
                pkg-config,
                prometheus <pkg.ceph.check>,
-               protobuf-compiler <pkg.ceph.crimson>,
+               protobuf-compiler,
                python3-all-dev,
                python3-cherrypy3,
                python3-natsort,
@@ -110,10 +110,10 @@ Build-Depends: automake,
                python3-sphinx,
                python3-venv,
                python3-yaml,
-               ragel <pkg.ceph.crimson>,
+               ragel,
                socat <pkg.ceph.check>,
                systemd,
-               systemtap-sdt-dev <pkg.ceph.crimson>,
+               systemtap-sdt-dev,
                uuid-dev <pkg.ceph.check>,
                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 <pkg.ceph.crimson>,
 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
index b935efaa8cddc3753a6e7e67b70e413c2b4b67aa..46202733727f62548663a29e64cc56704146d9e4 100755 (executable)
@@ -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