Commit aff11901 authored by sagar arora's avatar sagar arora

Rhel8.2 support

parent e34387d5
......@@ -25,21 +25,21 @@
#
#######################################
#SUPPORTED_DISTRO="Ubuntu 18.04, CentOS 7, RHEL 7"
SUPPORTED_DISTRO="Ubuntu 18.04"
SUPPORTED_DISTRO="Ubuntu 18.04,RHEL8"
if [ ! -f /etc/os-release ]; then
echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro."
fi
OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
case "$OS_DISTRO" in
fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;;
fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake3" ;;
rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac
IS_CONTAINER=`egrep -c "docker|kubepods" /proc/self/cgroup`
IS_CONTAINER=`egrep -c "docker|kubepods|podman" /proc/self/cgroup`
if [ $IS_CONTAINER -eq 0 ]
then
......@@ -128,7 +128,10 @@ check_supported_distribution() {
local distribution=$(get_distribution_release)
case "$distribution" in
"ubuntu18.04") return 0 ;;
#"rhel7") return 0 ;;
"rhel8") return 0 ;;
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
#"centos7") return 0 ;;
esac
return 1
......
......@@ -47,8 +47,26 @@ install_fb_folly_from_source(){
if [[ $prompt =~ [yY](es)* ]]
then
$SUDO apt-get install $OPTION \
if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
$SUDO $INSTALLER install $OPTION \
gcc-c++ \
$CMAKE \
boost-devel \
libevent-devel \
double-conversion-devel \
glog-devel \
gflags-devel \
snappy-devel \
make \
lz4-devel \
zlib-devel \
binutils-devel \
jemalloc-devel \
openssl-devel \
pkg-config
ret=$?;[[ $ret -ne 0 ]] && return $ret
elif [[ $OS_DISTRO == "ubuntu" ]]; then
$SUDO $INSTALLER install $OPTION \
g++ \
cmake \
libboost-all-dev \
......@@ -67,12 +85,13 @@ install_fb_folly_from_source(){
libssl-dev \
pkg-config
ret=$?;[[ $ret -ne 0 ]] && return $ret
fi
pushd /tmp
if [ $debug -eq 1 ]; then
# For advanced debugging options
$SUDO apt-get install $OPTION \
$SUDO $INSTALLER install $OPTION \
libunwind8-dev \
libelf-dev \
libdwarf-dev
......@@ -82,7 +101,7 @@ install_fb_folly_from_source(){
tar zxf release-1.8.0.tar.gz && \
rm -f release-1.8.0.tar.gz && \
cd googletest-release-1.8.0 && \
cmake . && \
$CMAKE . && \
make && \
$SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
......@@ -94,9 +113,32 @@ install_fb_folly_from_source(){
git clone https://github.com/facebook/folly.git
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
cd folly
if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
git checkout -f v2019.06.17.00
echo 'diff --git a/build/fbcode_builder/CMake/FindGflags.cmake b/build/fbcode_builder/CMake/FindGflags.cmake' > patch.diff
echo 'index 246ceac..3b96716 100644' >> patch.diff
echo '--- a/build/fbcode_builder/CMake/FindGflags.cmake' >> patch.diff
echo '+++ b/build/fbcode_builder/CMake/FindGflags.cmake' >> patch.diff
echo '@@ -34,6 +34,9 @@ IF (LIBGFLAGS_INCLUDE_DIR)' >> patch.diff
echo ' ENDIF ()' >> patch.diff
echo '' >> patch.diff
echo ' find_package(gflags CONFIG QUIET)' >> patch.diff
echo '+get_filename_component (_LIB_PATH "${gflags_CONFIG}/../../../" ABSOLUTE)' >> patch.diff
echo '+unset(gflags_LIBRARIES)' >> patch.diff
echo '+find_library(gflags_LIBRARIES gflags PATHS ${_LIB_PATH})' >> patch.diff
echo ' if (gflags_FOUND)' >> patch.diff
echo ' if (NOT Gflags_FIND_QUIETLY)' >> patch.diff
echo ' message(STATUS "Found gflags from package config ${gflags_CONFIG}")' >> patch.diff
git apply patch.diff
else
git checkout -f v2019.11.11.00
fi
mkdir _build && cd _build
if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
cmake3 ..
else
cmake ..
fi
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make -j $(nproc)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
......@@ -104,6 +146,7 @@ install_fb_folly_from_source(){
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
echo_success "End of folly installation"
return 0
}
......@@ -57,7 +57,7 @@ install_fmt() {
cd fmt
# Looks like since Nov 11 commits, we cannot build
git checkout -f 1936dddc3c53c1c0db55a665cf419dc7a257ba62
cmake -DFMT_TEST=FALSE .
$CMAKE -DFMT_TEST=FALSE .
ret=$?;[[ $ret -ne 0 ]] && return $ret
make -j `nproc`
ret=$?;[[ $ret -ne 0 ]] && return $ret
......@@ -140,7 +140,7 @@ install_pistache_from_git() {
cd pistache && git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
$CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
......@@ -188,7 +188,7 @@ install_nlohmann_from_git() {
cd json && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF ..
$CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
......@@ -219,7 +219,8 @@ install_nghttp2_from_git() {
if [[ $prompt =~ [yY](es)* ]]
then
$SUDO apt-get install $OPTION \
if [[ $OS_DISTRO == "ubuntu" ]]; then
PACKAGE_LIST="\
g++ \
cmake \
binutils \
......@@ -232,7 +233,25 @@ install_nghttp2_from_git() {
libcunit1-dev \
libssl-dev \
libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \
libjemalloc-dev libsystemd-dev cython python3-dev python-setuptools
libjemalloc-dev libsystemd-dev cython python3-dev python-setuptools"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\
gcc-c++ \
binutils-devel \
autoconf \
automake \
libtool \
pkg-config \
zlib-devel \
CUnit-devel \
openssl-devel \
libxml2-devel libev-devel libevent-devel jansson-devel c-ares-devel \
jemalloc-devel systemd-devel python3-Cython python3-devel python3-setuptools"
else
echo_fatal "$OS_DISTRO is not a supported distribution."
fi
echo "Install build tools"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
GIT_URL=https://github.com/nghttp2/nghttp2.git
......@@ -288,18 +307,31 @@ install_cpp_jwt_from_git() {
if [[ $prompt =~ [yY](es)* ]]
then
$SUDO apt-get install $OPTION \
if [[ $OS_DISTRO == "ubuntu" ]]; then
PACKAGE_LIST="\
libgtest-dev \
libssl-dev
libssl-dev"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\
gtest-devel \
openssl-devel"
else
echo_fatal "$OS_DISTRO is not a supported distribution."
fi
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
#install libgtest
#install libgtest
if [[ $OS_DISTRO == "ubuntu" ]]; then
echo "Building the gtest library"
pushd $OPENAIRCN_DIR/build/ext
cd /usr/src/gtest
$SUDO cmake CMakeLists.txt
$SUDO $CMAKE CMakeLists.txt
$SUDO make
$SUDO cp *.a /usr/lib
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
GIT_URL=https://github.com/arun11299/cpp-jwt.git
echo "Install Cpp-jwt from $GIT_URL"
......@@ -315,7 +347,7 @@ install_cpp_jwt_from_git() {
cd cpp-jwt && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build
cmake ..
$CMAKE ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
......@@ -425,7 +457,6 @@ check_install_nrf_deps() {
libconfig-devel \
libgcrypt-devel \
gmp-devel \
libidn2-devel \
libidn-devel \
lksctp-tools \
lksctp-tools-devel \
......@@ -435,7 +466,9 @@ check_install_nrf_deps() {
libxml2-devel \
openssl \
check \
python \
nettle-devel \
libcurl-devel \
python2 \
pkgconfig"
else
echo_fatal "$OS_DISTRO is not a supported distribution."
......
......@@ -28,12 +28,17 @@
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest AS oai-nrf-builder
ARG NEEDED_GIT_PROXY
#Build inside cluster
COPY ./etc-pki-entitlement /etc/pki/entitlement
COPY ./rhsm-conf /etc/rhsm
COPY ./rhsm-ca /etc/rhsm/ca
COPY tmp/ca/redhat-uep.pem /etc/rhsm/ca
COPY tmp/entitlement/*.pem /etc/pki/entitlement
# Build outside cluster
#COPY tmp/ca/redhat-uep.pem /etc/rhsm/ca
#COPY tmp/entitlement/*.pem /etc/pki/entitlement
RUN rm -f /etc/rhsm-host && \
yum repolist --disablerepo=* && \
......@@ -43,6 +48,7 @@ RUN rm -f /etc/rhsm-host && \
psmisc \
git \
diffutils \
libasan\
file && \
rm -rf /var/lib/apt/lists/*
......@@ -71,6 +77,7 @@ RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \
psmisc \
net-tools \
procps-ng\
libevent && \
rm -rf /var/lib/apt/lists/*
......@@ -85,10 +92,16 @@ COPY --from=oai-nrf-builder /usr/lib64/libdouble-conversion.so.1 /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libconfig++.so.9 /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libboost_system.so.1.66.0 /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libboost_thread.so.1.66.0 /usr/lib64/
COPY --from=oai-nrf-builder /openair-nrf/build/nrf/build/nas/libNAS.so /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libboost_filesystem.so.1.66.0 /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libboost_chrono.so.1.66.0 /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libboost_atomic.so.1.66.0 /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libboost_date_time.so.1.66.0 /usr/lib64/
COPY --from=oai-nrf-builder /usr/lib64/libboost_regex.so.1.66.0 /usr/lib64/
COPY --from=oai-nrf-builder /openair-nrf/scripts/entrypoint.sh entrypoint.sh
RUN ldconfig
# Copying template configuration files
# The configuration folder will be flat
WORKDIR /openair-nrf/etc
......@@ -99,6 +112,6 @@ WORKDIR /openair-nrf
# expose ports
EXPOSE 80/tcp 9090/tcp
CMD ["/openair-nrf/bin/oai_nrf", "-c", "/openair-nrf/etc/nrf.conf", "-o"]
ENTRYPOINT ["/openair-nrf/bin/entrypoint.sh"]
CMD ["/openair-nrf/bin/oai_nrf", "-c", "/openair-nrf/etc/nrf.conf", "-o"]
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: oai-nrf
spec:
lookupPolicy:
local: true
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: "oai-nrf"
spec:
runPolicy: "Serial"
source:
type: "Binary"
secrets:
- secret:
name: etc-pki-entitlement
destinationDir: etc-pki-entitlement
configMaps:
- configMap:
name: rhsm-conf
destinationDir: rhsm-conf
- configMap:
name: rhsm-ca
destinationDir: rhsm-ca
strategy:
dockerStrategy:
dockerfilePath: "docker/Dockerfile.nrf.rhel8.2"
buildArgs:
- name: "NEEDED_GIT_PROXY"
value: "http://proxy.eurecom.fr:8080"
output:
to:
kind: "ImageStreamTag"
name: "oai-nrf:develop"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment