test #160
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
branches: | |
- master | |
- github-cicd | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '30 2 * * 0' | |
jobs: | |
build: | |
runs-on: Ubuntu-20.04 | |
timeout-minutes: 90 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 # otherwise will fail to push refs to dest repo | |
- run: pip3 install docutils | |
- run: git submodule update --init --recursive --remote | |
- run: python3 generate_installation_script.py | |
- run: sudo swapoff -a | |
- name: Install Dependencies | |
run: | | |
sudo apt install nfs-common | |
sudo apt-get install build-essential cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev libtool autoconf | |
sudo apt-get install libzmq3-dev | |
sudo apt install libtool autoconf | |
- name: Install asn1c Compiler | |
run: | | |
cd asn1c | |
autoreconf -iv | |
./configure | |
make -j4 | |
sudo make install | |
sudo ldconfig | |
- name: Install O-RAN Near Real-Time RIC | |
run: | | |
# Step 2: Install Kubernetes, Docker, and Helm (4 minutes) | |
cd RIC-Deployment/tools/k8s/bin | |
./gen-cloud-init.sh | |
sudo ./k8s-1node-cloud-init-k_1_16-h_2_17-d_cur.sh | |
sudo kubectl get pods -A | |
sudo kubectl create ns ricinfra | |
sudo helm install stable/nfs-server-provisioner --namespace ricinfra --name nfs-release-1 | |
sudo kubectl patch storageclass nfs -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' | |
# Step 3: Build Modified E2 docker Image (7 minutes) | |
sudo docker run -d -p 5001:5000 --restart=always --name ric registry:2 | |
cd ../../../.. | |
cd ric-plt-e2 | |
cd RIC-E2-TERMINATION | |
sudo docker build -f Dockerfile -t localhost:5001/ric-plt-e2:5.5.0 . | |
sudo docker push localhost:5001/ric-plt-e2:5.5.0 | |
cd ../../ | |
# Step 4: Deploy the near-Real Time RIC (3 minutes) | |
cd RIC-Deployment/bin | |
sudo ./deploy-ric-platform -f ../RECIPE_EXAMPLE/PLATFORM/example_recipe_oran_e_release_modified_e2.yaml | |
- name: Install srsRAN with E2-Like Agent | |
run: | | |
# compile srsRAN-e2 with e2-like build flags (19 minutes without running tests) | |
cd srsRAN-e2 | |
mkdir build | |
export SRS=`realpath .` | |
cd build | |
cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DENABLE_E2_LIKE=1 \ | |
-DENABLE_AGENT_CMD=1 \ | |
-DRIC_GENERATED_E2AP_BINDING_DIR=${SRS}/e2_bindings/E2AP-v01.01 \ | |
-DRIC_GENERATED_E2SM_KPM_BINDING_DIR=${SRS}/e2_bindings/E2SM-KPM \ | |
-DRIC_GENERATED_E2SM_GNB_NRT_BINDING_DIR=${SRS}/e2_bindings/E2SM-GNB-NRT | |
make -j4 | |
cd ../.. | |
- name: Install srsRAN with E2 Agent | |
run: | | |
# compile srsRAN-e2 (19 minutes without running tests) | |
cd srsRAN-e2 | |
rm -rf build | |
mkdir build | |
export SRS=`realpath .` | |
cd build | |
cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DRIC_GENERATED_E2AP_BINDING_DIR=${SRS}/e2_bindings/E2AP-v01.01 \ | |
-DRIC_GENERATED_E2SM_KPM_BINDING_DIR=${SRS}/e2_bindings/E2SM-KPM \ | |
-DRIC_GENERATED_E2SM_GNB_NRT_BINDING_DIR=${SRS}/e2_bindings/E2SM-GNB-NRT | |
make -j4 | |
#make test | |
sudo make install | |
sudo ldconfig | |
sudo srsran_install_configs.sh service # --force | |
- name: Set up 5G Network | |
run: | | |
echo ">>> Adding UE1..." | |
sudo ip netns add ue1 | |
echo ">>> Starting EPC..." | |
sudo srsepc & pid_epc=$! | |
echo ">>> Getting E2NODE IP..." | |
export E2NODE_IP=`hostname -I | cut -f1 -d' '` | |
echo ">>> E2NODE IP is ${E2NODE_IP}" | |
export E2NODE_PORT=5006 | |
echo ">>> Getting E2TERM IP..." | |
export E2TERM_IP=`sudo kubectl get svc -n ricplt --field-selector metadata.name=service-ricplt-e2term-sctp-alpha -o jsonpath='{.items[0].spec.clusterIP}'` | |
echo ">>> E2TERM IP is ${E2TERM_IP}" | |
echo ">>> Starting eNB..." | |
sudo srsenb --enb.n_prb=50 --enb.name=enb1 --enb.enb_id=0x19B \ | |
--rf.device_name=zmq --rf.device_args="fail_on_disconnect=true,tx_port0=tcp://*:2000,rx_port0=tcp://localhost:2001,tx_port1=tcp://*:2100,rx_port1=tcp://localhost:2101,id=enb,base_srate=23.04e6" \ | |
--ric.agent.remote_ipv4_addr=${E2TERM_IP} --log.all_level=warn --ric.agent.log_level=debug --log.filename=enbLog.txt --ric.agent.local_ipv4_addr=${E2NODE_IP} --ric.agent.local_port=${E2NODE_PORT} & pid_enb=$! | |
echo ">>> eNB started with pid ${pid_enb}" | |
echo ">>> Waiting for RIC state to establish" | |
sleep 120 | |
echo ">>> Starting UE..." | |
sudo srsue --gw.netns=ue1 & pid_ue=$! | |
sleep 120 | |
echo ">>> Pinging IP address..." | |
#timeout 5 sudo ip netns exec ue1 ping 172.16.0.1 -O -c 10 ; rc=$? # 124 for succesful ping | |
#if [ $rc -ne 124 ] ; then exit -1 ; fi | |
#echo ">>> 5G Network setup completed" | |
while ! sudo ip netns exec ue1 ping 172.16.0.1 -c3; do echo "Ping Fail"; done ; echo "5G Network setup completed" ; | |
# - name: Deploy and test KPIMON | |
# run: | | |
# OAIC=`pwd` | |
# sudo apt-get install nginx | |
# | |
# sudo systemctl start nginx.service | |
# | |
# cd /etc/nginx/sites-enabled | |
# sudo unlink default | |
# cd ../ | |
# cd ../../var/www | |
# sudo mkdir xApp_config.local | |
# cd xApp_config.local/ | |
# sudo mkdir config_files | |
# | |
# cd ../../../etc/nginx/conf.d | |
# sudo sh -c "echo 'server { | |
# listen 5010 default_server; | |
# server_name xApp_config.local; | |
# location /config_files/ { | |
# | |
# root /var/www/xApp_config.local/; | |
# } | |
# | |
# }' >xApp_config.local.conf" | |
# | |
# echo ">>> reloading nginx..." | |
# sudo nginx -t | |
# cd ${OAIC} | |
# sudo cp ric-scp-kpimon/scp-kpimon-config-file.json /var/www/xApp_config.local/config_files/ | |
# sudo systemctl reload nginx | |
# | |
# | |
# echo ">>> getting machine IP..." | |
# export MACHINE_IP=`hostname -I | cut -f1 -d' '` | |
# | |
# echo ">>> checking for config-file" | |
# curl http://${MACHINE_IP}:5010/config_files/scp-kpimon-config-file.json | |
# | |
# echo ">>> building docker image...." | |
# cd ${OAIC}/ric-scp-kpimon | |
# echo ">>> checking directory" | |
# ls | |
# sudo docker build . -t xApp-registry.local:5008/scp-kpimon:1.0.1 | |
# | |
# export KONG_PROXY=`sudo kubectl get svc -n ricplt -l app.kubernetes.io/name=kong -o jsonpath='{.items[0].spec.clusterIP}'` | |
# export APPMGR_HTTP=`sudo kubectl get svc -n ricplt --field-selector metadata.name=service-ricplt-appmgr-http -o jsonpath='{.items[0].spec.clusterIP}'` | |
# export ONBOARDER_HTTP=`sudo kubectl get svc -n ricplt --field-selector metadata.name=service-ricplt-xapp-onboarder-http -o jsonpath='{.items[0].spec.clusterIP}'` | |
# | |
# echo "KONG_PROXY = $KONG_PROXY" | |
# echo "APPMGR_HTTP = $APPMGR_HTTP" | |
# echo "ONBOARDER_HTTP = $ONBOARDER_HTTP" | |
# | |
# echo ">>> getting charts..." | |
# curl --location --request GET "http://$KONG_PROXY:32080/onboard/api/v1/charts" | |
# ls | |
# echo '{"config-file.json_url":"http://'$MACHINE_IP':5010/config_files/scp-kpimon-config-file.json"}' > scp-kpimon-onboard.url | |
# | |
# echo ">>> scp-kpimon-onboard.url" | |
# cat scp-kpimon-onboard.url | |
# | |
# echo ">>> curl POST..." | |
# curl -L -X POST "http://$KONG_PROXY:32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@scp-kpimon-onboard.url" | |
# | |
# echo ">>> curl GET..." | |
# curl -L -X GET "http://$KONG_PROXY:32080/onboard/api/v1/charts" | |
# | |
# echo ">>> curl POST..." | |
# curl -L -X POST "http://$KONG_PROXY:32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "scp-kpimon"}' | |
# | |
# sleep 10 | |
# | |
# echo ">>> getting pods..." | |
# sudo kubectl get pods -A | grep 'kpimon' | grep 'Running' | |
# | |
# echo ">>> showing kubernetes logs..." | |
# | |
# sudo timeout 5 sudo kubectl logs -f -n ricxapp -l app=ricxapp-scp-kpimon || rc=$? | |
# #rc=$? #124 for succesful ping | |
# if [ $rc -ne 124 ] ; then exit -1 ; fi | |
# #sudo kubectl logs -f -n ricxapp -l app=ricxapp-scp-kpimon | |
# | |
# echo ">>> printing decoded metrics..." | |
# sudo timeout 5 sudo kubectl exec -it -n ricxapp `sudo kubectl get pod -n ricxapp -l app=ricxapp-scp-kpimon -o jsonpath='{.items[0].metadata.name}'` -- tail -F /opt/kpimon.log || rc=$? | |
# if [ $rc -ne 124 ] ; then exit -1 ; fi | |
# | |
# echo 'Successful: KPIMON xApp up and running' | |
#- run: sudo bash setup5GNetwork.sh | |
#- run: sudo bash deployKPIMON.sh |