Commit aff11901 authored by sagar arora's avatar sagar arora

Rhel8.2 support

parent e34387d5
...@@ -25,21 +25,21 @@ ...@@ -25,21 +25,21 @@
# #
####################################### #######################################
#SUPPORTED_DISTRO="Ubuntu 18.04, CentOS 7, RHEL 7" #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 if [ ! -f /etc/os-release ]; then
echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro." echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro."
fi fi
OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g") 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") OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
case "$OS_DISTRO" in 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" ;; rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac 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 ] if [ $IS_CONTAINER -eq 0 ]
then then
...@@ -128,7 +128,10 @@ check_supported_distribution() { ...@@ -128,7 +128,10 @@ check_supported_distribution() {
local distribution=$(get_distribution_release) local distribution=$(get_distribution_release)
case "$distribution" in case "$distribution" in
"ubuntu18.04") return 0 ;; "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 ;; #"centos7") return 0 ;;
esac esac
return 1 return 1
......
...@@ -47,32 +47,51 @@ install_fb_folly_from_source(){ ...@@ -47,32 +47,51 @@ install_fb_folly_from_source(){
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
$SUDO apt-get install $OPTION \ $SUDO $INSTALLER install $OPTION \
g++ \ gcc-c++ \
cmake \ $CMAKE \
libboost-all-dev \ boost-devel \
libevent-dev \ libevent-devel \
libdouble-conversion-dev \ double-conversion-devel \
libgoogle-glog-dev \ glog-devel \
libgflags-dev \ gflags-devel \
libiberty-dev \ snappy-devel \
liblz4-dev \ make \
liblzma-dev \ lz4-devel \
libsnappy-dev \ zlib-devel \
make \ binutils-devel \
zlib1g-dev \ jemalloc-devel \
binutils-dev \ openssl-devel \
libjemalloc-dev \ pkg-config
libssl-dev \ ret=$?;[[ $ret -ne 0 ]] && return $ret
pkg-config elif [[ $OS_DISTRO == "ubuntu" ]]; then
ret=$?;[[ $ret -ne 0 ]] && return $ret $SUDO $INSTALLER install $OPTION \
g++ \
cmake \
libboost-all-dev \
libevent-dev \
libdouble-conversion-dev \
libgoogle-glog-dev \
libgflags-dev \
libiberty-dev \
liblz4-dev \
liblzma-dev \
libsnappy-dev \
make \
zlib1g-dev \
binutils-dev \
libjemalloc-dev \
libssl-dev \
pkg-config
ret=$?;[[ $ret -ne 0 ]] && return $ret
fi
pushd /tmp pushd /tmp
if [ $debug -eq 1 ]; then if [ $debug -eq 1 ]; then
# For advanced debugging options # For advanced debugging options
$SUDO apt-get install $OPTION \ $SUDO $INSTALLER install $OPTION \
libunwind8-dev \ libunwind8-dev \
libelf-dev \ libelf-dev \
libdwarf-dev libdwarf-dev
...@@ -82,7 +101,7 @@ install_fb_folly_from_source(){ ...@@ -82,7 +101,7 @@ install_fb_folly_from_source(){
tar zxf release-1.8.0.tar.gz && \ tar zxf release-1.8.0.tar.gz && \
rm -f release-1.8.0.tar.gz && \ rm -f release-1.8.0.tar.gz && \
cd googletest-release-1.8.0 && \ cd googletest-release-1.8.0 && \
cmake . && \ $CMAKE . && \
make && \ make && \
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
...@@ -94,9 +113,32 @@ install_fb_folly_from_source(){ ...@@ -94,9 +113,32 @@ install_fb_folly_from_source(){
git clone https://github.com/facebook/folly.git git clone https://github.com/facebook/folly.git
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
cd folly cd folly
git checkout -f v2019.11.11.00 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 mkdir _build && cd _build
cmake .. if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
cmake3 ..
else
cmake ..
fi
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make -j $(nproc) make -j $(nproc)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
...@@ -104,6 +146,7 @@ install_fb_folly_from_source(){ ...@@ -104,6 +146,7 @@ install_fb_folly_from_source(){
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd popd
fi fi
echo_success "End of folly installation"
return 0 return 0
} }
...@@ -57,7 +57,7 @@ install_fmt() { ...@@ -57,7 +57,7 @@ install_fmt() {
cd fmt cd fmt
# Looks like since Nov 11 commits, we cannot build # Looks like since Nov 11 commits, we cannot build
git checkout -f 1936dddc3c53c1c0db55a665cf419dc7a257ba62 git checkout -f 1936dddc3c53c1c0db55a665cf419dc7a257ba62
cmake -DFMT_TEST=FALSE . $CMAKE -DFMT_TEST=FALSE .
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
make -j `nproc` make -j `nproc`
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
...@@ -140,7 +140,7 @@ install_pistache_from_git() { ...@@ -140,7 +140,7 @@ install_pistache_from_git() {
cd pistache && git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907 cd pistache && git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build 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 ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
...@@ -188,7 +188,7 @@ install_nlohmann_from_git() { ...@@ -188,7 +188,7 @@ install_nlohmann_from_git() {
cd json && git checkout master cd json && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build 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 ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
...@@ -219,20 +219,39 @@ install_nghttp2_from_git() { ...@@ -219,20 +219,39 @@ install_nghttp2_from_git() {
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
$SUDO apt-get install $OPTION \ if [[ $OS_DISTRO == "ubuntu" ]]; then
g++ \ PACKAGE_LIST="\
cmake \ g++ \
binutils \ cmake \
autoconf \ binutils \
automake \ autoconf \
autotools-dev \ automake \
libtool \ autotools-dev \
pkg-config \ libtool \
zlib1g-dev \ pkg-config \
libcunit1-dev \ zlib1g-dev \
libssl-dev \ libcunit1-dev \
libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \ libssl-dev \
libjemalloc-dev libsystemd-dev cython python3-dev python-setuptools libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \
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 ret=$?;[[ $ret -ne 0 ]] && return $ret
GIT_URL=https://github.com/nghttp2/nghttp2.git GIT_URL=https://github.com/nghttp2/nghttp2.git
...@@ -288,19 +307,32 @@ install_cpp_jwt_from_git() { ...@@ -288,19 +307,32 @@ install_cpp_jwt_from_git() {
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
$SUDO apt-get install $OPTION \ if [[ $OS_DISTRO == "ubuntu" ]]; then
libgtest-dev \ PACKAGE_LIST="\
libssl-dev libgtest-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 ret=$?;[[ $ret -ne 0 ]] && return $ret
#install libgtest
pushd $OPENAIRCN_DIR/build/ext #install libgtest
cd /usr/src/gtest if [[ $OS_DISTRO == "ubuntu" ]]; then
$SUDO cmake CMakeLists.txt echo "Building the gtest library"
$SUDO make pushd $OPENAIRCN_DIR/build/ext
$SUDO cp *.a /usr/lib cd /usr/src/gtest
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret $SUDO $CMAKE CMakeLists.txt
popd $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 GIT_URL=https://github.com/arun11299/cpp-jwt.git
echo "Install Cpp-jwt from $GIT_URL" echo "Install Cpp-jwt from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext pushd $OPENAIRCN_DIR/build/ext
...@@ -315,7 +347,7 @@ install_cpp_jwt_from_git() { ...@@ -315,7 +347,7 @@ install_cpp_jwt_from_git() {
cd cpp-jwt && git checkout master cd cpp-jwt && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build mkdir _build && cd _build
cmake .. $CMAKE ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
...@@ -425,7 +457,6 @@ check_install_nrf_deps() { ...@@ -425,7 +457,6 @@ check_install_nrf_deps() {
libconfig-devel \ libconfig-devel \
libgcrypt-devel \ libgcrypt-devel \
gmp-devel \ gmp-devel \
libidn2-devel \
libidn-devel \ libidn-devel \
lksctp-tools \ lksctp-tools \
lksctp-tools-devel \ lksctp-tools-devel \
...@@ -435,7 +466,9 @@ check_install_nrf_deps() { ...@@ -435,7 +466,9 @@ check_install_nrf_deps() {
libxml2-devel \ libxml2-devel \
openssl \ openssl \
check \ check \
python \ nettle-devel \
libcurl-devel \
python2 \
pkgconfig" pkgconfig"
else else
echo_fatal "$OS_DISTRO is not a supported distribution." echo_fatal "$OS_DISTRO is not a supported distribution."
......
...@@ -28,12 +28,17 @@ ...@@ -28,12 +28,17 @@
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# BUILDER IMAGE # BUILDER IMAGE
#--------------------------------------------------------------------- #---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest AS oai-nrf-builder 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 # Build outside cluster
COPY tmp/entitlement/*.pem /etc/pki/entitlement #COPY tmp/ca/redhat-uep.pem /etc/rhsm/ca
#COPY tmp/entitlement/*.pem /etc/pki/entitlement
RUN rm -f /etc/rhsm-host && \ RUN rm -f /etc/rhsm-host && \
yum repolist --disablerepo=* && \ yum repolist --disablerepo=* && \
...@@ -43,6 +48,7 @@ RUN rm -f /etc/rhsm-host && \ ...@@ -43,6 +48,7 @@ RUN rm -f /etc/rhsm-host && \
psmisc \ psmisc \
git \ git \
diffutils \ diffutils \
libasan\
file && \ file && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
...@@ -71,6 +77,7 @@ RUN yum update -y && \ ...@@ -71,6 +77,7 @@ RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \ yum install -y --enablerepo="ubi-8-codeready-builder" \
psmisc \ psmisc \
net-tools \ net-tools \
procps-ng\
libevent && \ libevent && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
...@@ -85,10 +92,16 @@ COPY --from=oai-nrf-builder /usr/lib64/libdouble-conversion.so.1 /usr/lib64/ ...@@ -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/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_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 /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 COPY --from=oai-nrf-builder /openair-nrf/scripts/entrypoint.sh entrypoint.sh
RUN ldconfig
# Copying template configuration files # Copying template configuration files
# The configuration folder will be flat # The configuration folder will be flat
WORKDIR /openair-nrf/etc WORKDIR /openair-nrf/etc
...@@ -99,6 +112,6 @@ WORKDIR /openair-nrf ...@@ -99,6 +112,6 @@ WORKDIR /openair-nrf
# expose ports # expose ports
EXPOSE 80/tcp 9090/tcp EXPOSE 80/tcp 9090/tcp
CMD ["/openair-nrf/bin/oai_nrf", "-c", "/openair-nrf/etc/nrf.conf", "-o"] ENTRYPOINT ["/openair-nrf/bin/entrypoint.sh"]
ENTRYPOINT ["/openair-nrf/bin/entrypoint.sh"] CMD ["/openair-nrf/bin/oai_nrf", "-c", "/openair-nrf/etc/nrf.conf", "-o"]
\ No newline at end of file
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