Merge "Extending rw-core timeout in scale jobs and using 'master' images"
diff --git a/jjb/cord-test/nightly-build-pipeline.yaml b/jjb/cord-test/nightly-build-pipeline.yaml
index 532773d..c2c47fd 100644
--- a/jjb/cord-test/nightly-build-pipeline.yaml
+++ b/jjb/cord-test/nightly-build-pipeline.yaml
@@ -68,11 +68,6 @@
           description: 'The config file'
 
       - string:
-          name: oltDebVersion
-          default: '{oltDebVersion}'
-          description: 'OLT Software version to install'
-
-      - string:
           name: branch
           default: '{branch}'
 
@@ -914,11 +909,6 @@
           description: 'Technology Profile pushed to the ETCD'
 
       - string:
-          name: oltDebVersion
-          default: '{oltDebVersion}'
-          description: 'OLT Software version to install'
-
-      - string:
           name: helmRepoUrl
           default: 'https://charts.opencord.org'
           description: 'URL where helm-charts are published'
diff --git a/jjb/cord-test/voltha.yaml b/jjb/cord-test/voltha.yaml
index 14dce79..3c8dc25 100644
--- a/jjb/cord-test/voltha.yaml
+++ b/jjb/cord-test/voltha.yaml
@@ -25,7 +25,6 @@
           num-of-openonu: '2'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           profile: '1T4GEM'
 
       # flex pod1 test job - using voltha branch
@@ -45,7 +44,6 @@
           branch: 'master'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           profile: '1T4GEM'
 
       # onlab pod1 test job - BAL3.1 tests using voltha branch
@@ -68,7 +66,6 @@
           num-of-atomix: '3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
           time: '1'
@@ -94,7 +91,6 @@
           num-of-atomix: '3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: '1T4GEM'
           time: '3'
@@ -117,7 +113,6 @@
           branch: 'voltha-2.3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: '1T4GEM'
           time: '4'
@@ -143,7 +138,6 @@
           num-of-atomix: '3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
           time: '1'
@@ -167,7 +161,6 @@
           branch: 'voltha-2.3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
           time: '3'
@@ -194,7 +187,6 @@
           num-of-atomix: '3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: '1T4GEM'
           time: '4'
@@ -221,7 +213,6 @@
           work-flow: 'DT'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: '1T8GEM'
           time: '6'
@@ -251,7 +242,6 @@
           work-flow: 'DT'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: '1T8GEM'
           time: '7'
@@ -278,7 +268,6 @@
           branch: 'master'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: '1T4GEM'
       - 'build_pod_test':
@@ -297,7 +286,6 @@
           branch: 'master'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
 
@@ -318,7 +306,6 @@
           branch: 'master'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
 
@@ -342,7 +329,6 @@
           num-of-atomix: '3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
           time: '10'
@@ -364,7 +350,6 @@
           branch: 'voltha-2.3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
           time: '12'
@@ -388,7 +373,6 @@
           num-of-openonu: '2'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           profile: 'Default'
       # infosys test job - Manual Job
       - 'build_pod_test':
@@ -410,7 +394,6 @@
           num-of-atomix: '3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
           with-kind: true
@@ -435,7 +418,6 @@
           branch: 'voltha-2.3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           configurePod: true
           profile: 'Default'
           with-kind: true
@@ -465,7 +447,6 @@
           work-flow: 'DT'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asgvolt64.deb'
           configurePod: true
           profile: '1T8GEM'
           with-kind: true
@@ -494,7 +475,6 @@
           num-of-openonu: '2'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
           profile: 'Default'
 
       # Berlin pod1 test job - using voltha branch
