Automation scripts 45/6245/2
authorlal.harshita <Harshita.Lal@radisys.com>
Mon, 7 Jun 2021 10:40:59 +0000 (16:10 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Mon, 7 Jun 2021 10:55:22 +0000 (16:25 +0530)
Change-Id: I4e8e93617844b06797739b3b397e793520ff7d81
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
12 files changed:
Dockerfile
build/odu/makefile
build/scripts/cleanup [new file with mode: 0755]
build/scripts/install_lib_O1.sh [moved from build/scripts/install_lib.sh with 99% similarity]
build/scripts/install_odu_dependency.sh [new file with mode: 0755]
build/scripts/odu_high.sh [new file with mode: 0755]
build/scripts/start_cu_stub_logging.sh [moved from build/scripts/cu_script.sh with 74% similarity, mode: 0755]
build/scripts/start_du_logging.sh [moved from build/scripts/odu_script.sh with 73% similarity, mode: 0755]
build/scripts/start_gnb.sh [new file with mode: 0755]
build/scripts/start_ric_stub_logging.sh [new file with mode: 0755]
docs/README
docs/installation-guide.rst

index 3274200..02e0e27 100644 (file)
@@ -25,7 +25,7 @@ RUN cd build/odu && make clean_odu odu MACHINE=BIT64 MODE=TDD
 #CMD /opt/o-du-l2/bin/odu/odu
 
 #cleanup netconf folder and install libraries
-RUN cd build/scripts && /bin/bash install_lib.sh -c
+RUN cd build/scripts && /bin/bash install_lib_O1.sh -c
 
 # Install the data models based on the ODU yang model
 RUN /usr/local/bin/sysrepoctl -i build/yang/o-ran-sc-odu-alarm-v1.yang
index 99cd9df..31183ea 100644 (file)
@@ -283,7 +283,7 @@ link_cu:
                $(L_OPTS) -L$(LIB_ROOT)/cu_stub -L$(ROOT_DIR)/libs/cu_stub
                $(Q)cp -f ./obj/cu_stub/cu_stub ./bin/cu_stub
                $(Q)cp -rf ./bin/cu_stub $(ROOT_DIR)/bin/
-               $(Q)cp -f ../scripts/cu_script.sh $(ROOT_DIR)/bin/cu_stub
+               $(Q)cp -f ../scripts/start_cu_stub_logging.sh $(ROOT_DIR)/bin/cu_stub
                $(Q)echo -e "***** CU STUB BUILD COMPLETE *****"
 
 ric: 
@@ -320,19 +320,19 @@ link_ric:
                $(L_OPTS) -L$(LIB_ROOT)/ric_stub -L$(ROOT_DIR)/libs/ric_stub
                $(Q)cp -f ./obj/ric_stub/ric_stub ./bin/ric_stub
                $(Q)cp -rf ./bin/ric_stub $(ROOT_DIR)/bin/
+               $(Q)cp -f ../scripts/start_ric_stub_logging.sh $(ROOT_DIR)/bin/ric_stub
                $(Q)echo -e "***** RIC STUB BUILD COMPLETE *****"
 
 
 copy_build: link_du
                        $(Q)cp -f ./obj/odu/odu ./bin/odu
                        $(Q)cp -rf ./bin/odu $(ROOT_DIR)/bin/
-                       $(Q)cp -f ../scripts/odu_script.sh $(ROOT_DIR)/bin/odu
+                       $(Q)cp -f ../scripts/start_du_logging.sh $(ROOT_DIR)/bin/odu
                        $(Q)cp -rf ../config/ $(ROOT_DIR)/bin/odu
                        $(Q)cp -f ./lib/odu/*.a $(ROOT_DIR)/libs/
                   $(Q)echo -e "***** BUILD COMPLETE *****"
 
 odu: prepare_dirs copy_build
-
 cu_stub: prepare_cu_dirs cu link_cu
 ric_stub: prepare_ric_dirs ric link_ric
 
diff --git a/build/scripts/cleanup b/build/scripts/cleanup
new file mode 100755 (executable)
index 0000000..7a47aa6
--- /dev/null
@@ -0,0 +1,63 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to clean-up the system environment
+#!/bin/bash
+
+echo "***** Environment Clean-up Start *****"
+
+if [ -f /etc/os-release ]; then
+   . /etc/os-release
+   OS=$ID
+fi
+
+echo "===> Uninstalling GCC"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y build-essential
+else
+   sudo yum groups mark remove -y "Development Tools"
+fi
+
+echo ""
+echo "===> Uninstalling LKSCTP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y libsctp-dev
+else
+   sudo yum remove -y lksctp-tools-devel
+fi
+
+echo ""
+echo "===> Uninstalling PCAP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y libpcap-dev
+else
+   sudo yum remove -y libpcap-devel
+fi
+
+echo ""
+echo "===> Uninstalling XTERM"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y xterm
+else
+   sudo yum remove -y xterm
+fi
+
+echo ""
+echo "***** Environment Clean-up Complete *****"
+
+################################################################################
+#                              End of file                                     #
+################################################################################
+
similarity index 99%
rename from build/scripts/install_lib.sh
rename to build/scripts/install_lib_O1.sh
index f4e2df5..25a75ed 100755 (executable)
@@ -195,7 +195,7 @@ acknowledge() {
 #show help for user to provide valid input
 show_help(){
    echo "use -c option for cleanup"
-   echo "ex : $./install_lib.sh -c"
+   echo "ex : $./install_lib_O1.sh -c"
    exit
 }
 
diff --git a/build/scripts/install_odu_dependency.sh b/build/scripts/install_odu_dependency.sh
new file mode 100755 (executable)
index 0000000..a48a303
--- /dev/null
@@ -0,0 +1,62 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                             #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to setup environment for execution of ODU-High
+#!/bin/bash
+
+echo "***** Installation Start *****"
+
+if [ -f /etc/os-release ]; then
+   . /etc/os-release
+   OS=$ID
+fi
+
+echo "===> Installing GCC"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y build-essential
+else
+   sudo yum groups mark install -y “Development Tools”
+fi
+echo""
+
+echo "===> Installing LKSCTP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y libsctp-dev
+else
+   sudo yum install -y lksctp-tools-devel
+fi
+echo ""
+
+echo "===> Installing PCAP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y libpcap-dev
+else
+   sudo yum install -y libpcap-devel
+fi
+echo ""
+
+echo "===> Installing XTERM"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y xterm
+else
+   sudo yum install -y xterm
+fi
+echo ""
+
+echo "***** Installation Complete *****"
+
+################################################################################
+#                              End of file                                     #
+################################################################################
diff --git a/build/scripts/odu_high.sh b/build/scripts/odu_high.sh
new file mode 100755 (executable)
index 0000000..51ec331
--- /dev/null
@@ -0,0 +1,28 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                             #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This is the main script that in turn triggers sub-scripts to install, compile 
+# and execute ODU-High modules
+#!/bin/bash
+
+# Installing dependencies for ODU-High
+./install_odu_dependency.sh
+
+# Compiling and executing ODU-High binaries
+./start_gnb.sh
+
+################################################################################
+#                              End of file                                     #
+################################################################################                                                                              
old mode 100644 (file)
new mode 100755 (executable)
similarity index 74%
rename from build/scripts/cu_script.sh
rename to build/scripts/start_cu_stub_logging.sh
index 4737f58..e07fb73
@@ -1,29 +1,19 @@
 ################################################################################
-#   Copyright (c) [2017-2019] [Radisys]
-#   #
+#   Copyright (c) [2017-2019] [Radisys]                                        #
 #                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   #
-#   you may not use this file except in compliance with the License.
-#   #
-#   You may obtain a copy of the License at
-#   #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
 #                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0
-#       #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
 #                                                                              #
-#   Unless required by applicable law or agreed to in writing, software
-#   #
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-#   implied.   #
-#   See the License for the specific language governing permissions
-#   and        #
-#   limitations under the License.
-#   #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
 ################################################################################
-
+# This script is used to log CU Stub
 #!/bin/sh
 
 ROOT_DIR=$PWD
old mode 100644 (file)
new mode 100755 (executable)
similarity index 73%
rename from build/scripts/odu_script.sh
rename to build/scripts/start_du_logging.sh
index fc8b285..d53afc9
@@ -1,29 +1,19 @@
 ################################################################################
-#   Copyright (c) [2017-2019] [Radisys]
-#   #
+#   Copyright (c) [2017-2019] [Radisys]                                        #
 #                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   #
-#   you may not use this file except in compliance with the License.
-#   #
-#   You may obtain a copy of the License at
-#   #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
 #                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0
-#       #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
 #                                                                              #
-#   Unless required by applicable law or agreed to in writing, software
-#   #
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-#   implied.   #
-#   See the License for the specific language governing permissions
-#   and        #
-#   limitations under the License.
-#   #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
 ################################################################################
-
+# This script is used to log ODU-High
 #!/bin/sh
 
 ROOT_DIR=$PWD
diff --git a/build/scripts/start_gnb.sh b/build/scripts/start_gnb.sh
new file mode 100755 (executable)
index 0000000..8c9a47c
--- /dev/null
@@ -0,0 +1,50 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                             #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to build and execute ODU-High and test stubs
+#!/bin/bash
+
+CURRENT_DIR=$PWD
+ROOT_DIR=$CURRENT_DIR/../../
+
+echo ""
+cd $ROOT_DIR/build/odu
+make clean_all
+echo "***** Building O-DU Binary *****"
+make odu MACHINE=BIT64 MODE=FDD
+echo ""
+echo "***** Building CU Stub Binary *****"
+make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+echo ""
+echo "***** Building RIC Stub Binary *****"
+make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+
+echo ""
+echo "***** Assigning IP addresses *****"
+INTERFACE=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
+INTERFACE="$(echo -e "${INTERFACE}" | tr -d '[:space:]')"
+ifconfig $INTERFACE:ODU "192.168.130.81"
+ifconfig $INTERFACE:CU_STUB "192.168.130.82"
+ifconfig $INTERFACE:RIC_STUB "192.168.130.80"
+
+xterm -hold -e "cd $ROOT_DIR/bin/cu_stub; chmod 777 *; ./start_cu_stub_logging.sh && ./cu_stub" &
+sleep 2
+xterm -hold -e "cd $ROOT_DIR/bin/ric_stub; chmod 777 *; ./start_ric_stub_logging.sh && ./ric_stub" &
+sleep 2
+xterm -hold -e "cd $ROOT_DIR/bin/odu; chmod 777 *; ./start_du_logging.sh && ./odu" &
+
+################################################################################
+#                              End of file                                     #
+################################################################################                                                                              
diff --git a/build/scripts/start_ric_stub_logging.sh b/build/scripts/start_ric_stub_logging.sh
new file mode 100755 (executable)
index 0000000..252e7c6
--- /dev/null
@@ -0,0 +1,35 @@
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to log RIC stub
+#!/bin/sh
+
+ROOT_DIR=$PWD
+d=`date +%Y_%m_%d_%I_%M_%S`
+
+touch  $ROOT_DIR/"log_ric_stub_$d.txt"
+chmod -c 777 $ROOT_DIR/"log_ric_stub_$d.txt"
+touch /etc/rsyslog.d/rsyslog_loginauth.conf
+cp /dev/null /etc/rsyslog.d/rsyslog_loginauth.conf
+echo "if \$programname == \"RIC_STUB\" then" >> \
+/etc/rsyslog.d/rsyslog_loginauth.conf
+echo "$ROOT_DIR/../ric_stub/log_ric_stub_$d.txt" >> \
+/etc/rsyslog.d/rsyslog_loginauth.conf
+systemctl restart rsyslog
+
+
+#**********************************************************************
+#        End of file
+#**********************************************************************
index 5d86416..98d5b6c 100644 (file)
@@ -47,8 +47,8 @@ C. Pre-requisite for O1 Interface (Required only if run with O1 interface enable
         cat /home/netconf/.ssh/id_dsa.pub > /home/netconf/.ssh/authorized_keys
        Install netconf packages. 
        $cd l2/build/scripts
-       $chmod +x install_lib.sh
-       $ ./install_lib.sh -c
+       $chmod +x install_lib_O1.sh
+       $ ./install_lib_O1.sh -c
 
 2. Start Netopeer2-server:
    $cd l2/build/scripts
index 700180e..78d620b 100644 (file)
@@ -123,7 +123,7 @@ Setting up Netconf server
    - Ubuntu :  
    
        | cd <O-DU High Directory>/l2/build/scripts
-       | sudo ./install_lib.sh -c
+       | sudo ./install_lib_O1.sh -c
 
 - Start Netopeer2-server: