Skip to content
Snippets Groups Projects
Commit d7ae0161 authored by ismail's avatar ismail
Browse files

updated to create network brige automatically and also to capture the pcaps

parent 82d5c1c0
No related branches found
No related tags found
No related merge requests found
......@@ -37,24 +37,11 @@ def cn_ci_host = params.Host_CN_CI_Server
// for lock
def cn_ci_resource = params.DockerContainers
// When triggered by upstream, specify which tag to use
def upstreamTagToUse = params.upstreamTagToUse
// Location of the 2nd CN executor
def new_host_flag = false
def new_host = ""
def new_host_user = ""
// Location of the CN tester
def dsT_host_flag = false
def dsT_host = ""
def dsT_host_user = ""
def dsT_host_ip_addr = ""
// Flags
def scmEvent = false
def upstreamEvent = false
//-------------------------------------------------------------------------------
// Pipeline start
pipeline {
......@@ -90,20 +77,7 @@ pipeline {
echo "Node is ${NODE_NAME}"
}
// Find out the cause of the trigger
for (cause in currentBuild.getBuildCauses()) {
if (cause.toString() ==~ /.*UpstreamCause.*/) {
upstreamEvent = true
}
}
if (upstreamEvent) {
sh "git clean -x -d -f > /dev/null 2>&1"
sh "git fetch --prune > /dev/null 2>&1"
sh 'git checkout -f ' + upstreamTagToUse
}
if ((!upstreamEvent) && (!scmEvent)) {
sh "git clean -x -d -f > /dev/null 2>&1"
}
sh "git clean -x -d -f > /dev/null 2>&1"
sh "mkdir -p archives/cn5g"
sh "mkdir -p archives/cn5gwithnoNRF"
}
......@@ -117,7 +91,7 @@ pipeline {
sh 'docker-compose -f docker-compose.yaml up -d > ../archives/cn5g/compose_5gcn_up.log 2>&1'
sh 'sleep 100'
// Do a check on number of healthy containers
// 6 == mysql + nrf + amf + smf + upf(spgwu-tiny)
// 5 == mysql + nrf + amf + smf + upf(spgwu-tiny)
ret = sh returnStdout: true, script: 'docker-compose ps -a | grep -v unhealthy | grep -c healthy || true'
ret = ret.trim()
if (ret != '5') {
......@@ -166,7 +140,7 @@ pipeline {
sh 'docker-compose -f docker-compose-no-nrf.yaml up -d > ../archives/cn5gwithnoNRF/compose_5gcn_up.log 2>&1'
sh 'sleep 100'
// Do a check on number of healthy containers
// 5 == mysql + amf + smf + upf(spgwu-tiny)
// 4 == mysql + amf + smf + upf(spgwu-tiny)
ret = sh returnStdout: true, script: 'docker-compose ps -a | grep -v unhealthy | grep -c healthy || true'
ret = ret.trim()
if (ret != '4') {
......
......@@ -23,6 +23,12 @@ services:
oai-amf:
container_name: "oai-amf"
image: oai-amf:develop
command: >
bash -c "nohup tshark -i eth0 -w /tmp/amf.pcap 2>&1 > /dev/null &
/openair-amf/bin/oai_amf -c /openair-amf/etc/amf.conf -o | tee /tmp/amf.log 2>&1
"
cap_add:
- NET_ADMIN
environment:
- TZ=Europe/paris
- INSTANCE=0
......@@ -88,6 +94,12 @@ services:
oai-smf:
container_name: "oai-smf"
image: oai-smf:develop
command: >
bash -c "nohup tshark -i eth0 -w /tmp/smf.pcap 2>&1 > /dev/null &
/openair-smf/bin/oai_smf -c /openair-smf/etc/smf.conf -o | tee /tmp/smf.log 2>&1
"
cap_add:
- NET_ADMIN
environment:
- TZ=Europe/Paris
- INSTANCE=0
......@@ -131,6 +143,10 @@ services:
oai-spgwu:
container_name: "oai-spgwu"
image: oai-spgwu-tiny:develop
command: >
bash -c "nohup tshark -i eth0 -w /tmp/spgwu.pcap 2>&1 > /dev/null &
/openair-spgwu-tiny/bin/oai_spgwu -c /openair-spgwu-tiny/etc/spgw_u.conf -o | tee /tmp/spgwu.log 2>&1
"
environment:
- TZ=Europe/Paris
- PID_DIRECTORY=/var/run
......@@ -194,7 +210,6 @@ networks:
public_net:
external:
name: demo-oai-public-net
# Incase the user wants docker-compose to create a bridge rather than creating the bridge manually then uncomment the below lines
public_net:
driver: bridge
name: demo-oai-public-net
......
......@@ -3,6 +3,12 @@ services:
oai-nrf:
container_name: "oai-nrf"
image: oai-nrf:develop
command: >
bash -c "nohup tshark -i eth0 -w /tmp/nrf.pcap 2>&1 > /dev/null &
/openair-nrf/bin/oai_nrf -c /openair-nrf/etc/nrf.conf -o | tee /tmp/nrf.log 2>&1
"
cap_add:
- NET_ADMIN
environment:
- NRF_INTERFACE_NAME_FOR_SBI=eth0
- NRF_INTERFACE_PORT_FOR_SBI=80
......@@ -43,6 +49,12 @@ services:
oai-amf:
container_name: "oai-amf"
image: oai-amf:develop
command: >
bash -c "nohup tshark -i eth0 -w /tmp/amf.pcap 2>&1 > /dev/null &
/openair-amf/bin/oai_amf -c /openair-amf/etc/amf.conf -o | tee /tmp/amf.log 2>&1
"
cap_add:
- NET_ADMIN
environment:
- TZ=Europe/paris
- INSTANCE=0
......@@ -108,6 +120,12 @@ services:
oai-smf:
container_name: "oai-smf"
image: oai-smf:develop
command: >
bash -c "nohup tshark -i eth0 -w /tmp/smf.pcap 2>&1 > /dev/null &
/openair-smf/bin/oai_smf -c /openair-smf/etc/smf.conf -o | tee /tmp/smf.log 2>&1
"
cap_add:
- NET_ADMIN
environment:
- TZ=Europe/Paris
- INSTANCE=0
......@@ -151,6 +169,10 @@ services:
oai-spgwu:
container_name: "oai-spgwu"
image: oai-spgwu-tiny:develop
command: >
bash -c "nohup tshark -i eth0 -w /tmp/spgwu.pcap 2>&1 > /dev/null &
/openair-spgwu-tiny/bin/oai_spgwu -c /openair-spgwu-tiny/etc/spgw_u.conf -o | tee /tmp/spgwu.log 2>&1
"
environment:
- TZ=Europe/Paris
- PID_DIRECTORY=/var/run
......@@ -214,7 +236,6 @@ networks:
public_net:
external:
name: demo-oai-public-net
# Incase the user wants docker-compose to create a bridge rather than creating the bridge manually then uncomment the below lines
public_net:
driver: bridge
name: demo-oai-public-net
......
......@@ -99,43 +99,6 @@
# 3. Networking #
- The [docker-compose.yaml](../docker-compose/docker-compose.yaml) can create the network automatically, currently in the file automatic network creation is disabled. It can be enabled by uncommenting the lines.
```bash
networks:
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
```
- In user wants to create manual network then below is the command
components. To capture initial message exchange between smf<-->nrf<-->upf.
```bash
(docker-compose-host)$ docker network create \
--driver=bridge \
--subnet=192.168.70.128/26 \
-o "com.docker.network.bridge.name"="demo-oai" \
demo-oai-public-net
455631b3749ccd6f10a366cd1c49d5a66cf976d176884252d5d88a1e54049bc5
(docker-compose-host)$ ifconfig demo-oai
demo-oai: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.70.129 netmask 255.255.255.192 broadcast 192.168.70.191
ether 02:42:9c:0a:23:44 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(docker-compose-host)$ docker network ls
NETWORK ID NAME DRIVER SCOPE
d2d34e05bb2d bridge bridge local
455631b3749c demo-oai-public-net bridge local
```
- The [docker-compose.yaml](../docker-compose/docker-compose.yaml) will create the network automatically.
You are ready to check out the tutorial that [how 5g core works](./DEPLOY_SA5G_WITH_DS_TESTER.md).
......@@ -62,42 +62,11 @@ To know how to configure the machine with the above requirements vist [pre-requi
## 3. Configuring Host Machines ##
- The `docker-compose-host` machine needs to be configured with `demo-oai-public-net` bridge before deploying core network components. To capture initial message exchange between smf<-->nrf<-->upf.
- The `docker-compose-host` machine will be configured with `demo-oai-public-net` bridge automatically using [docker-compose.yaml](../docker-compose/docker-compose.yaml) at the time of deploying core network components. And also for each component it will start capturing `pcap` messages and stores it on the `/tmp/` location of that container. Use the below command as shown as an example.
```bash
(docker-compose-host)$ docker network create \
--driver=bridge \
--subnet=192.168.70.128/26 \
-o "com.docker.network.bridge.name"="demo-oai" \
demo-oai-public-net
455631b3749ccd6f10a366cd1c49d5a66cf976d176884252d5d88a1e54049bc5
(docker-compose-host)$ ifconfig demo-oai
demo-oai: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.70.129 netmask 255.255.255.192 broadcast 192.168.70.191
ether 02:42:9c:0a:23:44 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(docker-compose-host)$ docker network ls
NETWORK ID NAME DRIVER SCOPE
d2d34e05bb2d bridge bridge local
455631b3749c demo-oai-public-net bridge local
(docker-compose-host)$ docker cp container_name:/tmp/amf.pcap amf.pcap
```
- Optional, Though the bridge can be automatically created using docker-compose file if there is no need to capture initial packets. Uncomment the last lines of the [docker-compose.yaml](../docker-compose/docker-compose.yaml) or docker-compose-no-nrf.yaml. Else replace with below section
```
networks:
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
```
- Optional, if the `docker-compose-host` machine is not configured with packet forwarding then it can be done using below command,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment