Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc update: installation on Ubuntu 22 Jammy Jellyfish. #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately we still need to build the prometheus-cpp client library with ubuntu 22.04.


```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.**
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having the semantic version control should be able to be compatible with any patch releases. that means, as long as that SRT version is v1.4.X, that should be compatible with other libraries.


### 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