Verified Commit e679332e authored by Rohan's avatar Rohan
Browse files

Deployment script updated

parent 2e6c5f16
......@@ -29,7 +29,9 @@ if [[ $1 == 'start' ]]; then
docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim-vpp
elif [[ $2 == 'vpp-upf' ]]; then
echo -e "${BLUE}Starting 5gcn with vpp-upf ${NC}..."
docker-compose -f docker-compose-vpp-upf.yaml up -d
docker-compose -f docker-compose-vpp-upf.yaml up -d oai-amf
sleep 5
docker-compose -f docker-compose-vpp-upf.yaml up -d oai-smf
else
echo -e "${BLUE}Starting 5gcn components in the order mysql, amf, smf, spgwu${NC}..."
docker-compose -f docker-compose-no-nrf.yaml -p 5gcn up -d
......@@ -41,20 +43,26 @@ if [[ $1 == 'start' ]]; then
nrf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-nrf)
elif [[ $2 == 'gnbsim' ]]; then
gnbsim_health=$(docker inspect --format='{{json .State.Health.Status}}' gnbsim)
elif [[ $2 == 'vpp-upf' ]]; then
vpp_upf_health=$(docker inspect --format='{{json .State.Health.Status}}' vpp-upf)
fi
amf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-amf)
smf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-smf)
spgwu_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-spgwu)
if [[ $2 == 'vpp-upf' ]];then
vpp_upf_health=$(docker inspect --format='{{json .State.Health.Status}}' vpp-upf)
sleep 5
upf_logs=$(docker logs oai-smf | grep 'handle_receive(16 bytes)')
else
spgwu_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-spgwu)
upf_logs=$(docker logs oai-spgwu | grep 'Received SX HEARTBEAT RESPONSE')
fi
if [[ ${mysql_health} == '"healthy"' && ${amf_health} == '"healthy"' && ${smf_health} == '"healthy"' && ${spgwu_health} == '"healthy"' && $2 != 'nrf' && $2 != 'gnbsim' ]]; then
echo -e "\n${GREEN}All components are healthy${NC}..."
STATUS=0
STATUS=0 CVZxbag
break
elif [[ $2 == 'gnbsim' ]]; then
echo -ne "gnbsim : $gnbsim_health\033[0K\r"
if [[ ${gnbsim_health} == '"healthy"' ]]; then
STATUS=0
STATUS=0
break
fi
sleep 2
......@@ -62,6 +70,11 @@ if [[ $1 == 'start' ]]; then
echo -e "\n${GREEN}All components are healthy${NC}..."
STATUS=0
break
elif [[ $2 == 'vpp-upf' ]]; then
echo -ne "mysql : $mysql_health, oai-amf : $amf_health, oai-smf : $smf_health,vpp-upf : $vpp_upf_health\033[0K\r"
STATUS=0
sleep 2
break
elif [[ $2 != 'nrf' ]]; then
echo -ne "mysql : $mysql_health, oai-amf : $amf_health, oai-smf : $smf_health, oai-spgwu : $spgwu_health\033[0K\r"
STATUS=1
......@@ -88,7 +101,14 @@ if [[ $1 == 'start' ]]; then
echo -e "${GREEN}#### gnbsim is healthy - gnb & ue is conncted to core network now !! #####${NC}"
else
echo -e "${BLUE}Checking if SMF is able to connect with UPF${NC}"
upf_logs=$(docker logs oai-spgwu | grep 'Received SX HEARTBEAT RESPONSE')
if [[ $2 == 'vpp-upf' ]];then
sleep 5
upf_logs=$(docker logs oai-smf | grep 'handle_receive(16 bytes)')
else
upf_logs=$(docker logs oai-spgwu | grep 'Received SX HEARTBEAT RESPONSE')
fi
if [[ -z $upf_logs && $STATUS == 0 ]]; then
echo -e "\n${RED}UPF not receiving heartbeats from SMF${NC}..."
STATUS=1
......
......@@ -69,6 +69,7 @@ services:
- AUSF_API_VERSION=v1
depends_on:
- mysql
- vpp-upf
volumes:
- ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
healthcheck:
......@@ -108,15 +109,15 @@ services:
- USE_NETWORK_INSTANCE=yes
extra_hosts:
- "gw1.vppupf.node.5gcn.mnc95.mcc208.3gppnetwork.org:192.168.71.202"
# depends_on:
# - oai-amf
# volumes:
# - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
# healthcheck:
# test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
# interval: 10s
# timeout: 5s
# retries: 5
depends_on:
- oai-amf
volumes:
- ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
healthcheck:
test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net_core:
ipv4_address: 192.168.71.133
......
#!/bin/bash
set -eo pipefail
sleep 2
IS_VPP_UPF=$(docker ps -a | grep vpp-upg | awk {'print $2'})
if [$IS_VPP_UPF=="vpp-upg:develop"];then
x=1, VPP_STATUS=0
while [ $x -le 10 ]
do
VPP_UPF_PFCP_ENDPOINT=$(docker exec -it vpp-upf ./bin/vppctl show upf pfcp endpoint | awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')
PING_STATE=$(ping -c 3 $VPP_UPF_PFCP_ENDPOINT | grep "icmp_seq")
if [ -z "$var" ];then
echo "PFCP endpoint could not be reached"
else
echo "PFCP endpoint is ready, restarting SMF"
docker restart oai-smf
fi
x=$(( $x + 1 ))
done
fi
STATUS=0
SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
......@@ -35,4 +17,4 @@ if [[ -z $SMF_SBI_PORT_STATUS ]]; then
echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $SMF_INTERFACE_PORT_FOR_SBI is not listening."
fi
exit $STATUS
\ No newline at end of file
exit $STATUS
......@@ -22,4 +22,4 @@
5. [Tutorial: 5G Core Network Deployment using Helm Charts](./DEPLOY_SA5G_HC.md)
6. [Tutorial: 5G Core Network Deployment and Testing with gnbsim](./DEPLOY_SA5G_WITH_GNBSIM.md)
7. [Tutorial: 5G Core Network Deployment in Virtual Machines and Testing with COTSUE](./DEPLOY_SA5G_VM_COTSUE.md)
8. [Tutorial: 5G Core Network Deployment and Testing with VPP-UPF](./DEPLOY_SA5G_WITH_VPP_UPF.md)
8. [Tutorial: 5G Core Network Deployment and Testing with VPP-UPF (Travelping)](./DEPLOY_SA5G_WITH_VPP_UPF.md)
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