Skip to content

Commit 4446d80

Browse files
Merge branch 'main' into add-gradlew-retries
2 parents 1ce49ec + b6f876f commit 4446d80

File tree

1,311 files changed

+41826
-11787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,311 files changed

+41826
-11787
lines changed

.buildkite/pipelines/periodic.template.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ steps:
4949
- checkPart1
5050
- checkPart2
5151
- checkPart3
52-
- bwcTestSnapshots
5352
- checkRestCompat
5453
agents:
5554
provider: gcp
@@ -59,6 +58,22 @@ steps:
5958
env:
6059
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
6160
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
61+
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-fips-matrix-bwc"
62+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dtests.fips.enabled=true v$$BWC_VERSION#bwcTest
63+
timeout_in_minutes: 300
64+
matrix:
65+
setup:
66+
ES_RUNTIME_JAVA:
67+
- openjdk17
68+
BWC_VERSION: $BWC_LIST
69+
agents:
70+
provider: gcp
71+
image: family/elasticsearch-ubuntu-2004
72+
machineType: n1-standard-32
73+
buildDirectory: /dev/shm/bk
74+
env:
75+
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
76+
BWC_VERSION: "{{matrix.BWC_VERSION}}"
6277
- group: java-matrix
6378
steps:
6479
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.GRADLE_TASK}} / java-matrix"
@@ -69,16 +84,12 @@ steps:
6984
ES_RUNTIME_JAVA:
7085
- graalvm-ce17
7186
- openjdk17
72-
- openjdk18
73-
- openjdk19
74-
- openjdk20
7587
- openjdk21
7688
- openjdk22
7789
GRADLE_TASK:
7890
- checkPart1
7991
- checkPart2
8092
- checkPart3
81-
- bwcTestSnapshots
8293
- checkRestCompat
8394
agents:
8495
provider: gcp
@@ -88,6 +99,25 @@ steps:
8899
env:
89100
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
90101
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
102+
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-matrix-bwc"
103+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$$BWC_VERSION#bwcTest
104+
timeout_in_minutes: 300
105+
matrix:
106+
setup:
107+
ES_RUNTIME_JAVA:
108+
- graalvm-ce17
109+
- openjdk17
110+
- openjdk21
111+
- openjdk22
112+
BWC_VERSION: $BWC_LIST
113+
agents:
114+
provider: gcp
115+
image: family/elasticsearch-ubuntu-2004
116+
machineType: n1-standard-32
117+
buildDirectory: /dev/shm/bk
118+
env:
119+
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
120+
BWC_VERSION: "{{matrix.BWC_VERSION}}"
91121
- label: release-tests
92122
command: .buildkite/scripts/release-tests.sh
93123
timeout_in_minutes: 360

