[VOL-4073] Updated voltha-physical-soak-dt-tests jobs to get cpu usage by container

Change-Id: I45f04641f4de809a5b18a02c564df0e5048a67b5
diff --git a/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy b/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy
index 5918e4d..320bdf6 100644
--- a/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy
+++ b/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy
@@ -23,6 +23,8 @@
   deployment_config = null
 }
 
+def volthaNamespace = "voltha"
+
 pipeline {
   /* no label, executor is determined by JJB */
   agent {
@@ -142,6 +144,8 @@
       }
       steps {
         sh """
+        JENKINS_NODE_COOKIE="dontKillMe" _TAG="prometheus" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n cattle-prometheus svc/access-prometheus 31301:80; done"&
+        ps aux | grep port-forward
         mkdir -p $ROBOT_LOGS_DIR
         if [ "${params.testType}" == "Functional" ]; then
             if ( ${powerSwitch} ); then
@@ -230,7 +234,15 @@
         unstableThreshold: 0,
         onlyCritical: true
         ]);
-      archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt'
+      // get cpu usage by container
+      sh '''
+      mkdir -p $WORKSPACE/plots || true
+      cd $WORKSPACE/voltha-system-tests
+      source ./vst_venv/bin/activate || true
+      sleep 60 # we have to wait for prometheus to collect all the information
+      python scripts/sizing.py -o $WORKSPACE/plots -a 0.0.0.0:31301 -n ${volthaNamespace} -s 7200 || true
+      '''
+      archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt,plots/*'
     }
   }
 }
diff --git a/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy b/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy
index d5f1c9d..3c02c4e 100644
--- a/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy
+++ b/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy
@@ -361,7 +361,7 @@
         cd $WORKSPACE/voltha-system-tests
         source ./vst_venv/bin/activate
         sleep 60 # we have to wait for prometheus to collect all the information
-        python tests/scale/sizing.py -o $WORKSPACE/plots || true
+        python scripts/sizing.py -o $WORKSPACE/plots || true
       fi
       '''
       archiveArtifacts artifacts: 'kind-voltha/install-*.log,execution-time-*.txt,logs/**/*.txt,logs/**/*.tar.gz,logs/**/*.tgz,RobotLogs/**/*,plots/*,etcd-metrics/*'
diff --git a/jjb/pipeline/voltha/master/voltha-scale-test.groovy b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
index 92844c8..08f04a8 100644
--- a/jjb/pipeline/voltha/master/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
@@ -743,7 +743,7 @@
         cd $WORKSPACE/voltha-system-tests
         source ./vst_venv/bin/activate || true
         sleep 60 # we have to wait for prometheus to collect all the information
-        python tests/scale/sizing.py -o $WORKSPACE/plots || true
+        python scripts/sizing.py -o $WORKSPACE/plots || true
       fi
       '''
       archiveArtifacts artifacts: 'execution-time.txt,logs/*,logs/pprof/*,RobotLogs/**/*,plots/*,etcd-metrics/*'
diff --git a/jjb/pipeline/voltha/voltha-2.8/voltha-physical-soak-dt-tests.groovy b/jjb/pipeline/voltha/voltha-2.8/voltha-physical-soak-dt-tests.groovy
index 5918e4d..320bdf6 100644
--- a/jjb/pipeline/voltha/voltha-2.8/voltha-physical-soak-dt-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-2.8/voltha-physical-soak-dt-tests.groovy
@@ -23,6 +23,8 @@
   deployment_config = null
 }
 
+def volthaNamespace = "voltha"
+
 pipeline {
   /* no label, executor is determined by JJB */
   agent {
@@ -142,6 +144,8 @@
       }
       steps {
         sh """
+        JENKINS_NODE_COOKIE="dontKillMe" _TAG="prometheus" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n cattle-prometheus svc/access-prometheus 31301:80; done"&
+        ps aux | grep port-forward
         mkdir -p $ROBOT_LOGS_DIR
         if [ "${params.testType}" == "Functional" ]; then
             if ( ${powerSwitch} ); then
@@ -230,7 +234,15 @@
         unstableThreshold: 0,
         onlyCritical: true
         ]);
-      archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt'
+      // get cpu usage by container
+      sh '''
+      mkdir -p $WORKSPACE/plots || true
+      cd $WORKSPACE/voltha-system-tests
+      source ./vst_venv/bin/activate || true
+      sleep 60 # we have to wait for prometheus to collect all the information
+      python scripts/sizing.py -o $WORKSPACE/plots -a 0.0.0.0:31301 -n ${volthaNamespace} -s 7200 || true
+      '''
+      archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt,plots/*'
     }
   }
 }
diff --git a/jjb/pipeline/voltha/voltha-2.8/voltha-scale-multi-stack.groovy b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-multi-stack.groovy
index d5f1c9d..3c02c4e 100644
--- a/jjb/pipeline/voltha/voltha-2.8/voltha-scale-multi-stack.groovy
+++ b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-multi-stack.groovy
@@ -361,7 +361,7 @@
         cd $WORKSPACE/voltha-system-tests
         source ./vst_venv/bin/activate
         sleep 60 # we have to wait for prometheus to collect all the information
-        python tests/scale/sizing.py -o $WORKSPACE/plots || true
+        python scripts/sizing.py -o $WORKSPACE/plots || true
       fi
       '''
       archiveArtifacts artifacts: 'kind-voltha/install-*.log,execution-time-*.txt,logs/**/*.txt,logs/**/*.tar.gz,logs/**/*.tgz,RobotLogs/**/*,plots/*,etcd-metrics/*'
diff --git a/jjb/pipeline/voltha/voltha-2.8/voltha-scale-test.groovy b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-test.groovy
index 195da4a..0f010c4 100644
--- a/jjb/pipeline/voltha/voltha-2.8/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-test.groovy
@@ -702,7 +702,7 @@
         cd $WORKSPACE/voltha-system-tests
         source ./vst_venv/bin/activate || true
         sleep 60 # we have to wait for prometheus to collect all the information
-        python tests/scale/sizing.py -o $WORKSPACE/plots || true
+        python scripts/sizing.py -o $WORKSPACE/plots || true
       fi
       '''
       archiveArtifacts artifacts: 'execution-time.txt,logs/*,logs/pprof/*,RobotLogs/**/*,plots/*,etcd-metrics/*'