Removal of matplotlib 69/35969/1
authormbeierl <mark.beierl@dell.com>
Sat, 10 Jun 2017 12:38:00 +0000 (08:38 -0400)
committermbeierl <mark.beierl@dell.com>
Sat, 10 Jun 2017 12:38:00 +0000 (08:38 -0400)
Removes the matplotlib modules from the main container.

Change-Id: I26a0c171b2172dbf2be66cdf10b897bb72e4bf2b
JIRA: STORPERF-161
Signed-off-by: mbeierl <mark.beierl@dell.com>
ci/daily.sh
ci/verify.sh
docker/Dockerfile
docker/requirements.pip
rest_server.py
storperf/plot/__init__.py [deleted file]
storperf/plot/barchart.py [deleted file]

index 21fbc5c..c42fe64 100755 (executable)
@@ -64,6 +64,7 @@ $WORKSPACE/ci/create_storperf_flavor.sh
 $WORKSPACE/ci/launch_docker_container.sh
 $WORKSPACE/ci/create_stack.sh $AGENT_COUNT $VOLUME_SIZE "Ubuntu 16.04 x86_64" $NETWORK
 
+
 export WORKLOAD=_warm_up,$WORKLOADS
 export BLOCK_SIZE=$BLOCK_SIZES
 export QUEUE_DEPTH=$QUEUE_DEPTHS
index 28d0886..feb84d2 100755 (executable)
@@ -31,8 +31,6 @@ pip install funcsigs==0.4
 pip install flake8==2.5.4
 pip install html2text==2016.1.8
 pip install keystoneauth1==2.12.1
-pip install numpy==1.6
-pip install matplotlib==1.3.1
 pip install mock==1.3.0
 pip install nose==1.3.7
 pip install paramiko==2.0.2
index 6959095..d587fc4 100644 (file)
@@ -45,7 +45,6 @@ wget \
 puppet \
 build-essential \
 python-dev \
-python-matplotlib \
 python-pip \
 --no-install-recommends
 
@@ -107,7 +106,7 @@ RUN sed -i 's|url = "http://petstore.swagger.io/v2/swagger.json";|url = window.l
 
 RUN git clone http://git.kernel.dk/fio.git ${repos_dir}/fio
 RUN cd ${repos_dir}/fio && git checkout tags/fio-2.2.10
-RUN cd ${repos_dir}/fio && make -j 6 install
+RUN cd ${repos_dir}/fio && make install
 
 
 RUN chmod 600 ${repos_dir}/storperf/storperf/resources/ssh/storperf_rsa
index d1724fb..5f9b68e 100644 (file)
@@ -6,7 +6,6 @@ python-glanceclient==1.1.0
 python-cinderclient==1.6.0
 python-keystoneclient==1.6.0
 keystoneauth1==2.12.1
-matplotlib==1.3.1
 flask==0.10
 flask_cors==3.0.2
 flask-restful==0.3.5
index 1033ca8..8dffb11 100644 (file)
@@ -10,8 +10,6 @@
 import json
 import logging.config
 import os
-from storperf.db.job_db import JobDB
-from storperf.plot.barchart import Barchart
 from storperf.storperf_master import StorPerfMaster
 import sys
 
@@ -33,92 +31,6 @@ def send_swagger(path):
     return send_from_directory('storperf/resources/html/swagger', path)
 
 
