From 3b0c1b98a1ee551aba9888ff1baa36fd8431d15c Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 26 Jan 2020 18:44:03 +0000 Subject: [PATCH 1/6] switch to new version of plugin --- .ci/dev/localStorageClass.yml | 5 +++++ build.gradle | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .ci/dev/localStorageClass.yml diff --git a/.ci/dev/localStorageClass.yml b/.ci/dev/localStorageClass.yml new file mode 100644 index 0000000000..f380c51dbe --- /dev/null +++ b/.ci/dev/localStorageClass.yml @@ -0,0 +1,5 @@ +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: testing-storage +provisioner: microk8s.io/hostpath \ No newline at end of file diff --git a/build.gradle b/build.gradle index bdb66ed4ec..e5dcc0f818 100644 --- a/build.gradle +++ b/build.gradle @@ -183,7 +183,7 @@ buildscript { // Capsule gradle plugin forked and maintained locally to support Gradle 5.x // See https://github.com/corda/gradle-capsule-plugin classpath "us.kirchmeier:gradle-capsule-plugin:1.0.4_r3" - classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: "1.2-SNAPSHOT", changing: true + classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: "1.2-LOCAL-SNAPSHOT", changing: true classpath "com.bmuschko:gradle-docker-plugin:5.0.0" } } From d9f638260ca805881e689f27301bd5e8257dbbe0 Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 26 Jan 2020 19:01:49 +0000 Subject: [PATCH 2/6] change plugin version to force refresh --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e5dcc0f818..724ea70799 100644 --- a/build.gradle +++ b/build.gradle @@ -183,7 +183,7 @@ buildscript { // Capsule gradle plugin forked and maintained locally to support Gradle 5.x // See https://github.com/corda/gradle-capsule-plugin classpath "us.kirchmeier:gradle-capsule-plugin:1.0.4_r3" - classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: "1.2-LOCAL-SNAPSHOT", changing: true + classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: "1.2-LOCAL-K8s-SNAPSHOT", changing: true classpath "com.bmuschko:gradle-docker-plugin:5.0.0" } } From 6435a132e49269679cb63248d5b08dd9cca89ae7 Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 26 Jan 2020 20:27:19 +0000 Subject: [PATCH 3/6] try using pre-populated cache --- Jenkinsfile | 8 ++++---- build.gradle | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dcd0522239..6fd3f917a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ import static com.r3.build.BuildControl.killAllExistingBuildsForJob killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) pipeline { - agent { label 'k8s' } + agent { label 'local-k8s' } options { timestamps() } environment { @@ -24,7 +24,7 @@ pipeline { "-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " + "-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " + "-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\"" + - " clean pushBuildImage preAllocateForAllParallelIntegrationTest preAllocateForAllParallelUnitTest --stacktrace" + " clean pushBuildImage preAllocateForAllParallelIntegrationTest --stacktrace" } sh "kubectl auth can-i get pods" } @@ -42,7 +42,7 @@ pipeline { "-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " + "-Dgit.branch=\"\${GIT_BRANCH}\" " + "-Dgit.target.branch=\"\${CHANGE_TARGET}\" " + - " deAllocateForAllParallelIntegrationTest allParallelIntegrationTest --stacktrace" + " allParallelIntegrationTest --stacktrace" } } stage('Unit Tests') { @@ -55,7 +55,7 @@ pipeline { "-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " + "-Dgit.branch=\"\${GIT_BRANCH}\" " + "-Dgit.target.branch=\"\${CHANGE_TARGET}\" " + - " deAllocateForAllParallelUnitTest allParallelUnitTest --stacktrace" + " allParallelUnitTest --stacktrace" } } } diff --git a/build.gradle b/build.gradle index 724ea70799..804f3897b7 100644 --- a/build.gradle +++ b/build.gradle @@ -183,7 +183,7 @@ buildscript { // Capsule gradle plugin forked and maintained locally to support Gradle 5.x // See https://github.com/corda/gradle-capsule-plugin classpath "us.kirchmeier:gradle-capsule-plugin:1.0.4_r3" - classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: "1.2-LOCAL-K8s-SNAPSHOT", changing: true + classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: "1.2-LOCAL-K8S-SHARED-CACHE-SNAPSHOT", changing: true classpath "com.bmuschko:gradle-docker-plugin:5.0.0" } } From 8c6904e9ef2efc24c852f4076a90ec8bcfb6af3f Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 26 Jan 2020 21:11:59 +0000 Subject: [PATCH 4/6] do not preallocate --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6fd3f917a6..0b1039cb5d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { "-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " + "-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " + "-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\"" + - " clean pushBuildImage preAllocateForAllParallelIntegrationTest --stacktrace" + " clean pushBuildImage --stacktrace" } sh "kubectl auth can-i get pods" } From 4465c15d396d3d1e700e1e3fa38fb61888668cef Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 26 Jan 2020 21:16:55 +0000 Subject: [PATCH 5/6] no daemon --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0b1039cb5d..4c679de085 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { stage('Corda Pull Request - Generate Build Image') { steps { withCredentials([string(credentialsId: 'container_reg_passwd', variable: 'DOCKER_PUSH_PWD')]) { - sh "./gradlew " + + sh "./gradlew --no-daemon " + "-Dkubenetize=true " + "-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " + "-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " + @@ -34,7 +34,7 @@ pipeline { parallel { stage('Integration Tests') { steps { - sh "./gradlew " + + sh "./gradlew --no-daemon " + "-DbuildId=\"\${BUILD_ID}\" " + "-Dkubenetize=true " + "-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " + @@ -47,7 +47,7 @@ pipeline { } stage('Unit Tests') { steps { - sh "./gradlew " + + sh "./gradlew --no-daemon " + "-DbuildId=\"\${BUILD_ID}\" " + "-Dkubenetize=true " + "-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " + From 7af363d1a6ace73507c5b57e8c649a160deb188a Mon Sep 17 00:00:00 2001 From: stefano Date: Mon, 27 Jan 2020 09:14:27 +0000 Subject: [PATCH 6/6] reduce cores per fork to increase parallelism --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 804f3897b7..f12fb23445 100644 --- a/build.gradle +++ b/build.gradle @@ -634,7 +634,7 @@ task allParallelIntegrationTest(type: ParallelTestGroup) { testGroups "integrationTest" numberOfShards 10 streamOutput false - coresPerFork 5 + coresPerFork 4 memoryInGbPerFork 12 distribute DistributeTestsBy.METHOD nodeTaints "big"