Skip to content

Commit eeb36db

Browse files
authored
Partition muzzle tasks with the same method as build and tests (#9077)
1 parent 1de42c8 commit eeb36db

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,14 @@ muzzle:
392392
extends: .gradle_build
393393
needs: [ build_tests ]
394394
stage: tests
395-
parallel: 8
395+
parallel:
396+
matrix:
397+
- CI_SPLIT: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
396398
variables:
397399
CACHE_TYPE: inst
398400
script:
399401
- export SKIP_BUILDSCAN="true"
400-
- ./gradlew writeMuzzleTasksToFile $GRADLE_ARGS
401-
- sort workspace/build/muzzleTasks > sortedMuzzleTasks
402-
- split --number=l/$NORMALIZED_NODE_TOTAL --suffix-length=1 --numeric-suffixes sortedMuzzleTasks muzzleSplit
403-
- ./gradlew $(cat muzzleSplit${NORMALIZED_NODE_INDEX} | xargs) $GRADLE_ARGS
402+
- ./gradlew :runMuzzle -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
404403
after_script:
405404
- *cgroup_info
406405
- source .gitlab/gitlab-utils.sh

build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,6 @@ wrapper {
121121
distributionType = Wrapper.DistributionType.ALL
122122
}
123123

124-
tasks.register('writeMuzzleTasksToFile') {
125-
doLast {
126-
def muzzleFile = file("${buildDir}/muzzleTasks")
127-
assert muzzleFile.parentFile.mkdirs() || muzzleFile.parentFile.directory
128-
129-
muzzleFile.text = subprojects.findAll { subproject -> subproject.plugins.hasPlugin('muzzle') }
130-
.collect { it.path + ":muzzle" }
131-
.join('\n')
132-
}
133-
}
134-
135124
def writeMainVersionFileTask = tasks.register('writeMainVersionFile') {
136125
def versionFile = file("${rootProject.buildDir}/main.version")
137126
inputs.property "version", scmVersion.version

gradle/ci_jobs.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,8 @@ testAggregate("base", [":"], [
188188
":dd-java-agent:agent-profiling",
189189
":dd-java-agent:agent-debugger"
190190
])
191+
192+
193+
tasks.register('runMuzzle') {
194+
dependsOn subprojects.findAll { p -> p.activePartition && p.plugins.hasPlugin('muzzle') }.collect { p -> p.path + ":muzzle" }
195+
}

0 commit comments

Comments
 (0)