.buildkite/pipelines/periodic.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,6 @@ steps:
12301230
- checkPart1
12311231
- checkPart2
12321232
- checkPart3
1233-
- bwcTestSnapshots
12341233
- checkRestCompat
12351234
agents:
12361235
provider: gcp
@@ -1240,6 +1239,22 @@ steps:
12401239
env:
12411240
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
12421241
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
1242+
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-fips-matrix-bwc"
1243+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dtests.fips.enabled=true v$$BWC_VERSION#bwcTest
1244+
timeout_in_minutes: 300
1245+
matrix:
1246+
setup:
1247+
ES_RUNTIME_JAVA:
1248+
- openjdk17
1249+
BWC_VERSION: ["7.17.19", "8.12.3", "8.13.0", "8.14.0"]
1250+
agents:
1251+
provider: gcp
1252+
image: family/elasticsearch-ubuntu-2004
1253+
machineType: n1-standard-32
1254+
buildDirectory: /dev/shm/bk
1255+
env:
1256+
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
1257+
BWC_VERSION: "{{matrix.BWC_VERSION}}"
12431258
- group: java-matrix
12441259
steps:
12451260
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.GRADLE_TASK}} / java-matrix"
@@ -1250,16 +1265,12 @@ steps:
12501265
ES_RUNTIME_JAVA:
12511266
- graalvm-ce17
12521267
- openjdk17
1253-
- openjdk18
1254-
- openjdk19
1255-
- openjdk20
12561268
- openjdk21
12571269
- openjdk22
12581270
GRADLE_TASK:
12591271
- checkPart1
12601272
- checkPart2
12611273
- checkPart3
1262-
- bwcTestSnapshots
12631274
- checkRestCompat
12641275
agents:
12651276
provider: gcp
@@ -1269,6 +1280,25 @@ steps:
12691280
env:
12701281
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
12711282
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
1283+
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-matrix-bwc"
1284+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$$BWC_VERSION#bwcTest
1285+
timeout_in_minutes: 300
1286+
matrix:
1287+
setup:
1288+
ES_RUNTIME_JAVA:
1289+
- graalvm-ce17
1290+
- openjdk17
1291+
- openjdk21
1292+
- openjdk22
1293+
BWC_VERSION: ["7.17.19", "8.12.3", "8.13.0", "8.14.0"]
1294+
agents:
1295+
provider: gcp
1296+
image: family/elasticsearch-ubuntu-2004
1297+
machineType: n1-standard-32
1298+
buildDirectory: /dev/shm/bk
1299+
env:
1300+
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
1301+
BWC_VERSION: "{{matrix.BWC_VERSION}}"
12721302
- label: release-tests
12731303
command: .buildkite/scripts/release-tests.sh
12741304
timeout_in_minutes: 360

.github/CODEOWNERS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,23 @@ build-tools-internal @elastic/es-delivery
3939
distribution/src @elastic/es-delivery
4040
distribution/packages/src @elastic/es-delivery
4141
distribution/docker/src @elastic/es-delivery
42+
43+
# Core/Infra
44+
distribution/tools @elastic/es-core-infra
45+
libs/core @elastic/es-core-infra
46+
libs/logging @elastic/es-core-infra
47+
libs/native @elastic/es-core-infra
48+
libs/plugin-analysis-api @elastic/es-core-infra
49+
libs/plugin-api @elastic/es-core-infra
50+
libs/plugin-classloader @elastic/es-core-infra
51+
libs/plugin-scanner @elastic/es-core-infra
52+
libs/x-content @elastic/es-core-infra
53+
modules/lang-expression @elastic/es-core-infra
54+
modules/lang-mustache @elastic/es-core-infra
55+
modules/lang-painless @elastic/es-core-infra
56+
modules/rest-root @elastic/es-core-infra
57+
modules/systemd @elastic/es-core-infra
58+
server/src/main/java/org/elasticsearch/bootstrap @elastic/es-core-infra
59+
server/src/main/java/org/elasticsearch/node @elastic/es-core-infra
60+
server/src/main/java/org/elasticsearch/plugins @elastic/es-core-infra
61+
server/src/main/java/org/elasticsearch/threadpool @elastic/es-core-infra

README.asciidoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
= Elasticsearch
22

3-
Elasticsearch is a distributed, RESTful search engine optimized for speed and relevance on production-scale workloads. You can use Elasticsearch to perform real-time search over massive datasets for applications including:
3+
Elasticsearch is a distributed search and analytics engine optimized for speed and relevance on production-scale workloads. Elasticsearch is the foundation of Elastic's open Stack platform. Search in near real-time over massive datasets, perform vector searches, integrate with generative AI applications, and much more.
44

5-
* Vector search
5+
Use cases enabled by Elasticsearch include:
6+
7+
* https://www.elastic.co/search-labs/blog/articles/retrieval-augmented-generation-rag[Retrieval Augmented Generation (RAG)]
8+
* https://www.elastic.co/search-labs/blog/categories/vector-search[Vector search]
69
* Full-text search
710
* Logs
811
* Metrics
912
* Application performance monitoring (APM)
1013
* Security logs
1114
12-
1315
\... and more!
1416

