From eddc35b497362c0c01e612d66ed19c4d5c9dd328 Mon Sep 17 00:00:00 2001 From: "wu.zhihui" Date: Wed, 12 Oct 2016 15:32:52 +0800 Subject: Adjust directory structure qtip ! +---- scripts ! ! ! +----ref_result # python scripts to generate results report ! +----fetch_compute_ips.sh ! +----fetch_os_creds.sh ! +----file_permission.sh ! +----get_env_info.sh ! +----qtip_creds.sh ! +----ssh_exch.exp ! +---- config ! ! ! +---- Qtip_key ! +---- Qtip_key.pub ! +---- SampleHeat.yaml ! +---- utils ! ! ! +---- logger_utils.py ! +---- report # generate pdf report file Change-Id: Ia908ff31494369c1a13fb88b1ff9b0e5681f8e29 Signed-off-by: wu.zhihui --- config/QtipKey | 27 ++++ config/QtipKey.pub | 1 + config/SampleHeat.yaml | 36 +++++ data/QtipKey | 27 ---- data/QtipKey.pub | 1 - data/__init__.py | 0 data/fetch_compute_ips.sh | 117 -------------- data/fetch_os_creds.sh | 188 ---------------------- data/file_permission.sh | 3 - data/qtip_creds.sh | 30 ---- data/ref_results/__init__.py | 0 data/ref_results/compute_benchmarks_indices.py | 161 ------------------ data/ref_results/generator_ref_json.py | 81 ---------- data/ref_results/index_calculation.py | 41 ----- data/ref_results/network_benchmarks_indices.py | 20 --- data/ref_results/reference.json | 97 ----------- data/ref_results/result_accum.py | 31 ---- data/ref_results/storage_benchmarks_indices.py | 29 ---- data/ref_results/suite_result.py | 55 ------- data/report/Qtip_Report.py | 108 ------------- data/report/get_indices.py | 8 - data/report/get_results.py | 50 ------ data/report/qtip_graph.py | 30 ---- data/ssh_exch.exp | 9 -- docker/run_qtip.sh | 12 +- func/driver.py | 4 +- func/env_setup.py | 8 +- func/spawn_vm.py | 8 +- get_env_info.sh | 37 ----- heat/SampleHeat.yaml | 36 ----- scripts/fetch_compute_ips.sh | 117 ++++++++++++++ scripts/fetch_os_creds.sh | 188 ++++++++++++++++++++++ scripts/file_permission.sh | 3 + scripts/get_env_info.sh | 37 +++++ scripts/qtip_creds.sh | 30 ++++ scripts/ref_results/__init__.py | 0 scripts/ref_results/compute_benchmarks_indices.py | 161 ++++++++++++++++++ scripts/ref_results/generator_ref_json.py | 81 ++++++++++ scripts/ref_results/index_calculation.py | 41 +++++ scripts/ref_results/network_benchmarks_indices.py | 20 +++ scripts/ref_results/reference.json | 97 +++++++++++ scripts/ref_results/result_accum.py | 31 ++++ scripts/ref_results/storage_benchmarks_indices.py | 29 ++++ scripts/ref_results/suite_result.py | 55 +++++++ scripts/ssh_exch.exp | 9 ++ setup.py | 2 +- tests/ansible_api_test.py | 2 +- tests/env_setup_test.py | 2 +- utils/report/Qtip_Report.py | 108 +++++++++++++ utils/report/__init__.py | 0 utils/report/get_indices.py | 8 + utils/report/get_results.py | 50 ++++++ utils/report/qtip_graph.py | 30 ++++ 53 files changed, 1178 insertions(+), 1178 deletions(-) create mode 100644 config/QtipKey create mode 100644 config/QtipKey.pub create mode 100644 config/SampleHeat.yaml delete mode 100644 data/QtipKey delete mode 100644 data/QtipKey.pub delete mode 100644 data/__init__.py delete mode 100755 data/fetch_compute_ips.sh delete mode 100755 data/fetch_os_creds.sh delete mode 100755 data/file_permission.sh delete mode 100755 data/qtip_creds.sh delete mode 100644 data/ref_results/__init__.py delete mode 100644 data/ref_results/compute_benchmarks_indices.py delete mode 100644 data/ref_results/generator_ref_json.py delete mode 100644 data/ref_results/index_calculation.py delete mode 100644 data/ref_results/network_benchmarks_indices.py delete mode 100644 data/ref_results/reference.json delete mode 100644 data/ref_results/result_accum.py delete mode 100644 data/ref_results/storage_benchmarks_indices.py delete mode 100644 data/ref_results/suite_result.py delete mode 100644 data/report/Qtip_Report.py delete mode 100644 data/report/get_indices.py delete mode 100644 data/report/get_results.py delete mode 100644 data/report/qtip_graph.py delete mode 100644 data/ssh_exch.exp delete mode 100755 get_env_info.sh delete mode 100644 heat/SampleHeat.yaml create mode 100755 scripts/fetch_compute_ips.sh create mode 100755 scripts/fetch_os_creds.sh create mode 100755 scripts/file_permission.sh create mode 100755 scripts/get_env_info.sh create mode 100755 scripts/qtip_creds.sh create mode 100644 scripts/ref_results/__init__.py create mode 100644 scripts/ref_results/compute_benchmarks_indices.py create mode 100644 scripts/ref_results/generator_ref_json.py create mode 100644 scripts/ref_results/index_calculation.py create mode 100644 scripts/ref_results/network_benchmarks_indices.py create mode 100644 scripts/ref_results/reference.json create mode 100644 scripts/ref_results/result_accum.py create mode 100644 scripts/ref_results/storage_benchmarks_indices.py create mode 100644 scripts/ref_results/suite_result.py create mode 100644 scripts/ssh_exch.exp create mode 100644 utils/report/Qtip_Report.py create mode 100644 utils/report/__init__.py create mode 100644 utils/report/get_indices.py create mode 100644 utils/report/get_results.py create mode 100644 utils/report/qtip_graph.py diff --git a/config/QtipKey b/config/QtipKey new file mode 100644 index 00000000..3f520775 --- /dev/null +++ b/config/QtipKey @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAxVpAC+Q8LTyftATCgVHIKvDkXYzHI/8CZeKlVWHlHUA0/6Eu +qSrhzbpOwSaQi2C3x4Eszvh7/CfuVMql11yShsXwFD7aV6x0YG7q8IUScHILUFal +m0Fx52No7IpB3llluUV+kh8ay68V9OGvMZrQ+wWw4ieh2alUnpvFwteXmb8NQtXW +6pm2algUVixc4R3//YKLnGkj93pGFlQlDz5Q0vg+69jHNgodGewIrxCWeZk2pnn0 +vNAdWTQUTm7z/1uYz6AIeR/Wx66msmchFRmmDpP7aHXSSQEBySF7v/GEsZ1JwtBW +07WebNiTv9wYoOfyKVuZuTbBwjqlT4x5CpIJEwIDAQABAoIBAFHcDZThJtTcwKG7 +F7LsaUrmgNMNAc08iZIZYNr5sD9h0pn2EZS55M+g5+nWRT6K77AhNKTlDQiax5EE +PaYHEAA3Ok4rhAW50svtNiZuDCf4Jhk815R+oPCJm4wCDTBdhIRE/ys9G7BA/6qD +slexD94Pjj9AkTHnuuHPW0hmhMuQaSg96EO6QUWCG/HeMFDGcorBlM0s+NeR46Jm +dI8tOvt+rSa68oDtKEwhUbP5cATNdAITzo9+4We5EnYhW9/nRsaF/um2BPih6JnU +zG9udvZwj+YARmEfxhXzeRDpi30qYil/+CUF+qdyd8eoPBvhsW6rr1TA6XYGmPDN +SnlPLAECgYEA6RtgGqL34orxiqT3tDkA2Lb4aSq9Zntr09VAqwft4I3550XihHsa +lqJoy2macX36f60oRDZEL3v4cH22zyjojav4MXe2fLlCiApy45xCzsGkWizxTe5D +184jUIcRxb/sGbOulbXBdu8lmtNiyslvkAoj75bvL2MXhytbYgikhrMCgYEA2Lv1 +9Os+VXT9py/67dO/GY14NUpT1sFq2zxPYWpKxJD+j/NVZsflpPd/V5cGANZGovA0 +c8WNupJmCO1P20uldRX5dJ3EhhER2kn0yKhZuBBxmrELQZdnXGc9T8ub0xJVbo2u +K3Km3C1Dx7Us4BwzGOO6K2kYbT1ij/vAbZWmpCECgYBdkhqStqYwbrukfrHbyyH2 +3AN9G6XpdFOFNc3+mXE4OWV+G4Rgz5WNr+XG+T4AnqQmChjmwK3ALdA9P4lZQL+Q +1t4K5VYAXNFDEIarrPb4Tayucenu8VyUTO/KDF3q9i5M5t6Gw+3D0x1SN9YpNpCs +zhU8wGaErA8uuA23nWaFlwKBgQDXSf6MB5GnucqtZI/R5uCRNWIPLYISdZb7p/EC +R1912sHDpGdU7YREVkV8cFxaQH9yI0E3LyoWBo6sl28X2xDEOcvN91ncAuDFAWnS +WMimek8e5nbT9N2LgFH7Dbn/9NpAMySrq/vsAlqt6l5lUB3Bv5SSwpatDKj3dZA0 +Ss95gQKBgQCvwxW4PSd+hxdofwGd6KBwhA404GPdcVLLmASGVYRNcVNyfhUmMCn+ +UF1WsBCOcnWjJ/pT864S9Rp1bbqzpQS8Pz1vJwhkaHEJD0a5l+KhD4llsWDjUNfI +KfVffcmydNC3uRD59WPZEAgu+gOS8kRw7lybFTNuMS7B3dC5v9UtWg== +-----END RSA PRIVATE KEY----- diff --git a/config/QtipKey.pub b/config/QtipKey.pub new file mode 100644 index 00000000..7a40f91c --- /dev/null +++ b/config/QtipKey.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFWkAL5DwtPJ+0BMKBUcgq8ORdjMcj/wJl4qVVYeUdQDT/oS6pKuHNuk7BJpCLYLfHgSzO+Hv8J+5UyqXXXJKGxfAUPtpXrHRgburwhRJwcgtQVqWbQXHnY2jsikHeWWW5RX6SHxrLrxX04a8xmtD7BbDiJ6HZqVSem8XC15eZvw1C1dbqmbZqWBRWLFzhHf/9goucaSP3ekYWVCUPPlDS+D7r2Mc2Ch0Z7AivEJZ5mTamefS80B1ZNBRObvP/W5jPoAh5H9bHrqayZyEVGaYOk/toddJJAQHJIXu/8YSxnUnC0FbTtZ5s2JO/3Big5/IpW5m5NsHCOqVPjHkKkgkT root@foreman-jump.opnfv.com diff --git a/config/SampleHeat.yaml b/config/SampleHeat.yaml new file mode 100644 index 00000000..ae9f5667 --- /dev/null +++ b/config/SampleHeat.yaml @@ -0,0 +1,36 @@ +heat_template_version: 2014-10-16 +parameters: + + private_net_name: + type: string + default: 'private_network' + + availability_zone: + type: string + description: The AvailZone. + default: compute1 + +resources: + + private_network: + type: OS::Neutron::Net + private_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: private_network } + cidr: '10.10.17.0/24' + dns_nameservers: [ '8.8.8.8' ] + gateway_ip: '10.10.17.1' + allocation_pools: [ {"start":'10.10.17.2', "end": '10.10.17.200'} ] + router_1: + type: OS::Neutron::Router + properties: + external_gateway_info: + network: { get_param: public_network } + router_interface: + type: OS::Neutron::RouterInterface + properties: + router_id: { get_resource: router_1 } + subnet: { get_resource: private_subnet } +outputs: + description: 'none' diff --git a/data/QtipKey b/data/QtipKey deleted file mode 100644 index 3f520775..00000000 --- a/data/QtipKey +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAxVpAC+Q8LTyftATCgVHIKvDkXYzHI/8CZeKlVWHlHUA0/6Eu -qSrhzbpOwSaQi2C3x4Eszvh7/CfuVMql11yShsXwFD7aV6x0YG7q8IUScHILUFal -m0Fx52No7IpB3llluUV+kh8ay68V9OGvMZrQ+wWw4ieh2alUnpvFwteXmb8NQtXW -6pm2algUVixc4R3//YKLnGkj93pGFlQlDz5Q0vg+69jHNgodGewIrxCWeZk2pnn0 -vNAdWTQUTm7z/1uYz6AIeR/Wx66msmchFRmmDpP7aHXSSQEBySF7v/GEsZ1JwtBW -07WebNiTv9wYoOfyKVuZuTbBwjqlT4x5CpIJEwIDAQABAoIBAFHcDZThJtTcwKG7 -F7LsaUrmgNMNAc08iZIZYNr5sD9h0pn2EZS55M+g5+nWRT6K77AhNKTlDQiax5EE -PaYHEAA3Ok4rhAW50svtNiZuDCf4Jhk815R+oPCJm4wCDTBdhIRE/ys9G7BA/6qD -slexD94Pjj9AkTHnuuHPW0hmhMuQaSg96EO6QUWCG/HeMFDGcorBlM0s+NeR46Jm -dI8tOvt+rSa68oDtKEwhUbP5cATNdAITzo9+4We5EnYhW9/nRsaF/um2BPih6JnU -zG9udvZwj+YARmEfxhXzeRDpi30qYil/+CUF+qdyd8eoPBvhsW6rr1TA6XYGmPDN -SnlPLAECgYEA6RtgGqL34orxiqT3tDkA2Lb4aSq9Zntr09VAqwft4I3550XihHsa -lqJoy2macX36f60oRDZEL3v4cH22zyjojav4MXe2fLlCiApy45xCzsGkWizxTe5D -184jUIcRxb/sGbOulbXBdu8lmtNiyslvkAoj75bvL2MXhytbYgikhrMCgYEA2Lv1 -9Os+VXT9py/67dO/GY14NUpT1sFq2zxPYWpKxJD+j/NVZsflpPd/V5cGANZGovA0 -c8WNupJmCO1P20uldRX5dJ3EhhER2kn0yKhZuBBxmrELQZdnXGc9T8ub0xJVbo2u -K3Km3C1Dx7Us4BwzGOO6K2kYbT1ij/vAbZWmpCECgYBdkhqStqYwbrukfrHbyyH2 -3AN9G6XpdFOFNc3+mXE4OWV+G4Rgz5WNr+XG+T4AnqQmChjmwK3ALdA9P4lZQL+Q -1t4K5VYAXNFDEIarrPb4Tayucenu8VyUTO/KDF3q9i5M5t6Gw+3D0x1SN9YpNpCs -zhU8wGaErA8uuA23nWaFlwKBgQDXSf6MB5GnucqtZI/R5uCRNWIPLYISdZb7p/EC -R1912sHDpGdU7YREVkV8cFxaQH9yI0E3LyoWBo6sl28X2xDEOcvN91ncAuDFAWnS -WMimek8e5nbT9N2LgFH7Dbn/9NpAMySrq/vsAlqt6l5lUB3Bv5SSwpatDKj3dZA0 -Ss95gQKBgQCvwxW4PSd+hxdofwGd6KBwhA404GPdcVLLmASGVYRNcVNyfhUmMCn+ -UF1WsBCOcnWjJ/pT864S9Rp1bbqzpQS8Pz1vJwhkaHEJD0a5l+KhD4llsWDjUNfI -KfVffcmydNC3uRD59WPZEAgu+gOS8kRw7lybFTNuMS7B3dC5v9UtWg== ------END RSA PRIVATE KEY----- diff --git a/data/QtipKey.pub b/data/QtipKey.pub deleted file mode 100644 index 7a40f91c..00000000 --- a/data/QtipKey.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFWkAL5DwtPJ+0BMKBUcgq8ORdjMcj/wJl4qVVYeUdQDT/oS6pKuHNuk7BJpCLYLfHgSzO+Hv8J+5UyqXXXJKGxfAUPtpXrHRgburwhRJwcgtQVqWbQXHnY2jsikHeWWW5RX6SHxrLrxX04a8xmtD7BbDiJ6HZqVSem8XC15eZvw1C1dbqmbZqWBRWLFzhHf/9goucaSP3ekYWVCUPPlDS+D7r2Mc2Ch0Z7AivEJZ5mTamefS80B1ZNBRObvP/W5jPoAh5H9bHrqayZyEVGaYOk/toddJJAQHJIXu/8YSxnUnC0FbTtZ5s2JO/3Big5/IpW5m5NsHCOqVPjHkKkgkT root@foreman-jump.opnfv.com diff --git a/data/__init__.py b/data/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/data/fetch_compute_ips.sh b/data/fetch_compute_ips.sh deleted file mode 100755 index ebe817a6..00000000 --- a/data/fetch_compute_ips.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -############################################################################## -#Copyright (c) 2016 Ericsson AB, ZTE and others. -#jose.lausuch@ericsson.com -#wu.zhihui1@zte.com.cn -#All rights reserved. This program and the accompanying materials -#are made available under the terms of the Apache License, Version 2.0 -#which accompanies this distribution, and is available at -#http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - - -usage(){ - echo "usage: $0 [-v] -i -a " >&2 - echo "[-v] Virtualized deployment" >&2 -} - -info() { - logger -s -t "fetch_compute_info.info" "$*" -} - - -error() { - logger -s -t "fetch_compute_info.error" "$*" - exit 1 -} - -verify_connectivity(){ - local ip=$1 - info "Verifying connectivity to $ip..." - for i in $(seq 0 10); do - if ping -c 1 -W 1 $ip > /dev/null; then - info "$ip is reachable!" - return 0 - fi - sleep 1 - done - error "Can not talk to $ip." -} - -:${DEPLOY_TYPE:=''} - -#Getoptions -while getopts ":i:a:h:v" optchar; do - case "${optchar}" in - i) installer_type=${OPTARG} ;; - a) installer_ip=${OPTARG} ;; - v) DEPLOY_TYPE="virt" ;; - *) echo "Non-option argument: '-${OPTARG}'" >&2 - usage - exit 2 - ;; - esac -done - -#set vars from env if not provided by user as options -installer_type=${installer_type:-$INSTALLER_TYPE} -installer_ip=${installer_ip:-$INSTALLER_IP} - -if [ -z $installer_type ] || [ -z $installer_ip ]; then - usage - exit 2 -fi - -ssh_options="-oUserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - -#Start fetching compute ip -if [ "$installer_type" == "fuel" ]; then - verify_connectivity $installer_ip - - env=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ - 'fuel env'|grep operational|head -1|awk '{print $1}') &> /dev/null - if [ -z $env ]; then - error "No operational environment detected in Fuel" - fi - env_id="${FUEL_ENV:-$env}" - - # Check if compute is alive (online='True') - IPS=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ - "fuel node --env ${env_id} | grep compute | grep 'True\| 1' | awk -F\| '{print \$5}' " | \ - sed 's/ //g') &> /dev/null - - -elif [ "$installer_type" == "apex" ]; then - echo "not implement now" - exit 1 - -elif [ "$installer_type" == "compass" ]; then - # need test - verify_connectivity $installer_ip - IPS=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \ - 'mysql -ucompass -pcompass -Dcompass -e"select * from cluster;"' \ - | awk -F"," '{for(i=1;i $HOME/ips.log - echo $IPS -fi - -exit 0 diff --git a/data/fetch_os_creds.sh b/data/fetch_os_creds.sh deleted file mode 100755 index 3b493e14..00000000 --- a/data/fetch_os_creds.sh +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright (c) 2015 Ericsson AB and others. -# jose.lausuch@ericsson.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - - -usage() { - echo "usage: $0 -d -i -a " >&2 -} - -info () { - logger -s -t "fetch_os_creds.info" "$*" -} - - -error () { - logger -s -t "fetch_os_creds.error" "$*" - exit 1 -} - - -verify_connectivity() { - local ip=$1 - info "Verifying connectivity to $ip..." - for i in $(seq 0 10); do - if ping -c 1 -W 1 $ip > /dev/null; then - info "$ip is reachable!" - return 0 - fi - sleep 1 - done - error "Can not talk to $ip." -} - - - -#Get options -while getopts ":d:i:a:h:" optchar; do - case "${optchar}" in - d) dest_path=${OPTARG} ;; - i) installer_type=${OPTARG} ;; - a) installer_ip=${OPTARG} ;; - *) echo "Non-option argument: '-${OPTARG}'" >&2 - usage - exit 2 - ;; - esac -done - -# set vars from env if not provided by user as options -dest_path=${dest_path:-$HOME/opnfv-openrc.sh} -installer_type=${installer_type:-$INSTALLER_TYPE} -installer_ip=${installer_ip:-$INSTALLER_IP} - -if [ -z $dest_path ] || [ -z $installer_type ] || [ -z $installer_ip ]; then - usage - exit 2 -fi - -# Checking if destination path is valid -if [ -d $dest_path ]; then - error "Please provide the full destination path for the credentials file including the filename" -else - # Check if we can create the file (e.g. path is correct) - touch $dest_path || error "Cannot create the file specified. Check that the path is correct and run the script again." -fi - - -ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - -# Start fetching the files -if [ "$installer_type" == "fuel" ]; then - #ip_fuel="10.20.0.2" - verify_connectivity $installer_ip - - # Check if controller is alive (online='True') - controller_ip=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ - 'fuel node | grep controller | grep True | awk "{print \$10}" | tail -1') &> /dev/null - - if [ -z $controller_ip ]; then - error "The controller $controller_ip is not up. Please check that the POD is correctly deployed." - fi - - info "Fetching rc file from controller $controller_ip..." - sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ - "scp $ssh_options ${controller_ip}:/root/openrc ." &> /dev/null - sshpass -p r00tme scp 2>/dev/null $ssh_options root@${installer_ip}:~/openrc $dest_path &> /dev/null - - #This file contains the mgmt keystone API, we need the public one for our rc file - admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') - public_ip=$(sshpass -p r00tme ssh $ssh_options root@${installer_ip} \ - "ssh ${controller_ip} 'source openrc; keystone endpoint-list'" \ - | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) &> /dev/null - #| grep http | head -1 | cut -d '|' -f 4 | sed 's/v1\/.*/v1\//' | sed 's/ //g') &> /dev/null - #NOTE: this is super ugly sed 's/v1\/.*/v1\//'OS_AUTH_URL - # but sometimes the output of endpoint-list is like this: http://172.30.9.70:8004/v1/%(tenant_id)s - -elif [ "$installer_type" == "apex" ]; then - verify_connectivity $installer_ip - - # The credentials file is located in the Instack VM (192.0.2.1) - # NOTE: This might change for bare metal deployments - info "Fetching rc file from Instack VM $installer_ip..." - if [ -f /root/.ssh/id_rsa ]; then - chmod 600 /root/.ssh/id_rsa - fi - sudo scp $ssh_options root@$installer_ip:/home/stack/overcloudrc $dest_path - -elif [ "$installer_type" == "compass" ]; then - verify_connectivity $installer_ip - controller_ip=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \ - 'mysql -ucompass -pcompass -Dcompass -e"select * from cluster;"' \ - | awk -F"," '{for(i=1;i/dev/null $ssh_options root@${installer_ip} \ - "scp $ssh_options ${controller_ip}:/opt/admin-openrc.sh ." &> /dev/null - sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:~/admin-openrc.sh $dest_path &> /dev/null - echo 'export OS_REGION_NAME=regionOne' >> $dest_path - - info "This file contains the mgmt keystone API, we need the public one for our rc file" - admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') - info "admin_ip: $admin_ip" - public_ip=$(sshpass -p root ssh $ssh_options root@${installer_ip} \ - "ssh ${controller_ip} 'source /opt/admin-openrc.sh; keystone endpoint-list'" \ - | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) - info "public_ip: $public_ip" - - -elif [ "$installer_type" == "joid" ]; then - # do nothing...for the moment - # we can either do a scp from the jumphost or use the -v option to transmit the param to the docker file - echo "Do nothing, creds will be provided through volume option at docker creation for joid" - -elif [ "$installer_type" == "foreman" ]; then - #ip_foreman="172.30.10.73" - controller="oscontroller1.opnfv.com" - verify_connectivity $installer_ip - - # Check if controller is alive (here is more difficult to get the ip from a command like "fuel node") - sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ - "sshpass -p Op3nStack ssh $ssh_options root@${controller} 'ls'" &> /dev/null - if [ $? -ne 0 ]; then - error "The controller ${controller} is not up. Please check that the POD is correctly deployed." - fi - - info "Fetching openrc from a Foreman Controller '${controller}'..." - sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ - "sshpass -p Op3nStack scp $ssh_options root@${controller}:~/keystonerc_admin ." &> /dev/null - sshpass -p vagrant scp $ssh_options root@${installer_ip}:~/keystonerc_admin $dest_path &> /dev/null - - #This file contains the mgmt keystone API, we need the public one for our rc file - admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') - public_ip=$(sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ - "sshpass -p Op3nStack ssh $ssh_options root@${controller} \ - 'source keystonerc_admin;keystone endpoint-list'" \ - | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) &> /dev/null - -else - error "Installer $installer is not supported by this script" -fi - - -if [ ! -f $dest_path ]; then - error "There has been an error retrieving the credentials" -fi - -if [ "$public_ip" != "" ]; then - info "Exchanging keystone public IP in rc file to $public_ip" - sed -i "/OS_AUTH_URL/c\export OS_AUTH_URL=\'$public_ip'" $dest_path -fi - - - -echo "-------- Credentials: --------" -cat $dest_path - -exit 0 diff --git a/data/file_permission.sh b/data/file_permission.sh deleted file mode 100755 index 01a77d50..00000000 --- a/data/file_permission.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash -chmod 0600 data/QtipKey -chmod 0600 data/QtipKey.pub diff --git a/data/qtip_creds.sh b/data/qtip_creds.sh deleted file mode 100755 index beb4659f..00000000 --- a/data/qtip_creds.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/bash - -DEST_IP=$1 -echo $INSTALLER_TYPE -echo $INSTALLER_IP -sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -case "$INSTALLER_TYPE" in - apex) - scp $sshoptions -i $APEX_KEY ./data/QtipKey.pub stack@$INSTALLER_IP:/home/stack - scp $sshoptions -i $APEX_KEY ./data/QtipKey stack@$INSTALLER_IP:/home/stack - ssh $sshoptions -i $APEX_KEY stack@$INSTALLER_IP "ssh-copy-id $sshoptions -i /home/stack/QtipKey.pub heat-admin@$DEST_IP && rm -rf /home/stack/QtipKey && rm -rf /home/stack/QtipKey.pub" - ;; - fuel) - PSWD="r00tme" - sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root - sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root - sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "grep -q '\-F /dev/null ' /usr/bin/ssh-copy-id || sed -i 's/\(ssh -i.*$\)/\1\n -F \/dev\/null \\\/g' `which ssh-copy-id`" - sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" - ;; - compass) - PSWD="root" - sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root - sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root - sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey.pub root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" - ;; - joid) - PSWD="joid";; - *) - echo "Unkown installer $INSTALLER_TYPE specified";; -esac diff --git a/data/ref_results/__init__.py b/data/ref_results/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/data/ref_results/compute_benchmarks_indices.py b/data/ref_results/compute_benchmarks_indices.py deleted file mode 100644 index 9012cefc..00000000 --- a/data/ref_results/compute_benchmarks_indices.py +++ /dev/null @@ -1,161 +0,0 @@ -from index_calculation import generic_index as get_index -from index_calculation import get_reference -from result_accum import result_concat as concat - - -def dpi_index(): - dpi_dict = concat('results/dpi/') - dpi_bm_ref = get_reference('compute', 'dpi_bm') - dpi_bm_index = get_index(dpi_dict, 'dpi_bm', dpi_bm_ref, 'details', 'bps') - - dpi_vm_ref = get_reference('compute', 'dpi_vm') - dpi_vm_index = get_index(dpi_dict, 'dpi_vm', dpi_vm_ref, 'details', 'bps') - - dpi_index = (dpi_bm_index + dpi_vm_index) / 2 - dpi_dict_i = {} - dpi_dict_i['index'] = dpi_index - dpi_dict_i['results'] = dpi_dict - return dpi_dict_i - - -def dhrystone_index(): - - dhrystone_dict = concat('results/dhrystone/') - dhrystone_single_bm_ref = get_reference('compute', 'dhrystone_bm', 'single_cpu') - dhrystone_single_bm_index = get_index(dhrystone_dict, 'dhrystone_bm', dhrystone_single_bm_ref, 'details', 'single', 'score') - - dhrystone_multi_bm_ref = get_reference('compute', 'dhrystone_bm', 'multi_cpu') - dhrystone_multi_bm_index = get_index(dhrystone_dict, 'dhrystone_bm', dhrystone_multi_bm_ref, 'details', 'multi', 'score') - - dhrystone_bm_index = (dhrystone_single_bm_index + dhrystone_multi_bm_index) / 2 - - dhrystone_single_vm_ref = get_reference('compute', 'dhrystone_vm', 'single_cpu') - dhrystone_single_vm_index = get_index(dhrystone_dict, 'dhrystone_vm', dhrystone_single_vm_ref, 'details', 'single', 'score') - - dhrystone_multi_vm_ref = get_reference('compute', 'dhrystone_vm', 'multi_cpu') - dhrystone_multi_vm_index = get_index(dhrystone_dict, 'dhrystone_vm', dhrystone_multi_vm_ref, 'details', 'multi', 'score') - - dhrystone_vm_index = (dhrystone_single_vm_index + dhrystone_multi_vm_index) / 2 - - dhrystone_index = (dhrystone_bm_index + dhrystone_vm_index) / 2 - dhrystone_dict_i = {} - dhrystone_dict_i['index'] = dhrystone_index - dhrystone_dict_i['results'] = dhrystone_dict - return dhrystone_dict_i - - -def whetstone_index(): - - whetstone_dict = concat('results/whetstone/') - whetstone_single_bm_ref = get_reference('compute', 'whetstone_bm', 'single_cpu') - whetstone_single_bm_index = get_index(whetstone_dict, 'whetstone_bm', whetstone_single_bm_ref, 'details', 'single', 'score') - - whetstone_multi_bm_ref = get_reference('compute', 'whetstone_bm', 'multi_cpu') - whetstone_multi_bm_index = get_index(whetstone_dict, 'whetstone_bm', whetstone_multi_bm_ref, 'details', 'multi', 'score') - - whetstone_bm_index = (whetstone_single_bm_index + whetstone_multi_bm_index) / 2 - - whetstone_single_vm_ref = get_reference('compute', 'whetstone_vm', 'single_cpu') - whetstone_single_vm_index = get_index(whetstone_dict, 'whetstone_vm', whetstone_single_vm_ref, 'details', 'single', 'score') - - whetstone_multi_vm_ref = get_reference('compute', 'whetstone_vm', 'multi_cpu') - whetstone_multi_vm_index = get_index(whetstone_dict, 'whetstone_vm', whetstone_multi_vm_ref, 'details', 'multi', 'score') - - whetstone_vm_index = (whetstone_single_vm_index + whetstone_multi_vm_index) / 2 - - whetstone_index = (whetstone_bm_index + whetstone_vm_index) / 2 - whetstone_dict_i = {} - whetstone_dict_i['index'] = whetstone_index - whetstone_dict_i['results'] = whetstone_dict - return whetstone_dict_i - - -def ramspeed_index(): - - ramspeed_dict = concat('results/ramspeed/') - ramspeed_int_bm_ref = get_reference('compute', 'ramspeed_bm', 'INTmem', 'Average (MB/s)') - ramspeed_int_bm_index = get_index(ramspeed_dict, 'ramspeed_bm', ramspeed_int_bm_ref, 'details', 'int_bandwidth', 'average') - - ramspeed_float_bm_ref = get_reference('compute', 'ramspeed_bm', 'FLOATmem', 'Average (MB/s)') - ramspeed_float_bm_index = get_index(ramspeed_dict, 'ramspeed_bm', ramspeed_float_bm_ref, 'details', 'float_bandwidth', 'average') - - ramspeed_bm_index = (ramspeed_int_bm_index + ramspeed_float_bm_index) / 2 - - ramspeed_int_vm_ref = get_reference('compute', 'ramspeed_vm', 'INTmem', 'Average (MB/s)') - ramspeed_int_vm_index = get_index(ramspeed_dict, 'ramspeed_vm', ramspeed_int_vm_ref, 'details', 'int_bandwidth', 'average') - - ramspeed_float_vm_ref = get_reference('compute', 'ramspeed_vm', 'FLOATmem', 'Average (MB/s)') - ramspeed_float_vm_index = get_index(ramspeed_dict, 'ramspeed_vm', ramspeed_float_vm_ref, 'details', 'float_bandwidth', 'average') - - ramspeed_vm_index = (ramspeed_int_vm_index + ramspeed_float_vm_index) / 2 - - ramspeed_index = (ramspeed_vm_index + ramspeed_bm_index) / 2 - - ramspeed_dict_i = {} - ramspeed_dict_i['index'] = ramspeed_index - ramspeed_dict_i['results'] = ramspeed_dict - return ramspeed_dict_i - - -def ssl_index(): - - ssl_dict = concat('results/ssl/') - - ssl_RSA512b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '512b') - ssl_RSA1024b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '1024b') - ssl_RSA2048b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '2048b') - ssl_RSA4096b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '4096b') - - ssl_AES16B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '16B') - ssl_AES64B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '64B') - ssl_AES256B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '256B') - ssl_AES1024B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '1024B') - ssl_AES8192B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '8192B') - - ssl_RSA512b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA512b_bm_ref, 'details', 'rsa_sig', '512_bits') - ssl_RSA1024b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA1024b_bm_ref, 'details', 'rsa_sig', '1024_bits') - ssl_RSA2048b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA2048b_bm_ref, 'details', 'rsa_sig', '2048_bits') - ssl_RSA4096b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA4096b_bm_ref, 'details', 'rsa_sig', '4096_bits') - ssl_RSA_bm_index = (ssl_RSA512b_bm_index + ssl_RSA1024b_bm_index + ssl_RSA2048b_bm_index + ssl_RSA4096b_bm_index) / 4 - - ssl_AES16B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES16B_bm_ref, 'details', 'aes_128_cbc', '16_block') - ssl_AES64B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES64B_bm_ref, 'details', 'aes_128_cbc', '64_block') - ssl_AES256B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES256B_bm_ref, 'details', 'aes_128_cbc', '256_block') - ssl_AES1024B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES1024B_bm_ref, 'details', 'aes_128_cbc', '1024_block') - ssl_AES8192B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES8192B_bm_ref, 'details', 'aes_128_cbc', '8192_block') - ssl_AES_bm_index = (ssl_AES16B_bm_index + ssl_AES64B_bm_index + ssl_AES256B_bm_index + ssl_AES1024B_bm_index + ssl_AES8192B_bm_index) / 5 - - ssl_bm_index = (ssl_RSA_bm_index + ssl_AES_bm_index) / 2 - - ssl_RSA512b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '512b') - ssl_RSA1024b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '1024b') - ssl_RSA2048b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '2048b') - ssl_RSA4096b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '4096b') - - ssl_AES16B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '16B') - ssl_AES64B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '64B') - ssl_AES256B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '256B') - ssl_AES1024B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '1024B') - ssl_AES8192B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '8192B') - - ssl_RSA512b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA512b_vm_ref, 'details', 'rsa_sig', '512_bits') - ssl_RSA1024b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA1024b_vm_ref, 'details', 'rsa_sig', '1024_bits') - ssl_RSA2048b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA2048b_vm_ref, 'details', 'rsa_sig', '2048_bits') - ssl_RSA4096b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA4096b_vm_ref, 'details', 'rsa_sig', '4096_bits') - ssl_RSA_vm_index = (ssl_RSA512b_vm_index + ssl_RSA1024b_vm_index + ssl_RSA2048b_vm_index + ssl_RSA4096b_vm_index) / 4 - - ssl_AES16B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES16B_vm_ref, 'details', 'aes_128_cbc', '16_block') - ssl_AES64B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES64B_vm_ref, 'details', 'aes_128_cbc', '64_block') - ssl_AES256B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES256B_vm_ref, 'details', 'aes_128_cbc', '256_block') - ssl_AES1024B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES1024B_vm_ref, 'details', 'aes_128_cbc', '1024_block') - ssl_AES8192B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES8192B_vm_ref, 'details', 'aes_128_cbc', '8192_block') - ssl_AES_vm_index = (ssl_AES16B_vm_index + ssl_AES64B_vm_index + ssl_AES256B_vm_index + ssl_AES1024B_vm_index + ssl_AES8192B_vm_index) / 5 - - ssl_vm_index = (ssl_RSA_vm_index + ssl_AES_vm_index) / 2 - - ssl_index = (ssl_bm_index + ssl_vm_index) / 2 - - ssl_dict_i = {} - ssl_dict_i['index'] = ssl_index - ssl_dict_i['results'] = ssl_dict - return ssl_dict_i diff --git a/data/ref_results/generator_ref_json.py b/data/ref_results/generator_ref_json.py deleted file mode 100644 index 6b2d813c..00000000 --- a/data/ref_results/generator_ref_json.py +++ /dev/null @@ -1,81 +0,0 @@ -import json - -dict_ref = {} -dict_ref['compute'] = {} -dict_ref['compute']['dpi_bm'] = 8.12 -dict_ref['compute']['dpi_vm'] = 22.12 - -dict_ref['compute']['whetstone_bm'] = {} -dict_ref['compute']['whetstone_vm'] = {} -dict_ref['compute']['whetstone_bm']['single_cpu'] = 806.1 -dict_ref['compute']['whetstone_bm']['multi_cpu'] = 41483.3 -dict_ref['compute']['whetstone_vm']['single_cpu'] = 789.0 -dict_ref['compute']['whetstone_vm']['multi_cpu'] = 2950.6 - -dict_ref['compute']['dhrystone_bm'] = {} -dict_ref['compute']['dhrystone_vm'] = {} -dict_ref['compute']['dhrystone_bm']['single_cpu'] = 3231.7 -dict_ref['compute']['dhrystone_bm']['multi_cpu'] = 103362.1 -dict_ref['compute']['dhrystone_vm']['single_cpu'] = 2953.6 -dict_ref['compute']['dhrystone_vm']['multi_cpu'] = 10585.8 - -dict_ref['compute']['ssl_bm'] = {} -dict_ref['compute']['ssl_bm']['RSA'] = {} -dict_ref['compute']['ssl_bm']['AES'] = {} -dict_ref['compute']['ssl_bm']['RSA']['512b'] = 22148.9 -dict_ref['compute']['ssl_bm']['RSA']['1024b'] = 7931.44 -dict_ref['compute']['ssl_bm']['RSA']['2048b'] = 1544.3 -dict_ref['compute']['ssl_bm']['RSA']['4096b'] = 161.92 -dict_ref['compute']['ssl_bm']['AES']['16B'] = 735490250 -dict_ref['compute']['ssl_bm']['AES']['64B'] = 788429210 -dict_ref['compute']['ssl_bm']['AES']['256B'] = 803323650 -dict_ref['compute']['ssl_bm']['AES']['1024B'] = 808861020 -dict_ref['compute']['ssl_bm']['AES']['8192B'] = 807701160 - -dict_ref['compute']['ssl_vm'] = {} -dict_ref['compute']['ssl_vm']['RSA'] = {} -dict_ref['compute']['ssl_vm']['AES'] = {} -dict_ref['compute']['ssl_vm']['RSA']['512b'] = 22148.9 -dict_ref['compute']['ssl_vm']['RSA']['1024b'] = 7931.44 -dict_ref['compute']['ssl_vm']['RSA']['2048b'] = 1544.3 -dict_ref['compute']['ssl_vm']['RSA']['4096b'] = 161.92 -dict_ref['compute']['ssl_vm']['AES']['16B'] = 735490250 -dict_ref['compute']['ssl_vm']['AES']['64B'] = 788429210 -dict_ref['compute']['ssl_vm']['AES']['256B'] = 803323650 -dict_ref['compute']['ssl_vm']['AES']['1024B'] = 808861020 -dict_ref['compute']['ssl_vm']['AES']['8192B'] = 807701160 - -dict_ref['compute']['ramspeed_bm'] = {} -dict_ref['compute']['ramspeed_bm']['INTmem'] = {} -dict_ref['compute']['ramspeed_bm']['FLOATmem'] = {} -dict_ref['compute']['ramspeed_bm']['INTmem']['Average (MB/s)'] = 12268.38 -dict_ref['compute']['ramspeed_bm']['FLOATmem']['Average (MB/s)'] = 9758.79 - -dict_ref['compute']['ramspeed_vm'] = {} -dict_ref['compute']['ramspeed_vm']['INTmem'] = {} -dict_ref['compute']['ramspeed_vm']['FLOATmem'] = {} -dict_ref['compute']['ramspeed_vm']['INTmem']['Average (MB/s)'] = 12147.59 -dict_ref['compute']['ramspeed_vm']['FLOATmem']['Average (MB/s)'] = 9064.09 - -dict_ref['storage'] = {} -dict_ref['storage']['fio_bm'] = {} -dict_ref['storage']['fio_bm']['read'] = {} -dict_ref['storage']['fio_bm']['write'] = {} -dict_ref['storage']['fio_bm']['read']['IOPS'] = 6693 -dict_ref['storage']['fio_bm']['write']['IOPS'] = 6688 - -dict_ref['storage']['fio_vm'] = {} -dict_ref['storage']['fio_vm']['read'] = {} -dict_ref['storage']['fio_vm']['write'] = {} -dict_ref['storage']['fio_vm']['read']['IOPS'] = 2239 -dict_ref['storage']['fio_vm']['write']['IOPS'] = 2237 - -dict_ref['network'] = {} -dict_ref['network']['iperf_bm'] = {} -dict_ref['network']['iperf_vm'] = {} -dict_ref['network']['iperf_vm_2'] = {} -dict_ref['network']['iperf_bm']['throughput received(b/s)'] = 944473000.0 -dict_ref['network']['iperf_vm']['throughput received(b/s)'] = 14416700000.0 -dict_ref['network']['iperf_vm_2']['throughput received(b/s)'] = 2461530000.0 -with open('reference.json', 'w+') as result_json: - json.dump(dict_ref, result_json, indent=4, sort_keys=True) diff --git a/data/ref_results/index_calculation.py b/data/ref_results/index_calculation.py deleted file mode 100644 index 5ca4a46e..00000000 --- a/data/ref_results/index_calculation.py +++ /dev/null @@ -1,41 +0,0 @@ -import json - - -def compute_index(total_measured, ref_result, count): - try: - average = float(total_measured / count) - - except ZeroDivisionError: - average = 0 - index = average / ref_result - return index - - -def get_reference(*args): - - with open('data/ref_results/reference.json') as reference_file: - reference_djson = json.load(reference_file) - for arg in args: - ref_n = reference_djson.get(str(arg)) - reference_djson = reference_djson.get(str(arg)) - return ref_n - - -def generic_index(dict_gen, testcase, reference_num, *args): - c = len(args) - count = 0 - total = 0 - result = 0 - for k, v in dict_gen.iteritems(): - dict_temp = dict_gen[k] - if dict_gen[k]['name'] == str(testcase): - count = count + 1 - for arg in args: - if arg == args[c - 1]: - try: - result = float(dict_temp.get(str(arg))) - except ValueError: - result = float(dict_temp.get(str(arg))[:-1]) * 1000 - dict_temp = dict_temp.get(str(arg)) - total = total + result - return compute_index(total, reference_num, count) diff --git a/data/ref_results/network_benchmarks_indices.py b/data/ref_results/network_benchmarks_indices.py deleted file mode 100644 index c19d18eb..00000000 --- a/data/ref_results/network_benchmarks_indices.py +++ /dev/null @@ -1,20 +0,0 @@ -from index_calculation import generic_index as get_index -from index_calculation import get_reference -from result_accum import result_concat as concat - - -def iperf_index(): - iperf_dict = concat('results/iperf/') - iperf_bm_ref = get_reference('network', 'iperf_bm', 'throughput received(b/s)') - iperf_bm_index = get_index(iperf_dict, 'iperf_bm', iperf_bm_ref, 'details', 'bandwidth', 'received_throughput') - iperf_vm_ref = get_reference('network', 'iperf_vm', 'throughput received(b/s)') - iperf_vm_index = get_index(iperf_dict, 'iperf_vm', iperf_vm_ref, 'details', 'bandwidth', 'received_throughput') - - iperf_vm_2_ref = get_reference('network', 'iperf_vm_2', 'throughput received(b/s)') - iperf_vm_2_index = get_index(iperf_dict, 'iperf_vm_2', iperf_vm_2_ref, 'details', 'bandwidth', 'received_throughput') - iperf_index = float(iperf_bm_index + iperf_vm_index + iperf_vm_2_index) / 3 - print iperf_index - iperf_dict_i = {} - iperf_dict_i['index'] = iperf_index - iperf_dict_i['results'] = iperf_dict - return iperf_dict_i diff --git a/data/ref_results/reference.json b/data/ref_results/reference.json deleted file mode 100644 index cfcbfc3b..00000000 --- a/data/ref_results/reference.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "compute": { - "dhrystone_bm": { - "multi_cpu": 103362.1, - "single_cpu": 3231.7 - }, - "dhrystone_vm": { - "multi_cpu": 10585.8, - "single_cpu": 2953.6 - }, - "dpi_bm": 8.12, - "dpi_vm": 22.12, - "ramspeed_bm": { - "FLOATmem": { - "Average (MB/s)": 9758.79 - }, - "INTmem": { - "Average (MB/s)": 12268.38 - } - }, - "ramspeed_vm": { - "FLOATmem": { - "Average (MB/s)": 9064.09 - }, - "INTmem": { - "Average (MB/s)": 12147.59 - } - }, - "ssl_bm": { - "AES": { - "1024B": 808861020, - "16B": 735490250, - "256B": 803323650, - "64B": 788429210, - "8192B": 807701160 - }, - "RSA": { - "1024b": 7931.44, - "2048b": 1544.3, - "4096b": 161.92, - "512b": 22148.9 - } - }, - "ssl_vm": { - "AES": { - "1024B": 808861020, - "16B": 735490250, - "256B": 803323650, - "64B": 788429210, - "8192B": 807701160 - }, - "RSA": { - "1024b": 7931.44, - "2048b": 1544.3, - "4096b": 161.92, - "512b": 22148.9 - } - }, - "whetstone_bm": { - "multi_cpu": 41483.3, - "single_cpu": 806.1 - }, - "whetstone_vm": { - "multi_cpu": 2950.6, - "single_cpu": 789.0 - } - }, - "network": { - "iperf_bm": { - "throughput received(b/s)": 944473000.0 - }, - "iperf_vm": { - "throughput received(b/s)": 14416700000.0 - }, - "iperf_vm_2": { - "throughput received(b/s)": 2461530000.0 - } - }, - "storage": { - "fio_bm": { - "read": { - "IOPS": 6693 - }, - "write": { - "IOPS": 6688 - } - }, - "fio_vm": { - "read": { - "IOPS": 2239 - }, - "write": { - "IOPS": 2237 - } - } - } -} \ No newline at end of file diff --git a/data/ref_results/result_accum.py b/data/ref_results/result_accum.py deleted file mode 100644 index 6cd55886..00000000 --- a/data/ref_results/result_accum.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -import json - - -def result_concat(targ_dir): - list_vm = [] - list_bm = [] - diction = {} - - for file in os.listdir(targ_dir): - if file.endswith(".json"): - if file.startswith("instance"): - print str(file) - list_vm.append(file) - else: - list_bm.append(file) - l = len(list_bm) - k = len(list_vm) - - for x in range(0, l): - file_t = list_bm[x] - with open(targ_dir + file_t) as result_file: - result_djson = json.load(result_file) - diction['Baremetal' + str(int(x + 1))] = result_djson - - for x in range(0, k): - file_t = list_vm[x] - with open(targ_dir + file_t) as result_file: - result_djson = json.load(result_file) - diction['Virtual Machine ' + str(x + 1)] = result_djson - return diction diff --git a/data/ref_results/storage_benchmarks_indices.py b/data/ref_results/storage_benchmarks_indices.py deleted file mode 100644 index a5aef638..00000000 --- a/data/ref_results/storage_benchmarks_indices.py +++ /dev/null @@ -1,29 +0,0 @@ -from index_calculation import generic_index as get_index -from index_calculation import get_reference -from result_accum import result_concat as concat - - -def fio_index(): - fio_dict = concat('results/fio/') - fio_r_bm_ref = get_reference('storage', 'fio_bm', 'read', 'IOPS') - fio_r_bm_index = get_index(fio_dict, 'fio_bm', fio_r_bm_ref, 'details', 'job_0', 'read', 'io_ps') - fio_w_bm_ref = get_reference('storage', 'fio_bm', 'write', 'IOPS') - fio_w_bm_index = get_index(fio_dict, 'fio_bm', fio_w_bm_ref, 'details', 'job_0', 'write', 'io_ps') - - fio_bm_index = (fio_r_bm_index + fio_w_bm_index) / 2 - - fio_r_vm_ref = get_reference('storage', 'fio_vm', 'read', 'IOPS') - fio_r_vm_index = get_index(fio_dict, 'fio_vm', fio_r_vm_ref, 'details', 'job_0', 'read', 'io_ps') - - fio_w_vm_ref = get_reference('storage', 'fio_vm', 'write', 'IOPS') - fio_w_vm_index = get_index(fio_dict, 'fio_vm', fio_w_vm_ref, 'details', 'job_0', 'write', 'io_ps') - - fio_vm_index = (fio_r_vm_index + fio_w_vm_index) / 2 - - fio_index = (fio_bm_index + fio_vm_index) / 2 - print fio_index - - fio_dict_i = {} - fio_dict_i['index'] = fio_index - fio_dict_i['results'] = fio_dict - return fio_dict_i diff --git a/data/ref_results/suite_result.py b/data/ref_results/suite_result.py deleted file mode 100644 index d0b4647f..00000000 --- a/data/ref_results/suite_result.py +++ /dev/null @@ -1,55 +0,0 @@ -############################################################################## -# Copyright (c) 2016 ZTE Corp and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -import json -import importlib -import sys -from utils import logger_utils - -logger = logger_utils.QtipLogger('suite_result').get - - -def get_benchmark_result(benchmark_name, suite_name): - benchmark_indices = importlib.import_module('{0}_benchmarks_indices'.format(suite_name)) - methodToCall = getattr(benchmark_indices, '{0}_index'.format(benchmark_name)) - return methodToCall() - - -def get_suite_result(suite_name): - suite_dict = {} - suite_bench_list = {'compute': ['DPI', 'Dhrystone', 'Whetstone', 'SSL', 'RamSpeed'], - 'storage': ['FIO'], - 'network': ['IPERF']} - temp = 0 - l = len(suite_bench_list[suite_name]) - for benchmark in suite_bench_list[suite_name]: - try: - suite_dict[benchmark] = get_benchmark_result(benchmark.lower(), suite_name) - temp = temp + float(suite_dict[benchmark]['index']) - except OSError: - l = l - 1 - pass - - if l == 0: - logger.info("No {0} suite results found".format(suite_name)) - return False - else: - suite_index = temp / l - suite_dict_f = {'index': suite_index, - 'suite_results': suite_dict} - with open('results/{0}_result.json'.format(suite_name), 'w+') as result_json: - json.dump(suite_dict_f, result_json, indent=4, sort_keys=True) - return True - - -def main(): - get_suite_result(sys.argv[1]) - - -if __name__ == "__main__": - main() diff --git a/data/report/Qtip_Report.py b/data/report/Qtip_Report.py deleted file mode 100644 index cd20d57c..00000000 --- a/data/report/Qtip_Report.py +++ /dev/null @@ -1,108 +0,0 @@ -from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image -from reportlab.lib.styles import getSampleStyleSheet -from reportlab.lib.units import inch -from reportlab.lib.pagesizes import letter -import qtip_graph as graph -import get_indices as results -from get_results import report_concat -from get_results import generate_result - - -def dump_result(Stor, directory, testcase): - try: - lower_s = testcase.lower() - Stor.append(Paragraph(testcase, Style['h3'])) - l1 = report_concat(directory, lower_s) - l = 1 - for a in l1: - Stor.append(Paragraph(testcase + " result_" + str(l), Style['h5'])) - raw_string = generate_result(a, 0) - replaced_string = raw_string.replace('\n', '
').replace(' ', ' ') - Stor.append(Paragraph(replaced_string, Style['BodyText'])) - l = l + 1 - except OSError: - print "Results for {0} not found".format(testcase) - -doc = SimpleDocTemplate("../../results/QTIP_results.pdf", pagesize=letter, - rightMargin=72, leftMargin=72, - topMargin=72, bottomMargin=18) -Stor = [] -Style = getSampleStyleSheet() -Title = "QTIP Benchmark Suite" -Stor.append(Paragraph(Title, Style['Title'])) -H1 = "Results" -Stor.append(Spacer(0, 36)) -Stor.append(Paragraph(H1, Style['h2'])) -compute = 0 -storage = 0 -network = 0 -try: - compute = results.get_index('compute_result') -except IOError: - pass - -try: - storage = results.get_index('storage_result') -except IOError: - pass -try: - network = results.get_index('network_result') -except IOError: - pass - -Stor.append(Paragraph("Compute Suite: %f" % compute, Style['h5'])) -Stor.append(Paragraph("Storage Suite: %f" % storage, Style['h5'])) -Stor.append(Paragraph("Network Suite: %f" % network, Style['h5'])) -graph.plot_indices(compute, storage, network) -qtip_graph = ('qtip_graph.jpeg') -im = Image(qtip_graph, 5 * inch, 4 * inch) -Stor.append(im) -Stor.append(Spacer(0, 12)) -Stor.append(Paragraph("Reference POD", Style['h5'])) -ptext = "The Dell OPNFV Lab POD3 has been taken as the reference POD against which the reference results have been collected. The POD consists of 6 identical servers. The details of such a server are:" -Stor.append(Paragraph(ptext, Style['Normal'])) -ptext = "Server Type: Dell PowerEdge R630 Server" -Stor.append(Paragraph(ptext, Style['Bullet'])) -ptext = "CPU: Intel Xeon E5-2698 @ 2300 MHz" -Stor.append(Paragraph(ptext, Style["Bullet"])) -ptext = "RAM: 128GB" -Stor.append(Paragraph(ptext, Style["Bullet"])) -ptext = "Storage SSD: 420GB" -Stor.append(Paragraph(ptext, Style["Bullet"])) -ptext = "Network Card: Intel 2P X520/2P I350 rNDC" -Stor.append(Paragraph(ptext, Style["Bullet"])) -ptext = "Servers interconnected through a DELL S4810 switch using a 10Gbps physical link" -Stor.append(Paragraph(ptext, Style["Bullet"])) -Stor.append(Spacer(0, 12)) -ptext = "For Further Details of the Reference POD hardware, please visit: https://wiki.opnfv.org/reference_pod_hardware_details" -Stor.append(Paragraph(ptext, Style['Normal'])) -Stor.append(Spacer(0, 12)) -ptext = "For Details of the Reference POD Results, please visit: https://wiki.opnfv.org/reference_pod_qtip_results" -Stor.append(Spacer(0, 12)) -Stor.append(Paragraph(ptext, Style['Normal'])) -Stor.append(Paragraph("RAW Results", Style['h1'])) -Stor.append(Paragraph("Compute Results", Style['h2'])) - -dump_result(Stor, "../../results/dhrystone/", "Dhrystone_bm") -dump_result(Stor, "../../results/dhrystone/", "Dhrystone_vm") - -dump_result(Stor, "../../results/whetstone/", "Whetstone_bm") -dump_result(Stor, "../../results/whetstone/", "Whetstone_vm") - -dump_result(Stor, "../../results/ramspeed/", "Ramspeed_bm") -dump_result(Stor, "../../results/ramspeed/", "Ramspeed_vm") - -dump_result(Stor, "../../results/ssl/", "SSL_bm") -dump_result(Stor, "../../results/ssl/", "SSL_vm") - -Stor.append(Paragraph("Network Results", Style['h2'])) -dump_result(Stor, "../../results/iperf/", "IPERF_bm") -dump_result(Stor, "../../results/iperf/", "IPERF_vm") -dump_result(Stor, "../../results/iperf/", "IPERF_vm_2") - -Stor.append(Paragraph("Storage Results", Style['h2'])) -dump_result(Stor, "../../results/fio/", "fio_bm") -dump_result(Stor, "../../results/fio/", "fio_vm") - - -doc.build(Stor) diff --git a/data/report/get_indices.py b/data/report/get_indices.py deleted file mode 100644 index 91219c0b..00000000 --- a/data/report/get_indices.py +++ /dev/null @@ -1,8 +0,0 @@ -import json - - -def get_index(suite): - with open('../../results/' + suite + '.json') as result_file: - result_djson = json.load(result_file) - index = result_djson['index'] - return index diff --git a/data/report/get_results.py b/data/report/get_results.py deleted file mode 100644 index 23fd5383..00000000 --- a/data/report/get_results.py +++ /dev/null @@ -1,50 +0,0 @@ -import os -import json - - -def report_concat(targ_dir, testcase): - machine_temp = [] - machines = [] - - for file in os.listdir(targ_dir): - if file.endswith(".json"): - machine_temp.append(file) - - l = len(machine_temp) - - for x in range(0, l): - file_t = machine_temp[x] - with open(targ_dir + file_t) as result_file: - result_djson = json.load(result_file) - if result_djson['1 Testcase Name'] == str(testcase): - machines.append(result_djson) - return machines - - -def space_count(l): - spc = '' - for x in range(l): - spc = spc + ' ' - return spc - - -def custom_dict(list1, list2, k): - string_1 = '' - for num_1 in range(0, len(list1)): - string_1 = string_1 + space_count(k) + str(list1[num_1][0]) + "=" + str(list2[num_1]) + "\n" - return string_1 - - -def generate_result(dict_a, k): - list_1 = [] - list_2 = [] - count = 0 - for i, j in sorted(dict_a.iteritems()): - list_1.append([]) - list_1[count].append(i) - if (str(type(dict_a.get(i)))) == "": - list_2.append(str("\n" + generate_result(dict_a.get(i), int(k + 1)))) - else: - list_2.append(dict_a.get(i)) - count = count + 1 - return custom_dict(list_1, list_2, k) diff --git a/data/report/qtip_graph.py b/data/report/qtip_graph.py deleted file mode 100644 index acbda40c..00000000 --- a/data/report/qtip_graph.py +++ /dev/null @@ -1,30 +0,0 @@ -import matplotlib -import matplotlib.pyplot as plt -import numpy as np - -matplotlib.use('Agg') - - -def plot_indices(a, b, c): - N = 3 - ind = np.arange(N) - y_axis = (a, b, c) - width = 0.35 - f = plt.figure() - ax = f.gca() - ax.set_autoscale_on(True) - my_bars = ax.bar(ind, y_axis, width, color='b') - ax.set_ylabel('Index Score*') - ax.set_xlabel('Suite') - ax.set_title(' QTIP benchmark scores') - ax.axis('on') - my_bars = ax.bar(ind, y_axis, width) - ax.set_xticks(ind + width / 2) - ax.set_xticklabels(['Compute', 'Storage', 'Network']) - ax.axis([0, 3, 0, 1.25]) - f.text(0.7, 0.01, '* With Comparison to Refernece POD', fontsize=9) - - for rect in my_bars: - height = rect.get_height() - ax.text(rect.get_x() + rect.get_width() / 2., 1.05 * height, height, ha='center', va='bottom') - f.savefig('qtip_graph.jpeg') diff --git a/data/ssh_exch.exp b/data/ssh_exch.exp deleted file mode 100644 index c52140b7..00000000 --- a/data/ssh_exch.exp +++ /dev/null @@ -1,9 +0,0 @@ -#1 /usr/bin/expect -set timeout 4 -set ip [lindex $argv 0] -set pswd [lindex $argv 1] -spawn ssh-copy-id -i QtipKey $ip -expect "Are you sure you want to continue connecting" {send "yes\r"} -expect "password:" { send "$pswd\r"} - -interact diff --git a/docker/run_qtip.sh b/docker/run_qtip.sh index d766d46c..62f97c88 100755 --- a/docker/run_qtip.sh +++ b/docker/run_qtip.sh @@ -3,21 +3,21 @@ run_test_suite() { if [ "$TEST_CASE" == "compute" ]; then cd ${QTIP_DIR} && python qtip.py -l default -f compute - cd ${QTIP_DIR} && python data/ref_results/suite_result.py compute + cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute elif [ "$TEST_CASE" == "storage" ]; then cd ${QTIP_DIR} && python qtip.py -l default -f storage - cd ${QTIP_DIR} && python data/ref_results/suite_result.py storage + cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage elif [ "$TEST_CASE" == "network" ]; then cd ${QTIP_DIR} && python qtip.py -l default -f network - cd ${QTIP_DIR} && python data/ref_results/suite_result.py network + cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py network elif [ "$TEST_CASE" == "all" ]; then cd ${QTIP_DIR} && python qtip.py -l default -f compute cd ${QTIP_DIR} && python qtip.py -l default -f storage cd ${QTIP_DIR} && python qtip.py -l default -f network - cd ${QTIP_DIR} && python data/ref_results/suite_result.py compute - cd ${QTIP_DIR} && python data/ref_results/suite_result.py storage - cd ${QTIP_DIR} && python data/ref_results/suite_result.py network + cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute + cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage + cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py network fi } diff --git a/func/driver.py b/func/driver.py index bcda0ce1..9a011c2a 100644 --- a/func/driver.py +++ b/func/driver.py @@ -64,9 +64,9 @@ class Driver: def run_ansible_playbook(self, benchmark, extra_vars): logger.info(extra_vars) ansible_api = AnsibleApi() - ansible_api.execute_playbook('./data/hosts', + ansible_api.execute_playbook('./config/hosts', './benchmarks/playbooks/{0}.yaml'.format(benchmark), - './data/QtipKey', extra_vars) + './config/QtipKey', extra_vars) return self.get_ansible_result(extra_vars['role'], ansible_api.get_detail_playbook_stats()) def drive_bench(self, installer_type, pwd, benchmark, roles, benchmark_fname, diff --git a/func/env_setup.py b/func/env_setup.py index 2655fab9..9e21a5b6 100644 --- a/func/env_setup.py +++ b/func/env_setup.py @@ -46,7 +46,7 @@ class Env_setup: @staticmethod def write_to_file(role): - f_name_2 = open('./data/hosts', 'w') + f_name_2 = open('./config/hosts', 'w') print role.items() for k in role: f_name_2.write('[' + k + ']\n') @@ -62,13 +62,13 @@ class Env_setup: os.system('ssh-keyscan %s >> /root/.ssh/known_hosts' % ip) time.sleep(2) - ssh_cmd = './data/qtip_creds.sh %s' % ip + ssh_cmd = './scripts/qtip_creds.sh %s' % ip logger.info("run command: %s " % ssh_cmd) os.system(ssh_cmd) ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - ssh.connect(ip, key_filename='./data/QtipKey') + ssh.connect(ip, key_filename='./config/QtipKey') for attempts in range(100): try: @@ -109,7 +109,7 @@ class Env_setup: if not installer_ip: raise RuntimeError("undefine environment variable INSTALLER_IP") - cmd = "bash ./data/fetch_compute_ips.sh -i %s -a %s" % \ + cmd = "bash ./scripts/fetch_compute_ips.sh -i %s -a %s" % \ (installer_type, installer_ip) logger.info(cmd) os.system(cmd) diff --git a/func/spawn_vm.py b/func/spawn_vm.py index c45af00e..3a16e02d 100644 --- a/func/spawn_vm.py +++ b/func/spawn_vm.py @@ -65,15 +65,15 @@ class SpawnVM(Env_setup): def heat_template_vm(self, vm_params, installer): Heat_Dic = {} try: - with open('./heat/SampleHeat.yaml', 'r+') as H_temp: + with open('./config/SampleHeat.yaml', 'r+') as H_temp: Heat_Dic = yaml.safe_load(H_temp) except yaml.YAMLError as exc: if hasattr(exc, 'problem_mark'): mark = exc.problem_mark - print 'Error in qtip/heat/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1, mark.column + 1) + print 'Error in qtip/config/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1, mark.column + 1) print 'EXITING PROGRAM. Correct File and restart' sys.exit(1) - fopen = open('./data/QtipKey.pub', 'r') + fopen = open('./config/QtipKey.pub', 'r') fopenstr = fopen.read() fopenstr = fopenstr.rstrip() scriptcmd = '#!/bin/bash \n echo {0} >> foo.txt \n echo {1} >> /root/.ssh/authorized_keys'.format( @@ -243,7 +243,7 @@ class SpawnVM(Env_setup): if i['output_key'] == 'KeyPair_PublicKey': sshkey = str(i['output_value']) - with open('./data/my_key.pem', 'w') as fopen: + with open('./config/my_key.pem', 'w') as fopen: fopen.write(sshkey) fopen.close() print Env_setup.ip_pw_list diff --git a/get_env_info.sh b/get_env_info.sh deleted file mode 100755 index 2fb0d22b..00000000 --- a/get_env_info.sh +++ /dev/null @@ -1,37 +0,0 @@ -#! /bin/bash - -usage() { - echo "usage $0 -n -i -k " -} - - - -while getopts ":n:i:k:" optchar; do - case "${optchar}" in - n) - export INSTALLER_TYPE=${OPTARG};; - - i) - export INSTALLER_IP=${OPTARG};; - - k) - export APEX_KEY=${OPTARG};; - - *) - echo "Incorrect usage" - usage ;; - esac -done - -if [ $INSTALLER_TYPE == "apex" ] - then - if [ -z $APEX_KEY ] - then - echo "Please provide the the key to access the APEX Instack VM" - usage - exit 1 - fi -fi - - -./data/fetch_os_creds.sh -d ./opnfv-creds.sh diff --git a/heat/SampleHeat.yaml b/heat/SampleHeat.yaml deleted file mode 100644 index ae9f5667..00000000 --- a/heat/SampleHeat.yaml +++ /dev/null @@ -1,36 +0,0 @@ -heat_template_version: 2014-10-16 -parameters: - - private_net_name: - type: string - default: 'private_network' - - availability_zone: - type: string - description: The AvailZone. - default: compute1 - -resources: - - private_network: - type: OS::Neutron::Net - private_subnet: - type: OS::Neutron::Subnet - properties: - network_id: { get_resource: private_network } - cidr: '10.10.17.0/24' - dns_nameservers: [ '8.8.8.8' ] - gateway_ip: '10.10.17.1' - allocation_pools: [ {"start":'10.10.17.2', "end": '10.10.17.200'} ] - router_1: - type: OS::Neutron::Router - properties: - external_gateway_info: - network: { get_param: public_network } - router_interface: - type: OS::Neutron::RouterInterface - properties: - router_id: { get_resource: router_1 } - subnet: { get_resource: private_subnet } -outputs: - description: 'none' diff --git a/scripts/fetch_compute_ips.sh b/scripts/fetch_compute_ips.sh new file mode 100755 index 00000000..ebe817a6 --- /dev/null +++ b/scripts/fetch_compute_ips.sh @@ -0,0 +1,117 @@ +#!/bin/bash +############################################################################## +#Copyright (c) 2016 Ericsson AB, ZTE and others. +#jose.lausuch@ericsson.com +#wu.zhihui1@zte.com.cn +#All rights reserved. This program and the accompanying materials +#are made available under the terms of the Apache License, Version 2.0 +#which accompanies this distribution, and is available at +#http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +usage(){ + echo "usage: $0 [-v] -i -a " >&2 + echo "[-v] Virtualized deployment" >&2 +} + +info() { + logger -s -t "fetch_compute_info.info" "$*" +} + + +error() { + logger -s -t "fetch_compute_info.error" "$*" + exit 1 +} + +verify_connectivity(){ + local ip=$1 + info "Verifying connectivity to $ip..." + for i in $(seq 0 10); do + if ping -c 1 -W 1 $ip > /dev/null; then + info "$ip is reachable!" + return 0 + fi + sleep 1 + done + error "Can not talk to $ip." +} + +:${DEPLOY_TYPE:=''} + +#Getoptions +while getopts ":i:a:h:v" optchar; do + case "${optchar}" in + i) installer_type=${OPTARG} ;; + a) installer_ip=${OPTARG} ;; + v) DEPLOY_TYPE="virt" ;; + *) echo "Non-option argument: '-${OPTARG}'" >&2 + usage + exit 2 + ;; + esac +done + +#set vars from env if not provided by user as options +installer_type=${installer_type:-$INSTALLER_TYPE} +installer_ip=${installer_ip:-$INSTALLER_IP} + +if [ -z $installer_type ] || [ -z $installer_ip ]; then + usage + exit 2 +fi + +ssh_options="-oUserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + +#Start fetching compute ip +if [ "$installer_type" == "fuel" ]; then + verify_connectivity $installer_ip + + env=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ + 'fuel env'|grep operational|head -1|awk '{print $1}') &> /dev/null + if [ -z $env ]; then + error "No operational environment detected in Fuel" + fi + env_id="${FUEL_ENV:-$env}" + + # Check if compute is alive (online='True') + IPS=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ + "fuel node --env ${env_id} | grep compute | grep 'True\| 1' | awk -F\| '{print \$5}' " | \ + sed 's/ //g') &> /dev/null + + +elif [ "$installer_type" == "apex" ]; then + echo "not implement now" + exit 1 + +elif [ "$installer_type" == "compass" ]; then + # need test + verify_connectivity $installer_ip + IPS=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \ + 'mysql -ucompass -pcompass -Dcompass -e"select * from cluster;"' \ + | awk -F"," '{for(i=1;i $HOME/ips.log + echo $IPS +fi + +exit 0 diff --git a/scripts/fetch_os_creds.sh b/scripts/fetch_os_creds.sh new file mode 100755 index 00000000..3b493e14 --- /dev/null +++ b/scripts/fetch_os_creds.sh @@ -0,0 +1,188 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jose.lausuch@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +usage() { + echo "usage: $0 -d -i -a " >&2 +} + +info () { + logger -s -t "fetch_os_creds.info" "$*" +} + + +error () { + logger -s -t "fetch_os_creds.error" "$*" + exit 1 +} + + +verify_connectivity() { + local ip=$1 + info "Verifying connectivity to $ip..." + for i in $(seq 0 10); do + if ping -c 1 -W 1 $ip > /dev/null; then + info "$ip is reachable!" + return 0 + fi + sleep 1 + done + error "Can not talk to $ip." +} + + + +#Get options +while getopts ":d:i:a:h:" optchar; do + case "${optchar}" in + d) dest_path=${OPTARG} ;; + i) installer_type=${OPTARG} ;; + a) installer_ip=${OPTARG} ;; + *) echo "Non-option argument: '-${OPTARG}'" >&2 + usage + exit 2 + ;; + esac +done + +# set vars from env if not provided by user as options +dest_path=${dest_path:-$HOME/opnfv-openrc.sh} +installer_type=${installer_type:-$INSTALLER_TYPE} +installer_ip=${installer_ip:-$INSTALLER_IP} + +if [ -z $dest_path ] || [ -z $installer_type ] || [ -z $installer_ip ]; then + usage + exit 2 +fi + +# Checking if destination path is valid +if [ -d $dest_path ]; then + error "Please provide the full destination path for the credentials file including the filename" +else + # Check if we can create the file (e.g. path is correct) + touch $dest_path || error "Cannot create the file specified. Check that the path is correct and run the script again." +fi + + +ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + +# Start fetching the files +if [ "$installer_type" == "fuel" ]; then + #ip_fuel="10.20.0.2" + verify_connectivity $installer_ip + + # Check if controller is alive (online='True') + controller_ip=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ + 'fuel node | grep controller | grep True | awk "{print \$10}" | tail -1') &> /dev/null + + if [ -z $controller_ip ]; then + error "The controller $controller_ip is not up. Please check that the POD is correctly deployed." + fi + + info "Fetching rc file from controller $controller_ip..." + sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ + "scp $ssh_options ${controller_ip}:/root/openrc ." &> /dev/null + sshpass -p r00tme scp 2>/dev/null $ssh_options root@${installer_ip}:~/openrc $dest_path &> /dev/null + + #This file contains the mgmt keystone API, we need the public one for our rc file + admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') + public_ip=$(sshpass -p r00tme ssh $ssh_options root@${installer_ip} \ + "ssh ${controller_ip} 'source openrc; keystone endpoint-list'" \ + | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) &> /dev/null + #| grep http | head -1 | cut -d '|' -f 4 | sed 's/v1\/.*/v1\//' | sed 's/ //g') &> /dev/null + #NOTE: this is super ugly sed 's/v1\/.*/v1\//'OS_AUTH_URL + # but sometimes the output of endpoint-list is like this: http://172.30.9.70:8004/v1/%(tenant_id)s + +elif [ "$installer_type" == "apex" ]; then + verify_connectivity $installer_ip + + # The credentials file is located in the Instack VM (192.0.2.1) + # NOTE: This might change for bare metal deployments + info "Fetching rc file from Instack VM $installer_ip..." + if [ -f /root/.ssh/id_rsa ]; then + chmod 600 /root/.ssh/id_rsa + fi + sudo scp $ssh_options root@$installer_ip:/home/stack/overcloudrc $dest_path + +elif [ "$installer_type" == "compass" ]; then + verify_connectivity $installer_ip + controller_ip=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \ + 'mysql -ucompass -pcompass -Dcompass -e"select * from cluster;"' \ + | awk -F"," '{for(i=1;i/dev/null $ssh_options root@${installer_ip} \ + "scp $ssh_options ${controller_ip}:/opt/admin-openrc.sh ." &> /dev/null + sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:~/admin-openrc.sh $dest_path &> /dev/null + echo 'export OS_REGION_NAME=regionOne' >> $dest_path + + info "This file contains the mgmt keystone API, we need the public one for our rc file" + admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') + info "admin_ip: $admin_ip" + public_ip=$(sshpass -p root ssh $ssh_options root@${installer_ip} \ + "ssh ${controller_ip} 'source /opt/admin-openrc.sh; keystone endpoint-list'" \ + | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) + info "public_ip: $public_ip" + + +elif [ "$installer_type" == "joid" ]; then + # do nothing...for the moment + # we can either do a scp from the jumphost or use the -v option to transmit the param to the docker file + echo "Do nothing, creds will be provided through volume option at docker creation for joid" + +elif [ "$installer_type" == "foreman" ]; then + #ip_foreman="172.30.10.73" + controller="oscontroller1.opnfv.com" + verify_connectivity $installer_ip + + # Check if controller is alive (here is more difficult to get the ip from a command like "fuel node") + sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ + "sshpass -p Op3nStack ssh $ssh_options root@${controller} 'ls'" &> /dev/null + if [ $? -ne 0 ]; then + error "The controller ${controller} is not up. Please check that the POD is correctly deployed." + fi + + info "Fetching openrc from a Foreman Controller '${controller}'..." + sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ + "sshpass -p Op3nStack scp $ssh_options root@${controller}:~/keystonerc_admin ." &> /dev/null + sshpass -p vagrant scp $ssh_options root@${installer_ip}:~/keystonerc_admin $dest_path &> /dev/null + + #This file contains the mgmt keystone API, we need the public one for our rc file + admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') + public_ip=$(sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ + "sshpass -p Op3nStack ssh $ssh_options root@${controller} \ + 'source keystonerc_admin;keystone endpoint-list'" \ + | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) &> /dev/null + +else + error "Installer $installer is not supported by this script" +fi + + +if [ ! -f $dest_path ]; then + error "There has been an error retrieving the credentials" +fi + +if [ "$public_ip" != "" ]; then + info "Exchanging keystone public IP in rc file to $public_ip" + sed -i "/OS_AUTH_URL/c\export OS_AUTH_URL=\'$public_ip'" $dest_path +fi + + + +echo "-------- Credentials: --------" +cat $dest_path + +exit 0 diff --git a/scripts/file_permission.sh b/scripts/file_permission.sh new file mode 100755 index 00000000..01a77d50 --- /dev/null +++ b/scripts/file_permission.sh @@ -0,0 +1,3 @@ +#! /bin/bash +chmod 0600 data/QtipKey +chmod 0600 data/QtipKey.pub diff --git a/scripts/get_env_info.sh b/scripts/get_env_info.sh new file mode 100755 index 00000000..4b362fac --- /dev/null +++ b/scripts/get_env_info.sh @@ -0,0 +1,37 @@ +#! /bin/bash + +usage() { + echo "usage $0 -n -i -k " +} + + + +while getopts ":n:i:k:" optchar; do + case "${optchar}" in + n) + export INSTALLER_TYPE=${OPTARG};; + + i) + export INSTALLER_IP=${OPTARG};; + + k) + export APEX_KEY=${OPTARG};; + + *) + echo "Incorrect usage" + usage ;; + esac +done + +if [ $INSTALLER_TYPE == "apex" ] + then + if [ -z $APEX_KEY ] + then + echo "Please provide the the key to access the APEX Instack VM" + usage + exit 1 + fi +fi + + +./scripts/fetch_os_creds.sh -d ./opnfv-creds.sh diff --git a/scripts/qtip_creds.sh b/scripts/qtip_creds.sh new file mode 100755 index 00000000..beb4659f --- /dev/null +++ b/scripts/qtip_creds.sh @@ -0,0 +1,30 @@ +#! /bin/bash + +DEST_IP=$1 +echo $INSTALLER_TYPE +echo $INSTALLER_IP +sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" +case "$INSTALLER_TYPE" in + apex) + scp $sshoptions -i $APEX_KEY ./data/QtipKey.pub stack@$INSTALLER_IP:/home/stack + scp $sshoptions -i $APEX_KEY ./data/QtipKey stack@$INSTALLER_IP:/home/stack + ssh $sshoptions -i $APEX_KEY stack@$INSTALLER_IP "ssh-copy-id $sshoptions -i /home/stack/QtipKey.pub heat-admin@$DEST_IP && rm -rf /home/stack/QtipKey && rm -rf /home/stack/QtipKey.pub" + ;; + fuel) + PSWD="r00tme" + sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root + sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root + sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "grep -q '\-F /dev/null ' /usr/bin/ssh-copy-id || sed -i 's/\(ssh -i.*$\)/\1\n -F \/dev\/null \\\/g' `which ssh-copy-id`" + sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" + ;; + compass) + PSWD="root" + sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root + sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root + sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey.pub root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" + ;; + joid) + PSWD="joid";; + *) + echo "Unkown installer $INSTALLER_TYPE specified";; +esac diff --git a/scripts/ref_results/__init__.py b/scripts/ref_results/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/scripts/ref_results/compute_benchmarks_indices.py b/scripts/ref_results/compute_benchmarks_indices.py new file mode 100644 index 00000000..9012cefc --- /dev/null +++ b/scripts/ref_results/compute_benchmarks_indices.py @@ -0,0 +1,161 @@ +from index_calculation import generic_index as get_index +from index_calculation import get_reference +from result_accum import result_concat as concat + + +def dpi_index(): + dpi_dict = concat('results/dpi/') + dpi_bm_ref = get_reference('compute', 'dpi_bm') + dpi_bm_index = get_index(dpi_dict, 'dpi_bm', dpi_bm_ref, 'details', 'bps') + + dpi_vm_ref = get_reference('compute', 'dpi_vm') + dpi_vm_index = get_index(dpi_dict, 'dpi_vm', dpi_vm_ref, 'details', 'bps') + + dpi_index = (dpi_bm_index + dpi_vm_index) / 2 + dpi_dict_i = {} + dpi_dict_i['index'] = dpi_index + dpi_dict_i['results'] = dpi_dict + return dpi_dict_i + + +def dhrystone_index(): + + dhrystone_dict = concat('results/dhrystone/') + dhrystone_single_bm_ref = get_reference('compute', 'dhrystone_bm', 'single_cpu') + dhrystone_single_bm_index = get_index(dhrystone_dict, 'dhrystone_bm', dhrystone_single_bm_ref, 'details', 'single', 'score') + + dhrystone_multi_bm_ref = get_reference('compute', 'dhrystone_bm', 'multi_cpu') + dhrystone_multi_bm_index = get_index(dhrystone_dict, 'dhrystone_bm', dhrystone_multi_bm_ref, 'details', 'multi', 'score') + + dhrystone_bm_index = (dhrystone_single_bm_index + dhrystone_multi_bm_index) / 2 + + dhrystone_single_vm_ref = get_reference('compute', 'dhrystone_vm', 'single_cpu') + dhrystone_single_vm_index = get_index(dhrystone_dict, 'dhrystone_vm', dhrystone_single_vm_ref, 'details', 'single', 'score') + + dhrystone_multi_vm_ref = get_reference('compute', 'dhrystone_vm', 'multi_cpu') + dhrystone_multi_vm_index = get_index(dhrystone_dict, 'dhrystone_vm', dhrystone_multi_vm_ref, 'details', 'multi', 'score') + + dhrystone_vm_index = (dhrystone_single_vm_index + dhrystone_multi_vm_index) / 2 + + dhrystone_index = (dhrystone_bm_index + dhrystone_vm_index) / 2 + dhrystone_dict_i = {} + dhrystone_dict_i['index'] = dhrystone_index + dhrystone_dict_i['results'] = dhrystone_dict + return dhrystone_dict_i + + +def whetstone_index(): + + whetstone_dict = concat('results/whetstone/') + whetstone_single_bm_ref = get_reference('compute', 'whetstone_bm', 'single_cpu') + whetstone_single_bm_index = get_index(whetstone_dict, 'whetstone_bm', whetstone_single_bm_ref, 'details', 'single', 'score') + + whetstone_multi_bm_ref = get_reference('compute', 'whetstone_bm', 'multi_cpu') + whetstone_multi_bm_index = get_index(whetstone_dict, 'whetstone_bm', whetstone_multi_bm_ref, 'details', 'multi', 'score') + + whetstone_bm_index = (whetstone_single_bm_index + whetstone_multi_bm_index) / 2 + + whetstone_single_vm_ref = get_reference('compute', 'whetstone_vm', 'single_cpu') + whetstone_single_vm_index = get_index(whetstone_dict, 'whetstone_vm', whetstone_single_vm_ref, 'details', 'single', 'score') + + whetstone_multi_vm_ref = get_reference('compute', 'whetstone_vm', 'multi_cpu') + whetstone_multi_vm_index = get_index(whetstone_dict, 'whetstone_vm', whetstone_multi_vm_ref, 'details', 'multi', 'score') + + whetstone_vm_index = (whetstone_single_vm_index + whetstone_multi_vm_index) / 2 + + whetstone_index = (whetstone_bm_index + whetstone_vm_index) / 2 + whetstone_dict_i = {} + whetstone_dict_i['index'] = whetstone_index + whetstone_dict_i['results'] = whetstone_dict + return whetstone_dict_i + + +def ramspeed_index(): + + ramspeed_dict = concat('results/ramspeed/') + ramspeed_int_bm_ref = get_reference('compute', 'ramspeed_bm', 'INTmem', 'Average (MB/s)') + ramspeed_int_bm_index = get_index(ramspeed_dict, 'ramspeed_bm', ramspeed_int_bm_ref, 'details', 'int_bandwidth', 'average') + + ramspeed_float_bm_ref = get_reference('compute', 'ramspeed_bm', 'FLOATmem', 'Average (MB/s)') + ramspeed_float_bm_index = get_index(ramspeed_dict, 'ramspeed_bm', ramspeed_float_bm_ref, 'details', 'float_bandwidth', 'average') + + ramspeed_bm_index = (ramspeed_int_bm_index + ramspeed_float_bm_index) / 2 + + ramspeed_int_vm_ref = get_reference('compute', 'ramspeed_vm', 'INTmem', 'Average (MB/s)') + ramspeed_int_vm_index = get_index(ramspeed_dict, 'ramspeed_vm', ramspeed_int_vm_ref, 'details', 'int_bandwidth', 'average') + + ramspeed_float_vm_ref = get_reference('compute', 'ramspeed_vm', 'FLOATmem', 'Average (MB/s)') + ramspeed_float_vm_index = get_index(ramspeed_dict, 'ramspeed_vm', ramspeed_float_vm_ref, 'details', 'float_bandwidth', 'average') + + ramspeed_vm_index = (ramspeed_int_vm_index + ramspeed_float_vm_index) / 2 + + ramspeed_index = (ramspeed_vm_index + ramspeed_bm_index) / 2 + + ramspeed_dict_i = {} + ramspeed_dict_i['index'] = ramspeed_index + ramspeed_dict_i['results'] = ramspeed_dict + return ramspeed_dict_i + + +def ssl_index(): + + ssl_dict = concat('results/ssl/') + + ssl_RSA512b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '512b') + ssl_RSA1024b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '1024b') + ssl_RSA2048b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '2048b') + ssl_RSA4096b_bm_ref = get_reference('compute', 'ssl_bm', 'RSA', '4096b') + + ssl_AES16B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '16B') + ssl_AES64B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '64B') + ssl_AES256B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '256B') + ssl_AES1024B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '1024B') + ssl_AES8192B_bm_ref = get_reference('compute', 'ssl_bm', 'AES', '8192B') + + ssl_RSA512b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA512b_bm_ref, 'details', 'rsa_sig', '512_bits') + ssl_RSA1024b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA1024b_bm_ref, 'details', 'rsa_sig', '1024_bits') + ssl_RSA2048b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA2048b_bm_ref, 'details', 'rsa_sig', '2048_bits') + ssl_RSA4096b_bm_index = get_index(ssl_dict, "ssl_bm", ssl_RSA4096b_bm_ref, 'details', 'rsa_sig', '4096_bits') + ssl_RSA_bm_index = (ssl_RSA512b_bm_index + ssl_RSA1024b_bm_index + ssl_RSA2048b_bm_index + ssl_RSA4096b_bm_index) / 4 + + ssl_AES16B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES16B_bm_ref, 'details', 'aes_128_cbc', '16_block') + ssl_AES64B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES64B_bm_ref, 'details', 'aes_128_cbc', '64_block') + ssl_AES256B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES256B_bm_ref, 'details', 'aes_128_cbc', '256_block') + ssl_AES1024B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES1024B_bm_ref, 'details', 'aes_128_cbc', '1024_block') + ssl_AES8192B_bm_index = get_index(ssl_dict, "ssl_bm", ssl_AES8192B_bm_ref, 'details', 'aes_128_cbc', '8192_block') + ssl_AES_bm_index = (ssl_AES16B_bm_index + ssl_AES64B_bm_index + ssl_AES256B_bm_index + ssl_AES1024B_bm_index + ssl_AES8192B_bm_index) / 5 + + ssl_bm_index = (ssl_RSA_bm_index + ssl_AES_bm_index) / 2 + + ssl_RSA512b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '512b') + ssl_RSA1024b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '1024b') + ssl_RSA2048b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '2048b') + ssl_RSA4096b_vm_ref = get_reference('compute', 'ssl_vm', 'RSA', '4096b') + + ssl_AES16B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '16B') + ssl_AES64B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '64B') + ssl_AES256B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '256B') + ssl_AES1024B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '1024B') + ssl_AES8192B_vm_ref = get_reference('compute', 'ssl_vm', 'AES', '8192B') + + ssl_RSA512b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA512b_vm_ref, 'details', 'rsa_sig', '512_bits') + ssl_RSA1024b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA1024b_vm_ref, 'details', 'rsa_sig', '1024_bits') + ssl_RSA2048b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA2048b_vm_ref, 'details', 'rsa_sig', '2048_bits') + ssl_RSA4096b_vm_index = get_index(ssl_dict, "ssl_vm", ssl_RSA4096b_vm_ref, 'details', 'rsa_sig', '4096_bits') + ssl_RSA_vm_index = (ssl_RSA512b_vm_index + ssl_RSA1024b_vm_index + ssl_RSA2048b_vm_index + ssl_RSA4096b_vm_index) / 4 + + ssl_AES16B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES16B_vm_ref, 'details', 'aes_128_cbc', '16_block') + ssl_AES64B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES64B_vm_ref, 'details', 'aes_128_cbc', '64_block') + ssl_AES256B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES256B_vm_ref, 'details', 'aes_128_cbc', '256_block') + ssl_AES1024B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES1024B_vm_ref, 'details', 'aes_128_cbc', '1024_block') + ssl_AES8192B_vm_index = get_index(ssl_dict, "ssl_vm", ssl_AES8192B_vm_ref, 'details', 'aes_128_cbc', '8192_block') + ssl_AES_vm_index = (ssl_AES16B_vm_index + ssl_AES64B_vm_index + ssl_AES256B_vm_index + ssl_AES1024B_vm_index + ssl_AES8192B_vm_index) / 5 + + ssl_vm_index = (ssl_RSA_vm_index + ssl_AES_vm_index) / 2 + + ssl_index = (ssl_bm_index + ssl_vm_index) / 2 + + ssl_dict_i = {} + ssl_dict_i['index'] = ssl_index + ssl_dict_i['results'] = ssl_dict + return ssl_dict_i diff --git a/scripts/ref_results/generator_ref_json.py b/scripts/ref_results/generator_ref_json.py new file mode 100644 index 00000000..6b2d813c --- /dev/null +++ b/scripts/ref_results/generator_ref_json.py @@ -0,0 +1,81 @@ +import json + +dict_ref = {} +dict_ref['compute'] = {} +dict_ref['compute']['dpi_bm'] = 8.12 +dict_ref['compute']['dpi_vm'] = 22.12 + +dict_ref['compute']['whetstone_bm'] = {} +dict_ref['compute']['whetstone_vm'] = {} +dict_ref['compute']['whetstone_bm']['single_cpu'] = 806.1 +dict_ref['compute']['whetstone_bm']['multi_cpu'] = 41483.3 +dict_ref['compute']['whetstone_vm']['single_cpu'] = 789.0 +dict_ref['compute']['whetstone_vm']['multi_cpu'] = 2950.6 + +dict_ref['compute']['dhrystone_bm'] = {} +dict_ref['compute']['dhrystone_vm'] = {} +dict_ref['compute']['dhrystone_bm']['single_cpu'] = 3231.7 +dict_ref['compute']['dhrystone_bm']['multi_cpu'] = 103362.1 +dict_ref['compute']['dhrystone_vm']['single_cpu'] = 2953.6 +dict_ref['compute']['dhrystone_vm']['multi_cpu'] = 10585.8 + +dict_ref['compute']['ssl_bm'] = {} +dict_ref['compute']['ssl_bm']['RSA'] = {} +dict_ref['compute']['ssl_bm']['AES'] = {} +dict_ref['compute']['ssl_bm']['RSA']['512b'] = 22148.9 +dict_ref['compute']['ssl_bm']['RSA']['1024b'] = 7931.44 +dict_ref['compute']['ssl_bm']['RSA']['2048b'] = 1544.3 +dict_ref['compute']['ssl_bm']['RSA']['4096b'] = 161.92 +dict_ref['compute']['ssl_bm']['AES']['16B'] = 735490250 +dict_ref['compute']['ssl_bm']['AES']['64B'] = 788429210 +dict_ref['compute']['ssl_bm']['AES']['256B'] = 803323650 +dict_ref['compute']['ssl_bm']['AES']['1024B'] = 808861020 +dict_ref['compute']['ssl_bm']['AES']['8192B'] = 807701160 + +dict_ref['compute']['ssl_vm'] = {} +dict_ref['compute']['ssl_vm']['RSA'] = {} +dict_ref['compute']['ssl_vm']['AES'] = {} +dict_ref['compute']['ssl_vm']['RSA']['512b'] = 22148.9 +dict_ref['compute']['ssl_vm']['RSA']['1024b'] = 7931.44 +dict_ref['compute']['ssl_vm']['RSA']['2048b'] = 1544.3 +dict_ref['compute']['ssl_vm']['RSA']['4096b'] = 161.92 +dict_ref['compute']['ssl_vm']['AES']['16B'] = 735490250 +dict_ref['compute']['ssl_vm']['AES']['64B'] = 788429210 +dict_ref['compute']['ssl_vm']['AES']['256B'] = 803323650 +dict_ref['compute']['ssl_vm']['AES']['1024B'] = 808861020 +dict_ref['compute']['ssl_vm']['AES']['8192B'] = 807701160 + +dict_ref['compute']['ramspeed_bm'] = {} +dict_ref['compute']['ramspeed_bm']['INTmem'] = {} +dict_ref['compute']['ramspeed_bm']['FLOATmem'] = {} +dict_ref['compute']['ramspeed_bm']['INTmem']['Average (MB/s)'] = 12268.38 +dict_ref['compute']['ramspeed_bm']['FLOATmem']['Average (MB/s)'] = 9758.79 + +dict_ref['compute']['ramspeed_vm'] = {} +dict_ref['compute']['ramspeed_vm']['INTmem'] = {} +dict_ref['compute']['ramspeed_vm']['FLOATmem'] = {} +dict_ref['compute']['ramspeed_vm']['INTmem']['Average (MB/s)'] = 12147.59 +dict_ref['compute']['ramspeed_vm']['FLOATmem']['Average (MB/s)'] = 9064.09 + +dict_ref['storage'] = {} +dict_ref['storage']['fio_bm'] = {} +dict_ref['storage']['fio_bm']['read'] = {} +dict_ref['storage']['fio_bm']['write'] = {} +dict_ref['storage']['fio_bm']['read']['IOPS'] = 6693 +dict_ref['storage']['fio_bm']['write']['IOPS'] = 6688 + +dict_ref['storage']['fio_vm'] = {} +dict_ref['storage']['fio_vm']['read'] = {} +dict_ref['storage']['fio_vm']['write'] = {} +dict_ref['storage']['fio_vm']['read']['IOPS'] = 2239 +dict_ref['storage']['fio_vm']['write']['IOPS'] = 2237 + +dict_ref['network'] = {} +dict_ref['network']['iperf_bm'] = {} +dict_ref['network']['iperf_vm'] = {} +dict_ref['network']['iperf_vm_2'] = {} +dict_ref['network']['iperf_bm']['throughput received(b/s)'] = 944473000.0 +dict_ref['network']['iperf_vm']['throughput received(b/s)'] = 14416700000.0 +dict_ref['network']['iperf_vm_2']['throughput received(b/s)'] = 2461530000.0 +with open('reference.json', 'w+') as result_json: + json.dump(dict_ref, result_json, indent=4, sort_keys=True) diff --git a/scripts/ref_results/index_calculation.py b/scripts/ref_results/index_calculation.py new file mode 100644 index 00000000..5ca4a46e --- /dev/null +++ b/scripts/ref_results/index_calculation.py @@ -0,0 +1,41 @@ +import json + + +def compute_index(total_measured, ref_result, count): + try: + average = float(total_measured / count) + + except ZeroDivisionError: + average = 0 + index = average / ref_result + return index + + +def get_reference(*args): + + with open('data/ref_results/reference.json') as reference_file: + reference_djson = json.load(reference_file) + for arg in args: + ref_n = reference_djson.get(str(arg)) + reference_djson = reference_djson.get(str(arg)) + return ref_n + + +def generic_index(dict_gen, testcase, reference_num, *args): + c = len(args) + count = 0 + total = 0 + result = 0 + for k, v in dict_gen.iteritems(): + dict_temp = dict_gen[k] + if dict_gen[k]['name'] == str(testcase): + count = count + 1 + for arg in args: + if arg == args[c - 1]: + try: + result = float(dict_temp.get(str(arg))) + except ValueError: + result = float(dict_temp.get(str(arg))[:-1]) * 1000 + dict_temp = dict_temp.get(str(arg)) + total = total + result + return compute_index(total, reference_num, count) diff --git a/scripts/ref_results/network_benchmarks_indices.py b/scripts/ref_results/network_benchmarks_indices.py new file mode 100644 index 00000000..c19d18eb --- /dev/null +++ b/scripts/ref_results/network_benchmarks_indices.py @@ -0,0 +1,20 @@ +from index_calculation import generic_index as get_index +from index_calculation import get_reference +from result_accum import result_concat as concat + + +def iperf_index(): + iperf_dict = concat('results/iperf/') + iperf_bm_ref = get_reference('network', 'iperf_bm', 'throughput received(b/s)') + iperf_bm_index = get_index(iperf_dict, 'iperf_bm', iperf_bm_ref, 'details', 'bandwidth', 'received_throughput') + iperf_vm_ref = get_reference('network', 'iperf_vm', 'throughput received(b/s)') + iperf_vm_index = get_index(iperf_dict, 'iperf_vm', iperf_vm_ref, 'details', 'bandwidth', 'received_throughput') + + iperf_vm_2_ref = get_reference('network', 'iperf_vm_2', 'throughput received(b/s)') + iperf_vm_2_index = get_index(iperf_dict, 'iperf_vm_2', iperf_vm_2_ref, 'details', 'bandwidth', 'received_throughput') + iperf_index = float(iperf_bm_index + iperf_vm_index + iperf_vm_2_index) / 3 + print iperf_index + iperf_dict_i = {} + iperf_dict_i['index'] = iperf_index + iperf_dict_i['results'] = iperf_dict + return iperf_dict_i diff --git a/scripts/ref_results/reference.json b/scripts/ref_results/reference.json new file mode 100644 index 00000000..cfcbfc3b --- /dev/null +++ b/scripts/ref_results/reference.json @@ -0,0 +1,97 @@ +{ + "compute": { + "dhrystone_bm": { + "multi_cpu": 103362.1, + "single_cpu": 3231.7 + }, + "dhrystone_vm": { + "multi_cpu": 10585.8, + "single_cpu": 2953.6 + }, + "dpi_bm": 8.12, + "dpi_vm": 22.12, + "ramspeed_bm": { + "FLOATmem": { + "Average (MB/s)": 9758.79 + }, + "INTmem": { + "Average (MB/s)": 12268.38 + } + }, + "ramspeed_vm": { + "FLOATmem": { + "Average (MB/s)": 9064.09 + }, + "INTmem": { + "Average (MB/s)": 12147.59 + } + }, + "ssl_bm": { + "AES": { + "1024B": 808861020, + "16B": 735490250, + "256B": 803323650, + "64B": 788429210, + "8192B": 807701160 + }, + "RSA": { + "1024b": 7931.44, + "2048b": 1544.3, + "4096b": 161.92, + "512b": 22148.9 + } + }, + "ssl_vm": { + "AES": { + "1024B": 808861020, + "16B": 735490250, + "256B": 803323650, + "64B": 788429210, + "8192B": 807701160 + }, + "RSA": { + "1024b": 7931.44, + "2048b": 1544.3, + "4096b": 161.92, + "512b": 22148.9 + } + }, + "whetstone_bm": { + "multi_cpu": 41483.3, + "single_cpu": 806.1 + }, + "whetstone_vm": { + "multi_cpu": 2950.6, + "single_cpu": 789.0 + } + }, + "network": { + "iperf_bm": { + "throughput received(b/s)": 944473000.0 + }, + "iperf_vm": { + "throughput received(b/s)": 14416700000.0 + }, + "iperf_vm_2": { + "throughput received(b/s)": 2461530000.0 + } + }, + "storage": { + "fio_bm": { + "read": { + "IOPS": 6693 + }, + "write": { + "IOPS": 6688 + } + }, + "fio_vm": { + "read": { + "IOPS": 2239 + }, + "write": { + "IOPS": 2237 + } + } + } +} \ No newline at end of file diff --git a/scripts/ref_results/result_accum.py b/scripts/ref_results/result_accum.py new file mode 100644 index 00000000..6cd55886 --- /dev/null +++ b/scripts/ref_results/result_accum.py @@ -0,0 +1,31 @@ +import os +import json + + +def result_concat(targ_dir): + list_vm = [] + list_bm = [] + diction = {} + + for file in os.listdir(targ_dir): + if file.endswith(".json"): + if file.startswith("instance"): + print str(file) + list_vm.append(file) + else: + list_bm.append(file) + l = len(list_bm) + k = len(list_vm) + + for x in range(0, l): + file_t = list_bm[x] + with open(targ_dir + file_t) as result_file: + result_djson = json.load(result_file) + diction['Baremetal' + str(int(x + 1))] = result_djson + + for x in range(0, k): + file_t = list_vm[x] + with open(targ_dir + file_t) as result_file: + result_djson = json.load(result_file) + diction['Virtual Machine ' + str(x + 1)] = result_djson + return diction diff --git a/scripts/ref_results/storage_benchmarks_indices.py b/scripts/ref_results/storage_benchmarks_indices.py new file mode 100644 index 00000000..a5aef638 --- /dev/null +++ b/scripts/ref_results/storage_benchmarks_indices.py @@ -0,0 +1,29 @@ +from index_calculation import generic_index as get_index +from index_calculation import get_reference +from result_accum import result_concat as concat + + +def fio_index(): + fio_dict = concat('results/fio/') + fio_r_bm_ref = get_reference('storage', 'fio_bm', 'read', 'IOPS') + fio_r_bm_index = get_index(fio_dict, 'fio_bm', fio_r_bm_ref, 'details', 'job_0', 'read', 'io_ps') + fio_w_bm_ref = get_reference('storage', 'fio_bm', 'write', 'IOPS') + fio_w_bm_index = get_index(fio_dict, 'fio_bm', fio_w_bm_ref, 'details', 'job_0', 'write', 'io_ps') + + fio_bm_index = (fio_r_bm_index + fio_w_bm_index) / 2 + + fio_r_vm_ref = get_reference('storage', 'fio_vm', 'read', 'IOPS') + fio_r_vm_index = get_index(fio_dict, 'fio_vm', fio_r_vm_ref, 'details', 'job_0', 'read', 'io_ps') + + fio_w_vm_ref = get_reference('storage', 'fio_vm', 'write', 'IOPS') + fio_w_vm_index = get_index(fio_dict, 'fio_vm', fio_w_vm_ref, 'details', 'job_0', 'write', 'io_ps') + + fio_vm_index = (fio_r_vm_index + fio_w_vm_index) / 2 + + fio_index = (fio_bm_index + fio_vm_index) / 2 + print fio_index + + fio_dict_i = {} + fio_dict_i['index'] = fio_index + fio_dict_i['results'] = fio_dict + return fio_dict_i diff --git a/scripts/ref_results/suite_result.py b/scripts/ref_results/suite_result.py new file mode 100644 index 00000000..d0b4647f --- /dev/null +++ b/scripts/ref_results/suite_result.py @@ -0,0 +1,55 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import json +import importlib +import sys +from utils import logger_utils + +logger = logger_utils.QtipLogger('suite_result').get + + +def get_benchmark_result(benchmark_name, suite_name): + benchmark_indices = importlib.import_module('{0}_benchmarks_indices'.format(suite_name)) + methodToCall = getattr(benchmark_indices, '{0}_index'.format(benchmark_name)) + return methodToCall() + + +def get_suite_result(suite_name): + suite_dict = {} + suite_bench_list = {'compute': ['DPI', 'Dhrystone', 'Whetstone', 'SSL', 'RamSpeed'], + 'storage': ['FIO'], + 'network': ['IPERF']} + temp = 0 + l = len(suite_bench_list[suite_name]) + for benchmark in suite_bench_list[suite_name]: + try: + suite_dict[benchmark] = get_benchmark_result(benchmark.lower(), suite_name) + temp = temp + float(suite_dict[benchmark]['index']) + except OSError: + l = l - 1 + pass + + if l == 0: + logger.info("No {0} suite results found".format(suite_name)) + return False + else: + suite_index = temp / l + suite_dict_f = {'index': suite_index, + 'suite_results': suite_dict} + with open('results/{0}_result.json'.format(suite_name), 'w+') as result_json: + json.dump(suite_dict_f, result_json, indent=4, sort_keys=True) + return True + + +def main(): + get_suite_result(sys.argv[1]) + + +if __name__ == "__main__": + main() diff --git a/scripts/ssh_exch.exp b/scripts/ssh_exch.exp new file mode 100644 index 00000000..c52140b7 --- /dev/null +++ b/scripts/ssh_exch.exp @@ -0,0 +1,9 @@ +#1 /usr/bin/expect +set timeout 4 +set ip [lindex $argv 0] +set pswd [lindex $argv 1] +spawn ssh-copy-id -i QtipKey $ip +expect "Are you sure you want to continue connecting" {send "yes\r"} +expect "password:" { send "$pswd\r"} + +interact diff --git a/setup.py b/setup.py index 52874dd3..85dc966b 100644 --- a/setup.py +++ b/setup.py @@ -7,4 +7,4 @@ setup(name='qtip', py_modules=['qtip'], version='1.0', author='opnfv', - packages=['func', 'data.ref_results', 'data.report']) + packages=['func', 'scripts.ref_results', 'utils.report']) diff --git a/tests/ansible_api_test.py b/tests/ansible_api_test.py index e9f0a77d..613d5f7e 100644 --- a/tests/ansible_api_test.py +++ b/tests/ansible_api_test.py @@ -14,6 +14,6 @@ class TestClass: ansible_api = AnsibleApi() ret = ansible_api.execute_playbook('tests/data/hosts', 'tests/data/test.yml', - 'data/QtipKey', + 'config/QtipKey', {'keys': 'test'}) assert ret == 3 diff --git a/tests/env_setup_test.py b/tests/env_setup_test.py index cc3c6b60..a0bbf640 100644 --- a/tests/env_setup_test.py +++ b/tests/env_setup_test.py @@ -64,7 +64,7 @@ class TestClass: test_class.fetch_compute_ips = mock_ips test_class.parse("tests/test_case/bm_without_proxy.yaml") test_class.update_ansible() - result = filecmp.cmp('tests/output/hosts', 'data/hosts') + result = filecmp.cmp('tests/output/hosts', 'config/hosts') assert result def test_ping(self, capfd): diff --git a/utils/report/Qtip_Report.py b/utils/report/Qtip_Report.py new file mode 100644 index 00000000..cd20d57c --- /dev/null +++ b/utils/report/Qtip_Report.py @@ -0,0 +1,108 @@ +from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image +from reportlab.lib.styles import getSampleStyleSheet +from reportlab.lib.units import inch +from reportlab.lib.pagesizes import letter +import qtip_graph as graph +import get_indices as results +from get_results import report_concat +from get_results import generate_result + + +def dump_result(Stor, directory, testcase): + try: + lower_s = testcase.lower() + Stor.append(Paragraph(testcase, Style['h3'])) + l1 = report_concat(directory, lower_s) + l = 1 + for a in l1: + Stor.append(Paragraph(testcase + " result_" + str(l), Style['h5'])) + raw_string = generate_result(a, 0) + replaced_string = raw_string.replace('\n', '
').replace(' ', ' ') + Stor.append(Paragraph(replaced_string, Style['BodyText'])) + l = l + 1 + except OSError: + print "Results for {0} not found".format(testcase) + +doc = SimpleDocTemplate("../../results/QTIP_results.pdf", pagesize=letter, + rightMargin=72, leftMargin=72, + topMargin=72, bottomMargin=18) +Stor = [] +Style = getSampleStyleSheet() +Title = "QTIP Benchmark Suite" +Stor.append(Paragraph(Title, Style['Title'])) +H1 = "Results" +Stor.append(Spacer(0, 36)) +Stor.append(Paragraph(H1, Style['h2'])) +compute = 0 +storage = 0 +network = 0 +try: + compute = results.get_index('compute_result') +except IOError: + pass + +try: + storage = results.get_index('storage_result') +except IOError: + pass +try: + network = results.get_index('network_result') +except IOError: + pass + +Stor.append(Paragraph("Compute Suite: %f" % compute, Style['h5'])) +Stor.append(Paragraph("Storage Suite: %f" % storage, Style['h5'])) +Stor.append(Paragraph("Network Suite: %f" % network, Style['h5'])) +graph.plot_indices(compute, storage, network) +qtip_graph = ('qtip_graph.jpeg') +im = Image(qtip_graph, 5 * inch, 4 * inch) +Stor.append(im) +Stor.append(Spacer(0, 12)) +Stor.append(Paragraph("Reference POD", Style['h5'])) +ptext = "The Dell OPNFV Lab POD3 has been taken as the reference POD against which the reference results have been collected. The POD consists of 6 identical servers. The details of such a server are:" +Stor.append(Paragraph(ptext, Style['Normal'])) +ptext = "Server Type: Dell PowerEdge R630 Server" +Stor.append(Paragraph(ptext, Style['Bullet'])) +ptext = "CPU: Intel Xeon E5-2698 @ 2300 MHz" +Stor.append(Paragraph(ptext, Style["Bullet"])) +ptext = "RAM: 128GB" +Stor.append(Paragraph(ptext, Style["Bullet"])) +ptext = "Storage SSD: 420GB" +Stor.append(Paragraph(ptext, Style["Bullet"])) +ptext = "Network Card: Intel 2P X520/2P I350 rNDC" +Stor.append(Paragraph(ptext, Style["Bullet"])) +ptext = "Servers interconnected through a DELL S4810 switch using a 10Gbps physical link" +Stor.append(Paragraph(ptext, Style["Bullet"])) +Stor.append(Spacer(0, 12)) +ptext = "For Further Details of the Reference POD hardware, please visit: https://wiki.opnfv.org/reference_pod_hardware_details" +Stor.append(Paragraph(ptext, Style['Normal'])) +Stor.append(Spacer(0, 12)) +ptext = "For Details of the Reference POD Results, please visit: https://wiki.opnfv.org/reference_pod_qtip_results" +Stor.append(Spacer(0, 12)) +Stor.append(Paragraph(ptext, Style['Normal'])) +Stor.append(Paragraph("RAW Results", Style['h1'])) +Stor.append(Paragraph("Compute Results", Style['h2'])) + +dump_result(Stor, "../../results/dhrystone/", "Dhrystone_bm") +dump_result(Stor, "../../results/dhrystone/", "Dhrystone_vm") + +dump_result(Stor, "../../results/whetstone/", "Whetstone_bm") +dump_result(Stor, "../../results/whetstone/", "Whetstone_vm") + +dump_result(Stor, "../../results/ramspeed/", "Ramspeed_bm") +dump_result(Stor, "../../results/ramspeed/", "Ramspeed_vm") + +dump_result(Stor, "../../results/ssl/", "SSL_bm") +dump_result(Stor, "../../results/ssl/", "SSL_vm") + +Stor.append(Paragraph("Network Results", Style['h2'])) +dump_result(Stor, "../../results/iperf/", "IPERF_bm") +dump_result(Stor, "../../results/iperf/", "IPERF_vm") +dump_result(Stor, "../../results/iperf/", "IPERF_vm_2") + +Stor.append(Paragraph("Storage Results", Style['h2'])) +dump_result(Stor, "../../results/fio/", "fio_bm") +dump_result(Stor, "../../results/fio/", "fio_vm") + + +doc.build(Stor) diff --git a/utils/report/__init__.py b/utils/report/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/utils/report/get_indices.py b/utils/report/get_indices.py new file mode 100644 index 00000000..91219c0b --- /dev/null +++ b/utils/report/get_indices.py @@ -0,0 +1,8 @@ +import json + + +def get_index(suite): + with open('../../results/' + suite + '.json') as result_file: + result_djson = json.load(result_file) + index = result_djson['index'] + return index diff --git a/utils/report/get_results.py b/utils/report/get_results.py new file mode 100644 index 00000000..23fd5383 --- /dev/null +++ b/utils/report/get_results.py @@ -0,0 +1,50 @@ +import os +import json + + +def report_concat(targ_dir, testcase): + machine_temp = [] + machines = [] + + for file in os.listdir(targ_dir): + if file.endswith(".json"): + machine_temp.append(file) + + l = len(machine_temp) + + for x in range(0, l): + file_t = machine_temp[x] + with open(targ_dir + file_t) as result_file: + result_djson = json.load(result_file) + if result_djson['1 Testcase Name'] == str(testcase): + machines.append(result_djson) + return machines + + +def space_count(l): + spc = '' + for x in range(l): + spc = spc + ' ' + return spc + + +def custom_dict(list1, list2, k): + string_1 = '' + for num_1 in range(0, len(list1)): + string_1 = string_1 + space_count(k) + str(list1[num_1][0]) + "=" + str(list2[num_1]) + "\n" + return string_1 + + +def generate_result(dict_a, k): + list_1 = [] + list_2 = [] + count = 0 + for i, j in sorted(dict_a.iteritems()): + list_1.append([]) + list_1[count].append(i) + if (str(type(dict_a.get(i)))) == "": + list_2.append(str("\n" + generate_result(dict_a.get(i), int(k + 1)))) + else: + list_2.append(dict_a.get(i)) + count = count + 1 + return custom_dict(list_1, list_2, k) diff --git a/utils/report/qtip_graph.py b/utils/report/qtip_graph.py new file mode 100644 index 00000000..acbda40c --- /dev/null +++ b/utils/report/qtip_graph.py @@ -0,0 +1,30 @@ +import matplotlib +import matplotlib.pyplot as plt +import numpy as np + +matplotlib.use('Agg') + + +def plot_indices(a, b, c): + N = 3 + ind = np.arange(N) + y_axis = (a, b, c) + width = 0.35 + f = plt.figure() + ax = f.gca() + ax.set_autoscale_on(True) + my_bars = ax.bar(ind, y_axis, width, color='b') + ax.set_ylabel('Index Score*') + ax.set_xlabel('Suite') + ax.set_title(' QTIP benchmark scores') + ax.axis('on') + my_bars = ax.bar(ind, y_axis, width) + ax.set_xticks(ind + width / 2) + ax.set_xticklabels(['Compute', 'Storage', 'Network']) + ax.axis([0, 3, 0, 1.25]) + f.text(0.7, 0.01, '* With Comparison to Refernece POD', fontsize=9) + + for rect in my_bars: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.05 * height, height, ha='center', va='bottom') + f.savefig('qtip_graph.jpeg') -- cgit 1.2.3-korg