Splitup x-pack testing in more build steps (#101987)
We want to keep pull request and intake build time as short as possible. While testing this I noticed though that all those checkPartX runs are basically building core modules e.g. like :server by themself not leveraging the gradle cache ideally as all 4 checkPart jobs running in parallel likely run :server:compileJava in parallel. Not sure this is a big deal. I remember within the gradle team we had similar issues and addressed this by quick dedicated "populating build cache" pipeline steps. Not something we need to look into now, but at one point investigating this approach might be valuable for certain scenarios.
This commit is contained in:
parent
c303ab885a
commit
3d6ba88531
|
@ -32,6 +32,14 @@ steps:
|
||||||
image: family/elasticsearch-ubuntu-2004
|
image: family/elasticsearch-ubuntu-2004
|
||||||
machineType: n1-standard-32
|
machineType: n1-standard-32
|
||||||
buildDirectory: /dev/shm/bk
|
buildDirectory: /dev/shm/bk
|
||||||
|
- label: part4
|
||||||
|
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files checkPart4
|
||||||
|
timeout_in_minutes: 300
|
||||||
|
agents:
|
||||||
|
provider: gcp
|
||||||
|
image: family/elasticsearch-ubuntu-2004
|
||||||
|
machineType: n1-standard-32
|
||||||
|
buildDirectory: /dev/shm/bk
|
||||||
- group: bwc-snapshots
|
- group: bwc-snapshots
|
||||||
steps:
|
steps:
|
||||||
- label: "{{matrix.BWC_VERSION}} / bwc-snapshots"
|
- label: "{{matrix.BWC_VERSION}} / bwc-snapshots"
|
||||||
|
|
|
@ -33,6 +33,14 @@ steps:
|
||||||
image: family/elasticsearch-ubuntu-2004
|
image: family/elasticsearch-ubuntu-2004
|
||||||
machineType: n1-standard-32
|
machineType: n1-standard-32
|
||||||
buildDirectory: /dev/shm/bk
|
buildDirectory: /dev/shm/bk
|
||||||
|
- label: part4
|
||||||
|
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files checkPart4
|
||||||
|
timeout_in_minutes: 300
|
||||||
|
agents:
|
||||||
|
provider: gcp
|
||||||
|
image: family/elasticsearch-ubuntu-2004
|
||||||
|
machineType: n1-standard-32
|
||||||
|
buildDirectory: /dev/shm/bk
|
||||||
- group: bwc-snapshots
|
- group: bwc-snapshots
|
||||||
steps:
|
steps:
|
||||||
- label: "{{matrix.BWC_VERSION}} / bwc-snapshots"
|
- label: "{{matrix.BWC_VERSION}} / bwc-snapshots"
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
config:
|
||||||
|
allow-labels: "Team:Security"
|
||||||
|
steps:
|
||||||
|
- label: part-4-fips
|
||||||
|
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart4
|
||||||
|
timeout_in_minutes: 300
|
||||||
|
agents:
|
||||||
|
provider: gcp
|
||||||
|
image: family/elasticsearch-ubuntu-2004
|
||||||
|
machineType: custom-32-98304
|
||||||
|
buildDirectory: /dev/shm/bk
|
|
@ -0,0 +1,14 @@
|
||||||
|
config:
|
||||||
|
allow-labels: "test-windows"
|
||||||
|
steps:
|
||||||
|
- label: part-4-windows
|
||||||
|
command: .\.buildkite\scripts\run-script.ps1 bash .buildkite/scripts/windows-run-gradle.sh
|
||||||
|
timeout_in_minutes: 300
|
||||||
|
agents:
|
||||||
|
provider: gcp
|
||||||
|
image: family/elasticsearch-windows-2022
|
||||||
|
machineType: custom-32-98304
|
||||||
|
diskType: pd-ssd
|
||||||
|
diskSizeGb: 350
|
||||||
|
env:
|
||||||
|
GRADLE_TASK: checkPart4
|
|
@ -0,0 +1,11 @@
|
||||||
|
config:
|
||||||
|
skip-target-branches: "7.17"
|
||||||
|
steps:
|
||||||
|
- label: part-4
|
||||||
|
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed checkPart4
|
||||||
|
timeout_in_minutes: 300
|
||||||
|
agents:
|
||||||
|
provider: gcp
|
||||||
|
image: family/elasticsearch-ubuntu-2004
|
||||||
|
machineType: custom-32-98304
|
||||||
|
buildDirectory: /dev/shm/bk
|
28
build.gradle
28
build.gradle
|
@ -161,8 +161,10 @@ tasks.register("verifyVersions") {
|
||||||
String versionMapping = backportConfig.get("branchLabelMapping").fields().find { it.value.textValue() == 'main' }.key
|
String versionMapping = backportConfig.get("branchLabelMapping").fields().find { it.value.textValue() == 'main' }.key
|
||||||
String expectedMapping = "^v${versions.elasticsearch.replaceAll('-SNAPSHOT', '')}\$"
|
String expectedMapping = "^v${versions.elasticsearch.replaceAll('-SNAPSHOT', '')}\$"
|
||||||
if (versionMapping != expectedMapping) {
|
if (versionMapping != expectedMapping) {
|
||||||
throw new GradleException("Backport label mapping for branch 'main' is '${versionMapping}' but should be " +
|
throw new GradleException(
|
||||||
"'${expectedMapping}'. Update .backportrc.json.")
|
"Backport label mapping for branch 'main' is '${versionMapping}' but should be " +
|
||||||
|
"'${expectedMapping}'. Update .backportrc.json."
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,9 +213,9 @@ allprojects {
|
||||||
project.ext {
|
project.ext {
|
||||||
// for ide hacks...
|
// for ide hacks...
|
||||||
isEclipse = providers.systemProperty("eclipse.launcher").isPresent() || // Detects gradle launched from Eclipse's IDE
|
isEclipse = providers.systemProperty("eclipse.launcher").isPresent() || // Detects gradle launched from Eclipse's IDE
|
||||||
providers.systemProperty("eclipse.application").isPresent() || // Detects gradle launched from the Eclipse compiler server
|
providers.systemProperty("eclipse.application").isPresent() || // Detects gradle launched from the Eclipse compiler server
|
||||||
gradle.startParameter.taskNames.contains('eclipse') || // Detects gradle launched from the command line to do eclipse stuff
|
gradle.startParameter.taskNames.contains('eclipse') || // Detects gradle launched from the command line to do eclipse stuff
|
||||||
gradle.startParameter.taskNames.contains('cleanEclipse')
|
gradle.startParameter.taskNames.contains('cleanEclipse')
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.bwc_tests_enabled = bwc_tests_enabled
|
ext.bwc_tests_enabled = bwc_tests_enabled
|
||||||
|
@ -229,10 +231,10 @@ allprojects {
|
||||||
eclipse.classpath.file.whenMerged { classpath ->
|
eclipse.classpath.file.whenMerged { classpath ->
|
||||||
if (false == forbiddenApisTest.bundledSignatures.contains('jdk-non-portable')) {
|
if (false == forbiddenApisTest.bundledSignatures.contains('jdk-non-portable')) {
|
||||||
classpath.entries
|
classpath.entries
|
||||||
.findAll { it.kind == "con" && it.toString().contains("org.eclipse.jdt.launching.JRE_CONTAINER") }
|
.findAll { it.kind == "con" && it.toString().contains("org.eclipse.jdt.launching.JRE_CONTAINER") }
|
||||||
.each {
|
.each {
|
||||||
it.accessRules.add(new AccessRule("accessible", "com/sun/net/httpserver/*"))
|
it.accessRules.add(new AccessRule("accessible", "com/sun/net/httpserver/*"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,6 +250,8 @@ allprojects {
|
||||||
plugins.withId('lifecycle-base') {
|
plugins.withId('lifecycle-base') {
|
||||||
if (project.path.startsWith(":x-pack:")) {
|
if (project.path.startsWith(":x-pack:")) {
|
||||||
if (project.path.contains("security") || project.path.contains(":ml")) {
|
if (project.path.contains("security") || project.path.contains(":ml")) {
|
||||||
|
tasks.register('checkPart4') { dependsOn 'check' }
|
||||||
|
} else if (project.path == ":x-pack:plugin" || project.path.contains("ql") || project.path.contains("smoke-test")) {
|
||||||
tasks.register('checkPart3') { dependsOn 'check' }
|
tasks.register('checkPart3') { dependsOn 'check' }
|
||||||
} else {
|
} else {
|
||||||
tasks.register('checkPart2') { dependsOn 'check' }
|
tasks.register('checkPart2') { dependsOn 'check' }
|
||||||
|
@ -256,7 +260,7 @@ allprojects {
|
||||||
tasks.register('checkPart1') { dependsOn 'check' }
|
tasks.register('checkPart1') { dependsOn 'check' }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register('functionalTests') { dependsOn 'check'}
|
tasks.register('functionalTests') { dependsOn 'check' }
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -281,7 +285,7 @@ allprojects {
|
||||||
// :test:framework:test cannot run before and after :server:test
|
// :test:framework:test cannot run before and after :server:test
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
tasks.matching { it.name.equals('integTest')}.configureEach {integTestTask ->
|
tasks.matching { it.name.equals('integTest') }.configureEach { integTestTask ->
|
||||||
integTestTask.mustRunAfter tasks.matching { it.name.equals("test") }
|
integTestTask.mustRunAfter tasks.matching { it.name.equals("test") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,7 +294,7 @@ allprojects {
|
||||||
Project upstreamProject = dep.dependencyProject
|
Project upstreamProject = dep.dependencyProject
|
||||||
if (project.path != upstreamProject?.path) {
|
if (project.path != upstreamProject?.path) {
|
||||||
for (String taskName : ['test', 'integTest']) {
|
for (String taskName : ['test', 'integTest']) {
|
||||||
project.tasks.matching { it.name == taskName }.configureEach {task ->
|
project.tasks.matching { it.name == taskName }.configureEach { task ->
|
||||||
task.shouldRunAfter(upstreamProject.tasks.matching { upStreamTask -> upStreamTask.name == taskName })
|
task.shouldRunAfter(upstreamProject.tasks.matching { upStreamTask -> upStreamTask.name == taskName })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue