From 3cc7869706b93bddf17d900ec1e320e473a8d9d2 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 16:01:44 -0500 Subject: [PATCH 01/13] Print ncores --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0f6725d29eb..562d4f90b80 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,6 +65,13 @@ def rocmtestnode(Map conf) { checkout scm } + NCORES = sh ( + script: 'nproc', + returnStdout: true + ).trim() + + echo "ncores = {NCORES}" + gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') { withCredentials([usernamePassword(credentialsId: 'docker_test_cred', passwordVariable: 'DOCKERHUB_PASS', usernameVariable: 'DOCKERHUB_USER')]) { sh "echo $DOCKERHUB_PASS | docker login --username $DOCKERHUB_USER --password-stdin" From c8199e25df88944bead3aee783f172168c24bbc4 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 16:41:34 -0500 Subject: [PATCH 02/13] Print ncores --- Jenkinsfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 562d4f90b80..7b9d97256d1 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,7 +70,15 @@ def rocmtestnode(Map conf) { returnStdout: true ).trim() - echo "ncores = {NCORES}" + echo "ncores = ${NCORES}" + if ${NCORES} > 64 { + MAXTIMEOUT = 2 + } else { + MAXTIMEOUT = 3 + } + + echo "Timeout will be ${MAXTIMEOUT} + gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') { withCredentials([usernamePassword(credentialsId: 'docker_test_cred', passwordVariable: 'DOCKERHUB_PASS', usernameVariable: 'DOCKERHUB_USER')]) { @@ -78,7 +86,7 @@ def rocmtestnode(Map conf) { pre() sh "docker pull ${DOCKER_IMAGE}:${env.IMAGE_TAG}" withDockerContainer(image: "${DOCKER_IMAGE}:${env.IMAGE_TAG}", args: "--device=/dev/kfd --device=/dev/dri --group-add video --cap-add SYS_PTRACE -v=/home/jenkins/:/home/jenkins ${docker_args}") { - timeout(time: 2, unit: 'HOURS') { + timeout(time: ${MAXTIMEOUT}, unit: 'HOURS') { body(cmake_build) } } From a36f86cb6fd3e3db1cf06a7c86bd0e300ea5b9bd Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 16:43:04 -0500 Subject: [PATCH 03/13] Add if check --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7b9d97256d1..5f605917f96 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,7 +71,7 @@ def rocmtestnode(Map conf) { ).trim() echo "ncores = ${NCORES}" - if ${NCORES} > 64 { + if (${NCORES} > 64) { MAXTIMEOUT = 2 } else { MAXTIMEOUT = 3 From 72a7a708da67bc1c1e0bf93ddf5c785a4d03309b Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 16:44:11 -0500 Subject: [PATCH 04/13] Add if check --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5f605917f96..4fc363c7aa4 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -77,7 +77,7 @@ def rocmtestnode(Map conf) { MAXTIMEOUT = 3 } - echo "Timeout will be ${MAXTIMEOUT} + echo "Timeout will be ${MAXTIMEOUT}" gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') { From 02b5bc0c1dbfbc762f735c97d81e3ba2c203f9f5 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 16:58:36 -0500 Subject: [PATCH 05/13] fix if check --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4fc363c7aa4..d66ce311978 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,7 +71,7 @@ def rocmtestnode(Map conf) { ).trim() echo "ncores = ${NCORES}" - if (${NCORES} > 64) { + if (NCORES > 64) { MAXTIMEOUT = 2 } else { MAXTIMEOUT = 3 From 3780bfe4d2ec5d0cd932b34ab009b2b76f83ca5d Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 17:13:13 -0500 Subject: [PATCH 06/13] string vs int issues --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d66ce311978..dc02294d264 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,10 +71,13 @@ def rocmtestnode(Map conf) { ).trim() echo "ncores = ${NCORES}" - if (NCORES > 64) { - MAXTIMEOUT = 2 + + def working_cores = ${NCORES} as int + + if ( working_cores > 64) { + def MAXTIMEOUT = 2 } else { - MAXTIMEOUT = 3 + def MAXTIMEOUT = 3 } echo "Timeout will be ${MAXTIMEOUT}" From 731ba724d55b60543255a4f10f59d7f3879c469d Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 18:13:34 -0500 Subject: [PATCH 07/13] string vs int issues --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dc02294d264..441bfca3511 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,11 +72,13 @@ def rocmtestnode(Map conf) { echo "ncores = ${NCORES}" - def working_cores = ${NCORES} as int + def working_cores = "${NCORES}" as int - if ( working_cores > 64) { + if ( working_cores > 64) { + echo "Setting timeout to 2" def MAXTIMEOUT = 2 } else { + echo "Setting timeout to 3" def MAXTIMEOUT = 3 } From 73ab8fba2ad9dd33841afc05de5f1501c2581caf Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 18:20:04 -0500 Subject: [PATCH 08/13] string vs int issues --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 441bfca3511..61a658b7da1 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,10 +76,10 @@ def rocmtestnode(Map conf) { if ( working_cores > 64) { echo "Setting timeout to 2" - def MAXTIMEOUT = 2 + int MAXTIMEOUT = 3 } else { echo "Setting timeout to 3" - def MAXTIMEOUT = 3 + int MAXTIMEOUT = 4 } echo "Timeout will be ${MAXTIMEOUT}" From adcf205020cad82e7d83a13c6a2b4092a462dc07 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 18:28:00 -0500 Subject: [PATCH 09/13] string vs int issues --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 61a658b7da1..9e6987f4808 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,11 +75,13 @@ def rocmtestnode(Map conf) { def working_cores = "${NCORES}" as int if ( working_cores > 64) { - echo "Setting timeout to 2" + echo "Setting timeout to 3" int MAXTIMEOUT = 3 + echo "Done" } else { - echo "Setting timeout to 3" + echo "Setting timeout to 4" int MAXTIMEOUT = 4 + echo "Done" } echo "Timeout will be ${MAXTIMEOUT}" From 95ddac67ee2d8debaa8ebe44141e924a2bc55633 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Mon, 2 Dec 2024 18:32:14 -0500 Subject: [PATCH 10/13] string vs int issues --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9e6987f4808..ebb350e3873 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -83,9 +83,7 @@ def rocmtestnode(Map conf) { int MAXTIMEOUT = 4 echo "Done" } - - echo "Timeout will be ${MAXTIMEOUT}" - + println("The value of max timeout is " + MAXTIMEOUT) gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') { withCredentials([usernamePassword(credentialsId: 'docker_test_cred', passwordVariable: 'DOCKERHUB_PASS', usernameVariable: 'DOCKERHUB_USER')]) { @@ -93,7 +91,7 @@ def rocmtestnode(Map conf) { pre() sh "docker pull ${DOCKER_IMAGE}:${env.IMAGE_TAG}" withDockerContainer(image: "${DOCKER_IMAGE}:${env.IMAGE_TAG}", args: "--device=/dev/kfd --device=/dev/dri --group-add video --cap-add SYS_PTRACE -v=/home/jenkins/:/home/jenkins ${docker_args}") { - timeout(time: ${MAXTIMEOUT}, unit: 'HOURS') { + timeout(time: MAXTIMEOUT, unit: 'HOURS') { body(cmake_build) } } From f6fff5b96a78be5aad0489181fd7007f85876f80 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Tue, 3 Dec 2024 14:40:17 -0500 Subject: [PATCH 11/13] type check problem --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ebb350e3873..207e0c0cf11 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,11 +76,11 @@ def rocmtestnode(Map conf) { if ( working_cores > 64) { echo "Setting timeout to 3" - int MAXTIMEOUT = 3 + def MAXTIMEOUT = 3 echo "Done" } else { echo "Setting timeout to 4" - int MAXTIMEOUT = 4 + def MAXTIMEOUT = 4 echo "Done" } println("The value of max timeout is " + MAXTIMEOUT) From d3cc9bee32277c50b5e6dd3ef39e3722d5c3c525 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Tue, 3 Dec 2024 14:46:37 -0500 Subject: [PATCH 12/13] Final print --- Jenkinsfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 207e0c0cf11..485cb7156a3 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,20 +70,15 @@ def rocmtestnode(Map conf) { returnStdout: true ).trim() - echo "ncores = ${NCORES}" - def working_cores = "${NCORES}" as int if ( working_cores > 64) { - echo "Setting timeout to 3" def MAXTIMEOUT = 3 - echo "Done" } else { - echo "Setting timeout to 4" def MAXTIMEOUT = 4 - echo "Done" } - println("The value of max timeout is " + MAXTIMEOUT) + echo "Cores on server = ${NCORES}, Setting timeout to ${MAXTIMEOUT} hours" + println("Cores on server = " + ${NCORES} + ", Setting timeout to " + ${MAXTIMEOUT} + " hours" gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') { withCredentials([usernamePassword(credentialsId: 'docker_test_cred', passwordVariable: 'DOCKERHUB_PASS', usernameVariable: 'DOCKERHUB_USER')]) { From d4eae06c7ecf9aff7e406b24990292ddd3d70791 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Tue, 3 Dec 2024 14:56:15 -0500 Subject: [PATCH 13/13] Final print --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 485cb7156a3..95831c8ef23 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,7 +78,7 @@ def rocmtestnode(Map conf) { def MAXTIMEOUT = 4 } echo "Cores on server = ${NCORES}, Setting timeout to ${MAXTIMEOUT} hours" - println("Cores on server = " + ${NCORES} + ", Setting timeout to " + ${MAXTIMEOUT} + " hours" + println("Cores on server = " + ${NCORES} + ", Setting timeout to " + ${MAXTIMEOUT} + " hours") gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') { withCredentials([usernamePassword(credentialsId: 'docker_test_cred', passwordVariable: 'DOCKERHUB_PASS', usernameVariable: 'DOCKERHUB_USER')]) {