Commit 9b59ba63 authored by Bartosz Podrygajlo's avatar Bartosz Podrygajlo

Enable configuration of NR UE through a YAML file

This commit adds yaml-cpp library to required docker images and build commands. There is one workaround
in cross-compilation for apt behavior for installing libyaml-cpp-dev. Apt will uninistall previous
versions of the package whenever another one is installed. This means that installing the arm version
breaks amd version and vice versa. This makes it impossible to have both libs installed at the same
time which is required by the cross-compilation build command (it calls cmake twice, once with native
and once with target architecture)
parent 0b684732
...@@ -30,7 +30,8 @@ FROM ran-base:develop AS ran-tests ...@@ -30,7 +30,8 @@ FROM ran-base:develop AS ran-tests
RUN apt-get update && \ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libgtest-dev libgtest-dev \
libyaml-cpp-dev
RUN rm -Rf /oai-ran RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
......
...@@ -118,7 +118,7 @@ services: ...@@ -118,7 +118,7 @@ services:
devices: devices:
- /dev/net/tun:/dev/net/tun - /dev/net/tun:/dev/net/tun
volumes: volumes:
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf - ../../conf_files/nrue.uicc.yaml:/opt/oai-nr-ue/etc/nr-ue.yaml
healthcheck: healthcheck:
test: /bin/bash -c "pgrep nr-uesoftmodem" test: /bin/bash -c "pgrep nr-uesoftmodem"
interval: 10s interval: 10s
......
...@@ -497,7 +497,7 @@ function main() { ...@@ -497,7 +497,7 @@ function main() {
# add some default libraries that should always be built # add some default libraries that should always be built
# for eNB, gNB, UEs, simulators # for eNB, gNB, UEs, simulators
if [[ $gNB == 1 || $eNB == 1 || $UE == 1 || $nrUE == 1 || $SIMUS_PHY == 1 || $RU == 1 ]]; then if [[ $gNB == 1 || $eNB == 1 || $UE == 1 || $nrUE == 1 || $SIMUS_PHY == 1 || $RU == 1 ]]; then
TARGET_LIST="$TARGET_LIST params_libconfig coding rfsimulator dfts" TARGET_LIST="$TARGET_LIST params_libconfig coding rfsimulator dfts params_yaml"
fi fi
mkdir -p $DIR/$BUILD_DIR/build mkdir -p $DIR/$BUILD_DIR/build
......
find_package(yaml-cpp REQUIRED) find_package(yaml-cpp REQUIRED PATHS /usr/lib/aarch64-linux-gnu/pkgconfig/)
# include(FetchContent) # include(FetchContent)
# FetchContent_Declare( # FetchContent_Declare(
......
...@@ -66,6 +66,7 @@ RUN apt-get update && \ ...@@ -66,6 +66,7 @@ RUN apt-get update && \
libssl-dev:arm64 \ libssl-dev:arm64 \
libtool:arm64 \ libtool:arm64 \
zlib1g-dev:arm64 \ zlib1g-dev:arm64 \
libyaml-cpp-dev:arm64 \
# cross build libs and compilers # cross build libs and compilers
libc6-dev-i386 \ libc6-dev-i386 \
gcc-11-aarch64-linux-gnu \ gcc-11-aarch64-linux-gnu \
......
...@@ -41,6 +41,8 @@ RUN /bin/sh oaienv && \ ...@@ -41,6 +41,8 @@ RUN /bin/sh oaienv && \
ninja ldpc_generators generate_T > ../../log/host-tools.txt 2>&1 && \ ninja ldpc_generators generate_T > ../../log/host-tools.txt 2>&1 && \
echo "====== End of log for host-tools ======" && \ echo "====== End of log for host-tools ======" && \
cd ../build-cross/ && \ cd ../build-cross/ && \
# install missing libyaml-cpp-dev for arm64
apt install -y libyaml-cpp-dev:arm64 && \
cmake ../../.. -GNinja -DCMAKE_TOOLCHAIN_FILE=../../../cmake_targets/cross-arm.cmake -DNATIVE_DIR=../build && \ cmake ../../.. -GNinja -DCMAKE_TOOLCHAIN_FILE=../../../cmake_targets/cross-arm.cmake -DNATIVE_DIR=../build && \
echo "====== Start of log for cross-build executables ======" && \ echo "====== Start of log for cross-build executables ======" && \
# making always passing so we can analyze the all.txt file # making always passing so we can analyze the all.txt file
......
...@@ -34,6 +34,9 @@ FROM ran-build:latest AS nr-ue-build ...@@ -34,6 +34,9 @@ FROM ran-build:latest AS nr-ue-build
FROM registry.access.redhat.com/ubi9/ubi:latest AS oai-nr-ue FROM registry.access.redhat.com/ubi9/ubi:latest AS oai-nr-ue
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
# Install EPEL for RHEL9
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN dnf update -y && \ RUN dnf update -y && \
dnf install -y \ dnf install -y \
lksctp-tools \ lksctp-tools \
...@@ -47,7 +50,8 @@ RUN dnf update -y && \ ...@@ -47,7 +50,8 @@ RUN dnf update -y && \
python3 \ python3 \
python3-pip \ python3-pip \
libXpm \ libXpm \
libX11 && \ libX11 \
yaml-cpp-devel && \
pip3 install six && \ pip3 install six && \
pip3 install requests && \ pip3 install requests && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
...@@ -70,6 +74,7 @@ COPY --from=nr-ue-build \ ...@@ -70,6 +74,7 @@ COPY --from=nr-ue-build \
/oai-ran/cmake_targets/ran_build/build/libldpc*.so \ /oai-ran/cmake_targets/ran_build/build/libldpc*.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \
/oai-ran/cmake_targets/ran_build/build/libparams_yaml.so \
/usr/local/lib/ /usr/local/lib/
COPY --from=nr-ue-base \ COPY --from=nr-ue-base \
...@@ -117,5 +122,5 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai ...@@ -117,5 +122,5 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai
WORKDIR /opt/oai-nr-ue WORKDIR /opt/oai-nr-ue
COPY --from=nr-ue-base /tini /tini COPY --from=nr-ue-base /tini /tini
CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"] CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem"]
ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-nr-ue/bin/entrypoint.sh"] ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-nr-ue/bin/entrypoint.sh"]
...@@ -71,6 +71,7 @@ COPY --from=nr-ue-build \ ...@@ -71,6 +71,7 @@ COPY --from=nr-ue-build \
/oai-ran/cmake_targets/ran_build/build/libldpc*.so \ /oai-ran/cmake_targets/ran_build/build/libldpc*.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \
/oai-ran/cmake_targets/ran_build/build/libparams_yaml.so \
/usr/local/lib/ /usr/local/lib/
COPY --from=nr-ue-base \ COPY --from=nr-ue-base \
...@@ -118,5 +119,5 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai ...@@ -118,5 +119,5 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai
WORKDIR /opt/oai-nr-ue WORKDIR /opt/oai-nr-ue
COPY --from=nr-ue-base /tini /tini COPY --from=nr-ue-base /tini /tini
CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"] CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem"]
ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-nr-ue/bin/entrypoint.sh"] ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-nr-ue/bin/entrypoint.sh"]
...@@ -64,7 +64,8 @@ RUN apt-get update && \ ...@@ -64,7 +64,8 @@ RUN apt-get update && \
iputils-ping \ iputils-ping \
iproute2 \ iproute2 \
iperf3 \ iperf3 \
iperf && \ iperf \
libyaml-cpp-dev && \
# if the --sanitize option was used to build, additional packages are required # if the --sanitize option was used to build, additional packages are required
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
#libasan5 \ # see below #libasan5 \ # see below
...@@ -97,6 +98,7 @@ COPY --from=nr-ue-build \ ...@@ -97,6 +98,7 @@ COPY --from=nr-ue-build \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv_ciUE.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_ciUE.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \
/oai-ran/cmake_targets/ran_build/build/libparams_yaml.so \
/usr/local/lib/ /usr/local/lib/
# Now we are copying from builder-image the UHD files. # Now we are copying from builder-image the UHD files.
...@@ -123,5 +125,5 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai ...@@ -123,5 +125,5 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai
WORKDIR /opt/oai-nr-ue WORKDIR /opt/oai-nr-ue
COPY --from=nr-ue-base /tini /tini COPY --from=nr-ue-base /tini /tini
CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"] CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem"]
ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-nr-ue/bin/entrypoint.sh"] ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-nr-ue/bin/entrypoint.sh"]
...@@ -9,8 +9,13 @@ echo "==================================" ...@@ -9,8 +9,13 @@ echo "=================================="
echo "/proc/sys/kernel/core_pattern=$(cat /proc/sys/kernel/core_pattern)" echo "/proc/sys/kernel/core_pattern=$(cat /proc/sys/kernel/core_pattern)"
if [ ! -f $CONFIGFILE ]; then if [ ! -f $CONFIGFILE ]; then
echo "No configuration file found: please mount at $CONFIGFILE" echo "No configuration file $CONFIGFILE found: attempting to find YAML config"
exit 255 YAML_CONFIGFILE=$PREFIX/etc/nr-ue.yaml
if [ ! -f $YAML_CONFIGFILE ]; then
echo "No configuration file $YAML_CONFIGFILE found. Please mount either at $CONFIGFILE or $YAML_CONFIGFILE"
exit 255
fi
CONFIGFILE=$YAML_CONFIGFILE
fi fi
echo "==================================" echo "=================================="
...@@ -35,6 +40,9 @@ while [[ $# -gt 0 ]]; do ...@@ -35,6 +40,9 @@ while [[ $# -gt 0 ]]; do
shift shift
done done
new_args+=("-O")
new_args+=("$CONFIGFILE")
# enable printing of stack traces on assert # enable printing of stack traces on assert
export OAI_GDBSTACKS=1 export OAI_GDBSTACKS=1
......
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