diff --git a/jjb/pipeline/comac-in-a-box-github.groovy b/jjb/pipeline/comac-in-a-box-github.groovy
index 41db899..881257a 100644
--- a/jjb/pipeline/comac-in-a-box-github.groovy
+++ b/jjb/pipeline/comac-in-a-box-github.groovy
@@ -46,13 +46,6 @@
           cd $HOME/automation-tools/comac-in-a-box/
           sudo make reset-test
           """
-        sh label: 'Cleanup Docker Images', script: '''
-          sudo docker rmi -f $(sudo docker images --format '{{.Repository}} {{.ID}}' | grep 'none' | awk '{print $2}') || true
-          sudo docker rmi -f $(sudo docker images --format '{{.Repository}}:{{.Tag}}' | grep 'openmme') || true
-          sudo docker rmi -f $(sudo docker images --format '{{.Repository}}:{{.Tag}}' | grep 'nucleus') || true
-          sudo docker rmi -f $(sudo docker images --format '{{.Repository}}:{{.Tag}}' | grep 'ngic') || true
-          sudo docker rmi -f $(sudo docker images --format '{{.Repository}}:{{.Tag}}' | grep 'c3po') || true
-          '''
         sh label: 'helm-charts Repo Fresh Clone', script: """
           cd $HOME/cord/
           sudo rm -rf helm-charts/
diff --git a/jjb/pipeline/voltha-physical-build-and-tests.groovy b/jjb/pipeline/voltha-physical-build-and-tests.groovy
index 46c845d..8395eeb 100644
--- a/jjb/pipeline/voltha-physical-build-and-tests.groovy
+++ b/jjb/pipeline/voltha-physical-build-and-tests.groovy
@@ -148,7 +148,7 @@
           echo "on master, using default settings for kind-voltha"
         fi
 
-        if ! [[ "${gerritProject}" =~ ^(voltha-system-tests|kind-voltha)\$ ]]; then
+        if ! [[ "${gerritProject}" =~ ^(voltha-system-tests|kind-voltha|voltha-helm-charts)\$ ]]; then
           make -C $WORKSPACE/voltha/${gerritProject} DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
           docker images | grep citest
           for image in \$(docker images -f "reference=*/*citest" --format "{{.Repository}}")
@@ -203,6 +203,16 @@
               EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
           done
 
+          if [ "${gerritProject}" = "voltha-helm-charts" ]; then
+              export CHART_PATH=$WORKSPACE/voltha/voltha-helm-charts
+              export VOLTHA_CHART=\$CHART_PATH/voltha
+              export VOLTHA_ADAPTER_OPEN_OLT_CHART=\$CHART_PATH/voltha-adapter-openolt
+              export VOLTHA_ADAPTER_OPEN_ONU_CHART=\$CHART_PATH/voltha-adapter-openonu
+              helm dep update \$VOLTHA_CHART
+              helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART
+              helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART
+          fi
+
           cd $WORKSPACE/voltha/kind-voltha/
           echo \$EXTRA_HELM_FLAGS
           kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log &
@@ -394,9 +404,17 @@
       script {
         deployment_config.olts.each { olt ->
           sh returnStdout: false, script: """
-          sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/openolt.log $WORKSPACE/openolt-${olt.ip}.log || true
+          until sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/openolt.log $WORKSPACE/openolt-${olt.ip}.log
+          do
+              echo "Fetching openolt.log log failed, retrying..."
+              sleep 10
+          done
           sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.ip}.log  # Remove escape sequences
-          sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/dev_mgmt_daemon.log $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log || true
+          until sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/dev_mgmt_daemon.log $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log
+          do
+              echo "Fetching dev_mgmt_daemon.log failed, retrying..."
+              sleep 10
+          done
           sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log  # Remove escape sequences
           """
         }
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index b1e04b3..76e56b9 100644
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -602,7 +602,7 @@
                 comment-contains-value: '^hardware test with delay$'
           projects:
             - project-compare-type: REG_EXP
-              project-pattern: '^(voltha-go|voltha-openolt-adapter|voltha-openonu-adapter|voltha-api-server|voltha-system-tests|ofagent-py|ofagent-go|voltha-onos|kind-voltha)$'
+              project-pattern: '^(voltha-go|voltha-openolt-adapter|voltha-openonu-adapter|voltha-api-server|voltha-system-tests|ofagent-py|ofagent-go|voltha-onos|kind-voltha|voltha-helm-charts)$'
               branches:
                 - branch-compare-type: REG_EXP
                   branch-pattern: '{all-branches-regexp}'