From 80b70dedd14b9d41e91c33aaed31f46026d30d4f Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 12 Sep 2023 10:08:07 -0400 Subject: [PATCH] MT#54294 packaging for rtpengine-gpu Change-Id: Ida33db035754763a6709bb0bcdc001e8764b88f9 (cherry picked from commit b3544bec2c7406486d3a03a3b9b65353092b5bf0) --- debian/control | 95 ++++++++++++++++++++++++++++- debian/generate-gpu-dh-fragments.sh | 28 +++++++++ debian/rules | 7 +++ pkg/deb/generator.sh | 3 +- 4 files changed, 130 insertions(+), 3 deletions(-) create mode 100755 debian/generate-gpu-dh-fragments.sh diff --git a/debian/control b/debian/control index dd4cee664..a2f0475ed 100644 --- a/debian/control +++ b/debian/control @@ -45,6 +45,7 @@ Build-Depends: libxmlrpc-core-c3-dev (>= 1.16.07), libxtables-dev (>= 1.4) | iptables-dev (>= 1.4), markdown, + ngcp-libcudecs-dev , pandoc, python3, python3-websockets, @@ -53,6 +54,7 @@ Testsuite: autopkgtest-pkg-dkms Package: ngcp-rtpengine-daemon Architecture: any +Build-Profiles: Multi-Arch: foreign Recommends: ngcp-rtpengine-perftest, @@ -74,8 +76,8 @@ Description: proxy for RTP and media streams used in NGCP, userspace part Package: ngcp-rtpengine-recording-daemon Architecture: any +Build-Profiles: Multi-Arch: foreign -Build-Profiles: Recommends: ngcp-rtpengine-utils, Suggests: @@ -100,6 +102,7 @@ Description: IPtables extension module for the kernel-space NGCP media proxy Package: ngcp-rtpengine Architecture: all +Build-Profiles: Multi-Arch: foreign Depends: ngcp-rtpengine-daemon (>= ${source:Version}), @@ -147,8 +150,8 @@ Description: scripts and Perl modules for NGCP rtpengine Package: ngcp-rtpengine-perftest Architecture: any +Build-Profiles: Multi-Arch: foreign -Build-Profiles: Depends: ngcp-rtpengine-perftest-data (= ${source:Version}), ${misc:Depends}, @@ -169,3 +172,91 @@ Description: helper tool to test rtpengine transcoding performance - data files base and produces performance and load statistics. . These are data files needed for the binary package. + +Package: ngcp-rtpengine-daemon-gpu +Architecture: any +Build-Profiles: +Multi-Arch: foreign +Conflicts: + ngcp-rtpengine-daemon, +Provides: + ngcp-rtpengine-daemon, +Recommends: + ngcp-rtpengine-perftest-gpu, + ngcp-rtpengine-recording-daemon-gpu, + ngcp-rtpengine-utils, +Suggests: + ngcp-system-tools, +Pre-Depends: + adduser, + ${misc:Pre-Depends}, +Depends: + iptables, + sysvinit-utils (>= 3.05-4~) | lsb-base (>= 3.0-6), + ${misc:Depends}, + ${shlibs:Depends}, +Description: proxy for RTP and media streams incl GPU transcoding, userspace part + This daemon handles the first stages of proxying media streams and talks to + the kernel part of the proxy for eventual high-performance packet forwarding. + This build includes support for GPU transcoding. + +Package: ngcp-rtpengine-recording-daemon-gpu +Architecture: any +Multi-Arch: foreign +Build-Profiles: +Conflicts: + ngcp-rtpengine-recording-daemon, +Provides: + ngcp-rtpengine-recording-daemon, +Recommends: + ngcp-rtpengine-utils, +Suggests: + ngcp-system-tools, +Depends: + nfs-common, + ngcp-rtpengine-daemon-gpu, + sysvinit-utils (>= 3.05-4~) | lsb-base (>= 3.0-6), + ${misc:Depends}, + ${shlibs:Depends}, +Description: recording daemon for RTP and media streams incl GPU transcodnig + This daemon handles the call recording (media intercept) component of rtpengine. + This build includes support for GPU transcoding. + +Package: ngcp-rtpengine-gpu +Architecture: all +Build-Profiles: +Multi-Arch: foreign +Conflicts: + ngcp-rtpengine, +Provides: + ngcp-rtpengine, +Depends: + ngcp-rtpengine-daemon-gpu (>= ${source:Version}), + ngcp-rtpengine-iptables (>= ${source:Version}), + ngcp-rtpengine-kernel-dkms (>= ${source:Version}), + ngcp-rtpengine-perftest-gpu (>= ${source:Version}), + ngcp-rtpengine-recording-daemon-gpu (>= ${source:Version}), + ngcp-rtpengine-utils (>= ${source:Version}), + ${misc:Depends}, +Description: NGCP RTP/media proxy incl GPU transcoding - meta package + This is a meta package for easy installation of all four parts of the NGCP + media proxy. It will install the user-space daemon, the kernel-space IPtables + module, the IPtables extension module and utility scripts. + This build includes support for GPU transcoding. + +Package: ngcp-rtpengine-perftest-gpu +Architecture: any +Multi-Arch: foreign +Build-Profiles: +Conflicts: + ngcp-rtpengine-perftest, +Provides: + ngcp-rtpengine-perftest, +Depends: + ngcp-rtpengine-perftest-data (= ${source:Version}), + ${misc:Depends}, + ${shlibs:Depends}, +Description: helper tool to test rtpengine transcoding performance incl GPU transcoding + This interactive tool simulates transcoding scenarios using the rtpengine code + base and produces performance and load statistics. + This build includes support for GPU transcoding. diff --git a/debian/generate-gpu-dh-fragments.sh b/debian/generate-gpu-dh-fragments.sh new file mode 100755 index 000000000..0bbe7ea81 --- /dev/null +++ b/debian/generate-gpu-dh-fragments.sh @@ -0,0 +1,28 @@ +#!/bin/bash +for pkg in ngcp-rtpengine-daemon ngcp-rtpengine-recording-daemon ngcp-rtpengine-perftest; do + for file in "$pkg".*; do + if test -f "$file"; then + suffix=${file#"$pkg".} + cp -v "$pkg"."$suffix" "$pkg"-gpu."$suffix" + fi + done + for file in "$pkg"@.*; do + if test -f "$file"; then + suffix=${file#"$pkg"@.} + cp -v "$pkg"@."$suffix" "$pkg"-gpu@."$suffix" + fi + done + if test -f "$pkg"-gpu.links; then + rm -vf "$pkg"-gpu.links.tmp + while read -r line; do + # rewrite link from original 'rtpengine-daemon.service -> ngcp-rtpengine-daemon.service' + # ... to 'rtpengine-daemon-gpu.service -> ngcp-rtpengine-daemon-gpu.service' + echo "$line" | sed 's/\(@\?\)\.service/-gpu\1.service/g' >> "$pkg"-gpu.links.tmp + # add link 'rtpengine-daemon.service -> ngcp-rtpengine-daemon-gpu.service' + echo "$line" | sed 's/\(@\?\)\.service/-gpu\1.service/' >> "$pkg"-gpu.links.tmp + # add link 'ngcp-rtpengine-daemon.service -> ngcp-rtpengine-daemon-gpu.service' + echo "$line" | sed 's/\(@\?\)\.service/-gpu\1.service/; s,system/rtpengine,system/ngcp-rtpengine,' >> "$pkg"-gpu.links.tmp + done < "$pkg"-gpu.links + mv -v "$pkg"-gpu.links.tmp "$pkg"-gpu.links + fi +done diff --git a/debian/rules b/debian/rules index 2b169749d..3a15e0b8d 100755 --- a/debian/rules +++ b/debian/rules @@ -28,6 +28,9 @@ export FIXTURES_PATH = /usr/share/rtpengine-perftest execute_before_dh_auto_configure: (cd debian && sh generate-systemd-templates.sh) +ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.ngcp-rtpengine.cudecs)) + (cd debian && ./generate-gpu-dh-fragments.sh) +endif execute_before_dh_auto_install-indep: # markdown README @@ -35,7 +38,11 @@ execute_before_dh_auto_install-indep: gzip -9 < README.md > debian/README.md.gz execute_after_dh_installsystemd: +ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.ngcp-rtpengine.cudecs)) + dh_installsystemd -pngcp-rtpengine-recording-daemon-gpu --name=ngcp-rtpengine-recording-nfs-mount +else dh_installsystemd -pngcp-rtpengine-recording-daemon --name=ngcp-rtpengine-recording-nfs-mount +endif override_dh_dkms: dh_dkms -p$(DEB_SOURCE)-kernel-dkms -V $(DEB_VERSION_UPSTREAM) diff --git a/pkg/deb/generator.sh b/pkg/deb/generator.sh index eb70647df..ba5cd3ccd 100755 --- a/pkg/deb/generator.sh +++ b/pkg/deb/generator.sh @@ -29,8 +29,9 @@ while read -r file; do rm "${file}" done < <(find debian -name '*links') -echo "- Remove NGCP packages from Suggests" +echo "- Remove NGCP packages from control" sed -i -e '/ngcp-system-tools/d' debian/control +sed -i -e '/ngcp-libcudecs/d' debian/control echo "- Set package-specific homepage" sed -i -e 's,^Homepage:.*,Homepage: https://rtpengine.com/,' debian/control