Commit c8017402 authored by mineuse's avatar mineuse
Browse files

Update the build_m5g script and add oai-ue module

parent 43eeb9bc
......@@ -24,3 +24,7 @@
[submodule "ll-mec-ovs"]
path = ovs-gtp
url = https://gitlab.eurecom.fr/mosaic5g/ll-mec-ovs.git
[submodule "oai-ue"]
path = oai-ue
url = https://gitlab.eurecom.fr/oai/openairinterface5g.git
branch = develop
......@@ -80,6 +80,12 @@ oai_ran_build=$oai_ran_path/cmake_targets
oai_ran_bin=$oai_ran_path/targets/bin
oai_ran_branch=develop
oai_ue_path=$m5g_path/oai-ue
oai_ue_build=$oai_ue_path/cmake_targets
oai_ue_bin=$oai_ue_path/targets/bin
oai_ue_branch=develop
oai_cn_path=$m5g_path/oai-cn
oai_cn_build=$oai_cn_path/scripts
oai_cn_exec=$oai_cn_path/build
......@@ -111,7 +117,8 @@ echo_info "OVS Path: $ovs_path"
echo_info "Jox Path: $jox_path"
echo_info "Store Path: $store_path"
echo_info "OAI oai_ran Path: $oai_ran_path"
echo_info "OAI oai_cn Path: $oai_cn_path"
echo_info "OAI oai_ue Path: $oai_ue_path"
echo_info "OAI oai_cn Path: $oai_cn_path"
os=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
......@@ -317,6 +324,18 @@ build_oai_ran(){
cp $oai_ran_bin $m5g_bin
echo_success "Build OAI RAN $oai_ran_branch branch with FlexRAN agent in $oai_ran_bin"
}
build_oai_ue(){
git submodule update oai-ue
cd $oai_ue_path
git checkout $oai_ue_branch
cd $oai_ue_build
./build_oai -I -w USRP
./build_oai -c -C --UE -w USRP
cd $m5g_path
cp $oai_ue_bin $m5g_bin
echo_success "Build OAI UE $oai_ue_branch branch in $oai_ue_bin"
}
build_oai_cn(){
......@@ -391,6 +410,7 @@ build_m5g (){
#EDGE nodes
build_oai_ran
build_oai_ue
build_rtc
#CORE nodes
......@@ -403,9 +423,9 @@ build_m5g (){
build_jox
}
snap_rtc(){
echo 'Snapping FLEXRAN '
snap list flexran &> /dev/null
snap_m5g_module(){
echo "Snapping $1"
snap list $1 &> /dev/null
if [ $? -eq 0 ]; then
op="refresh"
else
......@@ -414,125 +434,32 @@ snap_rtc(){
if [ "$snap_revision" != "" ]; then
op="$op --revision=$snap_revision"
fi
echo "snap $op flexran --channel=beta --devmode"
sudo snap $op flexran --channel=beta --devmode
echo "snap $op $1 --channel=edge --devmode"
sudo snap $op $1 --channel=edge --devmode
echo "-----------------------------------"
echo " FLEXRAN SNAP INFO "
echo " $1 SNAP INFO "
echo "-----------------------------------"
snap info flexran
snap info $1
}
snap_oai_ran(){
echo 'Snapping OAI-RAN '
snap list oai-ran &> /dev/null
if [ $? -eq 0 ]; then
op="refresh"
else
op="install"
fi
if [ "$snap_revision" != "" ]; then
op="$op --revision=$snap_revision"
fi
echo "snap $op oai-ran --channel=beta --devmode"
sudo snap $op oai-ran --channel=beta --devmode
echo "-----------------------------------"
echo " OAI-RAN SNAP INFO "
echo "-----------------------------------"
snap info oai-ran
}
snap_oai_cn(){
echo 'Snapping OAI-CN '
snap list oai-cn &> /dev/null
if [ $? -eq 0 ]; then
op="refresh"
else
op="install"
fi
echo "$op OAI-CN snap"
if [ "$snap_revision" != "" ]; then
op="$op --revision=$snap_revision"
fi
echo "snap $op oai-cn --channel=beta --devmode"
sudo snap $op oai-cn --channel=beta --devmode
echo "-----------------------------------"
echo " OAI-CN SNAP INFO "
echo "-----------------------------------"
snap info oai-cn
}
snap_llmec(){
echo 'Snapping LL-MEC'
snap list ll-mec &> /dev/null
if [ $? -eq 0 ]; then
op="refresh"
else
op="install"
fi
if [ "$snap_revision" != "" ]; then
op="$op --revision=$snap_revision"
fi
echo "snap $op ll-mec --channel=beta --devmode"
sudo snap $op ll-mec --channel=beta --devmode
echo "-----------------------------------"
echo " LL-MEC SNAP INFO "
echo "-----------------------------------"
snap info ll-mec
}
snap_ovs_gtp(){
echo 'Snapping OVS-GTP'
snap list ovs-gtp &> /dev/null
if [ $? -eq 0 ]; then
op="refresh"
else
op="install"
fi
if [ "$snap_revision" != "" ]; then
op="$op --revision=$snap_revision"
fi
echo "snap $op ovs-gtp --channel=beta --devmode"
sudo snap $op ovs-gtp --channel=beta --devmode
echo "-----------------------------------"
echo " OVS-GTP SNAP INFO "
echo "-----------------------------------"
snap info ovs-gtp
}
declare -a snaps=("oai-cn" "oai-ran" "oai-ue" "oai-tracer" "flexran" "ll-mec")
snap_oai_tracer(){
echo 'Snapping OAI-TRACER '
snap list oai-tracer &> /dev/null
if [ $? -eq 0 ]; then
op="refresh"
else
op="install"
fi
echo "$op OAI-TRACER snap"
if [ "$snap_revision" != "" ]; then
op="$op --revision=$snap_revision"
fi
echo "snap $op oai-tracer --channel=beta --devmode"
sudo snap $op oai-tracer --channel=beta --devmode
echo "-----------------------------------"
echo " OAI-TRACER SNAP INFO "
echo "-----------------------------------"
snap info oai-tracer
}
snap_m5g (){
snap_rtc
snap_oai_ran
snap_llmec
snap_ovs_gtp
snap_oai_cn
}
for s in "${snaps[@]}"
do
snap_m5g_module $s
done
echo""
echo "-------------------------------------"
echo " Listing the installed snaps "
echo "-------------------------------------"
echo ""
snap list
}
init_snap_m5g(){
echo ''
echo ""
}
......@@ -549,14 +476,27 @@ init_build_m5g(){
###########################
clean_snaps(){
sudo snap remove oai-cn
sudo snap remove oai-ran
sudo snap remove flexran
sudo snap remove ll-mec
if [ "$snap_revision" != "" ]; then
op="$op --revision=$snap_revision"
fi
for s in "${snaps[@]}"
do
echo "removing snapping $s"
sudo snap remove $op $s
done
echo ""
echo "-------------------------------------"
echo "Listing the current installed snaps "
echo "-------------------------------------"
echo ""
snap list
}
clean_all(){
echo_info "cleaning "
clean_snaps
}
############################
......@@ -572,10 +512,6 @@ Options
print this help
--clean-snaps
Clean all the snaps"
--clean-all
Clean all files to make a rebuild from start"
--install-kernel
install the required kernel
-i | --install-required-pkg
install required packages for build and/or snap process
-I | --install-all-packages
......@@ -608,6 +544,10 @@ Options
install OAI RAN with the FlexRAN agent from snap
-s | --build-store
Builds ans setup the store
-u | --install-ue
Install OAI UE from source
-U | --snap-ue
Install OAI UE from Snap
-v | --revision
Install specific revision of the snap. You must have developer access.
-p | --pb-version
......@@ -628,10 +568,10 @@ function main() {
--clean-snaps)
CLEAN_SNAPS=1
shift;;
-k | --install-kernel)
INSTALL_KERNEL=1
echo_info "Will install the kernel"
shift;;
# -k | --install-kernel)
# INSTALL_KERNEL=1
# echo_info "Will install the kernel"
# shift;;
-i | --install-required-pkg)
INSTALL_PKG=1
echo_info "Will install the required packages for build and snap process"
......@@ -700,6 +640,14 @@ function main() {
echo "setting protobuf version to $2"
pb_version=$2
shift 2;;
-u | --build-oai-ue )
echo "Will install OAI UE from source"
BUILD_OAI_UE=1
shift ;;
-U | --snap-oai-ue )
echo "Will install OAI UE from snap"
SNAP_OAI_UE=1
shift ;;
-v | --revision )
echo "setting snap revision is set to $2"
snap_revision=$2
......@@ -751,6 +699,14 @@ function main() {
echo_info "Building OAI RAN with the FlexRAN Agent"
build_oai_ran
fi
if [ "$BUILD_OAI_RAN" = "1" ] ; then
echo_info "Building OAI RAN with the FlexRAN Agent"
build_oai_ran
fi
if [ "$BUILD_OAI_UE" = "1" ] ; then
echo_info "Building OAI UE"
build_oai_ue
fi
if [ "$BUILD_OAI_CN" = "1" ] ; then
echo_info "Building OAI CN with the LL-MEC Agent"
build_oai_cn
......@@ -781,27 +737,31 @@ function main() {
init_snap_m5g
if [ "$SNAP_RTC" = "1" ] ; then
echo_info "Snap FlexRAN realtime controller"
snap_rtc
snap_m5g_module "flexran"
fi
if [ "$SNAP_OAI_RAN" = "1" ] ; then
echo_info "Snap OAI RAN with the FlexRAN Agent"
snap_oai_ran
snap_m5g_module "oai-ran"
fi
if [ "$SNAP_OAI_UE" = "1" ] ; then
echo_info "Snap OAI UE"
snap_m5g_module "oai-ue"
fi
if [ "$SNAP_OAI_CN" = "1" ] ; then
echo_info "Snap OAI CN with the LL-MEC Agent"
snap_oai_cn
snap_m5g_module "oai-cn"
fi
if [ "$SNAP_LLMEC" = "1" ] ; then
echo_info "Snap lowlatency MEC platforms"
snap_llmec
snap_m5g_module "ll-mec"
fi
if [ "$SNAP_OVS_GTP" = "1" ] ; then
echo_info "Snap OVS with GTP"
snap_ovs_gtp
echo_info "Snap OVS with GTP not yet supported !"
#snap_ovs_gtp
fi
if [ "$SNAP_OAI_TRACER" = "1" ] ; then
echo_info "Snap OAI Tracer"
snap_oai_tracer
snap_m5g_module "oai-tracer"
fi
fi
......
Subproject commit ae0494b0bc431bf664e300b0b5a10f348d6b6757
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