From 1b8f9145b74d759f5fa85d9c2c52a35b67c94a2d Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 17 Aug 2023 10:07:58 +0800 Subject: [PATCH 01/33] feat: close all screen sessions before continuing pipeline Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index ba7be585..fdccb3ea 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -124,6 +124,7 @@ private def update_agent() { // clean up residue containers stage('Clean up residue docker containers') { sh 'sudo docker ps -q -f status=exited | xargs --no-run-if-empty sudo docker rm' + sh 'sudo killall screen' //close all screen session on the agent } } } From f4d011a31c7c102863ff8e294c69c3e2ad3cabb4 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 17 Aug 2023 11:15:45 +0800 Subject: [PATCH 02/33] feat: close only detached screen session Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index fdccb3ea..277cb295 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -121,10 +121,10 @@ private def update_agent() { } } - // clean up residue containers + // clean up residue containers and detached screen sessions stage('Clean up residue docker containers') { sh 'sudo docker ps -q -f status=exited | xargs --no-run-if-empty sudo docker rm' - sh 'sudo killall screen' //close all screen session on the agent + sh 'sudo screen -ls | grep Detached | cut -d. -f1 | awk "{print $1}" | sudo xargs -r kill' //close all detached screen session on the agent } } } From b63cdf4c5b21b4d00a3564a4b1aa7e58238673e6 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Wed, 23 Aug 2023 10:46:44 +0800 Subject: [PATCH 03/33] pyadi-iio: add checkout scm Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 277cb295..239b52d1 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -490,7 +490,16 @@ def stage_library(String stage_name) { dir('pytest-libiio'){ run_i('python3 setup.py install', true) } - run_i('git clone -b "' + gauntEnv.pyadi_iio_branch + '" ' + gauntEnv.pyadi_iio_repo, true) + //scm pyadi-iio + dir('pyadi-iio'){ + under_scm = isMultiBranchPipeline() + if (under_scm){ + println("Multibranch pipeline. Checkout scm") + }else{ + println("Not a multibranch pipeline. Cloning "+gauntEnv.no_os_branch+" branch from "+gauntEnv.no_os_repo) + run_i('git clone -b "' + gauntEnv.pyadi_iio_branch + '" ' + gauntEnv.pyadi_iio_repo+' .', true) + } + } dir('pyadi-iio') { run_i('pip3 install -r requirements.txt', true) From 1c956623ae02bad9d0dc45b81b90d380491b2e04 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Wed, 23 Aug 2023 11:57:38 +0800 Subject: [PATCH 04/33] scm: add 3 retries Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 239b52d1..b8961a99 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -1379,8 +1379,10 @@ def isMultiBranchPipeline() { println("Checking if multibranch pipeline..") try { - checkout scm - isMultiBranch = true + retry(3){ + checkout scm + isMultiBranch = true + } } catch(all) { From 62ec2bd897ca2453f40c859a03dc669d08a87417 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Wed, 23 Aug 2023 16:41:50 +0800 Subject: [PATCH 05/33] libiio: use latest release of libiio --- vars/getGauntEnv.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index 4bafc7f1..fe9374f8 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -60,7 +60,7 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo nebula_repo: 'https://github.com/sdgtt/nebula.git', nebula_branch: 'master', libiio_repo: 'https://github.com/analogdevicesinc/libiio.git', - libiio_branch: 'master', + libiio_branch: 'v0.25', telemetry_repo: 'https://github.com/sdgtt/telemetry.git', telemetry_branch: 'master', matlab_release: 'R2021a', @@ -92,4 +92,4 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo update_lib_requirements: false, // Set to true to run installation of requirements.txt of nebula and telemetry update_container_lib: false // Set to true to force update libiio, nebula, telemetry base on master branch inside docker container ] -} \ No newline at end of file +} From ae0f488bbf9dad78443aea18aba530cc99204c28 Mon Sep 17 00:00:00 2001 From: Julia Pineda Date: Tue, 19 Sep 2023 09:59:26 +0800 Subject: [PATCH 06/33] Support MATLAB network license Signed-off-by: Julia Pineda --- src/sdg/Gauntlet.groovy | 11 ++++++++++- vars/getDockerConfig.groovy | 28 +++++++++++++++------------- vars/getGauntEnv.groovy | 1 + 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index b8961a99..86f4dc20 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -978,7 +978,7 @@ private def run_agents() { def update_lib_requirements = gauntEnv.update_lib_requirements def jobs = [:] def num_boards = gauntEnv.boards.size() - def docker_args = getDockerConfig(gauntEnv.docker_args) + def docker_args = getDockerConfig(gauntEnv.docker_args, gauntEnv.matlab_license) def enable_update_boot_pre_docker = gauntEnv.enable_update_boot_pre_docker def enable_resource_queuing = gauntEnv.enable_resource_queuing def pre_docker_cls = stage_library("UpdateBOOTFiles") @@ -1361,6 +1361,15 @@ def set_matlab_timeout(matlab_timeout) { gauntEnv.matlab_timeout = matlab_timeout } +/** + * Set type of MATLAB license file + * @param matlab_license acceptable values are 'network' for 'machine' + * 'network' for network license and 'machine' for machine-specific license + */ +def set_matlab_license(matlab_license) { + gauntEnv.matlab_license = matlab_license +} + /** * Enables updating of nebula-config used by nebula * @param enable boolean replaces default gauntEnv.update_nebula_config diff --git a/vars/getDockerConfig.groovy b/vars/getDockerConfig.groovy index b256936e..918ee349 100644 --- a/vars/getDockerConfig.groovy +++ b/vars/getDockerConfig.groovy @@ -1,5 +1,5 @@ -def call(java.util.ArrayList listOfResources, matlabHSPro=true, UseNFS=false) { +def call(java.util.ArrayList listOfResources, matlablic, matlabHSPro=true, UseNFS=false) { assert listOfResources instanceof java.util.List args = ['--privileged'] @@ -15,18 +15,20 @@ def call(java.util.ArrayList listOfResources, matlabHSPro=true, UseNFS=false) { else args.add('-v "/nfs/apps/resources/mlhsp":"/mlhspro":ro') } - else { - args.add('-v "/usr/local/MATLAB":"/usr/local/MATLAB":ro') - args.add('-v "/root/.matlab":"/root/.matlabro":ro') - if (matlabHSPro) - args.add('-v "/mlhsp":"/mlhsp":ro') - else - args.add('-v "/mlhsp":"/mlhspro":ro') - } - // Add correct MAC to licenses work in Docker - withCredentials([string(credentialsId: 'MAC_ADDR', variable: 'MAC_ADDR')]) { - args.add('--mac-address ' + MAC_ADDR) - } + else { + args.add('-v "/usr/local/MATLAB":"/usr/local/MATLAB":ro') + args.add('-v "/root/.matlab":"/root/.matlabro":ro') + if (matlabHSPro) + args.add('-v "/mlhsp":"/mlhsp":ro') + else + args.add('-v "/mlhsp":"/mlhspro":ro') + } + // Add correct MAC to licenses work in Docker + if (matlablic.equalsIgnoreCase( 'machine' )) { + withCredentials([string(credentialsId: 'MAC_ADDR', variable: 'MAC_ADDR')]) { + args.add('--mac-address ' + MAC_ADDR) + } + } } else if (listOfResources[i].equalsIgnoreCase( 'Vivado' )) { echo '----Adding Vivado Resources----' diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index fe9374f8..04b6c9e5 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -68,6 +68,7 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo matlab_branch: 'master', matlab_commands: [], matlab_timeout: '10m', + matlab_license: 'machine', no_os_repo: 'https://github.com/analogdevicesinc/no-OS.git', no_os_branch: 'master', vivado_ver: '2019.1', From b41b0cfc49bea22c6f9f465abac2779be6e66bb2 Mon Sep 17 00:00:00 2001 From: kimpaller Date: Thu, 28 Sep 2023 10:15:42 +0800 Subject: [PATCH 07/33] allow required_libraries to be configurable Signed-off-by: kimpaller --- src/sdg/Gauntlet.groovy | 20 +++++++++----------- vars/getGauntEnv.groovy | 1 + 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index b8961a99..8acf9426 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -65,6 +65,7 @@ private def setup_agents() { private def update_agent() { def docker_status = gauntEnv.enable_docker + def update_container_lib = gauntEnv.update_container_lib def update_requirements = gauntEnv.update_lib_requirements def board_map = [:] @@ -80,7 +81,8 @@ private def update_agent() { stage('Update agents') { sh 'mkdir -p /usr/app' sh 'rm -rf /usr/app/*' - setupAgent(['nebula', 'libiio'], false, update_requirements) + def deps = check_update_container_lib(update_container_lib) + setupAgent(deps, false, update_requirements) } // automatically update nebula config if(gauntEnv.update_nebula_config){ @@ -1868,17 +1870,13 @@ private def setup_libserialport() { private def check_update_container_lib(update_container_lib=false) { def deps = [] def default_branch = 'master' - def branches = [0:gauntEnv.nebula_branch, 1:gauntEnv.libiio_branch, 2:gauntEnv.telemetry_branch] - def dep_map = [ 0:'nebula', 1:'libiio', 2:'telemetry'] if (update_container_lib){ - deps = ['nebula', 'libiio', 'telemetry'] - } - else { - def i; - for (i=0; i Date: Thu, 28 Sep 2023 15:25:37 +0800 Subject: [PATCH 08/33] add X11forwarding support to docker args Signed-off-by: kimpaller --- vars/getDockerConfig.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vars/getDockerConfig.groovy b/vars/getDockerConfig.groovy index b256936e..acca9343 100644 --- a/vars/getDockerConfig.groovy +++ b/vars/getDockerConfig.groovy @@ -52,6 +52,11 @@ def call(java.util.ArrayList listOfResources, matlabHSPro=true, UseNFS=false) { args.add('-v /etc/udev/rules.d:/etc/udev/rules.d') args.add('-v /run/udev/data:/run/udev/data') } + else if (listOfResources[i].equalsIgnoreCase( 'x11forwarding' )) { + echo '----Adding X11 Forwarding ----' + args.add('-v /tmp/.X11-unix:/tmp/.X11-unix:rw') + args.add('-v /home/analog/.Xauthority:/root/.Xauthority') + } else { args.add(listOfResources[i]) } From 3aaea09c9da27bcc1f2e490fbcb7e3bc063c82a3 Mon Sep 17 00:00:00 2001 From: Julia Pineda Date: Mon, 2 Oct 2023 11:15:02 +0800 Subject: [PATCH 09/33] Handle MATLAB exit code Signed-off-by: Julia Pineda --- src/sdg/Gauntlet.groovy | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index b8961a99..3c070fb1 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -666,7 +666,22 @@ def stage_library(String stage_name) { println('Parsing MATLAB hardware results failed') echo getStackTrace(ex) } - } + } + // Print test result summary and set stage status depending on test result + if (statusCode != 0) { + currentBuild.result = 'FAILURE' + } + switch (statusCode) { + case 1: + unstable("MATLAB: Error encountered when running the tests.") + break + case 2: + unstable("MATLAB: Some tests failed.") + break + case 3: + unstable("MATLAB: Some tests did not run to completion.") + break + } } } else @@ -705,6 +720,21 @@ def stage_library(String stage_name) { echo getStackTrace(ex) } } + // Print test result summary and set stage status depending on test result + if (statusCode != 0) { + currentBuild.result = 'FAILURE' + } + switch (statusCode) { + case 1: + unstable("MATLAB: Error encountered when running the tests.") + break + case 2: + unstable("MATLAB: Some tests failed.") + break + case 3: + unstable("MATLAB: Some tests did not run to completion.") + break + } } } } From 268da34ed9077d05c015f70bb94c8796b030aa66 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 26 Oct 2023 11:09:23 +0800 Subject: [PATCH 10/33] check iio_info first before dmesg errors Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 66c24bfa..5773e22f 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -410,11 +410,6 @@ def stage_library(String stage_name) { // run_i('pip3 install pylibiio',true) //def ip = nebula('uart.get-ip') def ip = nebula('update-config network-config dutip --board-name='+board) - try{ - nebula("net.check-dmesg --ip='"+ip+"' --board-name="+board) - }catch(Exception ex) { - failed_test = failed_test + "[dmesg check failed: ${ex.getMessage()}]" - } try{ nebula('driver.check-iio-devices --uri="ip:'+ip+'" --board-name='+board, true, true, true) @@ -429,6 +424,12 @@ def stage_library(String stage_name) { devs = devs.minus(missing_devs) writeFile(file: board+'_enumerated_devs.log', text: devs.join("\n")) set_elastic_field(board, 'drivers_enumerated', devs.size().toString()) + + try{ + nebula("net.check-dmesg --ip='"+ip+"' --board-name="+board) + }catch(Exception ex) { + failed_test = failed_test + "[dmesg check failed: ${ex.getMessage()}]" + } try{ if (!gauntEnv.firmware_boards.contains(board)){ From 5f8129a68d91a3205421f0fd7fcf5337c6973272 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 26 Oct 2023 14:34:27 +0800 Subject: [PATCH 11/33] run iio_info before dmesg check Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 5773e22f..b01db8e0 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -426,6 +426,7 @@ def stage_library(String stage_name) { set_elastic_field(board, 'drivers_enumerated', devs.size().toString()) try{ + sh 'iio_info --uri=ip:'+ip nebula("net.check-dmesg --ip='"+ip+"' --board-name="+board) }catch(Exception ex) { failed_test = failed_test + "[dmesg check failed: ${ex.getMessage()}]" From b4cce5bf05dcc780577f0d8a624fc699e80e46f1 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Fri, 3 Nov 2023 16:41:11 +0800 Subject: [PATCH 12/33] fix setting hdl and linux hash Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index b01db8e0..1e554d6d 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -98,7 +98,12 @@ private def update_agent() { if(gauntEnv.netbox_include_children == false){ custom = custom + " --no-include-children" } - nebula('gen-config-netbox --jenkins-agent=' + agent_name + if(gauntEnv.netbox_test_agent == true){ + agent = "" + }else{ + agent = agent_name + } + nebula('gen-config-netbox --jenkins-agent=' + agent + ' --netbox-ip=' + gauntEnv.netbox_ip + ' --netbox-port=' + gauntEnv.netbox_port + ' --netbox-baseurl=' + gauntEnv.netbox_base_url @@ -1965,16 +1970,18 @@ def get_gitsha(String board){ set_elastic_field(board, 'linux_hash', linux_hash) return } - - // properties.hdl_git_sha = null - // properties.hdl_folder = null - // properties.linux_git_sha = null - // properties.linux_folder = null if (fileExists('outs/properties.yaml')){ dir ('outs'){ script{ properties = readYaml file: 'properties.yaml' } } + if (gauntEnv.bootPartitionBranch == 'NA'){ + hdl_hash = properties.hdl_git_sha + " (" + properties.hdl_folder + ")" + linux_hash = properties.linux_git_sha + " (" + properties.linux_folder + ")" + }else{ + hdl_hash = properties.hdl_git_sha + " (" + properties.bootpartition_folder + ")" + linux_hash = properties.linux_git_sha + " (" + properties.bootpartition_folder + ")" + } } else if(fileExists('outs/properties.txt')){ dir ('outs'){ def file = readFile 'properties.txt' @@ -1991,21 +1998,10 @@ def get_gitsha(String board){ } } } - } else { - return - } - - if (gauntEnv.bootPartitionBranch == 'NA'){ - hdl_hash = properties.hdl_git_sha + " (" + properties.hdl_folder + ")" - linux_hash = properties.linux_git_sha + " (" + properties.linux_folder + ")" - }else{ - hdl_hash = properties.hdl_git_sha + " (" + properties.bootpartition_folder + ")" - linux_hash = properties.linux_git_sha + " (" + properties.bootpartition_folder + ")" - } - - if (linux_git_sha != null){ linux_hash = linux_git_sha + " (" + linux_folder + ")" hdl_hash = "NA" + } else { + return } echo "Hashes set hdl: ${hdl_hash}, linux: ${linux_hash}" From dad19cc76d410fd2a53065e2a140556575dbc13d Mon Sep 17 00:00:00 2001 From: Julia Pineda Date: Mon, 15 Jan 2024 09:49:01 +0800 Subject: [PATCH 13/33] Update telemetry installation Signed-off-by: Julia Pineda --- src/sdg/Gauntlet.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index d9279bc4..3090ea09 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -1889,7 +1889,7 @@ private def install_telemetry(update_requirements=false){ if (update_requirements){ run_i('pip3 install -r requirements.txt', true) } - run_i('python3 setup.py install', true) + run_i('pip3 install .', true) } } } From b897f61dadf3c04ada3f5e9c1f569baa3ad5c2ce Mon Sep 17 00:00:00 2001 From: Kim Chesed Paller <73711098+kimpaller@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:38:52 +0800 Subject: [PATCH 14/33] Update getDockerConfig.groovy Share .ssh to container --- vars/getDockerConfig.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/getDockerConfig.groovy b/vars/getDockerConfig.groovy index 2edab8ac..07e142c0 100644 --- a/vars/getDockerConfig.groovy +++ b/vars/getDockerConfig.groovy @@ -58,6 +58,7 @@ def call(java.util.ArrayList listOfResources, matlablic, matlabHSPro=true, UseNF echo '----Adding X11 Forwarding ----' args.add('-v /tmp/.X11-unix:/tmp/.X11-unix:rw') args.add('-v /home/analog/.Xauthority:/root/.Xauthority') + args.add('-v /home/analog/.ssh:/root/.ssh') } else { args.add(listOfResources[i]) From 3169722883ee6b161acf9726ebcd916a8bcd65ea Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Wed, 10 Jan 2024 14:14:54 +0800 Subject: [PATCH 15/33] update libad9361 supported boards Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 3090ea09..3e1af8e9 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -585,12 +585,14 @@ def stage_library(String stage_name) { break case 'LibAD9361Tests': cls = { String board -> - def supported_boards = ['zynq-zed-adv7511-ad9361-fmcomms2-3', - 'zynq-zc706-adv7511-ad9361-fmcomms5', - 'zynq-adrv9361-z7035-fmc', - 'zynq-zed-adv7511-ad9364-fmcomms4', - 'pluto'] - if(supported_boards.contains(board) && gauntEnv.libad9361_iio_branch != null){ + def supported = false + def supported_boards = ["adrv9361", "adrv9364", "ad9361", "ad9364", "pluto"] + for(s in supported_boards){ + if (board.contains(s)){ + supported = true + } + } + if(supported && gauntEnv.libad9361_iio_branch != null){ try{ stage("Test libad9361") { def ip = nebula("update-config -s network-config -f dutip --board-name="+board) From 1cd56d55b8d64b83211514b2cd18d1e41145115c Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 15 Feb 2024 20:32:01 +0800 Subject: [PATCH 16/33] update default branch to main of pyadi-iio and libad9361 Signed-off-by: Trecia Agoylo --- vars/getGauntEnv.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index aad32d09..17f52736 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -55,9 +55,9 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo pytest_libiio_repo: 'https://github.com/tfcollins/pytest-libiio.git', pytest_libiio_branch: 'master', pyadi_iio_repo: 'https://github.com/analogdevicesinc/pyadi-iio.git', - pyadi_iio_branch: 'master', + pyadi_iio_branch: 'main', libad9361_iio_repo: 'https://github.com/analogdevicesinc/libad9361-iio.git', - libad9361_iio_branch : 'master', + libad9361_iio_branch : 'main', nebula_repo: 'https://github.com/sdgtt/nebula.git', nebula_branch: 'master', libiio_repo: 'https://github.com/analogdevicesinc/libiio.git', From e86c97c0101c94e2b82b4096e0a105f3d9a44986 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Mon, 11 Mar 2024 13:44:30 +0800 Subject: [PATCH 17/33] Update default vivado version --- vars/getGauntEnv.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index 17f52736..71a2751f 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -72,7 +72,7 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo matlab_license: 'machine', no_os_repo: 'https://github.com/analogdevicesinc/no-OS.git', no_os_branch: 'master', - vivado_ver: '2019.1', + vivado_ver: '2021.2', nebula_config_repo: 'https://github.com/sdgtt/nebula-config.git', nebula_config_branch: 'master', kuiper_checker_repo: 'https://github.com/sdgtt/kuiper-post-build-checker.git', From 2763fc1e42c8456b56329c816b5fed29ac059257 Mon Sep 17 00:00:00 2001 From: kimpaller Date: Mon, 18 Mar 2024 14:34:12 +0800 Subject: [PATCH 18/33] update way to install nebula Signed-off-by: kimpaller --- src/sdg/Gauntlet.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 3e1af8e9..5bba82a5 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -1833,7 +1833,7 @@ private def install_nebula(update_requirements=false) { if (update_requirements){ run_i('pip3 install -r requirements.txt', true) } - run_i('python3 setup.py install', true) + run_i('pip3 install .', true) } } } From ce69255f40c2a47db02152d75a838206c9f34a52 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Mon, 8 Apr 2024 08:40:23 +0800 Subject: [PATCH 19/33] pyaditest: install liad9361 python bindings Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 5bba82a5..57413997 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -499,6 +499,17 @@ def stage_library(String stage_name) { dir('pytest-libiio'){ run_i('python3 setup.py install', true) } + //install libad9361 python bindings + run_i('git clone -b '+ gauntEnv.libad9361_iio_branch + ' ' + gauntEnv.libad9361_iio_repo, true) + dir('libad9361-iio'){ + sh 'mkdir -p build' + dir('build'){ + sh 'sudo cmake -DPYTHON_BINDINGS=ON ..' + sh 'sudo make' + sh 'sudo make install' + sh 'ldconfig' + } + } //scm pyadi-iio dir('pyadi-iio'){ under_scm = isMultiBranchPipeline() From 24ec7f03df46849ce06f438d35e853eeeb4f7ce7 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Mon, 8 Apr 2024 12:30:31 +0800 Subject: [PATCH 20/33] update handling of libad9361 installation Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 57413997..2dbab264 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -500,14 +500,19 @@ def stage_library(String stage_name) { run_i('python3 setup.py install', true) } //install libad9361 python bindings - run_i('git clone -b '+ gauntEnv.libad9361_iio_branch + ' ' + gauntEnv.libad9361_iio_repo, true) - dir('libad9361-iio'){ - sh 'mkdir -p build' - dir('build'){ - sh 'sudo cmake -DPYTHON_BINDINGS=ON ..' - sh 'sudo make' - sh 'sudo make install' - sh 'ldconfig' + try{ + sh 'python3 -c "import ad9361"' + }catch (Exception ex){ + run_i('sudo rm -rf libad9361-iio') + run_i('git clone -b '+ gauntEnv.libad9361_iio_branch + ' ' + gauntEnv.libad9361_iio_repo, true) + dir('libad9361-iio'){ + sh 'mkdir -p build' + dir('build'){ + sh 'sudo cmake -DPYTHON_BINDINGS=ON ..' + sh 'sudo make' + sh 'sudo make install' + sh 'ldconfig' + } } } //scm pyadi-iio @@ -607,14 +612,17 @@ def stage_library(String stage_name) { try{ stage("Test libad9361") { def ip = nebula("update-config -s network-config -f dutip --board-name="+board) + run_i('sudo rm -rf libad9361-iio') run_i('git clone -b '+ gauntEnv.libad9361_iio_branch + ' ' + gauntEnv.libad9361_iio_repo, true) dir('libad9361-iio') { sh 'mkdir build' dir('build') { - sh 'cmake ..' + sh 'cmake -DPYTHON_BINDINGS=ON ..' sh 'make' + sh 'make install' + sh 'ldconfig' sh 'URI_AD9361="ip:'+ip+'" ctest -T test --no-compress-output -V' } } From 819b1f93cc03cf5f41850eaa3b42dc16a7bbceb7 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Mon, 8 Apr 2024 12:40:21 +0800 Subject: [PATCH 21/33] pyaditest: update print statement Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 2dbab264..4a3bdf13 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -521,7 +521,7 @@ def stage_library(String stage_name) { if (under_scm){ println("Multibranch pipeline. Checkout scm") }else{ - println("Not a multibranch pipeline. Cloning "+gauntEnv.no_os_branch+" branch from "+gauntEnv.no_os_repo) + println("Not a multibranch pipeline. Cloning "+gauntEnv.pyadi_iio_branch+" branch from "+gauntEnv.pyadi_iio_repo) run_i('git clone -b "' + gauntEnv.pyadi_iio_branch + '" ' + gauntEnv.pyadi_iio_repo+' .', true) } } From f08c19eec23603d9dcc3957511dc6fcabc5262fe Mon Sep 17 00:00:00 2001 From: bia1708 Date: Tue, 8 Oct 2024 16:57:57 +0300 Subject: [PATCH 22/33] Gauntlet.groovy: Remove unnecesary steps The `/usr/app` directory is no longer used to store dependencies. Signed-off-by: bia1708 --- src/sdg/Gauntlet.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 4a3bdf13..438c8b47 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -79,8 +79,6 @@ private def update_agent() { jobs[agent_name] = { node(agent_name) { stage('Update agents') { - sh 'mkdir -p /usr/app' - sh 'rm -rf /usr/app/*' def deps = check_update_container_lib(update_container_lib) setupAgent(deps, false, update_requirements) } From a6e7418f2a2f3ea6791e326b656e43b1481d5c6d Mon Sep 17 00:00:00 2001 From: bia1708 Date: Wed, 9 Oct 2024 17:52:25 +0300 Subject: [PATCH 23/33] Gauntlet.groovy: Rewrite dependency cloning Improve cloning time (changes are brought on top of the existing cloned repo). Requires Jenkins GitSCM plugin. Signed-off-by: bia1708 --- src/sdg/Gauntlet.groovy | 68 ++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 438c8b47..87c7d1a7 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -1842,16 +1842,16 @@ private def install_nebula(update_requirements=false) { } } else { + def scmVars = checkout([ + $class : 'GitSCM', + branches : [[name: "*/${gauntEnv.nebula_branch}"]], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'LocalBranch', localBranch: "**"]], + submoduleCfg: [], + userRemoteConfigs: [[credentialsId: '', url: "${gauntEnv.nebula_repo}"]] + ]) sh 'pip3 uninstall nebula -y || true' - run_i('sudo rm -rf nebula') - run_i('git clone -b ' + gauntEnv.nebula_branch + ' ' + gauntEnv.nebula_repo, true) - dir('nebula') - { - if (update_requirements){ - run_i('pip3 install -r requirements.txt', true) - } - run_i('pip3 install .', true) - } + sh 'pip3 install .' } } @@ -1869,21 +1869,24 @@ private def install_libiio() { } } else { - run_i('sudo rm -rf libiio') - run_i('git clone -b ' + gauntEnv.libiio_branch + ' ' + gauntEnv.libiio_repo, true) - dir('libiio') + def scmVars = checkout([ + $class : 'GitSCM', + branches : [[name: "refs/tags/${gauntEnv.libiio_branch}"]], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'LocalBranch', localBranch: "**"]], + submoduleCfg: [], + userRemoteConfigs: [[credentialsId: '', url: "${gauntEnv.libiio_repo}"]] + ]) + sh 'mkdir build' + dir('build') { - sh 'mkdir build' - dir('build') - { - sh 'cmake .. -DPYTHON_BINDINGS=ON -DWITH_SERIAL_BACKEND=ON -DHAVE_DNS_SD=OFF' - sh 'make' - sh 'make install' - sh 'ldconfig' - // install python bindings - dir('bindings/python'){ - sh 'python3 setup.py install' - } + sh 'cmake .. -DPYTHON_BINDINGS=ON -DWITH_SERIAL_BACKEND=ON -DHAVE_DNS_SD=OFF' + sh 'make' + sh 'sudo make install' + sh 'ldconfig' + // install python bindings + dir('bindings/python'){ + sh 'python3 setup.py install' } } } @@ -1901,15 +1904,18 @@ private def install_telemetry(update_requirements=false){ } }else{ // sh 'pip3 uninstall telemetry -y || true' - run_i('sudo rm -rf telemetry') - run_i('git clone -b ' + gauntEnv.telemetry_branch + ' ' + gauntEnv.telemetry_repo, true) - dir('telemetry') - { - if (update_requirements){ - run_i('pip3 install -r requirements.txt', true) - } - run_i('pip3 install .', true) + def scmVars = checkout([ + $class : 'GitSCM', + branches : [[name: "*/${gauntEnv.telemetry_branch}"]], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'LocalBranch', localBranch: "**"]], + submoduleCfg: [], + userRemoteConfigs: [[credentialsId: '', url: "${gauntEnv.telemetry_repo}"]] + ]) + if (update_requirements){ + run_i('pip3 install -r requirements.txt', true) } + sh 'pip3 install .' } } From c1be37fec68aa2a5cf61ee29bd7ec7886b9e09b3 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Tue, 15 Oct 2024 12:15:55 +0800 Subject: [PATCH 24/33] Add new netbox fields Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 2 ++ vars/getGauntEnv.groovy | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 4a3bdf13..9d4dbbcd 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -110,6 +110,8 @@ private def update_agent() { + ' --netbox-port=' + gauntEnv.netbox_port + ' --netbox-baseurl=' + gauntEnv.netbox_base_url + ' --netbox-token=' + gauntEnv.netbox_token + + ' --devices-status=' + gauntEnv.netbox_devices_status + + ' --devices-role=' + gauntEnv.netbox_devices_role + ' --devices-tag=' + gauntEnv.netbox_devices_tag + ' --template=' + gauntEnv.netbox_nebula_template + custom diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index 71a2751f..065dd4ef 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -36,6 +36,8 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo netbox_port: '', netbox_base_url: '', netbox_token: '', + netbox_devices_status: '', + netbox_devices_role: '', netbox_devices_tag: '', netbox_nebula_template: 'template_gen.yaml', netbox_include_variants: true, From bb6b8414984adc57ce21500dcc31ff864c04ac56 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Tue, 15 Oct 2024 12:24:28 +0800 Subject: [PATCH 25/33] update defaults similar to nebula Signed-off-by: Trecia Agoylo --- vars/getGauntEnv.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index 065dd4ef..ff5845a6 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -36,8 +36,8 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo netbox_port: '', netbox_base_url: '', netbox_token: '', - netbox_devices_status: '', - netbox_devices_role: '', + netbox_devices_status: 'active', + netbox_devices_role: 'fpga-dut', netbox_devices_tag: '', netbox_nebula_template: 'template_gen.yaml', netbox_include_variants: true, From bfb6fb0435cb145e6a128813f627d7d2c3fae195 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Tue, 15 Oct 2024 13:42:58 +0800 Subject: [PATCH 26/33] expose netbox_test_agent parameter Signed-off-by: Trecia Agoylo --- vars/getGauntEnv.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index ff5845a6..ddcec235 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -32,6 +32,7 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo docker_host_mode: true, update_nebula_config: true, nebula_config_source: 'netbox', + netbox_test_agent: false, netbox_ip: '', netbox_port: '', netbox_base_url: '', From 7f15441e855424b1f457540d6ffc4adc995a59bd Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 17 Oct 2024 14:21:28 +0800 Subject: [PATCH 27/33] use device instead of devices Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 6 +++--- vars/getGauntEnv.groovy | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 9d4dbbcd..7c731d47 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -110,9 +110,9 @@ private def update_agent() { + ' --netbox-port=' + gauntEnv.netbox_port + ' --netbox-baseurl=' + gauntEnv.netbox_base_url + ' --netbox-token=' + gauntEnv.netbox_token - + ' --devices-status=' + gauntEnv.netbox_devices_status - + ' --devices-role=' + gauntEnv.netbox_devices_role - + ' --devices-tag=' + gauntEnv.netbox_devices_tag + + ' --device-status=' + gauntEnv.netbox_device_status + + ' --device-role=' + gauntEnv.netbox_device_role + + ' --device-tag=' + gauntEnv.netbox_device_tag + ' --template=' + gauntEnv.netbox_nebula_template + custom + ' --outfile='+ agent_name, true, true, false) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index ddcec235..59cf3a38 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -37,9 +37,9 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo netbox_port: '', netbox_base_url: '', netbox_token: '', - netbox_devices_status: 'active', - netbox_devices_role: 'fpga-dut', - netbox_devices_tag: '', + netbox_device_status: 'active', + netbox_device_role: 'fpga-dut', + netbox_device_tag: '', netbox_nebula_template: 'template_gen.yaml', netbox_include_variants: true, netbox_include_children: true, From cc93fcb0ebea30bcc65193854ee9154b13185f8a Mon Sep 17 00:00:00 2001 From: bia1708 Date: Thu, 17 Oct 2024 14:32:04 +0300 Subject: [PATCH 28/33] Gauntlet.groovy: Rework locking strategy Starting with v1210 of the Lockable Resources Plugin in Jenkins, because of changes introduced in jenkinsci/lockable-resources-plugin#579, empty locks are no longer allowed. The `lock_agent` variable was not checked before being used as a lock and when set to false, it would throw an error. Due to the fact that agent locking is no longer needed, remove it altogether. Locking is always supported for DUTs and no longer optional. Signed-off-by: bia1708 --- doc/source/jenkinsfile_conf.rst | 3 -- doc/source/methods.rst | 16 ------ doc/source/pipeline.rst | 7 +-- src/sdg/Gauntlet.groovy | 92 ++++++++++----------------------- vars/getGauntEnv.groovy | 2 - 5 files changed, 28 insertions(+), 92 deletions(-) diff --git a/doc/source/jenkinsfile_conf.rst b/doc/source/jenkinsfile_conf.rst index 155568d3..79475d55 100644 --- a/doc/source/jenkinsfile_conf.rst +++ b/doc/source/jenkinsfile_conf.rst @@ -25,9 +25,6 @@ First, we will discuss the bare minimum requirements or parts for the Jenkinfile harness.set_enable_docker(true) harness.set_docker_args(['Vivado'])  - //set resource queuing parameter - harness.set_enable_resource_queuing(true) - //set required hardware harness.set_required_hardware(["pluto"])       diff --git a/doc/source/methods.rst b/doc/source/methods.rst index a1e0ec32..019821f5 100644 --- a/doc/source/methods.rst +++ b/doc/source/methods.rst @@ -261,22 +261,6 @@ Sample usage: harness = getGauntlet() harness.set_required_hardware(["zynq-zed-adv7511-ad9361-fmcomms2-3", "pluto"]) -set_enable_resource_queuing -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Enable resource queuing. Resource queuing is ensuring that each board iso only accessed one at a time. This is helpful when boards have project variants, like adrv9002. -Set to True to enable. - -parameter: - * *enable_resource_queuing* - Boolean true to enable - -Sample usage: - -.. code-block:: groovy - - harness = getGauntlet() - harness.set_enable_resource_queuing(True) - IIO URI ------- diff --git a/doc/source/pipeline.rst b/doc/source/pipeline.rst index 7c65f4a3..ac0a542e 100644 --- a/doc/source/pipeline.rst +++ b/doc/source/pipeline.rst @@ -21,7 +21,7 @@ Example Jenkinsfile lock(label: 'adgt_test_harness_boards'){ @Library('sdgtt-lib@jsl_updates') _  - + //instantiate constructor method def harness = getGauntlet()      @@ -32,9 +32,6 @@ Example Jenkinsfile harness.set_enable_docker(true) harness.set_docker_args(['Vivado'])  - //set resource queuing parameter - harness.set_enable_resource_queuing(true) - //set required hardware harness.set_required_hardware(["pluto", "zynq-zed-adv7511-fmcomms2-3", @@ -46,5 +43,3 @@ Example Jenkinsfile // Go go harness.run_stages() } - - diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 87c7d1a7..723df9b9 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -1038,7 +1038,6 @@ private def run_agents() { def num_boards = gauntEnv.boards.size() def docker_args = getDockerConfig(gauntEnv.docker_args, gauntEnv.matlab_license) def enable_update_boot_pre_docker = gauntEnv.enable_update_boot_pre_docker - def enable_resource_queuing = gauntEnv.enable_resource_queuing def pre_docker_cls = stage_library("UpdateBOOTFiles") docker_args.add('-v /etc/apt/apt.conf.d:/etc/apt/apt.conf.d:ro') docker_args.add('-v /etc/default:/default:ro') @@ -1143,15 +1142,10 @@ private def run_agents() { def stages = gauntEnv.stages def docker_image = gauntEnv.docker_image def num_stages = stages.size() - def lock_agent = '' println('Agent: ' + agent + ' Board: ' + board) println('Number of stages to run: ' + num_stages.toString()) - if (gauntEnv.lock_agent) { - println('Locking agent: '+agent+'. Effectively only one test executor is running on the agent.') - lock_agent = agent - } /* jobs[agent+"-"+board] = { node(agent) { @@ -1162,50 +1156,34 @@ jobs[agent+"-"+board] = { } } */ + // Always lock DUTs + def lock_name = extractLockName(board, agent) + echo "Acquiring lock for ${lock_name}" + if (gauntEnv.enable_docker) { - if( enable_resource_queuing ){ - println("Enable resource queueing") - jobs[agent + '-' + board] = { - def lock_name = extractLockName(board, agent) - echo "Acquiring lock for ${lock_name}" - lock(lock_agent){ - lock(lock_name){ - oneNodeDocker( - agent, - num_stages, - stages, - board, - docker_image, - enable_update_boot_pre_docker, - pre_docker_cls, - docker_status, - update_container_lib, - update_lib_requirements - ) - } - } - }; - }else{ - jobs[agent + '-' + board] = { - lock(lock_agent){ - oneNodeDocker( - agent, - num_stages, - stages, - board, - docker_image, - enable_update_boot_pre_docker, - pre_docker_cls, - docker_status, - update_container_lib, - update_lib_requirements - ) - } - }; - } - - } else{ - jobs[agent + '-' + board] = { oneNode(agent, num_stages, stages, board, docker_status) }; + println("Enable resource queueing") + jobs[agent + '-' + board] = { + lock(lock_name){ + oneNodeDocker( + agent, + num_stages, + stages, + board, + docker_image, + enable_update_boot_pre_docker, + pre_docker_cls, + docker_status, + update_container_lib, + update_lib_requirements + ) + } + }; + } else { + jobs[agent + '-' + board] = { + lock(lock_name) { + oneNode(agent, num_stages, stages, board, docker_status) + } + }; } } @@ -1294,22 +1272,6 @@ def set_iio_uri_baudrate(iio_uri_baudrate) { gauntEnv.iio_uri_baudrate = iio_uri_baudrate } -/** - * Set enable_resource_queuing. Set enable_resource_queuing. Set to true to enable - * @param enable_resource_queuing Boolean true to enable - */ -def set_enable_resource_queuing(enable_resource_queuing) { - gauntEnv.enable_resource_queuing = enable_resource_queuing -} - -/** - * Set lock_agent. Set to true to effectively use just one test executor on agents - * @param lock_agent Boolean true to enable - */ -def set_lock_agent(lock_agent) { - gauntEnv.lock_agent = lock_agent -} - /** * Set elastic server address. Setting will use a non-default elastic search server * @param elastic_server String of server IP diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index 71a2751f..72775742 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -41,9 +41,7 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo netbox_include_variants: true, netbox_include_children: true, enable_update_boot_pre_docker: false, - lock_agent: false, board_sub_categories : ['rx2tx2'], - enable_resource_queuing: false, setup_called: false, nebula_debug: false, nebula_local_fs_source_root: '/var/lib/tftpboot', From 38d756366317d63503161e53fdec43e9b9ed4b6f Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Tue, 22 Oct 2024 11:12:12 +0800 Subject: [PATCH 29/33] Revert "use device instead of devices" This reverts commit 7f15441e855424b1f457540d6ffc4adc995a59bd. --- src/sdg/Gauntlet.groovy | 6 +++--- vars/getGauntEnv.groovy | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 7c731d47..9d4dbbcd 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -110,9 +110,9 @@ private def update_agent() { + ' --netbox-port=' + gauntEnv.netbox_port + ' --netbox-baseurl=' + gauntEnv.netbox_base_url + ' --netbox-token=' + gauntEnv.netbox_token - + ' --device-status=' + gauntEnv.netbox_device_status - + ' --device-role=' + gauntEnv.netbox_device_role - + ' --device-tag=' + gauntEnv.netbox_device_tag + + ' --devices-status=' + gauntEnv.netbox_devices_status + + ' --devices-role=' + gauntEnv.netbox_devices_role + + ' --devices-tag=' + gauntEnv.netbox_devices_tag + ' --template=' + gauntEnv.netbox_nebula_template + custom + ' --outfile='+ agent_name, true, true, false) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index 59cf3a38..ddcec235 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -37,9 +37,9 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo netbox_port: '', netbox_base_url: '', netbox_token: '', - netbox_device_status: 'active', - netbox_device_role: 'fpga-dut', - netbox_device_tag: '', + netbox_devices_status: 'active', + netbox_devices_role: 'fpga-dut', + netbox_devices_tag: '', netbox_nebula_template: 'template_gen.yaml', netbox_include_variants: true, netbox_include_children: true, From 97e16f7a7ff40d4b03e3292974f11b47c9a38620 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Tue, 22 Oct 2024 13:43:06 +0800 Subject: [PATCH 30/33] modify generating of nebula-config command Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 33 ++++++++++++++++----------------- vars/getGauntEnv.groovy | 8 ++++---- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 9d4dbbcd..b3380da1 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -93,29 +93,28 @@ private def update_agent() { }else if(gauntEnv.nebula_config_source == 'netbox'){ run_i('mkdir nebula-config') dir('nebula-config'){ - def custom = "" + def custom = null if(gauntEnv.netbox_include_variants == false){ custom = custom + " --no-include-variants" } if(gauntEnv.netbox_include_children == false){ custom = custom + " --no-include-children" } - if(gauntEnv.netbox_test_agent == true){ - agent = "" - }else{ - agent = agent_name - } - nebula('gen-config-netbox --jenkins-agent=' + agent - + ' --netbox-ip=' + gauntEnv.netbox_ip - + ' --netbox-port=' + gauntEnv.netbox_port - + ' --netbox-baseurl=' + gauntEnv.netbox_base_url - + ' --netbox-token=' + gauntEnv.netbox_token - + ' --devices-status=' + gauntEnv.netbox_devices_status - + ' --devices-role=' + gauntEnv.netbox_devices_role - + ' --devices-tag=' + gauntEnv.netbox_devices_tag - + ' --template=' + gauntEnv.netbox_nebula_template - + custom - + ' --outfile='+ agent_name, true, true, false) + + def command_str = 'gen-config-netbox' + command_str += ' --netbox-ip=' + gauntEnv.netbox_ip + command_str += ' --netbox-port=' + gauntEnv.netbox_port + command_str += ' --netbox-baseurl=' + gauntEnv.netbox_base_url + command_str += ' --netbox-token=' + gauntEnv.netbox_token + command_str += (gauntEnv.netbox_test_agent == true)? "" : ' --jenkins-agent=' + agent_name + command_str += (gauntEnv.netbox_devices_status == null)? "" : ' --devices-status=' + gauntEnv.netbox_device_status + command_str += (gauntEnv.netbox_devices_role == null)? "" : ' --devices-role=' + gauntEnv.netbox_device_role + command_str += (gauntEnv.netbox_devices_tag == null)? "" : ' --devices-tag=' + gauntEnv.netbox_device_tag + command_str += (gauntEnv.netbox_nebula_template == null)? "" : ' --template=' + gauntEnv.netbox_nebula_template + command_str += (custom == null)? "" : custom + command_str += ' --outfile='+ agent_name + + nebula(command_str, true, true, false) } }else{ println(gauntEnv.nebula_config_source + ' as config source is not supported yet.') diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index ddcec235..e413c195 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -37,10 +37,10 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo netbox_port: '', netbox_base_url: '', netbox_token: '', - netbox_devices_status: 'active', - netbox_devices_role: 'fpga-dut', - netbox_devices_tag: '', - netbox_nebula_template: 'template_gen.yaml', + netbox_devices_status: null, + netbox_devices_role: null, + netbox_devices_tag: null, + netbox_nebula_template: null, netbox_include_variants: true, netbox_include_children: true, enable_update_boot_pre_docker: false, From 177c1d794d2de15033252d6cdf394871d69bdb37 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Tue, 22 Oct 2024 14:00:05 +0800 Subject: [PATCH 31/33] fix netbox fields name Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index b3380da1..cdb0fe49 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -107,9 +107,9 @@ private def update_agent() { command_str += ' --netbox-baseurl=' + gauntEnv.netbox_base_url command_str += ' --netbox-token=' + gauntEnv.netbox_token command_str += (gauntEnv.netbox_test_agent == true)? "" : ' --jenkins-agent=' + agent_name - command_str += (gauntEnv.netbox_devices_status == null)? "" : ' --devices-status=' + gauntEnv.netbox_device_status - command_str += (gauntEnv.netbox_devices_role == null)? "" : ' --devices-role=' + gauntEnv.netbox_device_role - command_str += (gauntEnv.netbox_devices_tag == null)? "" : ' --devices-tag=' + gauntEnv.netbox_device_tag + command_str += (gauntEnv.netbox_devices_status == null)? "" : ' --devices-status=' + gauntEnv.netbox_devices_status + command_str += (gauntEnv.netbox_devices_role == null)? "" : ' --devices-role=' + gauntEnv.netbox_devices_role + command_str += (gauntEnv.netbox_devices_tag == null)? "" : ' --devices-tag=' + gauntEnv.netbox_devices_tag command_str += (gauntEnv.netbox_nebula_template == null)? "" : ' --template=' + gauntEnv.netbox_nebula_template command_str += (custom == null)? "" : custom command_str += ' --outfile='+ agent_name From c1fb3fafcb35eeb70081fc77e159b59ceb42eaa9 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 24 Oct 2024 11:13:10 +0800 Subject: [PATCH 32/33] fix config generation when no variant or no children Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 6da92b54..b892cc6a 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -93,10 +93,10 @@ private def update_agent() { dir('nebula-config'){ def custom = null if(gauntEnv.netbox_include_variants == false){ - custom = custom + " --no-include-variants" + custom = " --no-include-variants" } if(gauntEnv.netbox_include_children == false){ - custom = custom + " --no-include-children" + custom = " --no-include-children" } def command_str = 'gen-config-netbox' From 775f37d904fa0e7cfe2d0e58ea23692fdb6d0377 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Thu, 24 Oct 2024 12:07:21 +0800 Subject: [PATCH 33/33] fix custom flag for nebula config command Signed-off-by: Trecia Agoylo --- src/sdg/Gauntlet.groovy | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index b892cc6a..b02d74c7 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -91,12 +91,15 @@ private def update_agent() { }else if(gauntEnv.nebula_config_source == 'netbox'){ run_i('mkdir nebula-config') dir('nebula-config'){ - def custom = null + def custom = "" if(gauntEnv.netbox_include_variants == false){ - custom = " --no-include-variants" + custom = custom + " --no-include-variants" } if(gauntEnv.netbox_include_children == false){ - custom = " --no-include-children" + custom = custom + " --no-include-children" + } + if(custom==""){ + custom = null } def command_str = 'gen-config-netbox'