Merge remote-tracking branch 'origin/cleanup-build-oai-speedup-cluster' into integration_2025_w33 (!3579)
CI: speed up and simplify build, remove unnecessary Python code, remove --eNB* parameter list
This cleans up the CI framework for running end-to-end tests, and
improves the integration with OAI code. Specifically
- cleanup build_oai and helpers to output all text, which is captured
better by the CI
- build some images in the Cluster-Build in parallel to increase speed
- remove all --eNB{,1,2}{IPAddress,UserName,Password} variables. Those
were indexed through "instance" and "server ID" and are replaced with
the actual node name. I consider further cleanup to introduce a
"global" XML file node name so we don't need this in each step and
instead define this once.
- individual cleanup
This commit is contained in:
+7
-59
@@ -37,11 +37,7 @@ set_openair_env
|
||||
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
|
||||
|
||||
HW=""
|
||||
VERBOSE_COMPILE=0
|
||||
RUN_GROUP=0
|
||||
TEST_CASE_GROUP=""
|
||||
BUILD_DIR=ran_build
|
||||
BUILD_DOXYGEN=0
|
||||
DISABLE_HARDWARE_DEPENDENCY="False"
|
||||
CMAKE_BUILD_TYPE="RelWithDebInfo"
|
||||
CMAKE_CMD="$CMAKE"
|
||||
@@ -99,14 +95,8 @@ Options:
|
||||
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_5g, oran_fhlib_5g_mplane, WLS
|
||||
-P | --phy_simulators
|
||||
Makes the unitary tests Layer 1 simulators
|
||||
-s | --check
|
||||
runs a set of auto-tests based on simulators and several compilation tests
|
||||
--run-group
|
||||
runs only specified test cases specified here. This flag is only valid with -s
|
||||
-V | --vcd
|
||||
Adds a debgging facility to the binary files: GUI with major internal synchronization events
|
||||
--verbose-compile
|
||||
Shows detailed compilation instructions in makefile
|
||||
--build-doxygen
|
||||
Builds doxygen based documentation.
|
||||
--trace-asn1c-enc-dec
|
||||
@@ -117,8 +107,6 @@ Options:
|
||||
Disables the T tracer.
|
||||
--disable-hardware-dependency
|
||||
Disable HW dependency during installation
|
||||
--ue-autotest-trace
|
||||
Enable specific traces for UE autotest framework
|
||||
--ue-trace
|
||||
Enable traces for UE debugging
|
||||
--ue-timing
|
||||
@@ -319,28 +307,14 @@ function main() {
|
||||
TARGET_LIST="$TARGET_LIST dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim nr_psbchsim"
|
||||
echo_info "Will compile dlsim, ulsim, ..."
|
||||
shift;;
|
||||
-s | --check)
|
||||
OAI_TEST=1
|
||||
echo_info "Will run auto-tests"
|
||||
shift;;
|
||||
--run-group)
|
||||
RUN_GROUP=1
|
||||
TEST_CASE_GROUP=$2
|
||||
echo_info "executing test cases only in group: $TEST_CASE_GROUP"
|
||||
shift 2;;
|
||||
-V | --vcd)
|
||||
echo_info "Setting gtk-wave output"
|
||||
CMAKE_CMD="$CMAKE_CMD -DENABLE_VCD_FIFO=True"
|
||||
shift;;
|
||||
--verbose-compile)
|
||||
VERBOSE_COMPILE=1
|
||||
echo_info "Will compile with verbose instructions"
|
||||
shift;;
|
||||
--build-doxygen)
|
||||
CMAKE_CMD="$CMAKE_CMD -DGENERATE_DOXYGEN=ON"
|
||||
TARGET_LIST="$TARGET_LIST doc"
|
||||
BUILD_DOXYGEN=1
|
||||
echo_info "Will build doxygen support"
|
||||
TARGET_LIST="$TARGET_LIST doc"
|
||||
echo_info "Will build Doxygen documentation: $DIR/$BUILD_DIR/build/doc/html/index.html"
|
||||
shift;;
|
||||
--enable-LTTNG)
|
||||
CMAKE_CMD="$CMAKE_CMD -DENABLE_LTTNG=ON -DT_TRACER=OFF"
|
||||
@@ -355,10 +329,6 @@ function main() {
|
||||
echo_info "Disabling hardware dependency for compiling software"
|
||||
DISABLE_HARDWARE_DEPENDENCY="True"
|
||||
shift 1;;
|
||||
--ue-autotest-trace)
|
||||
CMAKE_CMD="$CMAKE_CMD -DUE_AUTOTEST_TRACE=True"
|
||||
echo_info "Enabling autotest specific trace for UE"
|
||||
shift 1;;
|
||||
--ue-trace)
|
||||
CMAKE_CMD="$CMAKE_CMD -DUE_DEBUG_TRACE=False"
|
||||
echo_info "Enabling UE trace for debug"
|
||||
@@ -498,13 +468,10 @@ function main() {
|
||||
CMAKE_CMD="$CMAKE_CMD ../../.."
|
||||
echo_info "Running \"$CMAKE_CMD\""
|
||||
eval $CMAKE_CMD
|
||||
compilations $BUILD_DIR all.txt "$TARGET_LIST" "${BUILD_TOOL_OPT}"
|
||||
###################
|
||||
# Doxygen Support #
|
||||
###################
|
||||
if [ "$BUILD_DOXYGEN" = "1" ] ; then
|
||||
echo_info "Built Doxygen based documentation. The documentation file is located here: $DIR/$BUILD_DIR/build/doc/html/index.html"
|
||||
fi
|
||||
cmd="$CMAKE --build . --target ${TARGET_LIST} -- ${BUILD_TOOL_OPT}"
|
||||
echo_info "Running \"${cmd}\"" $green
|
||||
eval $cmd
|
||||
ret=$?
|
||||
|
||||
if [ "$UE" = 1 ] ; then
|
||||
echo_info "Generate LTE USIM default sim content UE specific part"
|
||||
@@ -517,26 +484,7 @@ function main() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
##############
|
||||
# Auto-tests #
|
||||
##############
|
||||
if [ "$OAI_TEST" = "1" ] ; then
|
||||
echo_info "The log file for the autotest script for debugging is located here: $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log "
|
||||
echo_info "The results of autotests results is located here: $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml "
|
||||
echo_info "You can hit CTRL-C at any time to terminate the autotests..."
|
||||
rm -fr $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
if [ "$RUN_GROUP" -eq "1" ]; then
|
||||
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log
|
||||
else
|
||||
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log
|
||||
fi
|
||||
wait
|
||||
else
|
||||
echo_success "BUILD SHOULD BE SUCCESSFUL"
|
||||
fi
|
||||
|
||||
echo_success "BUILD SHOULD BE SUCCESSFUL"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -181,73 +181,12 @@ clean_all_files() {
|
||||
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
|
||||
}
|
||||
|
||||
###################################
|
||||
# Compilers
|
||||
###################################
|
||||
|
||||
#check_warnings:
|
||||
# print error message if the compilation had warnings
|
||||
#argument:
|
||||
# $1: log file
|
||||
check_warnings() {
|
||||
#we look for 'warning:' in the compilation log file
|
||||
#this is how gcc starts a warning
|
||||
#this is not perfect, we may get false positive
|
||||
warning_count=`grep "warning:" "$1" | grep -E -v "jobserver unavailable|disabling jobserver mode" | wc -l`
|
||||
if [ $warning_count -gt 0 ]; then
|
||||
echo_error "WARNING: $warning_count warnings. See $1"
|
||||
fi
|
||||
}
|
||||
|
||||
#check_errors:
|
||||
# print error message if the compilation had errors
|
||||
#argument:
|
||||
# $1: log file
|
||||
check_errors() {
|
||||
#we look for 'error:' in the compilation log file
|
||||
error_count=`grep -c "error:" "$1"`
|
||||
if [ $error_count -gt 0 ]; then
|
||||
echo_error "ERROR: $error_count error. See $1"
|
||||
fi
|
||||
}
|
||||
|
||||
compilations() {
|
||||
[[ $# -eq 4 ]] || echo_fatal "compilations <dir> <logfile> <targets> <build-tool-opt>"
|
||||
local dir=$1
|
||||
local logfile=$2
|
||||
local targets=$3
|
||||
local build_tool_opt=$4
|
||||
local verbose=$([ "$VERBOSE_COMPILE" == "1" ] && echo "-v" || echo "")
|
||||
echo cd $OPENAIR_DIR/cmake_targets/$dir/build
|
||||
cd $OPENAIR_DIR/cmake_targets/$dir/build
|
||||
cmd="$CMAKE --build . ${verbose} --target ${targets} -- ${build_tool_opt}"
|
||||
echo_info "Running \"${cmd}\"" $green
|
||||
echo "Log file for compilation is being written to: $dlog/$logfile"
|
||||
set +e
|
||||
{
|
||||
eval ${cmd}
|
||||
ret=$?
|
||||
} > $dlog/$logfile 2>&1
|
||||
# Print the errors and warnings for CI purposes
|
||||
grep -E -A5 -B5 "warning:|error:| Error " $dlog/$logfile || true
|
||||
check_warnings "$dlog/$logfile"
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echo_success "$targets compiled"
|
||||
else
|
||||
check_errors "$dlog/$logfile"
|
||||
echo_error "compilation of $targets failed"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
############################################
|
||||
# External packages installers
|
||||
############################################
|
||||
|
||||
install_usrp_uhd_driver_from_source(){
|
||||
uhd_install_log=$OPENAIR_DIR/cmake_targets/log/uhd_install_log.txt
|
||||
echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log "
|
||||
(
|
||||
echo_info "\nInstalling UHD driver from sources."
|
||||
pushd /tmp
|
||||
echo "Cloning UHD driver repository"
|
||||
rm -rf /tmp/uhd
|
||||
@@ -292,7 +231,7 @@ install_usrp_uhd_driver_from_source(){
|
||||
git diff
|
||||
mkdir -p host/build
|
||||
cd host/build || true
|
||||
$CMAKE ../ -GNinja -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF
|
||||
$CMAKE ../ -GNinja -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_B100=OFF -DENABLE_DOXYGEN=OFF -DENABLE_MANUAL=OFF -DENABLE_MAN_PAGES=OFF -DENABLE_MAN_PAGE_COMPRESSION=OFF -DENABLE_OCTOCLOCK=ON -DENABLE_USRP1=OFF -DENABLE_USRP2=OFF
|
||||
echo "Compiling UHD"
|
||||
ninja
|
||||
$SUDO ninja install
|
||||
@@ -307,25 +246,13 @@ install_usrp_uhd_driver_from_source(){
|
||||
fi
|
||||
popd
|
||||
rm -rf /tmp/uhd
|
||||
) >& $uhd_install_log
|
||||
}
|
||||
|
||||
check_install_usrp_uhd_driver(){
|
||||
if [[ "$OS_BASEDISTRO" == "debian" ]]; then
|
||||
boost_libs_ubuntu="libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libboost-test-dev libboost-regex-dev"
|
||||
#first we remove old installation
|
||||
$SUDO apt-get remove uhd -y || true
|
||||
$SUDO apt-get remove uhd-host -y || true
|
||||
$SUDO apt-get remove libuhd-dev -y || true
|
||||
$SUDO apt-get remove libuhd003 -y || true
|
||||
$SUDO apt-get remove libuhd3.13.1 -y || true
|
||||
$SUDO apt-get remove libuhd3.14.0 -y || true
|
||||
$SUDO apt-get remove libuhd3.14.1 -y || true
|
||||
$SUDO apt-get remove libuhd3.15.0 -y || true
|
||||
local distribution=$(get_distribution_release)
|
||||
if [[ "$distribution" == "ubuntu20.04" || "$distribution" == "ubuntu22.04" || "$distribution" == "ubuntu24.04" ]]; then
|
||||
$SUDO apt-get remove libuhd4.?.? -y || true
|
||||
fi
|
||||
$SUDO apt-get remove uhd* libuhd* -y || true
|
||||
v=$(lsb_release -cs)
|
||||
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
|
||||
if [[ -v BUILD_UHD_FROM_SOURCE ]] || [[ "$OS_DISTRO" == "debian" ]]; then
|
||||
@@ -404,9 +331,7 @@ install_usrp_uhd_driver() {
|
||||
}
|
||||
|
||||
install_bladerf_driver_from_source(){
|
||||
bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt
|
||||
echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log "
|
||||
(
|
||||
echo_info "\nInstalling BladeRF driver from sources."
|
||||
cd /tmp
|
||||
echo "Downloading BladeRF driver"
|
||||
rm -rf /tmp/bladeRF
|
||||
@@ -429,7 +354,6 @@ install_bladerf_driver_from_source(){
|
||||
sudo mkdir -p /usr/share/Nuand/bladeRF
|
||||
sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf
|
||||
) >& $bladerf_install_log
|
||||
}
|
||||
|
||||
check_install_bladerf_driver(){
|
||||
@@ -464,9 +388,7 @@ check_install_lmssdr_driver(){
|
||||
}
|
||||
|
||||
install_soapy_from_source(){
|
||||
soapy_install_log=$OPENAIR_DIR/cmake_targets/log/soapy_install_log.txt
|
||||
echo_info "\nInstalling Soapy EcoSystem from source. The log file for Soapy installation is here: $soapy_install_log "
|
||||
(
|
||||
echo_info "\nInstalling Soapy EcoSystem from source."
|
||||
cd /tmp
|
||||
echo "Downloading SoapySDR"
|
||||
rm -rf /tmp/SoapySDR
|
||||
@@ -493,13 +415,10 @@ install_soapy_from_source(){
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& $soapy_install_log
|
||||
}
|
||||
|
||||
install_soapy_iris_from_source(){
|
||||
iris_install_log=$OPENAIR_DIR/cmake_targets/log/iris_install_log.txt
|
||||
echo_info "\nInstalling Iris driver from source. The log file for Iris driver installation is here: $iris_install_log "
|
||||
(
|
||||
echo_info "\nInstalling Iris driver from source."
|
||||
cd /tmp
|
||||
echo "Downloading SoapyIris"
|
||||
rm -rf /tmp/sklk-soapyiris
|
||||
@@ -512,7 +431,6 @@ install_soapy_iris_from_source(){
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& $iris_install_log
|
||||
}
|
||||
|
||||
check_install_soapy () {
|
||||
@@ -644,10 +562,7 @@ check_install_oai_software() {
|
||||
}
|
||||
|
||||
install_asn1c_from_source(){
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/log
|
||||
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
|
||||
(
|
||||
echo_info "\nInstalling ASN1."
|
||||
$SUDO $INSTALLER -y install bison flex
|
||||
$SUDO rm -rf /tmp/asn1c
|
||||
# GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
@@ -668,7 +583,6 @@ install_asn1c_from_source(){
|
||||
if [[ -v CI_ENV ]]; then
|
||||
$SUDO rm -rf /tmp/asn1c
|
||||
fi
|
||||
) > $asn1_install_log 2>&1
|
||||
}
|
||||
|
||||
install_simde_from_source(){
|
||||
@@ -808,43 +722,3 @@ set_openair_env(){
|
||||
export OPENAIR3_DIR=$openair_path/openair3
|
||||
export OPENAIR_TARGETS=$openair_path/targets
|
||||
}
|
||||
|
||||
################################
|
||||
# Function to killall the subprocesses when Ctrl-C Key is hit
|
||||
###############################
|
||||
function handle_ctrl_c(){
|
||||
CURPID=$$
|
||||
ppid=$$
|
||||
arraycounter=1
|
||||
echo_info "** Trapped CTRL-C. Killing all subprocesses now..."
|
||||
echo_info "** Calling sync now..."
|
||||
sync
|
||||
while true
|
||||
do
|
||||
FORLOOP=FALSE
|
||||
# Get all the child process id
|
||||
for i in `ps -ef| awk '$3 == '$ppid' { print $2 }'`
|
||||
do
|
||||
if [ $i -ne $CURPID ] ; then
|
||||
procid[$arraycounter]=$i
|
||||
arraycounter=`expr $arraycounter + 1`
|
||||
ppid=$i
|
||||
FORLOOP=TRUE
|
||||
fi
|
||||
done
|
||||
if [ "$FORLOOP" = "FALSE" ] ; then
|
||||
arraycounter=`expr $arraycounter - 1`
|
||||
## We want to kill child process id first and then parent id's
|
||||
while [ $arraycounter -ne 0 ]
|
||||
do
|
||||
echo "first we send ctrl-c to program"
|
||||
$SUDO kill -INT "${procid[$arraycounter]}"
|
||||
sleep 5
|
||||
echo "Now we force kill if that didn't work"
|
||||
$SUDO kill -9 "${procid[$arraycounter]}" >/dev/null
|
||||
arraycounter=`expr $arraycounter - 1`
|
||||
done
|
||||
exit
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user