1517
To learn more about Elasticsearch's features and capabilities, see our
1618
https://www.elastic.co/products/elasticsearch[product page].
1719

20+
To access information on https://www.elastic.co/search-labs/blog/categories/ml-research[machine learning innovations] and the latest https://www.elastic.co/search-labs/blog/categories/lucene[Lucene contributions from Elastic], more information can be found in https://www.elastic.co/search-labs[Search Labs].
21+
1822
[[get-started]]
1923
== Get started
2024

build-tools-internal/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ gradlePlugin {
119119
id = 'elasticsearch.java-doc'
120120
implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavadocPlugin'
121121
}
122+
javaBase {
123+
id = 'elasticsearch.java-base'
124+
implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavaBasePlugin'
125+
}
122126
java {
123127
id = 'elasticsearch.java'
124128
implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin'

build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/JdkDownloadPluginFuncTest.groovy

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
package org.elasticsearch.gradle.internal
1010

11-
import spock.lang.TempDir
11+
1212
import spock.lang.Unroll
1313
import com.github.tomakehurst.wiremock.WireMockServer
1414

@@ -99,17 +99,13 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
9999
given:
100100
def mockRepoUrl = urlPath(jdkVendor, jdkVersion, platform)
101101
def mockedContent = filebytes(jdkVendor, platform)
102-
3.times {
103-
settingsFile << """
104-
include ':sub-$it'
105-
"""
106-
}
107102
buildFile.text = """
108103
plugins {
109104
id 'elasticsearch.jdk-download' apply false
110105
}
111-
112-
subprojects {
106+
"""
107+
3.times {
108+
subProject(':sub-' + it) << """
113109
apply plugin: 'elasticsearch.jdk-download'
114110
115111
jdks {
@@ -126,8 +122,8 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
126122
println "JDK HOME: " + jdks.myJdk
127123
}
128124
}
129-
}
130-
"""
125+
"""
126+
}
131127

132128
when:
133129
def result = WiremockFixture.withWireMock(mockRepoUrl, mockedContent) { server ->
@@ -165,7 +161,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
165161
architecture = "x64"
166162
}
167163
}
168-
164+
169165
tasks.register("getJdk", PrintJdk) {
170166
dependsOn jdks.myJdk
171167
jdkPath = jdks.myJdk.getPath()
@@ -174,7 +170,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
174170
class PrintJdk extends DefaultTask {
175171
@Input
176172
String jdkPath
177-
173+
178174
@TaskAction void print() {
179175
println "JDK HOME: " + jdkPath
180176
}

build-tools-internal/src/main/groovy/elasticsearch.ide.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.elasticsearch.gradle.util.Pair
1010
import org.elasticsearch.gradle.util.GradleUtils
1111
import org.elasticsearch.gradle.internal.info.BuildParams
12+
import org.elasticsearch.gradle.internal.test.TestUtil
1213
import org.jetbrains.gradle.ext.JUnit
1314

1415
import java.nio.file.Files
@@ -128,9 +129,13 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
128129
':x-pack:plugin:esql:compute:gen:jar',
129130
':server:generateModulesList',
130131
':server:generatePluginsList',
131-
':generateProviderImpls'].collect { elasticsearchProject.right()?.task(it) ?: it })
132+
':generateProviderImpls',
133+
':libs:elasticsearch-native:elasticsearch-native-libraries:extractLibs'].collect { elasticsearchProject.right()?.task(it) ?: it })
132134
}
133135

136+
// this path is produced by the extractLibs task above
137+
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
138+
134139
idea {
135140
project {
136141
vcs = 'Git'
@@ -162,6 +167,8 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
162167
'-ea',
163168
'-Djava.security.manager=allow',
164169
'-Djava.locale.providers=SPI,COMPAT',
170+
'-Djava.library.path=' + testLibraryPath,
171+
'-Djna.library.path=' + testLibraryPath,
165172
// TODO: only open these for mockito when it is modularized
166173
'--add-opens=java.base/java.security.cert=ALL-UNNAMED',
167174
'--add-opens=java.base/java.nio.channels=ALL-UNNAMED',

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaBasePlugin.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212
import org.elasticsearch.gradle.internal.conventions.precommit.PrecommitTaskPlugin;
1313
import org.elasticsearch.gradle.internal.info.BuildParams;
1414
import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin;
15+
import org.elasticsearch.gradle.internal.test.TestUtil;
16+
import org.elasticsearch.gradle.test.SystemPropertyCommandLineArgumentProvider;
1517
import org.elasticsearch.gradle.util.GradleUtils;
1618
import org.gradle.api.JavaVersion;
1719
import org.gradle.api.Plugin;
1820
import org.gradle.api.Project;
21+
import org.gradle.api.artifacts.Configuration;
1922
import org.gradle.api.artifacts.ResolutionStrategy;
23+
import org.gradle.api.file.FileCollection;
2024
import org.gradle.api.plugins.JavaBasePlugin;
2125
import org.gradle.api.plugins.JavaPluginExtension;
2226
import org.gradle.api.provider.Provider;
@@ -26,10 +30,13 @@
2630
import org.gradle.api.tasks.compile.CompileOptions;
2731
import org.gradle.api.tasks.compile.GroovyCompile;
2832
import org.gradle.api.tasks.compile.JavaCompile;
33+
import org.gradle.api.tasks.testing.Test;
2934
import org.gradle.jvm.toolchain.JavaLanguageVersion;
3035
import org.gradle.jvm.toolchain.JavaToolchainService;
3136

3237
import java.util.List;
38+
import java.util.Map;
39+
import java.util.function.Supplier;
3340

3441
import javax.inject.Inject;
3542

@@ -59,6 +66,7 @@ public void apply(Project project) {
5966
configureConfigurations(project);
6067
configureCompile(project);
6168
configureInputNormalization(project);
69+
configureNativeLibraryPath(project);
6270

6371
// convenience access to common versions used in dependencies
6472
project.getExtensions().getExtraProperties().set("versions", VersionProperties.getVersions());
@@ -165,6 +173,26 @@ public static void configureInputNormalization(Project project) {
165173
project.getNormalization().getRuntimeClasspath().ignore("IMPL-JARS/**/META-INF/MANIFEST.MF");
166174
}
167175

176+
private static void configureNativeLibraryPath(Project project) {
177+
String nativeProject = ":libs:elasticsearch-native:elasticsearch-native-libraries";
178+
Configuration nativeConfig = project.getConfigurations().create("nativeLibs");
179+
nativeConfig.defaultDependencies(deps -> {
180+
deps.add(project.getDependencies().project(Map.of("path", nativeProject, "configuration", "default")));
181+
});
182+
// This input to the following lambda needs to be serializable. Configuration is not serializable, but FileCollection is.
183+
FileCollection nativeConfigFiles = nativeConfig;
184+
185+
project.getTasks().withType(Test.class).configureEach(test -> {
186+
var systemProperties = test.getExtensions().getByType(SystemPropertyCommandLineArgumentProvider.class);
187+
var libraryPath = (Supplier<String>) () -> TestUtil.getTestLibraryPath(nativeConfigFiles.getAsPath());
188+
189+
test.dependsOn(nativeConfigFiles);
190+
// we may use JNA or the JDK's foreign function api to load libraries, so we set both sysprops
191+
systemProperties.systemProperty("java.library.path", libraryPath);
192+
systemProperties.systemProperty("jna.library.path", libraryPath);
193+
});
194+
}
195+
168196
private static Provider<Integer> releaseVersionProviderFromCompileTask(Project project, AbstractCompile compileTask) {
169197
return project.provider(() -> {
170198
JavaVersion javaVersion = JavaVersion.toVersion(compileTask.getTargetCompatibility());

0 commit comments

Comments
 (0)