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 |
Matteo Scandolo | 1298618 | 2019-02-04 13:58:19 -0800 | [diff] [blame^] | 198 | ngic_sriov=$(kubectl exec -n epc ngic-dp-0 ifconfig s1u-net | grep 'inet addr' | cut -d: -f2 | awk '{print $1}') |
| 199 | helm install -n mcord-control-plane --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-control-plane --set spgwu_s1u_ip=$ngic_sriov |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 200 | """ |
| 201 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 202 | } |
Andy Bavier | 77df9fb | 2019-02-02 10:49:04 -0700 | [diff] [blame] | 203 | |
| 204 | stage("Install M-CORD BBU Services") { |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 205 | sh returnStdout: true, script: """ |
| 206 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Andy Bavier | 77df9fb | 2019-02-02 10:49:04 -0700 | [diff] [blame] | 207 | 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] | 208 | """ |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 209 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 210 | |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 211 | stage('Install CORD Kafka') { |
| 212 | timeout(10) { |
| 213 | sh returnStdout: true, script: """ |
| 214 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 215 | 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 |
| 216 | """ |
| 217 | } |
| 218 | timeout(10) { |
| 219 | waitUntil { |
| 220 | kafka_instances_running = sh returnStdout: true, script: """ |
| 221 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 222 | kubectl get pods | grep cord-kafka | grep -i running | grep 1/1 | wc -l |
| 223 | """ |
| 224 | return kafka_instances_running.toInteger() == 2 |
| 225 | } |
| 226 | } |
| 227 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 228 | // stage('Install Logging Infrastructure') { |
| 229 | // timeout(10) { |
| 230 | // sh returnStdout: true, script: """ |
| 231 | // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 232 | // 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 |
| 233 | // helm-repo-tools/wait_for_pods.sh |
| 234 | // """ |
| 235 | // } |
| 236 | // } |
| 237 | // stage('Install Monitoring Infrastructure') { |
| 238 | // timeout(10) { |
| 239 | // sh returnStdout: true, script: """ |
| 240 | // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 241 | // helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n nem-monitoring cord/nem-monitoring |
| 242 | // helm-repo-tools/wait_for_pods.sh |
| 243 | // """ |
| 244 | // } |
| 245 | // } |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 246 | stage('Install ONOS') { |
| 247 | timeout(10) { |
| 248 | sh returnStdout: true, script: """ |
| 249 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 250 | 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] | 251 | """ |
| 252 | } |
| 253 | timeout(10) { |
| 254 | waitUntil { |
| 255 | onos_completed = sh returnStdout: true, script: """ |
| 256 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 257 | kubectl get pods | grep -i onos | grep -i running | grep 2/2 | wc -l |
| 258 | """ |
| 259 | return onos_completed.toInteger() == 1 |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | stage('Install xos-core') { |
| 264 | timeout(10) { |
| 265 | sh returnStdout: true, script: """ |
| 266 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 267 | 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] | 268 | """ |
| 269 | } |
| 270 | timeout(10) { |
| 271 | waitUntil { |
| 272 | xos_core_completed = sh returnStdout: true, script: """ |
| 273 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 274 | kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l |
| 275 | """ |
| 276 | return xos_core_completed.toInteger() == 6 |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | stage('Install M-CORD Profile') { |
| 281 | timeout(10) { |
| 282 | sh returnStdout: true, script: """ |
| 283 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 284 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n mcord cord/mcord |
| 285 | """ |
| 286 | } |
| 287 | timeout(10) { |
| 288 | waitUntil { |
| 289 | tosca_completed = sh returnStdout: true, script: """ |
| 290 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 291 | kubectl get pods | grep -i mcord-tosca-loader | grep -i completed | wc -l |
| 292 | """ |
| 293 | return tosca_completed.toInteger() == 1 |
| 294 | } |
| 295 | } |
| 296 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 297 | |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 298 | // SEBA Begin |
| 299 | stage('Install SEBA Profile') { |
| 300 | timeout(10) { |
| 301 | sh returnStdout: true, script: """ |
| 302 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 303 | 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] | 304 | """ |
| 305 | } |
| 306 | timeout(10) { |
| 307 | waitUntil { |
| 308 | tosca_completed = sh returnStdout: true, script: """ |
| 309 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 310 | kubectl get pods | grep -i seba-services-tosca-loader | grep -i completed | wc -l |
| 311 | """ |
| 312 | return tosca_completed.toInteger() == 1 |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | stage('Install base-kubernetes') { |
| 318 | timeout(10) { |
| 319 | sh returnStdout: true, script: """ |
| 320 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 321 | 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] | 322 | """ |
| 323 | } |
| 324 | timeout(10) { |
| 325 | waitUntil { |
| 326 | base_kubernetes_tosca_running = sh returnStdout: true, script: """ |
| 327 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 328 | kubectl get pods | grep -i base-kubernetes-tosca-loader | grep -i completed | wc -l |
| 329 | """ |
| 330 | return base_kubernetes_tosca_running.toInteger() == 1 |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | stage('Install att workflow') { |
| 336 | timeout(10) { |
| 337 | sh returnStdout: true, script: """ |
| 338 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 339 | 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 |
| 340 | """ |
| 341 | } |
| 342 | timeout(10) { |
| 343 | waitUntil { |
| 344 | att_workflow_tosca_completed = sh returnStdout: true, script: """ |
| 345 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 346 | kubectl get pods | grep -i att-workflow-tosca-loader | grep -i completed | wc -l |
| 347 | """ |
| 348 | return att_workflow_tosca_completed.toInteger() == 1 |
| 349 | } |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | stage('Install voltha') { |
| 354 | timeout(10) { |
| 355 | sh returnStdout: true, script: """ |
| 356 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 357 | 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] | 358 | """ |
| 359 | } |
| 360 | timeout(10) { |
| 361 | waitUntil { |
| 362 | voltha_completed = sh returnStdout: true, script: """ |
| 363 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 364 | kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l |
| 365 | """ |
| 366 | return voltha_completed.toInteger() == 8 |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | // SEBA end |
| 371 | |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 372 | if ( params.configurePod ) { |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 373 | dir ("${configBaseDir}/${configToscaDir}/mcord") { |
| 374 | stage('Configure MCORD - Fabric') { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 375 | timeout(1) { |
| 376 | waitUntil { |
| 377 | out_fabric = sh returnStdout: true, script: """ |
| 378 | 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 |
| 379 | """ |
| 380 | return out_fabric.toInteger() == 1 |
| 381 | } |
| 382 | } |
| 383 | } |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 384 | } |
| 385 | dir ("${configBaseDir}/${configToscaDir}/att-workflow") { |
| 386 | stage('Configure SEBA - Fabric and whitelist') { |
| 387 | timeout(1) { |
| 388 | waitUntil { |
| 389 | out_fabric = sh returnStdout: true, script: """ |
| 390 | 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 |
| 391 | """ |
| 392 | return out_fabric.toInteger() == 1 |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | stage('Configure SEBA - Subscriber') { |
| 397 | timeout(1) { |
| 398 | waitUntil { |
| 399 | out_subscriber = sh returnStdout: true, script: """ |
| 400 | 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 |
| 401 | """ |
| 402 | return out_subscriber.toInteger() == 1 |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | stage('Configure SEBA - OLT') { |
| 407 | timeout(1) { |
| 408 | waitUntil { |
| 409 | out_olt = sh returnStdout: true, script: """ |
| 410 | 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 |
| 411 | """ |
| 412 | return out_olt.toInteger() == 1 |
| 413 | } |
| 414 | } |
| 415 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 416 | } |
| 417 | } |
| 418 | currentBuild.result = 'SUCCESS' |
| 419 | } catch (err) { |
| 420 | currentBuild.result = 'FAILURE' |
| 421 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 422 | } |
| 423 | echo "RESULT: ${currentBuild.result}" |
| 424 | } |
| 425 | } |