sys-cluster/ceph-15.2.2-r1: Revbump, fix bugs #724508 and #724438
authorPatrick McLean <patrick.mclean@sony.com>
Thu, 28 May 2020 19:08:53 +0000 (12:08 -0700)
committerPatrick McLean <chutzpah@gentoo.org>
Thu, 28 May 2020 19:09:22 +0000 (12:09 -0700)
Adds a "diskprediction" USE flag to enable diskprediction_local since it
forces an old scipy (forcing off python3_8) (bug #724438)

Fixes up the systemd unit and adds a tmpfiles entry (bug #724508)

Closes: https://bugs.gentoo.org/724508
Closes: https://bugs.gentoo.org/724438
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
sys-cluster/ceph/ceph-15.2.2-r1.ebuild [moved from sys-cluster/ceph/ceph-15.2.2.ebuild with 92% similarity]
sys-cluster/ceph/files/ceph-15.2.2-systemd-unit.patch [new file with mode: 0644]
sys-cluster/ceph/files/ceph-tmpfilesd [new file with mode: 0644]
sys-cluster/ceph/metadata.xml

similarity index 92%
rename from sys-cluster/ceph/ceph-15.2.2.ebuild
rename to sys-cluster/ceph/ceph-15.2.2-r1.ebuild
index 2d9f2924eca60b7208d19a2cebee3c02a521e251..d8466689267605621f116f2827d7b0514b87ebf8 100644 (file)
@@ -9,7 +9,7 @@ DISTUTILS_OPTIONAL=1
 
 inherit check-reqs bash-completion-r1 cmake-utils distutils-r1 flag-o-matic \
                multiprocessing python-r1 udev readme.gentoo-r1 toolchain-funcs \
-               systemd
+               systemd tmpfiles
 
 if [[ ${PV} == *9999* ]]; then
        inherit git-r3
@@ -28,9 +28,9 @@ SLOT="0"
 
 CPU_FLAGS_X86=(sse{,2,3,4_1,4_2} ssse3)
 
-IUSE="babeltrace +cephfs custom-cflags dpdk fuse grafana jemalloc kafka kerberos ldap
-       libressl lttng +mgr numa +openssl pmdk rabbitmq +radosgw rbd-rwl +ssl spdk
-       system-boost systemd +tcmalloc test uring xfs zfs"
+IUSE="babeltrace +cephfs custom-cflags diskprediction dpdk fuse grafana jemalloc
+       kafka kerberos ldap libressl lttng +mgr numa +openssl pmdk rabbitmq +radosgw
+       rbd-rwl +ssl spdk system-boost systemd +tcmalloc test uring xfs zfs"
 IUSE+=" $(printf "cpu_flags_x86_%s\n" ${CPU_FLAGS_X86[@]})"
 
 COMMON_DEPEND="
@@ -153,18 +153,22 @@ RDEPEND="${COMMON_DEPEND}
                dev-python/pyjwt[${PYTHON_USEDEP}]
                dev-python/pyyaml[${PYTHON_USEDEP}]
                dev-python/routes[${PYTHON_USEDEP}]
-               sci-libs/scipy[${PYTHON_USEDEP}]
+               diskprediction? (
+                       $(python_gen_cond_dep '<sci-libs/scipy-1.4.0[${PYTHON_USEDEP}]' python3_{6,7})
+               )
                sci-libs/scikits_learn[${PYTHON_USEDEP}]
                dev-python/six[${PYTHON_USEDEP}]
        )
 "
+# diskprediction needs older scipy not compatible with py38
+# bug #724438
 REQUIRED_USE="
        ${PYTHON_REQUIRED_USE}
+       ?? ( jemalloc tcmalloc )
        ^^ ( openssl libressl )
+       diskprediction? ( mgr !python_targets_python3_8 )
        kafka? ( radosgw )
-       rabbitmq? ( radosgw )
        mgr? ( cephfs )
-       ?? ( jemalloc tcmalloc )
        rabbitmq? ( radosgw )
 "
 RESTRICT="!test? ( test )"
@@ -189,10 +193,11 @@ PATCHES=(
        "${FILESDIR}/ceph-14.2.0-link-crc32-statically.patch"
        "${FILESDIR}/ceph-14.2.0-cython-0.29.patch"
        "${FILESDIR}/ceph-15.2.0-rocksdb-cmake.patch"
+       "${FILESDIR}/ceph-15.2.2-systemd-unit.patch"
 )
 
 check-reqs_export_vars() {
-       CHECKREQS_DISK_BUILD="5.2G"
+       CHECKREQS_DISK_BUILD="5200M"
        CHECKREQS_DISK_USR="510M"
 
        export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR
@@ -223,6 +228,10 @@ src_prepare() {
        sed -i -r "s:DESTINATION .+\\):DESTINATION $(get_bashcompdir)\\):" \
                src/bash_completion/CMakeLists.txt || die
 
+       if ! use diskprediction; then
+               rm -rf src/pybind/mgr/diskprediction_local || die
+       fi
+
        # remove tests that need root access
        rm src/test/cli/ceph-authtool/cap*.t || die
 }
@@ -262,6 +271,7 @@ ceph_src_configure() {
                -DWITH_RDMA=OFF
                -DWITH_TBB=OFF
                -DSYSTEMD_UNITDIR=$(systemd_get_systemunitdir)
+               -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR=$(systemd_get_systemunitdir)
                -DEPYTHON_VERSION="${EPYTHON#python}"
                -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PN}-${PVR}"
                -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
@@ -356,13 +366,15 @@ src_install() {
 
                systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" \
                        "ceph-osd@.service"
+
        fi
 
        udev_dorules udev/*.rules
+       newtmpfiles "${FILESDIR}"/ceph-tmpfilesd ${PN}.conf
 
        readme.gentoo_create_doc
 
-       python_setup 'python3*'
+       python_setup
 
        # bug #630232
        sed -i -r "s:${T//:/\\:}/${EPYTHON}:/usr:" "${ED}"/usr/bin/ceph{,-crash} \
diff --git a/sys-cluster/ceph/files/ceph-15.2.2-systemd-unit.patch b/sys-cluster/ceph/files/ceph-15.2.2-systemd-unit.patch
new file mode 100644 (file)
index 0000000..fdd3a6a
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ur ceph-15.2.2/systemd/ceph-osd@.service.in ceph-15.2.2.af/systemd/ceph-osd@.service.in
+--- ceph-15.2.2/systemd/ceph-osd@.service.in    2020-05-18 16:25:12.000000000 +0000
++++ ceph-15.2.2.af/systemd/ceph-osd@.service.in 2020-05-21 21:20:58.318655944 +0000
+@@ -10,7 +10,7 @@
+ EnvironmentFile=-@SYSTEMD_ENV_FILE@
+ Environment=CLUSTER=ceph
+ ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
+-ExecStartPre=/usr/lib/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
++ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
+ ExecReload=/bin/kill -HUP $MAINPID
+ LockPersonality=true
+ MemoryDenyWriteExecute=true
diff --git a/sys-cluster/ceph/files/ceph-tmpfilesd b/sys-cluster/ceph/files/ceph-tmpfilesd
new file mode 100644 (file)
index 0000000..2ded82f
--- /dev/null
@@ -0,0 +1 @@
+d /run/ceph 0770 ceph ceph -
index dcf0de05f77f0d496de9db5ee94e0888a4f0cb41..b29a383d9b5a9d3d73badf0a1722c5fa37a23db3 100644 (file)
@@ -20,6 +20,7 @@
     <flag name="babeltrace">Add support for LTTng babeltrace</flag>
     <flag name="cephfs">Build support for cephfs, a POSIX compatible filesystem built on top of ceph</flag>
     <flag name="dpdk">Enable DPDK messaging</flag>
+    <flag name="diskprediction">Enable local diskprediction module to predict disk failures</flag>
     <flag name="spdk">Enable SPDK user-mode storage driver toolkit</flag>
     <flag name="fuse">Build fuse client</flag>
     <flag name="grafana">Install grafana dashboards</flag>