Make it easier to see what's happening in Jenkins 59/27759/1
authormbeierl <mark.beierl@dell.com>
Mon, 30 Jan 2017 17:14:02 +0000 (12:14 -0500)
committermbeierl <mark.beierl@dell.com>
Mon, 30 Jan 2017 17:14:02 +0000 (12:14 -0500)
Change-Id: I3ac727faa98c1e87dcd9522c0063ca6b251c62b4
Signed-off-by: mbeierl <mark.beierl@dell.com>
ci/daily.sh
ci/start_job.sh
rest_server.py
storperf/test_executor.py

index 11af7f4..b31f8e6 100755 (executable)
@@ -81,12 +81,13 @@ export WORKLOAD=_warm_up
 WARM_UP=`$WORKSPACE/ci/start_job.sh | awk '/job_id/ {print $2}' | sed 's/"//g'`
 
 WARM_UP_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$WARM_UP&type=status" \
-    | awk '/Status/ {print $2}' | sed 's/"//g'`
+    | awk '/Status/ {print $2}' | cut -d\" -f2`
 while [ "$WARM_UP_STATUS" != "Completed" ]
 do
     sleep 60
+    curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$WARM_UP&type=status"
     WARM_UP_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$WARM_UP&type=status" \
-    | awk '/Status/ {print $2}' | sed 's/"//g'`
+    | awk '/Status/ {print $2}' | cut -d\" -f2`
 done
 
 
@@ -102,12 +103,13 @@ export TEST_CASE=snia_steady_state
 JOB=`$WORKSPACE/ci/start_job.sh \
     | awk '/job_id/ {print $2}' | sed 's/"//g'`
 JOB_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \
-    | awk '/Status/ {print $2}' | sed 's/"//g'`
+    | awk '/Status/ {print $2}' | cut -d\" -f2`
 while [ "$JOB_STATUS" != "Completed" ]
 do
     sleep 60
+    curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status"
     JOB_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \
-        | awk '/Status/ {print $2}' | sed 's/"//g'`
+    | awk '/Status/ {print $2}' | cut -d\" -f2`
 done
 
 echo "Deleting stack for cleanup"
index 86b8fc8..1a71735 100755 (executable)
@@ -28,7 +28,7 @@ cat << EOF > body.json
 }
 EOF
 
-cat body.json
+cat body.json 1>&2
 
 curl -s -X POST --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
index 40b9b77..5c84fdb 100644 (file)
@@ -288,7 +288,7 @@ class Job(Resource):
             return jsonify(storperf.fetch_metadata(workload_id))
 
         if type == "status":
-            return jsonify({"Status": storperf.fetch_job_status(workload_id)})
+            return jsonify(storperf.fetch_job_status(workload_id))
 
     @swagger.operation(
         parameters=[
index cda6c78..e6f0784 100644 (file)
@@ -42,6 +42,7 @@ class TestExecutor(object):
         self.start_time = None
         self.end_time = None
         self.current_workload = None
+        self.workload_status = {}
         self._queue_depths = [1, 4, 8]
         self._block_sizes = [512, 4096, 16384]
         self.event_listeners = set()
@@ -188,13 +189,17 @@ class TestExecutor(object):
         return terminated_hosts
 
     def execution_status(self, job_id):
-        if self.job_db.job_id != job_id:
-            return "Completed"
 
-        if (self._terminated is False):
-            return "Running"
+        result = {}
+        status = "Completed"
 
-        return "Completed"
+        if self.job_db.job_id == job_id and self._terminated is False:
+            status = "Running"
+
+        result['Status'] = status
+        result['Workloads'] = self.workload_status
+
+        return result
 
     def execute_workloads(self):
         self._terminated = False
@@ -205,6 +210,18 @@ class TestExecutor(object):
 
         self.start_time = time.time()
 
+        self.workload_status = {}
+        # Prepare stats list
+        for workload_module in self.workload_modules:
+            workload_name = getattr(workload_module, "__name__")
+            blocksizes = self._block_sizes
+            iodepths = self._queue_depths
+            for blocksize in blocksizes:
+                for iodepth in iodepths:
+                    name = '%s.%s.queue-depth.%s.block-size.%s' % \
+                        (self.job_db.job_id, workload_name, iodepth, blocksize)
+                    self.workload_status[name] = "Pending"
+
         for workload_module in self.workload_modules:
             workload_name = getattr(workload_module, "__name__")
             self.logger.info("Starting workload %s" % (workload_name))
@@ -238,6 +255,7 @@ class TestExecutor(object):
                          blocksize))
 
                     self.logger.info("Starting run %s" % self.current_workload)
+                    self.workload_status[self.current_workload] = "Running"
 
                     scheduler = sched.scheduler(time.time, time.sleep)
                     if self.deadline is not None \
@@ -278,6 +296,7 @@ class TestExecutor(object):
 
                     self.logger.info("Completed run %s" %
                                      self.current_workload)
+                    self.workload_status[self.current_workload] = "Completed"
                     self._workload_executors = []
                     self.current_workload = None