diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97f9bed..32bfcfc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-20.04, ubuntu-22.04] steps: - name: Check out repository code diff --git a/document/installation.md b/document/installation.md index 63723d0..6d95d57 100644 --- a/document/installation.md +++ b/document/installation.md @@ -2,27 +2,40 @@ ## Requirements / Dependency -### System +### Supported System -It could be working the following versions or latter, but not recommended to be used except following specific versions since it does not verify with other versions. - -- Ubuntu: 20.04 Focal Fossa -- [SRT v1.4.0](https://github.com/Haivision/srt/releases/tag/v1.4.0) +- [Ubuntu 20.04 Focal Fossa](https://releases.ubuntu.com/focal/) +- [Ubuntu 22.04 Jammy Jellyfish](https://releases.ubuntu.com/jammy/) ### Prerequisites -The following packages are required to install. +The following packages are required to install as common. ```bash apt update apt upgrade -y -apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zlib1g-dev git libsrt-dev libyaml-cpp-dev +apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zlib1g-dev git libyaml-cpp-dev +``` + +- Ubuntu 20.04 + +```bash +apt install -y libsrt-dev libsrt-doc +``` + +- Ubuntu 22.04 + +```bash +apt install -y libsrt-openssl-dev libsrt-doc ``` ### Dependent Packages - [prometheus-cpp](https://github.com/jupp0r/prometheus-cpp) library + > [!NOTE] + > `prometheus-cpp` debian package is supported on ubuntu 23 or later. see more details for https://github.com/Haivision/srt-prometheus-exporter/issues/11. + ```bash git clone https://github.com/jupp0r/prometheus-cpp cd prometheus-cpp @@ -32,16 +45,18 @@ apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zl cd _build cmake .. -DBUILD_SHARED_LIBS=ON make -j 4 - sudo make install + make install ``` Check if the following libraries are installed as expectedly. ```bash ls /usr/local/lib/libprometheus-cpp* - /usr/local/lib/libprometheus-cpp-core.so /usr/local/lib/libprometheus-cpp-pull.so /usr/local/lib/libprometheus-cpp-push.so - /usr/local/lib/libprometheus-cpp-core.so.1.1 /usr/local/lib/libprometheus-cpp-pull.so.1.1 /usr/local/lib/libprometheus-cpp-push.so.1.1 - /usr/local/lib/libprometheus-cpp-core.so.1.1.0 /usr/local/lib/libprometheus-cpp-pull.so.1.1.0 /usr/local/lib/libprometheus-cpp-push.so.1.1.0 + /usr/local/lib/libprometheus-cpp-core.so /usr/local/lib/libprometheus-cpp-pull.so.1.2.0 + /usr/local/lib/libprometheus-cpp-core.so.1.2 /usr/local/lib/libprometheus-cpp-push.so + /usr/local/lib/libprometheus-cpp-core.so.1.2.0 /usr/local/lib/libprometheus-cpp-push.so.1.2 + /usr/local/lib/libprometheus-cpp-pull.so /usr/local/lib/libprometheus-cpp-push.so.1.2.0 + /usr/local/lib/libprometheus-cpp-pull.so.1.2 ``` Set `/usr/local/lib` to `LD_LIBRARY_PATH` environmental variable to avoid dynamic link error. @@ -50,10 +65,17 @@ apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zl export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ``` -- SRT library (If necessary) +- SRT library version compatibility + + ```bash + dpkg -l | grep libsrt + ii libsrt-doc 1.4.4-4 all Secure Reliable Transport UDP streaming library (documentation) + ii libsrt-openssl-dev:amd64 1.4.4-4 amd64 Secure Reliable Transport UDP streaming library (OpenSSL flavour development) + ii libsrt1.4-openssl:amd64 1.4.4-4 amd64 Secure Reliable Transport UDP streaming library (OpenSSL flavour) + ``` - The stable version can be installed with `apt install libsrt-dev` on `Ubuntu 20.04` version is `v1.4.0`. - **If SRT library is compiled from code, be sure that the code is reset to tag `v1.4.0`. Otherwise, srt_exporter library compiled would not work with installed SRT library on other devices. Make sure that SRT Exporter library is built and running based on the same version of SRT library.** + > [!NOTE] + > **If SRT library is compiled from code, be sure that the code is aligned with tag `v1.4.X`. Otherwise, srt_exporter library would not get successfully compiled with installed SRT library.** ### Build and Install @@ -61,7 +83,7 @@ apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zl ```bash cd srt-prometheus-exporter - sudo make + make ``` `libsrtexp.so` will be compiled and installed to `/usr/local/lib`, and related header files will be installed in `/usr/local/include/srtexp`. @@ -70,5 +92,5 @@ apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zl ```bash cd srt-prometheus-exporter - sudo make clean + make clean ``` diff --git a/scripts/build-verification.sh b/scripts/build-verification.sh index 7e48234..0cb968d 100755 --- a/scripts/build-verification.sh +++ b/scripts/build-verification.sh @@ -34,7 +34,15 @@ function install_prerequisites () { trap exit_trap ERR echo "[${FUNCNAME[0]}]: update and install dependent packages." apt update && apt upgrade -y - apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zlib1g-dev git libsrt-dev libyaml-cpp-dev libsrt-dev + apt install -y g++ curl cmake pkg-config libcurl4-openssl-dev build-essential zlib1g-dev git libyaml-cpp-dev + if [[ $(lsb_release -rs) == "20.04" ]]; then + apt install -y libsrt-dev libsrt-dev + elif [[ $(lsb_release -rs) == "22.04" ]]; then + apt install -y libsrt-openssl-dev libsrt-doc + else + echo "CI is running on unsupported platform, trying to install SRT libs with wildcard." + apt install -y libsrt-* + fi cd $there }