Split muzzle across multiple executors (DataDog/dd-trace-java#1549)
MODIFY
.circleci/config.yml
.circleci/config.yml
@@ -175,15 +175,22 @@ jobs:
muzzle:
<<: *defaults
+ parallelism: 8
steps:
- checkout
# We are not running with a cache here because it gets very big and ends up taking more time
# restoring/saving than the actual increase in time it takes just downloading the artifacts each time.
+ - run:
+ name: Gather muzzle tasks
+ command: SKIP_BUILDSCAN="true" ./gradlew writeMuzzleTasksToFile --stacktrace --no-daemon
- run:
name: Verify Muzzle
- command: SKIP_BUILDSCAN="true" GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx4G -Xms64M' -Dota.forkedMaxHeapSize=4G -Dota.forkedMinHeapSize=64M" ./gradlew muzzle --parallel --stacktrace --no-daemon --max-workers=16
+ command: >-
+ SKIP_BUILDSCAN="true"
+ GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx4G -Xms64M' -Dota.forkedMaxHeapSize=4G -Dota.forkedMinHeapSize=64M"
+ ./gradlew `circleci tests split workspace/build/muzzleTasks | xargs` --parallel --stacktrace --no-daemon --max-workers=16
publish: &publish
<<: *defaults

MODIFY
build.gradle
build.gradle
@@ -55,3 +55,15 @@ allprojects {
jvmArgs "-XX:ErrorFile=/tmp/hs_err_pid%p.log"
}
}
+
+// Writes tasks to file allowing us to leverage CircleCI's file based task parallelization
+task writeMuzzleTasksToFile {
+ doLast {
+ def muzzleFile = file("${buildDir}/muzzleTasks")
+ assert muzzleFile.parentFile.mkdirs() || muzzleFile.parentFile.directory
+
+ muzzleFile.text = subprojects.findAll { subproject -> subproject.plugins.hasPlugin('muzzle') }
+ .collect { it.path + ":muzzle" }
+ .join('\n')
+ }
+}

MODIFY
buildSrc/src/main/groovy/MuzzlePlugin.groovy
buildSrc/src/main/groovy/MuzzlePlugin.groovy
@@ -33,7 +33,7 @@ class MuzzlePlugin implements Plugin<Project> {
/**
* Select a random set of versions to test
*/
- private static final int RANGE_COUNT_LIMIT = 10
+ private static final int RANGE_COUNT_LIMIT = 25
/**
* Remote repositories used to query version ranges and fetch dependencies
*/

Split muzzle across multiple executors (DataDog/dd-trace-java#1549)