From cadaadf81644e5cc7db50b0e8f10233c09506cc0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 29 Sep 2022 06:24:53 +0200 Subject: [PATCH 1/7] Use generic lockResources in all pipelines --- ci-scripts/Jenkinsfile-gitlab | 23 ++++++++++--------- ci-scripts/Jenkinsfile-physim-deploy | 9 +++++--- ci-scripts/Jenkinsfile-poll-gNB-UE | 13 +++++++---- ci-scripts/Jenkinsfile-push-registry | 11 +++++---- ci-scripts/Jenkinsfile-tmp-full-ran | 18 ++++++--------- ci-scripts/Jenkinsfile-tmp-multi-enb | 15 ++++++------ ci-scripts/Jenkinsfile-tmp-multi-enb-benetel | 16 ++++++------- .../Jenkinsfile-tmp-multi-enb-benetel-long | 16 ++++++------- ci-scripts/Jenkinsfile-tmp-multi-enb-nsa | 18 +++++---------- ci-scripts/Jenkinsfile-tmp-ran | 17 +++++++------- ci-scripts/Jenkinsfile-tmp-ue | 12 ++++++---- 11 files changed, 82 insertions(+), 86 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index a5912f4609..4518af6cae 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -33,8 +33,9 @@ def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) { // Location of the executor node def nodeExecutor = params.nodeExecutor -// VM Lockable resources -def vmResource = params.vmLockableResource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Tags to shorten pipeline duration def doMandatoryTests = false @@ -138,7 +139,7 @@ pipeline { stage ("Start VM -- gnb-usrp") { steps { - lock (vmResource) { + lock (extra: lockResources) { timeout (time: 5, unit: 'MINUTES') { sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } @@ -148,7 +149,7 @@ pipeline { stage ("Start VM -- nr-ue-usrp") { steps { - lock (vmResource) { + lock (extra: lockResources) { timeout (time: 5, unit: 'MINUTES') { sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } @@ -158,7 +159,7 @@ pipeline { stage ("Start VM -- enb-ethernet") { steps { - lock (vmResource) { + lock (extra: lockResources) { timeout (time: 7, unit: 'MINUTES') { sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } @@ -168,7 +169,7 @@ pipeline { stage ("Start VM -- ue-ethernet") { steps { - lock (vmResource) { + lock (extra: lockResources) { timeout (time: 7, unit: 'MINUTES') { sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } @@ -208,7 +209,7 @@ pipeline { stage ("Build UE-ethernet") { steps { // This is typically the last one to finish. - lock (vmResource) { + lock (extra: lockResources) { gitlabCommitStatus(name: "Build UE-ethernet") { timeout (time: 45, unit: 'MINUTES') { sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" @@ -269,7 +270,7 @@ pipeline { expression {doMandatoryTests} } steps { - lock (vmResource) { + lock (extra: lockResources) { script { timeout (time: 30, unit: 'MINUTES') { try { @@ -289,7 +290,7 @@ pipeline { expression {doMandatoryTests} } steps { - lock (vmResource) { + lock (extra: lockResources) { script { timeout (time: 40, unit: 'MINUTES') { try { @@ -309,7 +310,7 @@ pipeline { expression {doMandatoryTests} } steps { - lock (vmResource) { + lock (extra: lockResources) { script { timeout (time: 40, unit: 'MINUTES') { try { @@ -329,7 +330,7 @@ pipeline { expression {doMandatoryTests} } steps { - lock (vmResource) { + lock (extra: lockResources) { sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } diff --git a/ci-scripts/Jenkinsfile-physim-deploy b/ci-scripts/Jenkinsfile-physim-deploy index eac572e6cd..b57b842f6e 100644 --- a/ci-scripts/Jenkinsfile-physim-deploy +++ b/ci-scripts/Jenkinsfile-physim-deploy @@ -32,7 +32,9 @@ def buildStageStatus = true def testStageName = params.pipelineTestStageName // Name of the resource -def ciEpcResource = params.epcResource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Global Parameters. Normally they should be populated when the master job // triggers the slave job with parameters @@ -56,7 +58,7 @@ pipeline { disableConcurrentBuilds() timestamps() ansiColor('xterm') - lock(ciEpcResource) + lock(lockResources) } stages { @@ -80,7 +82,8 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.smartphonesResource == null) { + if (params.LockResources == null) { + echo "no LockResources given" allParametersPresent = false } if (params.eNB_IPAddress == null) { diff --git a/ci-scripts/Jenkinsfile-poll-gNB-UE b/ci-scripts/Jenkinsfile-poll-gNB-UE index 88dff2b102..b85f7e26ce 100644 --- a/ci-scripts/Jenkinsfile-poll-gNB-UE +++ b/ci-scripts/Jenkinsfile-poll-gNB-UE @@ -36,8 +36,10 @@ def testXMLFile = params.pythonTestXmlFile def mainPythonAllXmlFiles = "" def buildStageStatus = true -// Name of the phone resource -def ciUSRPsResource = params.USRPsResource +// Name of the resource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Terminate Status def termUE = 0 @@ -73,7 +75,7 @@ pipeline { disableConcurrentBuilds() gitLabConnection('OAI GitLab') ansiColor('xterm') - lock (ciUSRPsResource) + lock(extra: lockResources) } stages { @@ -135,8 +137,9 @@ pipeline { testStageName = params.pipelineTestStageName } - if (params.USRPsResource == null) { - allParametersPresent = false + if (params.LockResources == null) { + echo "no LockResources given" + allParametersPresent = false } if (params.eNB_IPAddress == null) { diff --git a/ci-scripts/Jenkinsfile-push-registry b/ci-scripts/Jenkinsfile-push-registry index feb1807c91..9442e9c78a 100644 --- a/ci-scripts/Jenkinsfile-push-registry +++ b/ci-scripts/Jenkinsfile-push-registry @@ -23,8 +23,10 @@ // Location of the python executor node shall be in the same subnet as the others servers def nodeExecutor = params.nodeExecutor -// Name of the phone resource -def ciServerResource = params.serverResource +// Name of the resource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Docker Hub account to push to def DH_Account = "oaisoftwarealliance" @@ -36,7 +38,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock (ciServerResource) + lock(extra: lockResources) } stages { stage ("Verify Parameters") { @@ -49,7 +51,8 @@ pipeline { if (params.nodeExecutor != null) { echo "Docker Push executor node : ${nodeExecutor}" } - if (params.serverResource == null) { + if (params.LockResources == null) { + echo "no LockResources given" allParametersPresent = false } } diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index c3323f792d..e4564d777e 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -33,11 +33,9 @@ def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName -// Name of the phone resource -def ciSmartPhoneResource = params.smartphonesResource - -// Name of the phone resource -def oaiUEResource = params.oaiUEResource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Terminate Status def termENB = 0 @@ -65,7 +63,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock(extra: [[resource: oaiUEResource]], resource: ciSmartPhoneResource) + lock(extra: lockResources) } stages { @@ -85,11 +83,9 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.smartphonesResource == null) { - allParametersPresent = false - } - if (params.oaiUEResource == null) { - allParametersPresent = false + if (params.LockResources == null) { + echo "no LockResources given" + allParametersPresent = false } if (params.eNB_IPAddress == null) { allParametersPresent = false diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb b/ci-scripts/Jenkinsfile-tmp-multi-enb index fb52316920..e0c756befb 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb @@ -33,11 +33,9 @@ def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName -// Name of the phone resource -def ciSmartPhoneResource = params.smartphonesResource - -// Name of the phone resource -def ciEpcResource = params.epcResource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Global Parameters. Normally they should be populated when the master job // triggers the slave job with parameters @@ -54,7 +52,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock(extra: [[resource: ciEpcResource]], resource: ciSmartPhoneResource) + lock(extra: lockResources) } stages { stage ("Verify Parameters") { @@ -73,8 +71,9 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.smartphonesResource == null) { - allParametersPresent = false + if (params.LockResources == null) { + echo "no LockResources given" + allParametersPresent = false } // 1st eNB parameters if (params.eNB_IPAddress == null) { diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel b/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel index 195456da11..2f56b0b691 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel @@ -33,9 +33,9 @@ def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName -// Name of the phone resource -def ciSmartPhonesResource1 = params.SmartPhonesResource1 -def ciSmartPhonesResource2 = params.SmartPhonesResource2 +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Global Parameters. Normally they should be populated when the master job // triggers the slave job with parameters @@ -52,7 +52,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock(extra: [[resource: ciSmartPhonesResource2]], resource: ciSmartPhonesResource1) + lock(extra: lockResources) } stages { stage("Build Init") { @@ -78,11 +78,9 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.SmartPhonesResource1 == null) { - allParametersPresent = false - } - if (params.SmartPhonesResource2 == null) { - allParametersPresent = false + if (params.LockResources == null) { + echo "no LockResources given" + allParametersPresent = false } // 1st eNB parameters if (params.eNB_IPAddress == null) { diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long b/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long index 3a002b3748..e1104ccf00 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long @@ -33,9 +33,9 @@ def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName -// Name of the phone resource -def ciSmartPhonesResource1 = params.SmartPhonesResource1 -def ciSmartPhonesResource2 = params.SmartPhonesResource2 +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Global Parameters. Populated when the master job // triggers the slave job with parameters @@ -53,7 +53,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock(extra: [[resource: ciSmartPhonesResource2]], resource: ciSmartPhonesResource1) + lock(extra: lockResources) } stages { stage("Build Init") { @@ -89,11 +89,9 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.SmartPhonesResource1 == null) { - allParametersPresent = false - } - if (params.SmartPhonesResource2 == null) { - allParametersPresent = false + if (params.LockResources == null) { + echo "no LockResources given" + allParametersPresent = false } // 1st eNB parameters if (params.eNB_IPAddress == null) { diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa index 6e987a5e38..1d977f00d3 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa @@ -34,10 +34,9 @@ def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName -// Name of the phone/server resource -def ciSmartPhonesResource1 = params.SmartPhonesResource1 -def ciSmartPhonesResource2 = params.SmartPhonesResource2 -def ciSmartPhonesResource3 = params.SmartPhonesResource3 +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Global Parameters. Normally they should be populated when the master job // triggers the slave job with parameters @@ -56,7 +55,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock(extra: [[resource: ciSmartPhonesResource2],[resource: ciSmartPhonesResource1]],resource: ciSmartPhonesResource3) + lock(extra: lockResources) } stages { stage("Build Init") { @@ -82,15 +81,10 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.SmartPhonesResource1 == null) { + if (params.LockResources == null) { + echo "no LockResources given" allParametersPresent = false } - if (params.SmartPhonesResource2 == null) { - allParametersPresent = false - } - if (params.SmartPhonesResource3 == null) { - allParametersPresent = false - } // 1st eNB parameters if (params.eNB_IPAddress == null) { allParametersPresent = false diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index a0d0f13871..271b9d042a 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -33,11 +33,9 @@ def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName -// Name of the phone resource -def ciSmartPhoneResource = params.smartphonesResource - -// Name of the phone resource -def ciEpcResource = params.epcResource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Terminate Status def termUE = 0 @@ -67,7 +65,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock(extra: [[resource: ciEpcResource]], resource: ciSmartPhoneResource) + lock(extra: lockResources) } // the following parameter options are commented out so it shows the ones // that you SHALL have to run the job. @@ -79,7 +77,7 @@ pipeline { string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run') string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage') booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact') - string(name: 'smartphonesResource', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource') + string(name: 'lockResources', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource') //eNB parameters string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB') @@ -115,8 +113,9 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.smartphonesResource == null) { - allParametersPresent = false + if (params.LockResources == null) { + echo "no LockResources given" + allParametersPresent = false } if (params.eNB_IPAddress == null) { allParametersPresent = false diff --git a/ci-scripts/Jenkinsfile-tmp-ue b/ci-scripts/Jenkinsfile-tmp-ue index e5e456cf7f..5a1e28d9f9 100644 --- a/ci-scripts/Jenkinsfile-tmp-ue +++ b/ci-scripts/Jenkinsfile-tmp-ue @@ -33,8 +33,9 @@ def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName -// Name of the phone resource -def ciSmartPhoneResource = params.smartphonesResource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} // Terminate Status def termUE = 0 @@ -64,7 +65,7 @@ pipeline { options { disableConcurrentBuilds() ansiColor('xterm') - lock (ciSmartPhoneResource) + lock(extra: lockResources) } stages { stage ("Verify Parameters") { @@ -83,8 +84,9 @@ pipeline { testStageName = 'Template Test Stage' } - if (params.smartphonesResource == null) { - allParametersPresent = false + if (params.LockResources == null) { + echo "no LockResources given" + allParametersPresent = false } if (params.UE_IPAddress == null) { allParametersPresent = false -- GitLab From 6975af96ea461e308f122ea8c3936d4d87d3d7f8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 29 Sep 2022 08:33:12 +0200 Subject: [PATCH 2/7] Rename test stage names for blue ocean, trigger 'timings' pipeline (copy of ue-mono) --- ci-scripts/Jenkinsfile-GitLab-Container | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index c8fb565488..3bc159cd98 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -117,10 +117,10 @@ pipeline { // Later we will add a Ubuntu20 build stage ("Image Building Processes") { parallel { - stage ("Ubuntu18 Build") { + stage ("Ubuntu18-Image-Builder") { steps { script { - triggerSlaveJob ('RAN-Ubuntu18-Image-Builder', 'Ubuntu18-Images-Build') + triggerSlaveJob ('RAN-Ubuntu18-Image-Builder', 'Ubuntu18-Image-Builder') } } post { @@ -155,10 +155,10 @@ pipeline { } } } - stage ("CppCheck Analysis") { + stage ("cppcheck") { steps { script { - triggerSlaveJob ('RAN-cppcheck', 'CppCheck Analysis') + triggerSlaveJob ('RAN-cppcheck', 'cppcheck') } } post { @@ -178,11 +178,11 @@ pipeline { } stage ("Image Test Processes") { parallel { - stage ("Physical Simulators") { + stage ("PhySim-Cluster") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-PhySim-Cluster', 'Test-Physim-Cluster') + triggerSlaveJob ('RAN-PhySim-Cluster', 'PhySim-Cluster') } } post { @@ -198,11 +198,11 @@ pipeline { } } } - stage ("4G RF Simulators") { + stage ("RF-Sim-Test-4G") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-RF-Sim-Test-4G', 'Test-RF-Sim-Container-4G') + triggerSlaveJob ('RAN-RF-Sim-Test-4G', 'RF-Sim-Test-4G') } } post { @@ -218,11 +218,11 @@ pipeline { } } } - stage ("5G RF Simulators") { + stage ("RF-Sim-Test-5G") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'Test-RF-Sim-Container-5G') + triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'RF-Sim-Test-5G') } } post { @@ -238,11 +238,11 @@ pipeline { } } } - stage ("4G L2 Simulators") { + stage ("L2-Sim-Test-4G") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-L2-Sim-Test-4G', 'Test-L2-Sim-Container-4G') + triggerSlaveJob ('RAN-L2-Sim-Test-4G', 'L2-Sim-Test-4G') } } post { @@ -258,11 +258,11 @@ pipeline { } } } - stage ("5G L2 Simulators") { + stage ("L2-Sim-Test-5G") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-L2-Sim-Test-5G', 'Test-L2-Sim-Container-5G') + triggerSlaveJob ('RAN-L2-Sim-Test-5G', 'L2-Sim-Test-5G') } } post { @@ -278,11 +278,11 @@ pipeline { } } } - stage ("NSA B200 Sanity Check") { + stage ("NSA-B200-Module-LTEBOX-Container") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-NSA-B200-Module-LTEBOX-Container', 'Test-NSA-B200') + triggerSlaveJob ('RAN-NSA-B200-Module-LTEBOX-Container', 'NSA-B200-Module-LTEBOX-Container') } } post { @@ -298,11 +298,11 @@ pipeline { } } } - stage ("SA B200 Sanity Check") { + stage ("NSA-B200-Module-SABOX-Container") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-SA-B200-Module-SABOX-Container', 'Test-SA-B200') + triggerSlaveJob ('RAN-SA-B200-Module-SABOX-Container', 'NSA-B200-Module-SABOX-Container') } } post { @@ -318,17 +318,17 @@ pipeline { } } } - stage ("Test OAI NR UE - OAI gNB - TDD - Band 78 - N300") { + stage ("gNB-N300-Timing-Phytest-LDPC") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-gNB-nrUE-MONO-TDD-Band78-N300', 'Test-TDD-Band78-gNB-NR-UE') + triggerSlaveJob ('RAN-gNB-N300-Timing-Phytest-LDPC', 'gNB-N300-Timing-Phytest-LDPC') } } post { always { script { - finalizeSlaveJob('RAN-gNB-nrUE-MONO-TDD-Band78-N300') + finalizeSlaveJob('RAN-gNB-N300-Timing-Phytest-LDPC') } } failure { @@ -339,11 +339,11 @@ pipeline { } } //avra is offline, re-enable once it is available - //stage ("Test T1 Offload") { + //stage ("T1-Offload-Test") { // when { expression {doMandatoryTests} } // steps { // script { - // triggerSlaveJob ('RAN-T1-Offload-Test', 'Test-T1-Offload') + // triggerSlaveJob ('RAN-T1-Offload-Test', 'T1-Offload-Test') // } // } // post { @@ -361,11 +361,11 @@ pipeline { //} } } - stage ("Images Push to Registries") { + stage ("DockerHub-Push") { when { expression {"PUSH".equals(env.gitlabActionType)} } steps { script { - triggerSlaveJob ('RAN-DockerHub-Push', 'Push-to-Docker-Hub') + triggerSlaveJob ('RAN-DockerHub-Push', 'DockerHub-Push') } } post { -- GitLab From ffe2202f3b07b26d3ff3c213acfef0833233fab5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 29 Sep 2022 08:40:12 +0200 Subject: [PATCH 3/7] Update TESTBench documentation --- doc/TESTBenches.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/doc/TESTBenches.md b/doc/TESTBenches.md index dd14817863..7bad43df65 100644 --- a/doc/TESTBenches.md +++ b/doc/TESTBenches.md @@ -18,10 +18,10 @@ | idefix | 172.21.16.135 | CI-NSA-MiniBench | Quectel | Quectel module | | amariue | 172.21.16.144 | CI-Amarisoft-UE-Usage | nrUE | Amarisoft UE simulator | | bellatrix | 192.168.117.115 | CI-RAN-VM-Deployment | Executor | -- | -| nano | 192.168.12.62 | CI-Bench-1-Phones | EPC, adb | 2x COTS (adb) | -| hutch | 192.168.12.19 | CI-Bench-1-Phones | eNB (B7) | B200mini (30C5239) | -| starsky | 192.168.12.18 | CI-Bench-1-Phones | eNB (B40) | b200mini (30A3E3C) | -| carabe | 192.168.12.211 | CI-Bench-2-OAI-Phone | UE (B7UE) | B200mini (30AE8C9) | +| nano | 172.21.18.48 | CI-Bench-1-Phones | EPC, adb | 2x COTS (adb) | +| hutch | 172.21.18.46 | CI-Bench-1-Phones | eNB (B7) | B200mini (30C5239) | +| starsky | 172.21.18.45 | CI-Bench-1-Phones | eNB (B40) | b200mini (30A3E3C) | +| carabe | 172.21.18.47 | CI-Bench-2-OAI-Phone | UE (B7UE) | B200mini (30AE8C9) | Note: The available resources, and their current usage, is indicated here: - [Lockable resources of jenkins-oai](https://jenkins-oai.eurecom.fr/lockable-resources/): @@ -97,7 +97,8 @@ Webhook - obelix + B200, nepes + B200, idefix + Quectel, porcepix w/ sabox - basic SA test (40 MHz TDD) - [RAN-PhySim-Cluster](https://jenkins-oai.eurecom.fr/job/RAN-PhySim-Cluster/) - - asterix (`Asterix-OC-oaicicd-session` resource), tests in OpenShift Cluster + - poseidon (jumphost, `Asterix-OC-oaicicd-session` resource), tests in + OpenShift Cluster - unitary simulators (`nr_dlsim`, etc.) - [RAN-RF-Sim-Test-4G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-4G/) - obelix (eNB, 1x UE, OAI EPC) @@ -106,8 +107,8 @@ Webhook - obelix (gNB, 2x UE, OAI 5GC) - uses RFsimulator, TDD 40MHz, FDD 40MHz, F1 split - [RAN-RHEL8-Cluster-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-RHEL8-Cluster-Image-Builder/) - - asterix (`Asterix-OC-oaicicd-session` resource): RHEL 8 image build using - the OpenShift in Eurecom + - poseidon (jumphost, `Asterix-OC-oaicicd-session` resource): RHEL 8 image + build using the OpenShift Cluster - [RAN-Ubuntu18-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/) - obelix: Ubuntu 18 image build using docker @@ -144,10 +145,6 @@ runs tests: - bellatrix: runs 4G/5G simulators directly (eNB + 1x UE + (opt.) OAI EPC, gNB + 1x UE in "noS1") triggers pipelines: -- [eNB-CI-F1-FDD-Band7-B210](https://open5glab.eurecom.fr:8083/jenkins/job/eNB-CI-F1-FDD-Band7-B210/) - - hutch + B210, nano w/ ltebox + 2x UE - - tests 4G FDD with F1 split, 5MHz, 10MHz, 20MHz. 5MHz stable, rest known to - be unstable - [eNB-CI-FDD-Band7-B210](https://open5glab.eurecom.fr:8083/jenkins/job/eNB-CI-FDD-Band7-B210/) - hutch + B210, nano w/ ltebox + 2x UE - tests T tracer, information through FlexRAN, RRC inactivity timers, -- GitLab From f7618a97b8d3b0737bcd02efbd829f7d36b6a062 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 29 Sep 2022 08:59:01 +0200 Subject: [PATCH 4/7] Introduce documentation step in RAN-Container-Parent, separate 4G and 5G --- ci-scripts/Jenkinsfile-GitLab-Container | 57 +++++++++++---------- ci-scripts/Jenkinsfile-gitlab | 2 +- ci-scripts/checkGitLabMergeRequestLabels.sh | 44 ++++++++++------ 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index 3bc159cd98..0786978388 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -24,8 +24,9 @@ def nodeExecutor = params.nodeExecutor // Tags to shorten pipeline duration -def doMandatoryTests = false -def doFullTestsuite = false +def doBuild = true +def do4Gtest = false +def do5Gtest = false // def gitCommitAuthorEmailAddr @@ -56,26 +57,30 @@ pipeline { LABEL_CHECK = sh returnStdout: true, script: 'ci-scripts/checkGitLabMergeRequestLabels.sh --mr-id ' + env.gitlabMergeRequestIid LABEL_CHECK = LABEL_CHECK.trim() if (LABEL_CHECK == 'NONE') { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Your merge request has none of the mandatory labels:\n\n" - message += " - BUILD-ONLY\n" - message += " - 4G-LTE\n" - message += " - 5G-NR\n" - message += " - CI\n\n" + def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Your merge request should have one of the mandatory labels:\n\n" + message += " - ~documentation (don't perform any stages)\n" + message += " - ~BUILD-ONLY (execute only build stages)\n" + message += " - ~4G-LTE (perform 4G tests)\n" + message += " - ~5G-NR (perform 5G tests)\n" + message += " - ~CI (perform both 4G and 5G tests)\n\n" message += "Not performing CI due to lack of labels" addGitLabMRComment comment: message error('Not performing CI due to lack of labels') } else if (LABEL_CHECK == 'FULL') { - doMandatoryTests = true - doFullTestsuite = true + do4Gtest = true + do5Gtest = true + } else if (LABEL_CHECK == "SHORTEN-4G") { + do4Gtest = true } else if (LABEL_CHECK == 'SHORTEN-5G') { - doMandatoryTests = true + do5Gtest = true + } else if (LABEL_CHECK == 'documentation') { + doBuild = false } else { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): We will perform only build stages on your Merge Request" - addGitLabMRComment comment: message + // is "BUILD-ONLY", will only build } } else { - doMandatoryTests = true - doFullTestsuite = true + do4Gtest = true + do5Gtest = true } } } @@ -116,6 +121,7 @@ pipeline { // Build Stages are Mandatory // Later we will add a Ubuntu20 build stage ("Image Building Processes") { + when { expression {doBuild} } parallel { stage ("Ubuntu18-Image-Builder") { steps { @@ -177,9 +183,10 @@ pipeline { } } stage ("Image Test Processes") { + when { expression {doBuild} } parallel { stage ("PhySim-Cluster") { - when { expression {doMandatoryTests} } + when { expression {do4Gtest || do5Gtest} } steps { script { triggerSlaveJob ('RAN-PhySim-Cluster', 'PhySim-Cluster') @@ -199,7 +206,7 @@ pipeline { } } stage ("RF-Sim-Test-4G") { - when { expression {doMandatoryTests} } + when { expression {do4Gtest} } steps { script { triggerSlaveJob ('RAN-RF-Sim-Test-4G', 'RF-Sim-Test-4G') @@ -219,7 +226,7 @@ pipeline { } } stage ("RF-Sim-Test-5G") { - when { expression {doMandatoryTests} } + when { expression {do5Gtest} } steps { script { triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'RF-Sim-Test-5G') @@ -239,7 +246,7 @@ pipeline { } } stage ("L2-Sim-Test-4G") { - when { expression {doMandatoryTests} } + when { expression {do4Gtest} } steps { script { triggerSlaveJob ('RAN-L2-Sim-Test-4G', 'L2-Sim-Test-4G') @@ -259,7 +266,7 @@ pipeline { } } stage ("L2-Sim-Test-5G") { - when { expression {doMandatoryTests} } + when { expression {do5Gtest} } steps { script { triggerSlaveJob ('RAN-L2-Sim-Test-5G', 'L2-Sim-Test-5G') @@ -279,7 +286,7 @@ pipeline { } } stage ("NSA-B200-Module-LTEBOX-Container") { - when { expression {doMandatoryTests} } + when { expression {do4Gtest || do5Gtest} } steps { script { triggerSlaveJob ('RAN-NSA-B200-Module-LTEBOX-Container', 'NSA-B200-Module-LTEBOX-Container') @@ -299,7 +306,7 @@ pipeline { } } stage ("NSA-B200-Module-SABOX-Container") { - when { expression {doMandatoryTests} } + when { expression {do5Gtest} } steps { script { triggerSlaveJob ('RAN-SA-B200-Module-SABOX-Container', 'NSA-B200-Module-SABOX-Container') @@ -319,7 +326,7 @@ pipeline { } } stage ("gNB-N300-Timing-Phytest-LDPC") { - when { expression {doMandatoryTests} } + when { expression {do5Gtest} } steps { script { triggerSlaveJob ('RAN-gNB-N300-Timing-Phytest-LDPC', 'gNB-N300-Timing-Phytest-LDPC') @@ -340,7 +347,7 @@ pipeline { } //avra is offline, re-enable once it is available //stage ("T1-Offload-Test") { - // when { expression {doMandatoryTests} } + // when { expression {do5Gtest} } // steps { // script { // triggerSlaveJob ('RAN-T1-Offload-Test', 'T1-Offload-Test') @@ -362,7 +369,7 @@ pipeline { } } stage ("DockerHub-Push") { - when { expression {"PUSH".equals(env.gitlabActionType)} } + when { expression {doBuild && "PUSH".equals(env.gitlabActionType)} } steps { script { triggerSlaveJob ('RAN-DockerHub-Push', 'DockerHub-Push') @@ -401,7 +408,6 @@ pipeline { script { def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")" if ("MERGE".equals(env.gitlabActionType)) { - echo "This is a MERGE event" addGitLabMRComment comment: message } echo "Pipeline is SUCCESSFUL" @@ -411,7 +417,6 @@ pipeline { script { def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")" if ("MERGE".equals(env.gitlabActionType)) { - echo "This is a MERGE event" addGitLabMRComment comment: message } echo "Pipeline FAILED" diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 4518af6cae..56dbc61e39 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -82,7 +82,7 @@ pipeline { message += "Not performing CI due to lack of labels" addGitLabMRComment comment: message error('Not performing CI due to lack of labels') - } else if (LABEL_CHECK == 'FULL') { + } else if (LABEL_CHECK == 'FULL' || LABEL_CHECK == 'SHORTEN-4G') { doMandatoryTests = true doFullTestsuite = true } else if (LABEL_CHECK == 'SHORTEN-5G') { diff --git a/ci-scripts/checkGitLabMergeRequestLabels.sh b/ci-scripts/checkGitLabMergeRequestLabels.sh index 7e4ea1c7de..d31c98706b 100755 --- a/ci-scripts/checkGitLabMergeRequestLabels.sh +++ b/ci-scripts/checkGitLabMergeRequestLabels.sh @@ -73,36 +73,50 @@ done LABELS=`curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/$MERGE_REQUEST_ID" | jq '.labels' || true` -IS_MR_BUILD_ONLY=`echo $LABELS | grep -c BUILD-ONLY || true` -IS_MR_CI=`echo $LABELS | grep -c CI || true` -IS_MR_4G=`echo $LABELS | grep -c 4G-LTE || true` -IS_MR_5G=`echo $LABELS | grep -c 5G-NR || true` +IS_MR_DOCUMENTATION=`echo $LABELS | grep -c Documentation` +IS_MR_BUILD_ONLY=`echo $LABELS | grep -c BUILD-ONLY` +IS_MR_CI=`echo $LABELS | grep -c CI` +IS_MR_4G=`echo $LABELS | grep -c 4G-LTE` +IS_MR_5G=`echo $LABELS | grep -c 5G-NR` -# First case: none is present! No CI -if [ $IS_MR_BUILD_ONLY -eq 0 ] && [ $IS_MR_CI -eq 0 ] && [ $IS_MR_4G -eq 0 ] && [ $IS_MR_5G -eq 0 ] +# none is present! No CI +if [ $IS_MR_BUILD_ONLY -eq 0 ] && [ $IS_MR_CI -eq 0 ] && [ $IS_MR_4G -eq 0 ] && [ $IS_MR_5G -eq 0 ] && [ $IS_MR_DOCUMENTATION -eq 0 ] then echo "NONE" exit 0 fi -# Second case: Build-Only -if [ $IS_MR_BUILD_ONLY -eq 1 ] +# 4G and 5G or CI labels: run everything (4G, 5G) +if [ $IS_MR_4G -eq 1 ] && [ $IS_MR_5G -eq 1 ] || [ $IS_MR_CI -eq 1 ] then - echo "BUILD-ONLY" + echo "FULL" exit 0 fi -# Third case: CI or 4G label --> Full CI run -if [ $IS_MR_4G -eq 1 ] || [ $IS_MR_CI -eq 1 ] +# 4G is present: run only 4G +if [ $IS_MR_4G -eq 1 ] then - echo "FULL" - exit 0 + echo "SHORTEN-4G" + exit 1 fi -# Fourth case: 5G label -if [ $IS_MR_BUILD_ONLY -eq 0 ] && [ $IS_MR_CI -eq 0 ] && [ $IS_MR_4G -eq 0 ] && [ $IS_MR_5G -eq 1 ] +# 5G is present: run only 5G +if [ $IS_MR_5G -eq 1 ] then echo "SHORTEN-5G" exit 0 fi +# BUILD-ONLY is present: only build stages +if [ $IS_MR_BUILD_ONLY -eq 1 ] +then + echo "BUILD-ONLY" + exit 0 +fi + +# Documentation is present: don't do anything +if [ $IS_MR_DOCUMENTATION -eq 1 ] +then + echo "documentation" + exit 1 +fi -- GitLab From 3c5ad7963512375d3ab61b918c1556e0f2eae140 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 4 Oct 2022 15:11:25 +0200 Subject: [PATCH 5/7] Check for correct label, case-insensitively --- ci-scripts/checkGitLabMergeRequestLabels.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/checkGitLabMergeRequestLabels.sh b/ci-scripts/checkGitLabMergeRequestLabels.sh index d31c98706b..41220ab770 100755 --- a/ci-scripts/checkGitLabMergeRequestLabels.sh +++ b/ci-scripts/checkGitLabMergeRequestLabels.sh @@ -73,7 +73,7 @@ done LABELS=`curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/$MERGE_REQUEST_ID" | jq '.labels' || true` -IS_MR_DOCUMENTATION=`echo $LABELS | grep -c Documentation` +IS_MR_DOCUMENTATION=`echo $LABELS | grep -ic documentation` IS_MR_BUILD_ONLY=`echo $LABELS | grep -c BUILD-ONLY` IS_MR_CI=`echo $LABELS | grep -c CI` IS_MR_4G=`echo $LABELS | grep -c 4G-LTE` -- GitLab From d044813f022c675933e6c3cdf74adb520b614304 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 4 Oct 2022 15:12:37 +0200 Subject: [PATCH 6/7] Delete old, unused Jenkinsfiles --- ci-scripts/Jenkinsfile-inria-r2lab | 457 ------------------ ci-scripts/Jenkinsfile-poll-gNB-UE | 379 --------------- ci-scripts/Jenkinsfile-tmp-multi-enb-benetel | 291 ----------- .../Jenkinsfile-tmp-multi-enb-benetel-long | 302 ------------ 4 files changed, 1429 deletions(-) delete mode 100644 ci-scripts/Jenkinsfile-inria-r2lab delete mode 100644 ci-scripts/Jenkinsfile-poll-gNB-UE delete mode 100644 ci-scripts/Jenkinsfile-tmp-multi-enb-benetel delete mode 100644 ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long diff --git a/ci-scripts/Jenkinsfile-inria-r2lab b/ci-scripts/Jenkinsfile-inria-r2lab deleted file mode 100644 index ada52277f4..0000000000 --- a/ci-scripts/Jenkinsfile-inria-r2lab +++ /dev/null @@ -1,457 +0,0 @@ -#!/bin/groovy -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -// Abstraction function to send social media messages: -// like on Slack or Mattermost -def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) { - if (params.pipelineUsesSlack != null) { - if (params.pipelineUsesSlack) { - slackSend channel: pipeChannel, color: pipeColor, message: pipeMessage - } - } -} - -// Location of the test XML file to be run -def testXMLFile = params.pythonTestXmlFile -def mainPythonAllXmlFiles = "" -def buildStageStatus = true - -// Name of the test stage -def testStageName = params.pipelineTestStageName - -// Name of the branch to work on -def ranRepoBranch = params.pythonWorkingBranch - -// Lease booking parameters -def r2labStartTime = params.R2LAB_LeaseBookStartTime -def r2labDuration = params.R2LAB_LeaseBookDuration - - -// Fixed deployment -def r2labBaseIpAddr = '192.168.3.' -def r2labPythonExeIdx = '14' -def r2labPythonExe = 'fit' + r2labPythonExeIdx -def r2labENB0Idx = '23' -def r2labENB0 = 'fit' + r2labENB0Idx -def r2labENB0IpAddr = r2labBaseIpAddr + r2labENB0Idx -def r2labEPC0Idx = '17' -def r2labEPC0 = 'fit' + r2labEPC0Idx -def r2labEPC0IpAddr = r2labBaseIpAddr + r2labEPC0Idx -def r2labUE0Idx = '6' -def r2labUE0 = 'fit0' + r2labUE0Idx -def r2labUE0IpAddr = r2labBaseIpAddr + r2labUE0Idx -def r2labENB1Idx = '16' -def r2labENB1 = 'fit' + r2labENB1Idx -def r2labENB1IpAddr = r2labBaseIpAddr + r2labENB1Idx -def r2labDoAllOff = true - -pipeline { - agent { - label 'master' - } - - options { - disableConcurrentBuilds() - timestamps() - ansiColor('xterm') - } - - stages { - stage ("Book session") { - steps { - script { - echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' - - def allParametersPresent = true - if (params.R2LAB_Credentials == null) { - allParametersPresent = false - } - if (params.R2LAB_FitNode_Credentials == null) { - allParametersPresent = false - } - if (params.R2LAB_LeaseBookStartTime == null) { - allParametersPresent = false - } - if (params.R2LAB_LeaseBookDuration == null) { - allParametersPresent = false - } - - // If not present picking a default Stage Name - if (params.pipelineTestStageName == null) { - // picking default - testStageName = 'Tests at Inria R2LAB' - } - // If not present picking a default branch name - if (params.pythonWorkingBranch == null) { - ranRepoBranch = 'develop' - } - - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/inria/enb_usrp210_band7_build.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - - if (!allParametersPresent) { - currentBuild.result = 'ABORTED' - error('Stopping early because no R2LAB credentials') - } - - JOB_TIMESTAMP = sh returnStdout: true, script: 'date --rfc-3339=seconds | sed -e "s#+00:00##"' - JOB_TIMESTAMP = JOB_TIMESTAMP.trim() - - echo '\u2705 \u001B[32mBook a Session\u001B[0m' - - BOOK_TIMESTAMP = sh returnStdout: true, script: 'date --rfc-3339=date' - BOOK_TIMESTAMP = BOOK_TIMESTAMP.trim() - - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_Credentials}", usernameVariable: 'r2labuser', passwordVariable: 'r2labpassword'] - ]) { - sh "python3 /home/eurecom/inria-scripts/booking-lease.py --book-lease --from ${BOOK_TIMESTAMP}T${r2labStartTime} --duration ${r2labDuration} --slice inria_oaici ${r2labuser} ${r2labpassword}" - sh "python3 /home/eurecom/inria-scripts/booking-lease.py --get-leases ${r2labuser} ${r2labpassword} | grep -v nightly" - } - - // Adding a tempo after booking leases - sh "sleep 10" - LEASE_STATUS = sh returnStdout: true, script: "ssh -t inria_oaici@faraday.inria.fr 'rleases --check'" - LEASE_STATUS = LEASE_STATUS.trim() - if (LEASE_STATUS ==~ /.*Access currently denied to inria_oaici.*/) { - r2labDoAllOff = false - currentBuild.result = 'ABORTED' - error('Stopping early because R2LAB not available') - } - } - } - } - stage ("Load Images") { - steps { - script { - sh "ssh -t inria_oaici@faraday.inria.fr 'all-off'" - sh "sleep 10" - - echo '\u2705 \u001B[32mLoad Image for Python Executor\u001B[0m' - try { - sh "ssh -t inria_oaici@faraday.inria.fr 'rload -i oai-ci-cd-u18-lowlatency-enb-ue ${r2labPythonExeIdx} > /dev/null 2>&1'" - } catch (Exception e) { - echo "Why is it wrong?" - } - try { - //sh "ssh -t inria_oaici@faraday.inria.fr 'rwait --silent ${r2labPythonExeIdx}'" - sh "ssh -t inria_oaici@faraday.inria.fr 'rwait ${r2labPythonExeIdx}'" - } catch (Exception e) { - echo "Why is it wrong?" - } - - echo '\u2705 \u001B[32mLoad Image for two (2) eNBs\u001B[0m' - try { - sh "ssh -t inria_oaici@faraday.inria.fr 'rload -i oai-ci-cd-u18-lowlatency-enb-ue ${r2labENB0Idx},${r2labENB1Idx} > /dev/null 2>&1'" - } catch (Exception e) { - echo "Why is it wrong?" - } - try { - sh "ssh -t inria_oaici@faraday.inria.fr 'rwait --silent ${r2labENB0Idx},${r2labENB1Idx}'" - } catch (Exception e) { - echo "Why is it wrong?" - } - sh "ssh -t inria_oaici@faraday.inria.fr 'uon ${r2labENB0Idx},${r2labENB1Idx}'" - sh "sleep 5" - sh "ssh -t inria_oaici@faraday.inria.fr 'uon ${r2labENB0Idx},${r2labENB1Idx}'" - - echo '\u2705 \u001B[32mLoad Image for one OAI UE\u001B[0m' - sh "ssh -t inria_oaici@faraday.inria.fr 'rload -i oai-ci-cd-u18-lowlatency-enb-ue ${r2labUE0Idx} > /dev/null 2>&1'" - sh "ssh -t inria_oaici@faraday.inria.fr 'rwait --silent ${r2labUE0Idx}'" - sh "ssh -t inria_oaici@faraday.inria.fr 'uon ${r2labUE0Idx}'" - sh "sleep 5" - sh "ssh -t inria_oaici@faraday.inria.fr 'uon ${r2labUE0Idx}'" - - echo '\u2705 \u001B[32mLoad Image for one EPC\u001B[0m' - sh "ssh -t inria_oaici@faraday.inria.fr 'rload -i oai-ci-cd-u18-lowlatency-epc ${r2labEPC0Idx} > /dev/null 2>&1'" - sh "ssh -t inria_oaici@faraday.inria.fr 'rwait --silent ${r2labEPC0Idx}'" - - sh "ssh -t inria_oaici@faraday.inria.fr 'nodes ${r2labUE0Idx},${r2labPythonExeIdx},${r2labEPC0Idx},${r2labENB0Idx},${r2labENB1Idx} && st'" - } - } - } - stage ("Prepare Python Executor") { - steps { - script { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g && git fetch --all --prune --quiet\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g && git checkout --quiet ${ranRepoBranch}\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g && git pull --quiet origin ${ranRepoBranch}\"'" - GIT_COMMIT_TO_RUN = sh returnStdout: true, script: "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g && git log -n1 --pretty=format:%H\"' | grep -v fit" - GIT_COMMIT_TO_RUN = GIT_COMMIT_TO_RUN.trim() - echo "Latest commit to use is ${GIT_COMMIT_TO_RUN}" - - // Putting the adaptation parameters for the OAI UE - sh "ssh -t inria_oaici@faraday.inria.fr 'scp /home/inria_oaici/for-ci/adapt_usim_parameters_${r2labUE0}.sed ${fituser}@${r2labUE0}:/tmp/adapt_usim_parameters.sed'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp /home/inria_oaici/for-ci/phones_list.txt ${fituser}@${r2labEPC0}:/tmp'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S cp /tmp/phones_list.txt /etc/ci\"'" - - // Out of rload, the sub-network-interfaces are not up - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ifconfig control:m11 172.16.1.102 up\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ifconfig control:m10 192.168.10.110 up\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ifconfig control:sxu 172.55.55.102 up\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ifconfig control:sxc 172.55.55.101 up\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ifconfig control:s5c 172.58.58.102 up\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ifconfig control:p5c 172.58.58.101 up\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ifconfig control:s11 172.16.1.104 up\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"ifconfig\"'" - - // Adding routes on the EPC - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ip route add default via 192.168.3.100 dev control table lte\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ip rule add from 12.0.0.0/8 table lte\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labEPC0} \"echo ${fitpasswd} | sudo -S ip rule add from 12.1.1.0/8 table lte\"'" - - // For the moment, simple way to route traffic from python executor to any UEs - sh "ssh -t inria_oaici@faraday.inria.fr 'ssh -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"echo ${fitpasswd} | sudo -S ip route add 12.1.1.0/24 via ${r2labEPC0IpAddr} dev control\"'" - } - } - } - } - stage ("Build and Test") { - steps { - script { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=InitiateHtml --ranRepository=https://gitlab.eurecom.fr/oai/openairinterface5g --ranBranch=${ranRepoBranch} --ranCommitID=${GIT_COMMIT_TO_RUN} --ranAllowMerge=false --ADBIPAddress=${r2labEPC0IpAddr} --ADBUserName=${fituser} --ADBPassword=${fitpasswd} --ADBType=distributed ${mainPythonAllXmlFiles}\"'" - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - try { - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=TesteNB --ranRepository=https://gitlab.eurecom.fr/oai/openairinterface5g --ranBranch=${ranRepoBranch} --ranCommitID=${GIT_COMMIT_TO_RUN} --ranAllowMerge=false --eNBIPAddress=${r2labENB0IpAddr} --eNBUserName=${fituser} --eNBPassword=${fitpasswd} --eNBSourceCodePath=/home/${fituser}/openairinterface5g --eNB1IPAddress=${r2labENB1IpAddr} --eNB1UserName=${fituser} --eNB1Password=${fitpasswd} --eNB1SourceCodePath=/home/${fituser}/openairinterface5g --UEIPAddress=${r2labUE0IpAddr} --UEUserName=${fituser} --UEPassword=${fitpasswd} --UESourceCodePath=/home/${fituser}/openairinterface5g --EPCIPAddress=${r2labEPC0IpAddr} --EPCType=OAI-Rel14-CUPS --EPCUserName=${fituser} --EPCPassword=${fitpasswd} --EPCSourceCodePath=/home/${fituser}/openair-cn --ADBIPAddress=${r2labEPC0IpAddr} --ADBUserName=${fituser} --ADBPassword=${fitpasswd} --ADBType=distributed --XMLTestFile=${xmlFile}\"'" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - buildStageStatus = false - } - } - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${r2labENB0IpAddr} --eNBUserName=${fituser} --eNBPassword=${fitpasswd}\"'" - } - } - } - } - stage ("Prepare Log Collection") { - steps { - sh "ssh -t inria_oaici@faraday.inria.fr 'mkdir -p /home/inria_oaici/archives'" - sh "ssh -t inria_oaici@faraday.inria.fr 'touch /home/inria_oaici/archives/no_error.txt'" - sh "ssh -t inria_oaici@faraday.inria.fr 'rm -f /home/inria_oaici/archives/*.*'" - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labPythonExe}:/home/${fituser}/openairinterface5g/ci-scripts/test_results.html /home/inria_oaici/archives'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/test_results.html ." - script { - if(fileExists("./test_results.html")) { - sh "mv ./test_results.html test_results-${JOB_NAME}.html" - sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-${JOB_NAME}.html" - archiveArtifacts "test_results-${JOB_NAME}.html" - } - } - } - } - stage ("Log Collection") { - parallel { - stage('Log Collection (OAI eNB - Build)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (OAI eNB - Build)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectBuild --eNBIPAddress=${r2labENB0IpAddr} --eNBUserName=${fituser} --eNBPassword=${fitpasswd} --eNBSourceCodePath=/home/${fituser}/openairinterface5g\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labENB0}:/home/${fituser}/openairinterface5g/cmake_targets/build.log.zip /home/inria_oaici/archives/enb.build.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/enb.build.log.zip enb.build.log.${env.BUILD_ID}.zip" - script { - if(fileExists("enb.build.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "enb.build.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (OAI UE - Build)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (OAI UE - Build)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectBuild --UEIPAddress=${r2labUE0IpAddr} --UEUserName=${fituser} --UEPassword=${fitpasswd} --UESourceCodePath=/home/${fituser}/openairinterface5g\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labUE0}:/home/${fituser}/openairinterface5g/cmake_targets/build.log.zip /home/inria_oaici/archives/ue.build.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/ue.build.log.zip ue.build.log.${env.BUILD_ID}.zip" - script { - if(fileExists("ue.build.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "ue.build.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (OAI eNB - Runs)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (OAI eNB - Runs)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollecteNB --eNBIPAddress=${r2labENB0IpAddr} --eNBUserName=${fituser} --eNBPassword=${fitpasswd} --eNBSourceCodePath=/home/${fituser}/openairinterface5g\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labENB0}:/home/${fituser}/openairinterface5g/cmake_targets/enb.log.zip /home/inria_oaici/archives/enb.run.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/enb.run.log.zip enb.run.log.${env.BUILD_ID}.zip" - script { - if(fileExists("enb.run.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "enb.run.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (OAI UE - Runs)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (OAI UE - Runs)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectOAIUE --UEIPAddress=${r2labUE0IpAddr} --UEUserName=${fituser} --UEPassword=${fitpasswd} --UESourceCodePath=/home/${fituser}/openairinterface5g\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labUE0}:/home/${fituser}/openairinterface5g/cmake_targets/ue.log.zip /home/inria_oaici/archives/ue.run.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/ue.run.log.zip ue.run.log.${env.BUILD_ID}.zip" - script { - if(fileExists("ue.run.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "ue.run.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (MME)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (MME)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectMME --EPCIPAddress=${r2labEPC0IpAddr} --EPCUserName=${fituser} --EPCPassword=${fitpasswd} --EPCSourceCodePath=/home/${fituser}/openair-cn --EPCType=OAI-Rel14-CUPS\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labEPC0}:/home/${fituser}/openair-cn/scripts/mme.log.zip /home/inria_oaici/archives/mme.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/mme.log.zip mme.log.${env.BUILD_ID}.zip" - script { - if(fileExists("mme.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "mme.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (HSS)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (HSS)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectHSS --EPCIPAddress=${r2labEPC0IpAddr} --EPCUserName=${fituser} --EPCPassword=${fitpasswd} --EPCSourceCodePath=/home/${fituser}/openair-cn --EPCType=OAI-Rel14-CUPS\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labEPC0}:/home/${fituser}/openair-cn/scripts/hss.log.zip /home/inria_oaici/archives/hss.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/hss.log.zip hss.log.${env.BUILD_ID}.zip" - script { - if(fileExists("hss.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "hss.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (SPGW)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (SPGW)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectSPGW --EPCIPAddress=${r2labEPC0IpAddr} --EPCUserName=${fituser} --EPCPassword=${fitpasswd} --EPCSourceCodePath=/home/${fituser}/openair-cn --EPCType=OAI-Rel14-CUPS\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labEPC0}:/home/${fituser}/openair-cn/scripts/spgw.log.zip /home/inria_oaici/archives/spgw.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/spgw.log.zip spgw.log.${env.BUILD_ID}.zip" - script { - if(fileExists("spgw.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "spgw.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (Ping)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Ping)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectPing --EPCIPAddress=${r2labEPC0IpAddr} --EPCUserName=${fituser} --EPCPassword=${fitpasswd} --EPCSourceCodePath=/home/${fituser}/openair-cn --EPCType=OAI-Rel14-CUPS\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labEPC0}:/home/${fituser}/openair-cn/scripts/ping.log.zip /home/inria_oaici/archives/ping.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/ping.log.zip ping.log.${env.BUILD_ID}.zip" - script { - if(fileExists("ping.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "ping.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (Iperf)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.R2LAB_FitNode_Credentials}", usernameVariable: 'fituser', passwordVariable: 'fitpasswd'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Iperf)\u001B[0m' - sh "ssh -t -t inria_oaici@faraday.inria.fr 'ssh -t -t -b 192.168.3.100 ${fituser}@${r2labPythonExe} \"cd openairinterface5g/ci-scripts && python3 main.py --mode=LogCollectIperf --EPCIPAddress=${r2labEPC0IpAddr} --EPCUserName=${fituser} --EPCPassword=${fitpasswd} --EPCSourceCodePath=/home/${fituser}/openair-cn --EPCType=OAI-Rel14-CUPS\"'" - sh "ssh -t inria_oaici@faraday.inria.fr 'scp ${fituser}@${r2labEPC0}:/home/${fituser}/openair-cn/scripts/iperf.log.zip /home/inria_oaici/archives/iperf.log.zip'" - } - sh "scp inria_oaici@faraday.inria.fr:/home/inria_oaici/archives/iperf.log.zip iperf.log.${env.BUILD_ID}.zip" - script { - if(fileExists("iperf.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "iperf.log.${env.BUILD_ID}.zip" - } - } - } - } - } - } - stage ("Clean-up Log Collection") { - steps { - sh "ssh -t inria_oaici@faraday.inria.fr 'rm -Rf /home/inria_oaici/archives'" - } - } - } - - post { - always { - script { - if (r2labDoAllOff) { - echo '\u2705 \u001B[32mShutdown every node\u001B[0m' - sh 'ssh -t inria_oaici@faraday.inria.fr "all-off"' - sh 'ssh -t inria_oaici@faraday.inria.fr "all-off"' - } - } - } - } -} diff --git a/ci-scripts/Jenkinsfile-poll-gNB-UE b/ci-scripts/Jenkinsfile-poll-gNB-UE deleted file mode 100644 index b85f7e26ce..0000000000 --- a/ci-scripts/Jenkinsfile-poll-gNB-UE +++ /dev/null @@ -1,379 +0,0 @@ -#!/bin/groovy -/* -* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The OpenAirInterface Software Alliance licenses this file to You under -* the OAI Public License, Version 1.1 (the "License"); you may not use this file -* except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.openairinterface.org/?page_id=698 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*------------------------------------------------------------------------------- -* For more information about the OpenAirInterface (OAI) Software Alliance: -* contact@openairinterface.org -*/ - - -// Abstraction function to send social media messages: -// like on Slack or Mattermost -def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) { - if (params.pipelineUsesSlack != null) { - if (params.pipelineUsesSlack) { - slackSend channel: pipeChannel, color: pipeColor, message: pipeMessage - } - } -} - -// Location of the test XML file to be run -def testXMLFile = params.pythonTestXmlFile -def mainPythonAllXmlFiles = "" -def buildStageStatus = true - -// Name of the resource -def lockResources = [] -if (params.LockResources != null && params.LockResources.trim().length() > 0) - params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} - -// Terminate Status -def termUE = 0 -def termENB = 1 -def termStatusArray = new Boolean[2] -termStatusArray[termUE] = false -termStatusArray[termENB] = false - -// Global Parameters. -def eNB_Repository -def eNB_Branch -def eNB_CommitID -def eNB_AllowMergeRequestProcess = false -def eNB_TargetBranch = "develop-nr" -def GIT_COMMIT_AUTHOR -def GIT_COMMIT_EMAIL -def testStageName -// Global Parameters not to break the main.py command line and code. -def ADB_IPAddress = "none" -def ADB_Username = "none" -def ADB_Password = "none" -def EPC_IPAddress = "none" -def EPC_Username = "none" -def EPC_Password = "none" - - - -pipeline { - agent { - label pythonExecutor - } - options { - disableConcurrentBuilds() - gitLabConnection('OAI GitLab') - ansiColor('xterm') - lock(extra: lockResources) - } - - stages { - stage ('Retrieve latest from branch') { - steps { - script { - checkout([$class: 'GitSCM', branches: [[name: "${params.Branch}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://gitlab.eurecom.fr/oai/openairinterface5g.git']]]) - sh "git clean -x -d -ff" - sh "git log -n1" - } - } - } - stage ("print latest commit info") { - steps { - script { - echo "Building on: " - echo " Repository -- ${GIT_URL}" - echo " Branch -- ${GIT_BRANCH}" - echo " Commit -- ${GIT_COMMIT}" - } - } - } - stage ("Verify Parameters") { - steps { - script { - JOB_TIMESTAMP = sh returnStdout: true, script: 'date --utc --rfc-3339=seconds | sed -e "s#+00:00##"' - JOB_TIMESTAMP = JOB_TIMESTAMP.trim() - - echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' - def allParametersPresent = true - - // It is already too late to check it - if (params.pythonExecutor != null) { - echo "eNB CI executor node : ${pythonExecutor}" - } - if (params.eNB_Repository == null) { - eNB_Repository = GIT_URL - } else { - eNB_Repository = params.eNB_Repository - } - echo "eNB_Repository = ${eNB_Repository}" - if (params.eNB_Branch== null) { - eNB_Branch = GIT_BRANCH - } else { - eNB_Branch = params.eNB_Branch - } - echo "eNB_Branch = ${eNB_Branch}" - if (params.eNB_CommitID == null) { - eNB_CommitID = GIT_COMMIT - } else { - eNB_CommitID = params.eNB_CommitID - } - echo "eNB_CommitID = ${eNB_CommitID}" - // If not present picking a default Stage Name - if (params.pipelineTestStageName == null) { - // picking default - testStageName = 'Template Test Stage' - } else { - testStageName = params.pipelineTestStageName - } - - if (params.LockResources == null) { - echo "no LockResources given" - allParametersPresent = false - } - - if (params.eNB_IPAddress == null) { - allParametersPresent = false - } - if (params.UE_IPAddress == null) { - allParametersPresent = false - } - if (params.eNB_SourceCodePath == null) { - allParametersPresent = false - } - if (params.eNB_Credentials == null) { - allParametersPresent = false - } - if (params.UE_Credentials == null) { - allParametersPresent = false - } - GIT_COMMIT_AUTHOR = sh ( - script: 'git show -s --pretty=%an', - returnStdout: true - ).trim() - echo "The author of the commit is: ${GIT_COMMIT_AUTHOR}" - GIT_COMMIT_EMAIL = sh ( - script: 'git show -s --pretty=%ae', - returnStdout: true - ).trim() - echo "The email of the author is: ${GIT_COMMIT_EMAIL}" - if (allParametersPresent) { - echo "All parameters are present" - } else { - echo "Some parameters are missing" - sh "./ci-scripts/fail.sh" - } - } - } - } - - stage ("Build and Test") { - steps { - script { - dir ('ci-scripts') { - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/gnb_usrp_build.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists(xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'] - ]) { - sh "python3 main.py --mode=InitiateHtml --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} ${mainPythonAllXmlFiles}" - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists(xmlFile)) { - try { - sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --UEIPAddress=${params.eNB_IPAddress} --UEUserName=${eNB_Username} --UEPassword=${eNB_Password} --UESourceCodePath=${params.eNB_SourceCodePath} --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --EPCIPAddress=${EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=/tmp/${EPC_Username} --EPCType=ltebox --XMLTestFile=${xmlFile}" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - buildStageStatus = false - } - } - } - sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}" - } - } - } - } - } - - stage ("Terminate") { - parallel { - stage('Terminate NR UE') { - steps { - echo '\u2705 \u001B[32mTerminate NR UE\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateOAIUE --UEIPAddress=${params.eNB_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password}" - } - } - post { - success { - script { - termStatusArray[termUE] = true - } - } - } - } - stage('Terminate NR eNB') { - steps { - echo '\u2705 \u001B[32mTerminate NR eNB\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateeNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}" - } - } - post { - success { - script { - termStatusArray[termENB] = true - } - } - } - } - } - } - - stage('Log Collection') { - parallel { - stage('Log Collection (gNB and NR UE - Build)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (gNB and NR UE - Build)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectBuild --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" - - echo '\u2705 \u001B[32mLog Transfer (gNB and NR UE - Build)\u001B[0m' - sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("build.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "build.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (gNB - Run)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (gNB - Run)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollecteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" - - echo '\u2705 \u001B[32mLog Transfer (gNB - Run)\u001B[0m' - sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/enb.log.zip ./enb.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("enb.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "enb.log.${env.BUILD_ID}.zip" - } - if(fileExists("ci-scripts/test_results.html")) { - sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html" - sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" - archiveArtifacts "test_results-${JOB_NAME}.html" - } - } - } - } - stage('Log Collection (NR UE - Run)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (gNB - Run)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectOAIUE --UEIPAddress=${params.eNB_IPAddress} --UEUserName=${eNB_Username} --UEPassword=${eNB_Password} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --UESourceCodePath=${params.eNB_SourceCodePath}" - - echo '\u2705 \u001B[32mLog Transfer (gNB - Run)\u001B[0m' - sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/ue.log.zip ./ue.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("ue.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "ue.log.${env.BUILD_ID}.zip" - } - } - } - } - } - } - } - - post { - always { - script { - if ("MERGE".equals(env.gitlabActionType)) { - echo "This is a MERGE event" - } else { - gitlabCommitStatus(name: "Test-gNB-nrUE") { - if ((currentBuild.result == null) || (currentBuild.result == 'SUCCESS')) { - echo "Setting the gitlab commit status to pass" - } else { - sh "./ci-scripts/fail.sh" - } - } - } - emailext attachmentsPattern: '*results*.html', - body: '''Hi, -Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS! - -Regards, -OAI CI Team''', - replyTo: 'no-reply@openairinterface.org', - subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', - to: GIT_COMMIT_EMAIL - } - } - success { - script { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")" - if ("MERGE".equals(env.gitlabActionType)) { - echo "This is a MERGE event" - //addGitLabMRComment comment: message - def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")" - sendSocialMediaMessage('ci-test', 'good', message2) - } else { - sendSocialMediaMessage('ci-test', 'good', message) - } - } - } - failure { - script { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")" - if ("MERGE".equals(env.gitlabActionType)) { - echo "This is a MERGE event" - //addGitLabMRComment comment: message - def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")" - sendSocialMediaMessage('ci-test', 'danger', message2) - } else { - sendSocialMediaMessage('ci-test', 'danger', message) - } - } - } - } -} - diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel b/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel deleted file mode 100644 index 2f56b0b691..0000000000 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel +++ /dev/null @@ -1,291 +0,0 @@ -#!/bin/groovy -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -// Template Jenkins Declarative Pipeline script to run Test w/ RF HW - -// Location of the python executor node shall be in the same subnet as the others servers -def pythonExecutor = params.pythonExecutor - -// Location of the test XML file to be run -def testXMLFile = params.pythonTestXmlFile -def mainPythonAllXmlFiles = "" -def buildStageStatus = true - -// Name of the test stage -def testStageName = params.pipelineTestStageName - -def lockResources = [] -if (params.LockResources != null && params.LockResources.trim().length() > 0) - params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} - -// Global Parameters. Normally they should be populated when the master job -// triggers the slave job with parameters -def eNB_Repository -def eNB_Branch -def eNB_CommitID -def eNB_AllowMergeRequestProcess -def eNB_TargetBranch - -pipeline { - agent { - label pythonExecutor - } - options { - disableConcurrentBuilds() - ansiColor('xterm') - lock(extra: lockResources) - } - stages { - stage("Build Init") { - steps { - // update the build name and description - buildName "${params.eNB_MR}" - buildDescription "Branch : ${params.eNB_Branch}" - } - } - stage ("Verify Parameters") { - steps { - script { - echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' - def allParametersPresent = true - - // It is already to late to check it - if (params.pythonExecutor != null) { - echo "eNB CI executor node : ${pythonExecutor}" - } - // If not present picking a default Stage Name - if (params.pipelineTestStageName == null) { - // picking default - testStageName = 'Template Test Stage' - } - - if (params.LockResources == null) { - echo "no LockResources given" - allParametersPresent = false - } - // 1st eNB parameters - if (params.eNB_IPAddress == null) { - allParametersPresent = false - } - if (params.eNB_SourceCodePath == null) { - allParametersPresent = false - } - if (params.eNB_Credentials == null) { - allParametersPresent = false - } - // 2nd eNB parameters - if (params.eNB1_IPAddress == null) { - allParametersPresent = false - } - if (params.eNB1_SourceCodePath == null) { - allParametersPresent = false - } - if (params.eNB1_Credentials == null) { - allParametersPresent = false - } - // 3rd eNB parameters - if (params.eNB2_IPAddress == null) { - allParametersPresent = false - } - if (params.eNB2_SourceCodePath == null) { - allParametersPresent = false - } - if (params.eNB2_Credentials == null) { - allParametersPresent = false - } - // the following 4 parameters should be pushed by the master trigger - // if not present, take the job GIT variables (used for developing) - if (params.eNB_Repository == null) { - eNB_Repository = env.GIT_URL - } else { - eNB_Repository = params.eNB_Repository - } - echo "eNB_Repository : ${eNB_Repository}" - if (params.eNB_Branch == null) { - eNB_Branch = env.GIT_BRANCH - } else { - eNB_Branch = params.eNB_Branch - } - echo "eNB_Branch : ${eNB_Branch}" - if (params.eNB_CommitID == null) { - eNB_CommitID = env.GIT_COMMIT - } else { - eNB_CommitID = params.eNB_CommitID - } - echo "eNB_CommitID : ${eNB_CommitID}" - if (params.eNB_mergeRequest!= null) { - eNB_AllowMergeRequestProcess = params.eNB_mergeRequest - if (eNB_AllowMergeRequestProcess) { - if (params.eNB_TargetBranch != null) { - eNB_TargetBranch = params.eNB_TargetBranch - } else { - eNB_TargetBranch = 'develop' - } - echo "eNB_TargetBranch : ${eNB_TargetBranch}" - } - } - - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } - - if (params.ADB_IPAddress == null) { - allParametersPresent = false - } - if (params.ADB_Credentials == null) { - allParametersPresent = false - } - - if (allParametersPresent) { - echo "All parameters are present" - if (eNB_AllowMergeRequestProcess) { - sh "git fetch" - sh "./ci-scripts/doGitLabMerge.sh --src-branch ${eNB_Branch} --src-commit ${eNB_CommitID} --target-branch ${eNB_TargetBranch} --target-commit latest" - } else { - sh "git fetch" - sh "git checkout -f ${eNB_CommitID}" - } - } else { - echo "Some parameters are missing" - sh "./ci-scripts/fail.sh" - } - } - } - } - stage ("Build and Test") { - steps { - script { - dir ('ci-scripts') { - echo "\u2705 \u001B[32m${testStageName}\u001B[0m" - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists(xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB1_Credentials}", usernameVariable: 'eNB1_Username', passwordVariable: 'eNB1_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB2_Credentials}", usernameVariable: 'eNB2_Username', passwordVariable: 'eNB2_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] - ]) { - sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} ${mainPythonAllXmlFiles}" - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists(xmlFile)) { - try { - sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath} --eNB2IPAddress=${params.eNB2_IPAddress} --eNB2UserName=${eNB2_Username} --eNB2Password=${eNB2_Password} --eNB2SourceCodePath=${params.eNB2_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${xmlFile}" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - buildStageStatus = false - } - } - } - sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}" - } - } - } - } - } - stage('Log Collection') { - parallel { - stage('Log Collection (eNB - Build)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (eNB - Build)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectBuild --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" - - echo '\u2705 \u001B[32mLog Transfer (eNB - Build)\u001B[0m' - sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("build.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "build.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (eNB - Run)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (eNB - Run)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollecteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" - - echo '\u2705 \u001B[32mLog Transfer (eNB - Run)\u001B[0m' - sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/enb.log.zip ./enb.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("enb.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "enb.log.${env.BUILD_ID}.zip" - } - if(fileExists("ci-scripts/test_results.html")) { - sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html" - sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" - archiveArtifacts "test_results-${JOB_NAME}.html" - } - } - } - } - } - } - } - - post { - always { - script { - if (params.pipelineZipsConsoleLog != null) { - if (params.pipelineZipsConsoleLog) { - echo "Archiving Jenkins console log" - sh "wget --no-check-certificate --no-proxy ${env.JENKINS_URL}/job/${env.JOB_NAME}/${env.BUILD_ID}/consoleText -O consoleText.log || true" - sh "zip -m consoleText.log.${env.BUILD_ID}.zip consoleText.log || true" - if(fileExists("consoleText.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "consoleText.log.${env.BUILD_ID}.zip" - } - } - } - } - } - } -} diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long b/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long deleted file mode 100644 index e1104ccf00..0000000000 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-benetel-long +++ /dev/null @@ -1,302 +0,0 @@ -#!/bin/groovy -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -// Template Jenkins Declarative Pipeline script to run Test w/ RF HW - -// Location of the python executor node shall be in the same subnet as the others servers -def pythonExecutor = params.pythonExecutor - -// Location of the test XML file to be run -def testXMLFile = params.pythonTestXmlFile -def mainPythonAllXmlFiles = "" -def buildStageStatus = true - -// Name of the test stage -def testStageName = params.pipelineTestStageName - -def lockResources = [] -if (params.LockResources != null && params.LockResources.trim().length() > 0) - params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} - -// Global Parameters. Populated when the master job -// triggers the slave job with parameters -def eNB_Repository = "https://gitlab.eurecom.fr/oai/openairinterface5g.git" -def eNB_Branch = "develop" -def eNB_CommitID -def eNB_AllowMergeRequestProcess = false -def eNB_TargetBranch = "develop" -def eNB_MR = "develop" - -pipeline { - agent { - label pythonExecutor - } - options { - disableConcurrentBuilds() - ansiColor('xterm') - lock(extra: lockResources) - } - stages { - stage("Build Init") { - steps { - script { - //retrieve latest commit ID from branch - latest_commit_from_branch= sh returnStdout: true, script: 'git log -1 origin/${eNB_Branch} | grep commit' - echo "Branch ${eNB_Branch}" - echo "${latest_commit_from_branch}" - tmp=latest_commit_from_branch.split() - echo "${tmp}" - eNB_CommitID = tmp[1] - echo "eNB_CommitID ${eNB_CommitID}" - // update the build name and description - buildName "${params.eNB_MR}" - buildDescription "Commit : ${eNB_CommitID}" - } - } - } - stage ("Verify Parameters") { - steps { - script { - echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' - def allParametersPresent = true - - // It is already to late to check it - if (params.pythonExecutor != null) { - echo "eNB CI executor node : ${pythonExecutor}" - } - // If not present picking a default Stage Name - if (params.pipelineTestStageName == null) { - // picking default - testStageName = 'Template Test Stage' - } - - if (params.LockResources == null) { - echo "no LockResources given" - allParametersPresent = false - } - // 1st eNB parameters - if (params.eNB_IPAddress == null) { - allParametersPresent = false - } - if (params.eNB_SourceCodePath == null) { - allParametersPresent = false - } - if (params.eNB_Credentials == null) { - allParametersPresent = false - } - // 2nd eNB parameters - if (params.eNB1_IPAddress == null) { - allParametersPresent = false - } - if (params.eNB1_SourceCodePath == null) { - allParametersPresent = false - } - if (params.eNB1_Credentials == null) { - allParametersPresent = false - } - // 3rd eNB parameters - if (params.eNB2_IPAddress == null) { - allParametersPresent = false - } - if (params.eNB2_SourceCodePath == null) { - allParametersPresent = false - } - if (params.eNB2_Credentials == null) { - allParametersPresent = false - } - // the following 4 parameters should be pushed by the master trigger - // if not present, take the job GIT variables (used for developing) - if (params.eNB_Repository == null) { - eNB_Repository = env.GIT_URL - } else { - eNB_Repository = params.eNB_Repository - } - echo "eNB_Repository : ${eNB_Repository}" - if (params.eNB_Branch == null) { - eNB_Branch = env.GIT_BRANCH - } else { - eNB_Branch = params.eNB_Branch - } - echo "eNB_Branch : ${eNB_Branch}" - //if (params.eNB_CommitID == null) { - // eNB_CommitID = env.GIT_COMMIT - //} else { - // eNB_CommitID = params.eNB_CommitID - //} - echo "eNB_CommitID : ${eNB_CommitID}" - if (params.eNB_mergeRequest!= null) { - eNB_AllowMergeRequestProcess = params.eNB_mergeRequest - if (eNB_AllowMergeRequestProcess) { - if (params.eNB_TargetBranch != null) { - eNB_TargetBranch = params.eNB_TargetBranch - } else { - eNB_TargetBranch = 'develop' - } - echo "eNB_TargetBranch : ${eNB_TargetBranch}" - } - } - - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } - - if (params.ADB_IPAddress == null) { - allParametersPresent = false - } - if (params.ADB_Credentials == null) { - allParametersPresent = false - } - - if (allParametersPresent) { - echo "All parameters are present" - if (eNB_AllowMergeRequestProcess) { - sh "git fetch" - sh "./ci-scripts/doGitLabMerge.sh --src-branch ${eNB_Branch} --src-commit ${eNB_CommitID} --target-branch ${eNB_TargetBranch} --target-commit latest" - } else { - sh "git fetch" - sh "git checkout -f ${eNB_CommitID}" - } - } else { - echo "Some parameters are missing" - sh "./ci-scripts/fail.sh" - } - } - } - } - stage ("Build and Test") { - steps { - script { - dir ('ci-scripts') { - echo "\u2705 \u001B[32m${testStageName}\u001B[0m" - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists(xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB1_Credentials}", usernameVariable: 'eNB1_Username', passwordVariable: 'eNB1_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB2_Credentials}", usernameVariable: 'eNB2_Username', passwordVariable: 'eNB2_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] - ]) { - sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} ${mainPythonAllXmlFiles}" - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists(xmlFile)) { - try { - sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath} --eNB2IPAddress=${params.eNB2_IPAddress} --eNB2UserName=${eNB2_Username} --eNB2Password=${eNB2_Password} --eNB2SourceCodePath=${params.eNB2_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${xmlFile}" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - buildStageStatus = false - } - } - } - sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}" - } - } - } - } - } - stage('Log Collection') { - parallel { - stage('Log Collection (eNB - Build)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (eNB - Build)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectBuild --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" - - echo '\u2705 \u001B[32mLog Transfer (eNB - Build)\u001B[0m' - sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("build.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "build.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (eNB - Run)') { - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (eNB - Run)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollecteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" - - echo '\u2705 \u001B[32mLog Transfer (eNB - Run)\u001B[0m' - sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/enb.log.zip ./enb.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("enb.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "enb.log.${env.BUILD_ID}.zip" - } - if(fileExists("ci-scripts/test_results.html")) { - sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html" - sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" - archiveArtifacts "test_results-${JOB_NAME}.html" - } - } - } - } - } - } - } - - post { - always { - script { - if (params.pipelineZipsConsoleLog != null) { - if (params.pipelineZipsConsoleLog) { - echo "Archiving Jenkins console log" - sh "wget --no-check-certificate --no-proxy ${env.JENKINS_URL}/job/${env.JOB_NAME}/${env.BUILD_ID}/consoleText -O consoleText.log || true" - sh "zip -m consoleText.log.${env.BUILD_ID}.zip consoleText.log || true" - if(fileExists("consoleText.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "consoleText.log.${env.BUILD_ID}.zip" - } - } - } - } - } - } -} -- GitLab From 52af6bc21a64f1c0e8e65e6e53154d8ce7e95a3e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 4 Oct 2022 16:59:43 +0200 Subject: [PATCH 7/7] Typo --- ci-scripts/Jenkinsfile-GitLab-Container | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index 0786978388..f9bb72ec47 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -305,11 +305,11 @@ pipeline { } } } - stage ("NSA-B200-Module-SABOX-Container") { + stage ("SA-B200-Module-SABOX-Container") { when { expression {do5Gtest} } steps { script { - triggerSlaveJob ('RAN-SA-B200-Module-SABOX-Container', 'NSA-B200-Module-SABOX-Container') + triggerSlaveJob ('RAN-SA-B200-Module-SABOX-Container', 'SA-B200-Module-SABOX-Container') } } post { -- GitLab