Skip to content

Commit

Permalink
doc update: installation on Ubuntu 22 Jammy Jellyfish. (#27)
Browse files Browse the repository at this point in the history
* doc update: installation on Ubuntu 22 Jammy Jellyfish.

Signed-off-by: Tomoya.Fujita <[email protected]>

* minor doc adjustment for Jammy support.

Signed-off-by: Tomoya Fujita <[email protected]>

* update .github/workflows build to support Jammy.

Signed-off-by: Tomoya Fujita <[email protected]>

---------

Signed-off-by: Tomoya.Fujita <[email protected]>
Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya authored Jan 22, 2024
1 parent 43cee8b commit 2567094
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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
Expand Down
54 changes: 38 additions & 16 deletions document/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -50,18 +65,25 @@ 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

- Install

```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`.
Expand All @@ -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
```
10 changes: 9 additions & 1 deletion scripts/build-verification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 2567094

Please sign in to comment.