-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pktgen for CI #148
Pktgen for CI #148
Changes from 47 commits
74676e5
3a97ae4
ef255d0
8ba65de
3a1874b
bf5e2a8
17882a6
1c2f52d
29bbef6
a1749cb
0c3a90b
45fdf70
c10dbb4
5b06b38
12935e3
b771745
04380b1
e7639ef
ed65879
3b01660
58a13ff
4bef1aa
05a89f8
24965be
7e71ec2
ee2220c
1c68a5f
32766cd
709c61b
a07c457
89af507
e57a6df
6f53017
b270224
5fa102d
8c48dd6
cbd1a61
eb39bc1
e787caf
d6774f3
93b94ee
5a652cb
d1e83bd
4f8fc06
fcd3b1a
ee97651
2d305f7
4f9928b
fd6332d
a9168f9
0f3dfd2
381f27d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../worker_files/helper-worker-functions.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
. helper-install-functions.sh | ||
|
||
set -e | ||
|
||
sudo rm -rf repository | ||
|
||
git clone https://github.com/sdnfv/openNetVM.git repository | ||
check_exit_code "ERROR: Failed installing onvm" | ||
|
||
print_header "Installing Dependencies" | ||
sudo apt-get update | ||
sudo apt-get upgrade -y | ||
sudo apt-get install -y build-essential linux-headers-$(uname -r) git | ||
sudo apt-get install -y libnuma1 | ||
sudo apt-get install -y libnuma-dev | ||
sudo apt-get install libpcap-dev | ||
sudo apt-get install libreadline-dev | ||
|
||
print_header "Installing Lua" | ||
curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz | ||
tar zxf lua-5.3.5.tar.gz | ||
cd lua-5.3.5 | ||
sudo make linux test | ||
sudo make install | ||
|
||
cd repository | ||
|
||
print_header "Beginning Execution of Workload" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rm |
||
|
||
print_header "Installing Environment" | ||
install_env $RUN_PKT | ||
check_exit_code "ERROR: Installing environment failed" | ||
|
||
print_header "Make pktgen-dpdk" | ||
cd ~/repository/tools/Pktgen/pktgen-dpdk/ | ||
make | ||
|
||
print_header "Updating lua script" | ||
cp ~/pktgen-timed-config.lua ~/repository/tools/Pktgen/openNetVM-Scripts/pktgen-config.lua | ||
|
||
print_header "Pktgen installed" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
-- openNetVM | ||
-- https://github.com/sdnfv/openNetVM | ||
-- | ||
-- BSD LICENSE | ||
-- | ||
-- Copyright(c) | ||
-- 2015-2016 George Washington University | ||
-- 2015-2016 University of California Riverside | ||
-- All rights reserved. | ||
|
||
-- Redistribution and use in source and binary forms, with or without | ||
-- modification, are permitted provided that the following conditions | ||
-- are met: | ||
|
||
-- Redistributions of source code must retain the above copyright | ||
-- notice, this list of conditions and the following disclaimer. | ||
-- Redistributions in binary form must reproduce the above copyright | ||
-- notice, this list of conditions and the following disclaimer in | ||
-- the documentation and/or other materials provided with the | ||
-- distribution. | ||
-- The name of the author may not be used to endorse or promote | ||
-- products derived from this software without specific prior | ||
-- written permission. | ||
|
||
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
-- Change any of the settings below to configure Pktgen-DPDK | ||
|
||
-- A list of the test script for Pktgen and Lua. | ||
-- Each command somewhat mirrors the pktgen command line versions. | ||
-- A couple of the arguments have be changed to be more like the others. | ||
|
||
package.path = package.path ..";?.lua;test/?.lua;app/?.lua;" | ||
|
||
require "Pktgen" | ||
|
||
local function doWait(port, waitTime) | ||
local idx; | ||
|
||
pktgen.delay(1000); | ||
|
||
pkt_rate_file = io.open("port_stats", "w"); | ||
|
||
if ( waitTime == 0 ) then | ||
return; | ||
end | ||
waitTime = waitTime - 1; | ||
|
||
-- Try to wait for the total number of packets to be sent. | ||
local idx = 0; | ||
while( idx < waitTime ) do | ||
|
||
-- Write port stats to output file separated by line | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add 2 spaces so comment lines up and remove the newline above |
||
pkt_rate_file:write(pktgen.portStats("all", "rate")[0]["pkts_rx"] .. "\n"); | ||
idx = idx + 1; | ||
|
||
local sending = pktgen.isSending(port); | ||
if ( sending[tonumber(port)] == "n" ) then | ||
break; | ||
end | ||
pktgen.delay(1000); | ||
end | ||
|
||
pkt_rate_file:close() | ||
end | ||
|
||
printf("Lua Version : %s\n", pktgen.info.Lua_Version); | ||
printf("Pktgen Version : %s\n", pktgen.info.Pktgen_Version); | ||
printf("Pktgen Copyright : %s\n", pktgen.info.Pktgen_Copyright); | ||
|
||
prints("pktgen.info", pktgen.info); | ||
|
||
printf("Port Count %d\n", pktgen.portCount()); | ||
printf("Total port Count %d\n", pktgen.totalPorts()); | ||
|
||
|
||
-- set up a mac address to set flow to | ||
-- | ||
-- TO DO LIST: | ||
-- | ||
-- Please update this part with the destination mac address, source and destination ip address you would like to sent packets to | ||
|
||
pktgen.set_mac("0", "90:e2:ba:5e:73:21"); | ||
pktgen.set_ipaddr("0", "dst", "10.11.1.17"); | ||
pktgen.set_ipaddr("0", "src", "10.11.1.16"); | ||
|
||
pktgen.set_proto("all", "udp"); | ||
pktgen.set_type("all", "ipv4"); | ||
|
||
pktgen.set("all", "size", 64) | ||
pktgen.set("all", "burst", 32); | ||
pktgen.set("all", "sport", 1234); | ||
pktgen.set("all", "dport", 1234); | ||
pktgen.set("all", "count", 1000000000); | ||
pktgen.set("all", "rate",100); | ||
|
||
pktgen.vlan_id("all", "start", 1); | ||
|
||
pktgen.start("all"); | ||
doWait("all", 30); | ||
pktgen.quit(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
set -e | ||
|
||
# source helper functions file | ||
. helper-functions.sh | ||
. helper-manager-functions.sh | ||
SCRIPT_LOC=$(pwd) | ||
|
||
print_header "Validating Config File and Sourcing Variables" | ||
|
@@ -78,7 +78,7 @@ fi | |
print_header "Cleaning up Old Results" | ||
|
||
sudo rm -f *.txt | ||
sudo rm -rf stats | ||
sudo rm -rf *stats | ||
sudo rm -rf repository | ||
|
||
print_header "Checking Worker and GitHub Creds Exist" | ||
|
@@ -127,7 +127,6 @@ then | |
fi | ||
|
||
print_header "Preparing Workers" | ||
|
||
for worker_tuple in "${WORKER_LIST[@]}" | ||
do | ||
tuple_arr=($worker_tuple) | ||
|
@@ -157,10 +156,16 @@ do | |
tuple_arr=($worker_tuple) | ||
worker_ip="${tuple_arr[0]}" | ||
worker_key_file="${tuple_arr[1]}" | ||
scp -i $worker_key_file -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -r ./repository $worker_ip: | ||
check_exit_code "ERROR: Failed to copy ONVM files to $worker_ip" | ||
scp -i $worker_key_file -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null helper-functions.sh worker.sh $worker_ip: | ||
# make sure the config file is updated with the correct run mode | ||
sed -i "/WORKER_MODE*/c\\WORKER_MODE=\"${RUN_MODE}\"" worker_files/worker-config | ||
# put all files in one temporary folder for one scp | ||
koolzz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cp -r ./$worker_ip temp | ||
cp -r ./repository temp/ | ||
cp -r ./worker_files/* temp/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just copy all of these at once, will look cleaner |
||
scp -i $worker_key_file -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -r ./temp/* $worker_ip: | ||
check_exit_code "ERROR: Failed to copy ONVM files to $worker_ip" | ||
# get rid of the temp folder now for next worker | ||
sudo rm -rf temp | ||
done | ||
|
||
print_header "Running Workloads on Workers" | ||
|
@@ -174,18 +179,30 @@ do | |
done | ||
|
||
print_header "Obtaining Performance Results from all workers" | ||
|
||
rm -f results_summary.stats | ||
|
||
for worker_tuple in "${WORKER_LIST[@]}" | ||
do | ||
tuple_arr=($worker_tuple) | ||
worker_ip="${tuple_arr[0]}" | ||
worker_key_file="${tuple_arr[1]}" | ||
scp -i $worker_key_file -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null $worker_ip:stats ./$worker_ip.stats | ||
check_exit_code "ERROR: Failed to fetch results from $worker_ip" | ||
# TODO: this will overwrite results if we have more than 1 worker, investigate this case | ||
python3 speed-tester-analysis.py ./$worker_ip.stats $worker_ip results_summary.stats | ||
# get the benchmarks for each node (some servers are faster) | ||
. ./$worker_ip/benchmarks | ||
koolzz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# TODO: this will overwrite results if we have more than 1 worker, investigate this case | ||
if [[ "$RUN_MODE" -eq "0" ]] | ||
then | ||
# fetch pktgen stats | ||
fetch_files $worker_key_file $worker_ip pktgen_stats | ||
python3 pktgen-analysis.py ./$worker_ip.pktgen_stats $worker_ip pktgen_summary.stats $AVG_PKTGEN_SPEED | ||
check_exit_code "Failed to parse Pktgen stats" | ||
# fetch speed_tester stats | ||
fetch_files $worker_key_file $worker_ip speed_stats | ||
python3 speed-tester-analysis.py ./$worker_ip.speed_stats $worker_ip speed_summary.stats $AVG_SPEED_TESTER_SPEED | ||
check_exit_code "Failed to parse Speed Tester stats" | ||
else | ||
# only fetch speed tester stats if mode is not 0 | ||
fetch_files $worker_key_file $worker_ip speed_stats | ||
python3 speed-tester-analysis.py ./$worker_ip.speed_stats $worker_ip speed_summary.stats $AVG_SPEED_TESTER_SPEED | ||
check_exit_code "Failed to parse Speed Tester stats" | ||
fi | ||
check_exit_code "ERROR: Failed to analyze results from $worker_ip" | ||
done | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed cloning