-@app.route('/results/<path:job_id>')
-def results_page(job_id):
-
-    job_db = JobDB()
-
-    params = job_db.fetch_workload_params(job_id)
-
-    results = storperf.fetch_results(job_id)
-    workloads = []
-    block_sizes = []
-    queue_depths = []
-
-    for key, value in results.iteritems():
-        workload = key.split('.')[0]
-        queue_depth = int(key.split('.')[2])
-        block_size = int(key.split('.')[4])
-        if workload not in workloads:
-            workloads.append(workload)
-        if queue_depth not in queue_depths:
-            queue_depths.append(queue_depth)
-        if block_size not in block_sizes:
-            block_sizes.append(block_size)
-
-    queue_depths.sort()
-    block_sizes.sort()
-
-    read_latencies = []
-    write_latencies = []
-#    for workload in workloads:
-    workload = "rw"
-
-    for queue_depth in queue_depths:
-        rlatencies = []
-        read_latencies.append(rlatencies)
-        wlatencies = []
-        write_latencies.append(wlatencies)
-        for block_size in block_sizes:
-
-            key = "%s.queue-depth.%s.block-size.%s.read.latency" % \
-                (workload, queue_depth, block_size)
-            if key in results:
-                rlatencies.append(results[key] / 1000)
-            else:
-                rlatencies.append(0)
-
-            key = "%s.queue-depth.%s.block-size.%s.write.latency" % \
-                (workload, queue_depth, block_size)
-            if key in results:
-                wlatencies.append(results[key] / 1000)
-            else:
-                wlatencies.append(0)
-
-    chart = Barchart()
-    chart.barchart3d(queue_depths, block_sizes, read_latencies, 'g',
-                     'Read Latency (ms)')
-    readchart = chart.to_base64_image()
-
-    chart.barchart3d(queue_depths, block_sizes, write_latencies, 'r',
-                     'Write Latency (ms)')
-    writechart = chart.to_base64_image()
-
-    metadata = "<table>"
-    for key, value in params.iteritems():
-        metadata += "<TR><TD>" + key + "<TD>" + value + "</TR>"
-    metadata += "</table>"
-
-    html = """<html><body>%s <BR>
-    Number of VMs: %s <BR>
-    Cinder volume size per VM: %s (GB) <BR>
-    Metadata: <BR>
-    %s<BR>
-    <center>Read Latency Report <BR>
-    <img src="data:image/png;base64,%s"/>
-    <center>Write Latency Report <BR>
-    <img src="data:image/png;base64,%s"/>
-    </body></html>""" % (job_id,
-                         params['agent_count'],
-                         params['volume_size'],
-                         metadata,
-                         readchart,
-                         writechart,
-                         )
-
-    return html
-
-
 @swagger.model
 class ConfigurationRequestModel:
     resource_fields = {
diff --git a/storperf/plot/__init__.py b/storperf/plot/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/storperf/plot/barchart.py b/storperf/plot/barchart.py
deleted file mode 100644 (file)
index f82f3b8..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 EMC 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 cStringIO
-
-import matplotlib as mpl
-mpl.use('Agg')
-import matplotlib.pyplot as pyplot  # noqa: ignore E402
-from mpl_toolkits.mplot3d import Axes3D  # noqa: ignore E402, F401
-import numpy as np  # noqa: ignore E402
-
-
-class Barchart(object):
-
-    def __init__(self):
-        pass
-
-    def barchart3d(self, queue_depths, block_sizes, latencies, c, title):
-
-        fig = pyplot.figure()
-
-        data = np.array(latencies)
-
-        lx = len(data[0])          # Work out matrix dimensions
-        ly = len(data[:, 0])
-        xpos = np.arange(0, lx, 1)    # Set up a mesh of positions
-        ypos = np.arange(0, ly, 1)
-        xpos, ypos = np.meshgrid(xpos + 0.25, ypos + 0.25)
-
-        xpos = xpos.flatten()   # Convert positions to 1D array
-        ypos = ypos.flatten()
-        zpos = np.zeros(lx * ly)
-
-        dx = 0.5 * np.ones_like(zpos)
-        dy = dx.copy()
-        dz = data.flatten()
-
-        ax = fig.add_subplot(111, projection='3d')
-        ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color=c)
-
-        ticksx = np.arange(0.5, len(block_sizes), 1)
-        pyplot.xticks(ticksx, block_sizes)
-
-        ticksy = np.arange(0.6, len(queue_depths), 1)
-        pyplot.yticks(ticksy, queue_depths)
-
-        ax.set_xlabel('Block Size')
-        ax.set_ylabel('Queue Depth')
-        ax.set_zlabel(title)
-
-        ticksx = np.arange(0.5, 3, 1)
-        pyplot.xticks(ticksx, block_sizes)
-
-    def barchart(self, queue_depths, block_sizes, read_latencies):
-        pyplot.figure()
-
-        y_pos = np.arange(len(block_sizes))
-        bar_width = 0.15
-
-        colors = ['r', 'g', 'b', 'y']
-        legend = []
-        index = 0
-        for series in queue_depths:
-            chart = pyplot.bar(y_pos + (bar_width * index),
-                               read_latencies[index],
-                               bar_width,
-                               color=colors[index],
-                               align='center',
-                               label="Queue Depth " + str(series),
-                               alpha=0.4)
-            legend.append(chart[0])
-            index += 1
-
-        pyplot.xticks(y_pos + bar_width, block_sizes)
-        pyplot.ylabel("Latency (Microseconds)")
-        pyplot.xlabel("Block Sizes (bytes)")
-        pyplot.title("Latency Report")
-        pyplot.legend()
-        pyplot.tight_layout()
-
-    def to_base64_image(self):
-        sio = cStringIO.StringIO()
-        pyplot.savefig(sio, format="png")
-        return sio.getvalue().encode("base64").strip()