Skip to content

Partition muzzle tasks with the same method as build and tests #9077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,14 @@ muzzle:
extends: .gradle_build
needs: [ build_tests ]
stage: tests
parallel: 8
parallel:
matrix:
- CI_SPLIT: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
variables:
CACHE_TYPE: inst
script:
- export SKIP_BUILDSCAN="true"
- ./gradlew writeMuzzleTasksToFile $GRADLE_ARGS
- sort workspace/build/muzzleTasks > sortedMuzzleTasks
- split --number=l/$NORMALIZED_NODE_TOTAL --suffix-length=1 --numeric-suffixes sortedMuzzleTasks muzzleSplit
- ./gradlew $(cat muzzleSplit${NORMALIZED_NODE_INDEX} | xargs) $GRADLE_ARGS
- ./gradlew :runMuzzle -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
after_script:
- *cgroup_info
- source .gitlab/gitlab-utils.sh
Expand Down
11 changes: 0 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@ wrapper {
distributionType = Wrapper.DistributionType.ALL
}

tasks.register('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')
}
}

def writeMainVersionFileTask = tasks.register('writeMainVersionFile') {
def versionFile = file("${rootProject.buildDir}/main.version")
inputs.property "version", scmVersion.version
Expand Down
5 changes: 5 additions & 0 deletions gradle/ci_jobs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,8 @@ testAggregate("base", [":"], [
":dd-java-agent:agent-profiling",
":dd-java-agent:agent-debugger"
])


tasks.register('runMuzzle') {
dependsOn subprojects.findAll { p -> p.activePartition && p.plugins.hasPlugin('muzzle') }.collect { p -> p.path + ":muzzle" }
}