Skip to content

Commit

Permalink
enh(build): libssl, zlib and some others are taken from the OS now.
Browse files Browse the repository at this point in the history
* enh(cmake): conan replaced by vcpkg
* doc(README): installation procedure updated

REFS: MON-34051
  • Loading branch information
bouda1 authored Feb 28, 2024
1 parent c4f613b commit de7b1b4
Show file tree
Hide file tree
Showing 176 changed files with 2,173 additions and 1,498 deletions.
23 changes: 14 additions & 9 deletions .github/docker/Dockerfile.centreon-collect-alma8
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,36 @@ dnf install -y cmake \
python38-pip \
perl-Thread-Queue \
redhat-lsb \
rpm-build \
rrdtool-devel \
selinux-policy-devel \
yum-utils \
perl \
rpm-build \
zstd \
nfpm \
openssl-devel \
libssh2-devel \
libcurl-devel \
zlib-devel \
sudo

dnf update libarchive

dnf clean all

pip3 install conan==1.61.0 --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default
git clone --depth 1 -b 2024.01.12 https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
mkdir /src

EOF

COPY conanfile.txt .
COPY vcpkg.json /src
COPY overlays /overlays
COPY custom-triplets /custom-triplets

RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
export VCPKG_ROOT=/vcpkg
export PATH=\$VCPKG_ROOT:\$PATH

/vcpkg/vcpkg install --overlay-triplets=custom-triplets --triplet x64-linux-release --vcpkg-root vcpkg --x-wait-for-lock --x-manifest-root=/src --x-install-root=vcpkg_installed --overlay-ports=overlays

EOF

Expand Down
23 changes: 14 additions & 9 deletions .github/docker/Dockerfile.centreon-collect-alma9
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,35 @@ dnf --best install -y cmake \
python3 \
python3-pip \
perl-Thread-Queue \
rpm-build \
rrdtool-devel \
selinux-policy-devel \
yum-utils \
perl \
rpm-build \
procps-ng \
zstd \
nfpm \
openssl-devel \
libssh2-devel \
libcurl-devel \
zlib-devel \
sudo

dnf clean all

pip3 install conan==1.61.0 --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default
git clone --depth 1 -b 2024.01.12 https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
mkdir /src

EOF

COPY conanfile.txt .
COPY vcpkg.json /src
COPY overlays /overlays
COPY custom-triplets /custom-triplets

RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
export VCPKG_ROOT=/vcpkg
export PATH=\$VCPKG_ROOT:\$PATH

/vcpkg/vcpkg install --overlay-triplets=custom-triplets --triplet x64-linux-release --vcpkg-root vcpkg --x-wait-for-lock --x-manifest-root=/src --x-install-root=vcpkg_installed --overlay-ports=overlays

EOF

Expand Down
1 change: 0 additions & 1 deletion .github/docker/Dockerfile.centreon-collect-alma9-test
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ cd /tmp/collect
/bin/rm -rf /tmp/collect

EOF

40 changes: 32 additions & 8 deletions .github/docker/Dockerfile.centreon-collect-debian-bookworm
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/debian:bookworm

ENV DEBIAN_FRONTEND noninteractive

ARG TRIPLET

RUN bash -e <<EOF

apt-get update

apt-get -y install cmake \
git \
apt-get -y install git \
cmake \
curl \
gcc \
g++ \
Expand All @@ -25,34 +29,54 @@ apt-get -y install cmake \
libperl-dev \
libgcrypt20-dev \
aptitude \
git-buildpackage \
fakeroot \
strace \
locales \
rrdtool \
rrdcached \
zstd \
libssl-dev \
libssh2-1-dev \
zlib1g-dev \
zip \
libcurl4-openssl-dev \
sudo

echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list

apt-get update
apt-get install -y nfpm

apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
EOF

pip3 install --break-system-packages conan==1.61.0
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default
RUN bash -e <<EOF
if [ "${TRIPLET}" = "arm64-linux" ] ; then
export VCPKG_FORCE_SYSTEM_BINARIES=1
fi

cd /
git clone --depth 1 -b 2024.01.12 https://github.com/Microsoft/vcpkg.git
/vcpkg/bootstrap-vcpkg.sh
mkdir /src
EOF

COPY conanfile.txt .
COPY vcpkg.json /src
COPY overlays /overlays
COPY custom-triplets /custom-triplets

RUN bash -e <<EOF
if [ "${TRIPLET}" = "arm64-linux" ] ; then
export VCPKG_FORCE_SYSTEM_BINARIES=1
fi

export VCPKG_ROOT=/vcpkg
export PATH=\$VCPKG_ROOT:\$PATH

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build='missing'
/vcpkg/vcpkg install --overlay-triplets=custom-triplets --triplet ${TRIPLET}-release --vcpkg-root vcpkg --x-wait-for-lock --x-manifest-root=/src --x-install-root=vcpkg_installed --overlay-ports=overlays

EOF

Expand Down
37 changes: 29 additions & 8 deletions .github/docker/Dockerfile.centreon-collect-debian-bullseye
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ARG REGISTRY_URL

FROM ${REGISTRY_URL}/debian:bullseye
ARG TRIPLET

RUN bash -e <<EOF

apt-get update

apt-get -y install cmake \
git \
apt-get -y install git \
curl \
gcc \
g++ \
Expand All @@ -32,28 +32,49 @@ apt-get -y install cmake \
rrdtool \
rrdcached \
zstd \
libssl-dev \
libssh2-1-dev \
zlib1g-dev \
zip \
libcurl4-openssl-dev \
sudo

echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
echo 'deb http://deb.debian.org/debian bullseye-backports main contrib' | tee -a /etc/apt/sources.list

