Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 1 | // Copyright 2017-present Open Networking Foundation |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | node ("${TestNodeName}") { |
| 16 | timeout (100) { |
| 17 | try { |
| 18 | stage ("Parse deployment configuration file") { |
Matteo Scandolo | 9f8056b | 2019-01-17 10:33:51 -0800 | [diff] [blame] | 19 | sh returnStdout: true, script: "rm -rf helm-charts helm-repo-tools ${configBaseDir}" |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 20 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/helm-repo-tools" |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 21 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/helm-charts" |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 22 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
| 23 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml" |
| 24 | } |
| 25 | stage('Clean up') { |
| 26 | timeout(10) { |
| 27 | sh returnStdout: true, script: """ |
| 28 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 29 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet'); |
| 30 | do |
| 31 | echo "Purging chart: \${hchart}" |
| 32 | helm delete --purge "\${hchart}" |
| 33 | done |
| 34 | """ |
| 35 | timeout(5) { |
| 36 | waitUntil { |
| 37 | helm_deleted = sh returnStdout: true, script: """ |
| 38 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 39 | helm ls -q | grep -E -v 'docker-registry|mavenrepo|ponnet' | wc -l |
| 40 | """ |
| 41 | return helm_deleted.toInteger() == 0 |
| 42 | } |
| 43 | } |
Wei-Yu Chen | 9de5f16 | 2019-01-17 10:40:38 -0800 | [diff] [blame] | 44 | timeout(5) { |
Wei-Yu Chen | 213821c | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 45 | dir ("helm-charts") { |
| 46 | stage("Cleanup SR-IOV CNI and SR-IOV Network Device Plugin") { |
| 47 | sh returnStdout: true, script: """ |
| 48 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 736f6b8 | 2019-01-24 15:29:07 -0800 | [diff] [blame] | 49 | kubectl delete -f mcord/cni-config/05-sriov-device-plugin.yaml || true |
| 50 | kubectl delete -f mcord/cni-config/04-sriov-device-plugin-configmap.yaml || true |
| 51 | kubectl delete -f mcord/cni-config/03-network-definition.yaml || true |
| 52 | kubectl delete -f mcord/cni-config/02-network-crd.yaml || true |
| 53 | kubectl delete -f mcord/cni-config/01-cni-service-account.yaml || true |
Wei-Yu Chen | 213821c | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 54 | """ |
| 55 | } |
| 56 | } |
| 57 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 58 | timeout(5) { |
| 59 | waitUntil { |
| 60 | kubectl_deleted = sh returnStdout: true, script: """ |
| 61 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Matteo Scandolo | 736f6b8 | 2019-01-24 15:29:07 -0800 | [diff] [blame] | 62 | kubectl get pods --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet|test' | wc -l |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 63 | """ |
| 64 | return kubectl_deleted.toInteger() == 0 |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
Matteo Scandolo | 65046b2 | 2019-02-04 09:59:49 -0800 | [diff] [blame^] | 69 | // OLT Software START |
| 70 | if ( params.reinstallOlt ) { |
| 71 | stage('Reinstall OLT software') { |
| 72 | for(int i=0; i < deployment_config.olts.size(); i++) { |
| 73 | sh returnStdout: true, script: """ |
| 74 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16' |
| 75 | """ |
| 76 | timeout(5) { |
| 77 | waitUntil { |
| 78 | olt_sw_present = sh returnStdout: true, script: """ |
| 79 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l' |
| 80 | """ |
| 81 | return olt_sw_present.toInteger() == 0 |
| 82 | } |
| 83 | } |
| 84 | sh returnStdout: true, script: """ |
| 85 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${oltDebVersion}" |
| 86 | """ |
| 87 | timeout(5) { |
| 88 | waitUntil { |
| 89 | olt_sw_present = sh returnStdout: true, script: """ |
| 90 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l' |
| 91 | """ |
| 92 | return olt_sw_present.toInteger() == 1 |
| 93 | } |
| 94 | } |
| 95 | // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded |
| 96 | if ("${deployment_config.olts[i].fortygig}" != null && "${deployment_config.olts[i].fortygig}" == 'true') { |
| 97 | sh returnStdout: true, script: """ |
| 98 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'echo "port ce128 sp=40000" >> /broadcom/qax.soc' |
| 99 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '/opt/bcm68620/svk_init.sh' |
| 100 | """ |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | stage('Restart OLT processes') { |
| 105 | for(int i=0; i < deployment_config.olts.size(); i++) { |
| 106 | timeout(5) { |
| 107 | sh returnStdout: true, script: """ |
| 108 | ssh-keyscan -H ${deployment_config.olts[i].ip} >> ~/.ssh/known_hosts |
| 109 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service bal_core_dist stop' || true |
| 110 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt stop' || true |
| 111 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /var/log/bal_core_dist.log' |
| 112 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /var/log/openolt.log' |
| 113 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service bal_core_dist start &' |
| 114 | sleep 5 |
| 115 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt start &' |
| 116 | """ |
| 117 | } |
| 118 | timeout(15) { |
| 119 | waitUntil { |
| 120 | onu_discovered = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cat /var/log/openolt.log | grep \"oper_state: up\" | wc -l'" |
| 121 | return onu_discovered.toInteger() > 0 |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | // OLT Software END |
Luca Prete | 62a48c8 | 2019-01-16 10:40:01 -0800 | [diff] [blame] | 128 | stage('Add Helm repositories') { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 129 | sh returnStdout: true, script: """ |
| 130 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Wei-Yu Chen | 76dd793 | 2019-01-18 14:14:23 -0800 | [diff] [blame] | 131 | helm init --upgrade --force-upgrade |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 132 | helm repo add cord https://charts.opencord.org |
Luca Prete | 62a48c8 | 2019-01-16 10:40:01 -0800 | [diff] [blame] | 133 | helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 134 | helm repo update |
| 135 | """ |
| 136 | timeout(1) { |
| 137 | waitUntil { |
Wei-Yu Chen | 76dd793 | 2019-01-18 14:14:23 -0800 | [diff] [blame] | 138 | tillerpod_running = sh returnStdout: true, script: """ |
| 139 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 140 | kubectl -n kube-system get pods | grep tiller-deploy | grep Running | wc -l |
| 141 | """ |
| 142 | return tillerpod_running.toInteger() == 1 |
| 143 | } |
| 144 | } |
| 145 | timeout(1) { |
| 146 | waitUntil { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 147 | cord_repo_present = sh returnStdout: true, script: """ |
| 148 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 149 | helm repo list | grep cord | wc -l |
| 150 | """ |
| 151 | return cord_repo_present.toInteger() == 1 |
| 152 | } |
| 153 | } |
| 154 | } |
Matteo Scandolo | 08aea47 | 2019-01-23 11:45:37 -0800 | [diff] [blame] | 155 | |
| 156 | stage('Install etcd-cluster') { |
| 157 | timeout(10) { |
| 158 | sh returnStdout: true, script: """ |
| 159 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 160 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --version 0.8.3 -n etcd-operator stable/etcd-operator |
Wei-Yu Chen | 396d24e | 2019-01-28 11:48:52 -0800 | [diff] [blame] | 161 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set etcdNodePort=32379 -n etcd cord/etcd-cluster |
Matteo Scandolo | 08aea47 | 2019-01-23 11:45:37 -0800 | [diff] [blame] | 162 | """ |
| 163 | } |
| 164 | timeout(10) { |
| 165 | waitUntil { |
| 166 | etcd_running = sh returnStdout: true, script: """ |
| 167 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 168 | kubectl get pods | grep etcd | grep -i running | grep 1/1 | wc -l |
| 169 | """ |
| 170 | return etcd_running.toInteger() == 6 |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 175 | dir ("helm-charts") { |
| 176 | stage('Install SR-IOV CNI and SR-IOV Network Device Plugin') { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 177 | sh returnStdout: true, script: """ |
| 178 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 179 | kubectl apply -f mcord/cni-config/02-network-crd.yaml |
| 180 | kubectl apply -f mcord/cni-config/ |
Wei-Yu Chen | 7f8c4dd | 2019-01-17 15:32:03 -0800 | [diff] [blame] | 181 | sleep 5 |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 182 | """ |
| 183 | } |
| 184 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 185 | |
Wei-Yu Chen | 037762d | 2019-01-24 11:12:39 -0800 | [diff] [blame] | 186 | // In current development progress, we prefered to keep this for testing eNodeB's functionality |
Andy Bavier | 77df9fb | 2019-02-02 10:49:04 -0700 | [diff] [blame] | 187 | stage("Install M-CORD Data Plane Services") { |
| 188 | sh returnStdout: true, script: """ |
| 189 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 190 | helm install -n mcord-data-plane --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-data-plane |
| 191 | """ |
| 192 | } |
| 193 | |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 194 | if ( params.installEpcControlPlane ) { |
| 195 | stage("Install M-CORD Control Plane Services") { |
| 196 | sh returnStdout: true, script: """ |
| 197 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 198 | helm install -n mcord-control-plane --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-control-plane |
| 199 | """ |
| 200 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 201 | } |
Andy Bavier | 77df9fb | 2019-02-02 10:49:04 -0700 | [diff] [blame] | 202 | |
| 203 | stage("Install M-CORD BBU Services") { |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 204 | sh returnStdout: true, script: """ |
| 205 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Andy Bavier | 77df9fb | 2019-02-02 10:49:04 -0700 | [diff] [blame] | 206 | helm install -n mcord-bbu --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-bbu |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 207 | """ |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 208 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 209 | |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 210 | stage('Install CORD Kafka') { |
| 211 | timeout(10) { |
| 212 | sh returnStdout: true, script: """ |
| 213 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 214 | helm install --version 0.8.8 --set configurationOverrides."offsets\\.topic\\.replication\\.factor"=1 --set configurationOverrides."log\\.retention\\.hours"=4 --set configurationOverrides."log\\.message\\.timestamp\\.type"="LogAppendTime" --set replicas=1 --set persistence.enabled=false --set zookeeper.replicaCount=1 --set zookeeper.persistence.enabled=false -n cord-kafka incubator/kafka |
| 215 | """ |
| 216 | } |
| 217 | timeout(10) { |
| 218 | waitUntil { |
| 219 | kafka_instances_running = sh returnStdout: true, script: """ |
| 220 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 221 | kubectl get pods | grep cord-kafka | grep -i running | grep 1/1 | wc -l |
| 222 | """ |
| 223 | return kafka_instances_running.toInteger() == 2 |
| 224 | } |
| 225 | } |
| 226 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 227 | // stage('Install Logging Infrastructure') { |
| 228 | // timeout(10) { |
| 229 | // sh returnStdout: true, script: """ |
| 230 | // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 231 | // helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set elasticsearch.cluster.env.MINIMUM_MASTER_NODES="1" --set elasticsearch.client.replicas=1 --set elasticsearch.master.replicas=2 --set elasticsearch.master.persistence.enabled=false --set elasticsearch.data.replicas=1 --set elasticsearch.data.persistence.enabled=false -n logging cord/logging |
| 232 | // helm-repo-tools/wait_for_pods.sh |
| 233 | // """ |
| 234 | // } |
| 235 | // } |
| 236 | // stage('Install Monitoring Infrastructure') { |
| 237 | // timeout(10) { |
| 238 | // sh returnStdout: true, script: """ |
| 239 | // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 240 | // helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n nem-monitoring cord/nem-monitoring |
| 241 | // helm-repo-tools/wait_for_pods.sh |
| 242 | // """ |
| 243 | // } |
| 244 | // } |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 245 | stage('Install ONOS') { |
| 246 | timeout(10) { |
| 247 | sh returnStdout: true, script: """ |
| 248 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 249 | helm install -n onos -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/onos --version 1.1.0 |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 250 | """ |
| 251 | } |
| 252 | timeout(10) { |
| 253 | waitUntil { |
| 254 | onos_completed = sh returnStdout: true, script: """ |
| 255 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 256 | kubectl get pods | grep -i onos | grep -i running | grep 2/2 | wc -l |
| 257 | """ |
| 258 | return onos_completed.toInteger() == 1 |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | stage('Install xos-core') { |
| 263 | timeout(10) { |
| 264 | sh returnStdout: true, script: """ |
| 265 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 266 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n xos-core cord/xos-core --version 2.3.3 |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 267 | """ |
| 268 | } |
| 269 | timeout(10) { |
| 270 | waitUntil { |
| 271 | xos_core_completed = sh returnStdout: true, script: """ |
| 272 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 273 | kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l |
| 274 | """ |
| 275 | return xos_core_completed.toInteger() == 6 |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | stage('Install M-CORD Profile') { |
| 280 | timeout(10) { |
| 281 | sh returnStdout: true, script: """ |
| 282 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 283 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n mcord cord/mcord |
| 284 | """ |
| 285 | } |
| 286 | timeout(10) { |
| 287 | waitUntil { |
| 288 | tosca_completed = sh returnStdout: true, script: """ |
| 289 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 290 | kubectl get pods | grep -i mcord-tosca-loader | grep -i completed | wc -l |
| 291 | """ |
| 292 | return tosca_completed.toInteger() == 1 |
| 293 | } |
| 294 | } |
| 295 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 296 | |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 297 | // SEBA Begin |
| 298 | stage('Install SEBA Profile') { |
| 299 | timeout(10) { |
| 300 | sh returnStdout: true, script: """ |
| 301 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 302 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n seba cord/seba-services --set fabric.enabled=false --set onos-service.enabled=false --version 1.0.5 |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 303 | """ |
| 304 | } |
| 305 | timeout(10) { |
| 306 | waitUntil { |
| 307 | tosca_completed = sh returnStdout: true, script: """ |
| 308 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 309 | kubectl get pods | grep -i seba-services-tosca-loader | grep -i completed | wc -l |
| 310 | """ |
| 311 | return tosca_completed.toInteger() == 1 |
| 312 | } |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | stage('Install base-kubernetes') { |
| 317 | timeout(10) { |
| 318 | sh returnStdout: true, script: """ |
| 319 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 320 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n base-kubernetes cord/base-kubernetes --version 1.0.2 |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 321 | """ |
| 322 | } |
| 323 | timeout(10) { |
| 324 | waitUntil { |
| 325 | base_kubernetes_tosca_running = sh returnStdout: true, script: """ |
| 326 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 327 | kubectl get pods | grep -i base-kubernetes-tosca-loader | grep -i completed | wc -l |
| 328 | """ |
| 329 | return base_kubernetes_tosca_running.toInteger() == 1 |
| 330 | } |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | stage('Install att workflow') { |
| 335 | timeout(10) { |
| 336 | sh returnStdout: true, script: """ |
| 337 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 338 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set att-workflow-driver.kafkaService=cord-kafka -n att-workflow --version 1.0.2 cord/att-workflow |
| 339 | """ |
| 340 | } |
| 341 | timeout(10) { |
| 342 | waitUntil { |
| 343 | att_workflow_tosca_completed = sh returnStdout: true, script: """ |
| 344 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 345 | kubectl get pods | grep -i att-workflow-tosca-loader | grep -i completed | wc -l |
| 346 | """ |
| 347 | return att_workflow_tosca_completed.toInteger() == 1 |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | stage('Install voltha') { |
| 353 | timeout(10) { |
| 354 | sh returnStdout: true, script: """ |
| 355 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 356 | helm install -n voltha -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/voltha --set etcd.cluster.enabled=false --version 1.0.3 |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 357 | """ |
| 358 | } |
| 359 | timeout(10) { |
| 360 | waitUntil { |
| 361 | voltha_completed = sh returnStdout: true, script: """ |
| 362 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 363 | kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l |
| 364 | """ |
| 365 | return voltha_completed.toInteger() == 8 |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | // SEBA end |
| 370 | |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 371 | if ( params.configurePod ) { |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 372 | dir ("${configBaseDir}/${configToscaDir}/mcord") { |
| 373 | stage('Configure MCORD - Fabric') { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 374 | timeout(1) { |
| 375 | waitUntil { |
| 376 | out_fabric = sh returnStdout: true, script: """ |
| 377 | curl -s -H "xos-username:admin@opencord.org" -H "xos-password:letmein" -X POST --data-binary @${configFileName}-fabric.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 378 | """ |
| 379 | return out_fabric.toInteger() == 1 |
| 380 | } |
| 381 | } |
| 382 | } |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 383 | } |
| 384 | dir ("${configBaseDir}/${configToscaDir}/att-workflow") { |
| 385 | stage('Configure SEBA - Fabric and whitelist') { |
| 386 | timeout(1) { |
| 387 | waitUntil { |
| 388 | out_fabric = sh returnStdout: true, script: """ |
| 389 | curl -s -H "xos-username:admin@opencord.org" -H "xos-password:letmein" -X POST --data-binary @${configFileName}-fabric.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 390 | """ |
| 391 | return out_fabric.toInteger() == 1 |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | stage('Configure SEBA - Subscriber') { |
| 396 | timeout(1) { |
| 397 | waitUntil { |
| 398 | out_subscriber = sh returnStdout: true, script: """ |
| 399 | curl -s -H 'xos-username:admin@opencord.org' -H 'xos-password:letmein' -X POST --data-binary @${configFileName}-subscriber.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 400 | """ |
| 401 | return out_subscriber.toInteger() == 1 |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | stage('Configure SEBA - OLT') { |
| 406 | timeout(1) { |
| 407 | waitUntil { |
| 408 | out_olt = sh returnStdout: true, script: """ |
| 409 | curl -H 'xos-username:admin@opencord.org' -H 'xos-password:letmein' -X POST --data-binary @${configFileName}-olt.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 410 | """ |
| 411 | return out_olt.toInteger() == 1 |
| 412 | } |
| 413 | } |
| 414 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 415 | } |
| 416 | } |
| 417 | currentBuild.result = 'SUCCESS' |
| 418 | } catch (err) { |
| 419 | currentBuild.result = 'FAILURE' |
| 420 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 421 | } |
| 422 | echo "RESULT: ${currentBuild.result}" |
| 423 | } |
| 424 | } |