Skip to content

Commit 30cf49a

Browse files
authored
Merge pull request #156 from sdnfv/develop
This PR releases OpenNetVM v19.07
2 parents c12d26d + e13c9e5 commit 30cf49a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+8206
-1667
lines changed

ci/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
access_log
21
config
32
webhook-config.json
43
encrypted_secret.bin
@@ -10,4 +9,7 @@ repository
109
linter-output.txt
1110
*key
1211
*.pub
13-
*.stats
12+
*stats
13+
*out*
14+
*log*
15+
nimbnode*

ci/README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### Setting up CI
44
Run a Flask server that listens for new events from github, will get triggered when a new PR is created or when keyword `@onvm` is mentioned.
55
```sh
6-
python3 webhook-receiver.py 0.0.0.0 8080 @onvm webhook-config.json
6+
./run_ci.sh 0.0.0.0 8080 @onvm webhook-config.json
77
```
88

99
To run CI tests manually, requires a config file, the github PR ID, request message and a response message.
@@ -69,7 +69,7 @@ The CI process can be broken into multiple steps:
6969
7070
5. Run linter on the checked out code
7171
72-
Runs the `run_linter` function in `helper-functions.sh`
72+
Runs the `run_linter` function in `helper-manager-functions.sh`
7373
7474
6. Clean up and restart all worker nodes
7575
@@ -83,11 +83,15 @@ The CI process can be broken into multiple steps:
8383
8484
Use paramiko to ssh and run `run-workload.py`
8585
86-
9. Acquire results from the worker nodes
86+
9. Run modes are supplied to tell the worker which applications to test
87+
88+
Handle installation with `worker_files/worker.sh` for builds, and setting up manager for performance tests
89+
90+
10. Acquire results from the worker nodes
8791
8892
Use scp to copy the result stat file from worker
8993
90-
10. Submit results as a comment on github
94+
11. Submit results as a comment on github
9195
9296
Uses the `post-msg.py` script
9397
@@ -106,6 +110,33 @@ ProxyPassReverse /onvm-ci/ http://nimbnode44:8080/
106110
```
107111
(Also need to setup github webhook to post to **http://nimbus.seas.gwu.edu/onvm-ci/github-webhook**)
108112
113+
### Public and Private CI Runs
114+
115+
CI is now able to accept requests from unauthenticated users. There is a list of Github users in the public project allowed to create a full run. Anyone who is able to view the private `-dev` repository is able to run CI there as well. In `openNetVM`, if a user is not in our list, the linter and branch checks will be executed, ignoring statistics calculations from the worker nodes.
116+
117+
### Setting Up a Connected Worker
118+
119+
Connecting two nodes is useful for measuring statistics with tools like Pktgen and the MTCP stack. There is a bit of setup required to get working connection working. Firstly, an SFP+ 10Gb Intel cable will be required to connect the Network Interface Cards in the two machines. Once this is done, attempt to bring up the correct interfaces for a stable connection. Some debugging might be required:
120+
- If you don't know which `ifconfig -a` interface is correct, use `ethtool -p <interface name> 120`
121+
- This will blink a light on the interface (you have to be next to the machine for this to help)
122+
- Do this on both machines, to find the name of the interfaces that are linked
123+
- Run `sudo ifconfig <interface name> 11.0.0.1/24 up` on the first machine and `sudo ifconfig <interface name> 11.0.0.2/24 up`
124+
- This will ensure `ping` understands what IP address it is supposed to talk to
125+
- If `ping -I <interface> 11.0.0.2` on the first machine works, great, if not, try changing the IP addresses or viewing `dmesg`
126+
127+
Now that the interfaces are connected, choose which machine will be the CI worker, and which is a helper (Pktgen for example). Install Pktgen on this node by sending the `ci/install_pktgen` files to that machines' home folder. *Remember public keys must be created for all new machines*. Store these public keys in a folder with the server name, see the next section on statistics for more information. Run `chmod +x install-pktgen.sh` if it's not already an executable and run `./install-pktgen.sh` to install everything. If there are dependency errors, the machine might be a different version, so try to install the necessary packages. Once everything is installed, test ONVM->Pktgen between the machines, and if a connection is established, CI should work just fine with no more setup!
128+
129+
### Advanced Statistics
130+
131+
As CI continued to improve, with more programs to test with, benchmarks were made to track the average performance of a worker. In the future, CI will be able to handle multiple workers running many different tests. Since server configurations are not all the same, some with different hardware (Intel x710 vs. x520 NIC for example), performance of the nodes will not be the same. All that matters with CI is that the result of a run is the same or better, not globally across all nodes, but based on the specific server it ran on. For each worker, create a folder in the ci directory with the name of the worker IP. For example if `nimbnode17` is the current worker, a folder with path `/ci/nimbnode17/` should exist. In this folder, 3 files should be there at least. Firstly, a `benchmarks` file (used by the manager) should look similar to this:
132+
133+
```
134+
AVG_SPEED_TESTER_SPEED=40000000
135+
AVG_PKTGEN_SPEED=10000000
136+
AVG_MTCP_SPEED=.230
137+
```
138+
This is a configuration file, sourced by the manager to keep track of `nimbnode17`'s average performance for each test (currently Speed Tester, Pktgen, and mTCP). The other two files in the folder should be the two public keys, one for the worker, and the second for the worker's client server. Check the previous section on setting up a connection for more information.
139+
109140
### Checking if Online
110141
111142
If you are worried if the CI build is offline or want to make sure it is listening for events, you can check the following url: curl http://nimbus.seas.gwu.edu/onvm-ci/status. If that URL returns 404, CI is offline. Otherwise it will display a message saying it is online.

ci/ci_busy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
. helper-functions.sh
5+
. helper-manager-functions.sh
66
SCRIPT_LOC=$(pwd)
77

88
print_header "Validating Config File and Sourcing Variables"

ci/helper-functions.sh renamed to ci/helper-manager-functions.sh

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -36,47 +36,6 @@ print_header() {
3636
done
3737
echo "--"
3838
echo ""
39-
40-
sleep 1
41-
}
42-
43-
# sets up dpdk, sets env variables, and runs the install script
44-
install_env() {
45-
git submodule sync
46-
git submodule update --init
47-
48-
echo export ONVM_HOME=$(pwd) >> ~/.bashrc
49-
export ONVM_HOME=$(pwd)
50-
51-
cd dpdk
52-
53-
echo export RTE_SDK=$(pwd) >> ~/.bashrc
54-
export RTE_SDK=$(pwd)
55-
56-
echo export RTE_TARGET=x86_64-native-linuxapp-gcc >> ~/.bashrc
57-
export RTE_TARGET=x86_64-native-linuxapp-gcc
58-
59-
echo export ONVM_NUM_HUGEPAGES=1024 >> ~/.bashrc
60-
export ONVM_NUM_HUGEPAGES=1024
61-
62-
echo $RTE_SDK
63-
64-
sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space"
65-
66-
cd ../
67-
pwd
68-
. ./scripts/install.sh
69-
}
70-
71-
# makes all onvm code
72-
build_onvm() {
73-
cd onvm
74-
make clean && make
75-
cd ../
76-
77-
cd examples
78-
make clean && make
79-
cd ../
8039
}
8140

8241
# obtains core config in cores.out file
@@ -142,3 +101,9 @@ run_linter() {
142101
fi
143102
done
144103
}
104+
105+
# inputs are key_file, worker ip address, stats file - in that order 1,2,3
106+
fetch_files() {
107+
scp -i $1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null $2:$3 ./$2.$3
108+
check_exit_code "ERROR: Failed to fetch results from $2"
109+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../worker_files/helper-worker-functions.sh

ci/install_pktgen/install-pktgen.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
. helper-install-functions.sh
4+
5+
set -e
6+
7+
sudo rm -rf repository
8+
9+
git clone https://github.com/sdnfv/openNetVM.git repository
10+
check_exit_code "ERROR: Failed cloning"
11+
12+
print_header "Installing Dependencies"
13+
sudo apt-get update
14+
sudo apt-get upgrade -y
15+
sudo apt-get install -y build-essential linux-headers-$(uname -r) git
16+
sudo apt-get install -y libnuma1
17+
sudo apt-get install -y libnuma-dev
18+
sudo apt-get install libpcap-dev
19+
sudo apt-get install libreadline-dev
20+
21+
print_header "Installing Lua"
22+
curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
23+
tar zxf lua-5.3.5.tar.gz
24+
cd lua-5.3.5
25+
sudo make linux test
26+
sudo make install
27+
28+
cd repository
29+
30+
print_header "Installing Environment"
31+
install_env $RUN_PKT
32+
check_exit_code "ERROR: Installing environment failed"
33+
34+
print_header "Make pktgen-dpdk"
35+
cd ~/repository/tools/Pktgen/pktgen-dpdk/
36+
make
37+
38+
print_header "Updating lua script"
39+
cp ~/pktgen-timed-config.lua ~/repository/tools/Pktgen/openNetVM-Scripts/pktgen-config.lua
40+
41+
print_header "Pktgen installed"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
-- openNetVM
2+
-- https://github.com/sdnfv/openNetVM
3+
--
4+
-- BSD LICENSE
5+
--
6+
-- Copyright(c)
7+
-- 2015-2016 George Washington University
8+
-- 2015-2016 University of California Riverside
9+
-- All rights reserved.
10+
11+
-- Redistribution and use in source and binary forms, with or without
12+
-- modification, are permitted provided that the following conditions
13+
-- are met:
14+
15+
-- Redistributions of source code must retain the above copyright
16+
-- notice, this list of conditions and the following disclaimer.
17+
-- Redistributions in binary form must reproduce the above copyright
18+
-- notice, this list of conditions and the following disclaimer in
19+
-- the documentation and/or other materials provided with the
20+
-- distribution.
21+
-- The name of the author may not be used to endorse or promote
22+
-- products derived from this software without specific prior
23+
-- written permission.
24+
25+
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26+
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27+
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28+
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29+
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30+
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31+
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32+
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33+
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34+
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35+
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36+
37+
-- Change any of the settings below to configure Pktgen-DPDK
38+
39+
-- A list of the test script for Pktgen and Lua.
40+
-- Each command somewhat mirrors the pktgen command line versions.
41+
-- A couple of the arguments have be changed to be more like the others.
42+
43+
package.path = package.path ..";?.lua;test/?.lua;app/?.lua;"
44+
45+
require "Pktgen"
46+
47+
local function doWait(port, waitTime)
48+
local idx;
49+
50+
pktgen.delay(1000);
51+
52+
pkt_rate_file = io.open("port_stats", "w");
53+
54+
if ( waitTime == 0 ) then
55+
return;
56+
end
57+
waitTime = waitTime - 1;
58+
59+
-- Try to wait for the total number of packets to be sent.
60+
local idx = 0;
61+
while( idx < waitTime ) do
62+
-- Write port stats to output file separated by line
63+
pkt_rate_file:write(pktgen.portStats("all", "rate")[0]["pkts_rx"] .. "\n");
64+
idx = idx + 1;
65+
66+
local sending = pktgen.isSending(port);
67+
if ( sending[tonumber(port)] == "n" ) then
68+
break;
69+
end
70+
pktgen.delay(1000);
71+
end
72+
73+
pkt_rate_file:close()
74+
end
75+
76+
printf("Lua Version : %s\n", pktgen.info.Lua_Version);
77+
printf("Pktgen Version : %s\n", pktgen.info.Pktgen_Version);
78+
printf("Pktgen Copyright : %s\n", pktgen.info.Pktgen_Copyright);
79+
80+
prints("pktgen.info", pktgen.info);
81+
82+
printf("Port Count %d\n", pktgen.portCount());
83+
printf("Total port Count %d\n", pktgen.totalPorts());
84+
85+
86+
-- set up a mac address to set flow to
87+
--
88+
-- TO DO LIST:
89+
--
90+
-- Please update this part with the destination mac address, source and destination ip address you would like to sent packets to
91+
92+
pktgen.set_mac("0", "90:e2:ba:5e:73:21");
93+
pktgen.set_ipaddr("0", "dst", "10.11.1.17");
94+
pktgen.set_ipaddr("0", "src", "10.11.1.16");
95+
96+
pktgen.set_proto("all", "udp");
97+
pktgen.set_type("all", "ipv4");
98+
99+
pktgen.set("all", "size", 64)
100+
pktgen.set("all", "burst", 32);
101+
pktgen.set("all", "sport", 1234);
102+
pktgen.set("all", "dport", 1234);
103+
pktgen.set("all", "count", 1000000000);
104+
pktgen.set("all", "rate",100);
105+
106+
pktgen.vlan_id("all", "start", 1);
107+
108+
pktgen.start("all");
109+
doWait("all", 30);
110+
pktgen.quit();

0 commit comments

Comments
 (0)