From 3fd1f072f15cfd4e4910fb258818ce61aea999e8 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Sun, 21 Jul 2019 10:08:39 +0800 Subject: [PATCH] Speed up ci/e2e builds (#3130) * Make use of multi-thread builds of maven * Bump up maven version to get rid of parallel build bug * Apply the same to E2E tests * Apply the same to JavaDoc task * Revert E2E settings * Add maven tuning opts * Increase maven fork process memory --- .mvn/wrapper/maven-wrapper.properties | 2 +- Jenkinsfile | 10 ++++++++-- Jenkinsfile-E2E | 10 +++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 00d32aab1..ecd7f7d95 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1 +1 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip \ No newline at end of file +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip diff --git a/Jenkinsfile b/Jenkinsfile index 9ae471d10..02987bfc3 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,10 @@ pipeline { timeout time: 60, unit: 'MINUTES' } + environment { + MAVEN_OPTS = '-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -Xmx3g' + } + stages { stage('Install & Test') { parallel { @@ -60,8 +64,10 @@ pipeline { stage('Test & Report') { steps { - sh './mvnw -P"agent,backend,ui,dist,CI-with-IT" org.jacoco:jacoco-maven-plugin:0.8.3:prepare-agent clean install org.jacoco:jacoco-maven-plugin:0.8.3:report coveralls:report' - sh './mvnw javadoc:javadoc -Dmaven.test.skip=true' + // separate lightweight checks that don't support parallel run + sh './mvnw checkstyle:check apache-rat:check' + sh './mvnw -Dcheckstyle.skip -Drat.skip -T2 -Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -P"agent,backend,ui,dist,CI-with-IT" org.jacoco:jacoco-maven-plugin:0.8.3:prepare-agent clean install org.jacoco:jacoco-maven-plugin:0.8.3:report coveralls:report' + sh './mvnw -DskipTests -Dcheckstyle.skip -Drat.skip -T 2C javadoc:javadoc' } } } diff --git a/Jenkinsfile-E2E b/Jenkinsfile-E2E index 2d1967412..e3646ea7f 100644 --- a/Jenkinsfile-E2E +++ b/Jenkinsfile-E2E @@ -25,6 +25,10 @@ pipeline { jdk 'JDK 1.8 (latest)' } + environment { + MAVEN_OPTS = '-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -Xmx3g' + } + stages { stage('Checkout Source Code') { steps { @@ -36,7 +40,11 @@ pipeline { stage('Prepare Distribution Package') { steps { - sh './mvnw -DskipTests clean package' + // although these checks are done in ci-it, since they are lightweight/cheap + // we're using them as a barrier here to filter out some invalid PRs (fast-fail) + // thus save unnecessary E2E builds(which is expensive) + sh './mvnw checkstyle:check apache-rat:check' + sh './mvnw -Dcheckstyle.skip -Drat.skip -T2 -Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean package' sh 'tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist' } }