apt-get update
apt-get install -y nfpm
apt-get install -y -t bullseye-backports cmake

apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
EOF

pip3 install conan==1.61.0
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default
RUN bash -e <<EOF
if [ "${TRIPLET}" = "arm64-linux" ] ; then
export VCPKG_FORCE_SYSTEM_BINARIES=1
fi

cd /
git clone --depth 1 -b 2024.01.12 https://github.com/Microsoft/vcpkg.git
/vcpkg/bootstrap-vcpkg.sh
mkdir /src
EOF

COPY conanfile.txt .
COPY vcpkg.json /src
COPY overlays /overlays
COPY custom-triplets /custom-triplets

RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build='missing'
export VCPKG_ROOT=/vcpkg
export PATH=\$VCPKG_ROOT:\$PATH

if [ "${TRIPLET}" = "arm64-linux" ] ; then
export VCPKG_FORCE_SYSTEM_BINARIES=1
fi
/vcpkg/vcpkg install --overlay-triplets=custom-triplets --triplet ${TRIPLET}-release --vcpkg-root vcpkg --x-wait-for-lock --x-manifest-root=/src --x-install-root=vcpkg_installed --overlay-ports=overlays

EOF

Expand Down
23 changes: 14 additions & 9 deletions .github/docker/Dockerfile.centreon-collect-mysql-alma9
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,34 @@ dnf --best install -y cmake \
python3 \
python3-pip \
perl-Thread-Queue \
rpm-build \
rrdtool-devel \
yum-utils \
perl \
rpm-build \
procps-ng \
zstd \
nfpm \
openssl-devel \
libssh2-devel \
libcurl-devel \
zlib-devel \
sudo

dnf clean all

pip3 install conan==1.61.0 --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default
git clone -b 2024.01.12 https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
mkdir /src

EOF

COPY conanfile.txt .
COPY vcpkg.json /src
COPY overlays /overlays
COPY custom-triplets /custom-triplets

RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
export VCPKG_ROOT=/vcpkg
export PATH=\$VCPKG_ROOT:\$PATH

vcpkg/vcpkg install --overlay-triplets=custom-triplets --triplet x64-linux-release --vcpkg-root vcpkg --x-wait-for-lock --x-manifest-root=/src --x-install-root=vcpkg_installed --overlay-ports=overlays

EOF

Expand Down
30 changes: 24 additions & 6 deletions .github/docker/Dockerfile.centreon-collect-ubuntu-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/ubuntu:jammy

ENV DEBIAN_FRONTEND noninteractive

RUN bash -e <<EOF

apt-get update

apt-get install -y --no-install-recommends tzdata

apt-get -y install cmake \
git \
curl \
Expand All @@ -25,12 +29,18 @@ apt-get -y install cmake \
libperl-dev \
libgcrypt20-dev \
aptitude \
git-buildpackage \
fakeroot \
strace \
locales \
rrdtool \
rrdcached \
zstd \
libssl-dev \
libssh2-1-dev \
zlib1g-dev \
zip \
libcurl4-openssl-dev \
sudo

echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
Expand All @@ -41,18 +51,26 @@ apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

pip3 install conan==1.61.0
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default
git clone --depth 1 -b 2024.01.12 https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
mkdir /src

EOF

COPY conanfile.txt .
COPY vcpkg.json /src
COPY overlays /overlays
COPY custom-triplets /custom-triplets

ARG TRIPLET
RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build='missing'
export VCPKG_ROOT=/vcpkg
export PATH=$VCPKG_ROOT:$PATH

if [ "${TRIPLET}" = "arm64-linux" ] ; then
export VCPKG_FORCE_SYSTEM_BINARIES=1
fi
vcpkg/vcpkg install --overlay-triplets=custom-triplets --triplet ${TRIPLET}-release --vcpkg-root vcpkg --x-wait-for-lock --x-manifest-root=/src --x-install-root=vcpkg_installed --overlay-ports=overlays

EOF

Expand Down
19 changes: 9 additions & 10 deletions .github/scripts/collect-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@
set -e

#Cmake
rm -rf /src/build
mkdir /src/build
cd /src/build/
cd /src
export VCPKG_ROOT=/vcpkg
export PATH=$VCPKG_ROOT:$PATH

conan install .. -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing

OS_ID=$(cat /etc/issue | awk '{print $1}')
OS_ID=$(awk '{print $1}' /etc/issue)
if [[ "$OS_ID" == "Debian" || "$OS_ID" == "Ubuntu" ]] ; then
CXXFLAGS="-Wall -Wextra" cmake -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -DNG=On ..
CXXFLAGS="-Wall -Wextra" cmake -B build -DVCPKG_OVERLAY_TRIPLETS=/custom-triplets -DVCPKG_TARGET_TRIPLET=x64-linux-release -DVCPKG_OVERLAY_PORTS=/overlays -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -S .
else
CXXFLAGS="-Wall -Wextra" cmake3 -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -DNG=On ..
CXXFLAGS="-Wall -Wextra" cmake -B build -GNinja -DVCPKG_OVERLAY_TRIPLETS=/custom-triplets -DVCPKG_OVERLAY_PORTS=/overlays -DVCPKG_TARGET_TRIPLET=x64-linux-release -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -S .
fi

#Build
ninja -j 8
ninja -j 8 install
ninja -Cbuild -j8
ninja -Cbuild -j8 install

#Test

cd build
tests/ut_broker --gtest_output=xml:ut_broker.xml
tests/ut_engine --gtest_output=xml:ut_engine.xml
tests/ut_clib --gtest_output=xml:ut_clib.xml
Expand Down
Loading

0 comments on commit de7b1b4

Please sign in to comment.