Skip to content

Commit

Permalink
Merge branch 'bulk_inference_ref' into register_semantic_text
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Mar 19, 2024
2 parents b2b8635 + c5de0da commit 64e8e43
Show file tree
Hide file tree
Showing 1,165 changed files with 41,995 additions and 9,824 deletions.
40 changes: 35 additions & 5 deletions .buildkite/pipelines/periodic.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ steps:
- checkPart1
- checkPart2
- checkPart3
- bwcTestSnapshots
- checkRestCompat
agents:
provider: gcp
Expand All @@ -59,6 +58,22 @@ steps:
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-fips-matrix-bwc"
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dtests.fips.enabled=true v$$BWC_VERSION#bwcTest
timeout_in_minutes: 300
matrix:
setup:
ES_RUNTIME_JAVA:
- openjdk17
BWC_VERSION: $BWC_LIST
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
BWC_VERSION: "{{matrix.BWC_VERSION}}"
- group: java-matrix
steps:
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.GRADLE_TASK}} / java-matrix"
Expand All @@ -69,16 +84,12 @@ steps:
ES_RUNTIME_JAVA:
- graalvm-ce17
- openjdk17
- openjdk18
- openjdk19
- openjdk20
- openjdk21
- openjdk22
GRADLE_TASK:
- checkPart1
- checkPart2
- checkPart3
- bwcTestSnapshots
- checkRestCompat
agents:
provider: gcp
Expand All @@ -88,6 +99,25 @@ steps:
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-matrix-bwc"
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$$BWC_VERSION#bwcTest
timeout_in_minutes: 300
matrix:
setup:
ES_RUNTIME_JAVA:
- graalvm-ce17
- openjdk17
- openjdk21
- openjdk22
BWC_VERSION: $BWC_LIST
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
BWC_VERSION: "{{matrix.BWC_VERSION}}"
- label: release-tests
command: .buildkite/scripts/release-tests.sh
timeout_in_minutes: 360
Expand Down
40 changes: 35 additions & 5 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,6 @@ steps:
- checkPart1
- checkPart2
- checkPart3
- bwcTestSnapshots
- checkRestCompat
agents:
provider: gcp
Expand All @@ -1240,6 +1239,22 @@ steps:
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-fips-matrix-bwc"
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dtests.fips.enabled=true v$$BWC_VERSION#bwcTest
timeout_in_minutes: 300
matrix:
setup:
ES_RUNTIME_JAVA:
- openjdk17
BWC_VERSION: ["7.17.19", "8.12.3", "8.13.0", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
BWC_VERSION: "{{matrix.BWC_VERSION}}"
- group: java-matrix
steps:
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.GRADLE_TASK}} / java-matrix"
Expand All @@ -1250,16 +1265,12 @@ steps:
ES_RUNTIME_JAVA:
- graalvm-ce17
- openjdk17
- openjdk18
- openjdk19
- openjdk20
- openjdk21
- openjdk22
GRADLE_TASK:
- checkPart1
- checkPart2
- checkPart3
- bwcTestSnapshots
- checkRestCompat
agents:
provider: gcp
Expand All @@ -1269,6 +1280,25 @@ steps:
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
GRADLE_TASK: "{{matrix.GRADLE_TASK}}"
- label: "{{matrix.ES_RUNTIME_JAVA}} / {{matrix.BWC_VERSION}} / java-matrix-bwc"
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$$BWC_VERSION#bwcTest
timeout_in_minutes: 300
matrix:
setup:
ES_RUNTIME_JAVA:
- graalvm-ce17
- openjdk17
- openjdk21
- openjdk22
BWC_VERSION: ["7.17.19", "8.12.3", "8.13.0", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
BWC_VERSION: "{{matrix.BWC_VERSION}}"
- label: release-tests
command: .buildkite/scripts/release-tests.sh
timeout_in_minutes: 360
Expand Down
20 changes: 20 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,23 @@ build-tools-internal @elastic/es-delivery
distribution/src @elastic/es-delivery
distribution/packages/src @elastic/es-delivery
distribution/docker/src @elastic/es-delivery

# Core/Infra
distribution/tools @elastic/es-core-infra
libs/core @elastic/es-core-infra
libs/logging @elastic/es-core-infra
libs/native @elastic/es-core-infra
libs/plugin-analysis-api @elastic/es-core-infra
libs/plugin-api @elastic/es-core-infra
libs/plugin-classloader @elastic/es-core-infra
libs/plugin-scanner @elastic/es-core-infra
libs/x-content @elastic/es-core-infra
modules/lang-expression @elastic/es-core-infra
modules/lang-mustache @elastic/es-core-infra
modules/lang-painless @elastic/es-core-infra
modules/rest-root @elastic/es-core-infra
modules/systemd @elastic/es-core-infra
server/src/main/java/org/elasticsearch/bootstrap @elastic/es-core-infra
server/src/main/java/org/elasticsearch/node @elastic/es-core-infra
server/src/main/java/org/elasticsearch/plugins @elastic/es-core-infra
server/src/main/java/org/elasticsearch/threadpool @elastic/es-core-infra
4 changes: 4 additions & 0 deletions build-tools-internal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ gradlePlugin {
id = 'elasticsearch.java-doc'
implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavadocPlugin'
}
javaBase {
id = 'elasticsearch.java-base'
implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavaBasePlugin'
}
java {
id = 'elasticsearch.java'
implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.elasticsearch.gradle.internal

import spock.lang.TempDir

import spock.lang.Unroll
import com.github.tomakehurst.wiremock.WireMockServer

Expand Down Expand Up @@ -99,17 +99,13 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
given:
def mockRepoUrl = urlPath(jdkVendor, jdkVersion, platform)
def mockedContent = filebytes(jdkVendor, platform)
3.times {
settingsFile << """
include ':sub-$it'
"""
}
buildFile.text = """
plugins {
id 'elasticsearch.jdk-download' apply false
}
subprojects {
"""
3.times {
subProject(':sub-' + it) << """
apply plugin: 'elasticsearch.jdk-download'
jdks {
Expand All @@ -126,8 +122,8 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
println "JDK HOME: " + jdks.myJdk
}
}
}
"""
"""
}

when:
def result = WiremockFixture.withWireMock(mockRepoUrl, mockedContent) { server ->
Expand Down Expand Up @@ -165,7 +161,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
architecture = "x64"
}
}
tasks.register("getJdk", PrintJdk) {
dependsOn jdks.myJdk
jdkPath = jdks.myJdk.getPath()
Expand All @@ -174,7 +170,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
class PrintJdk extends DefaultTask {
@Input
String jdkPath
@TaskAction void print() {
println "JDK HOME: " + jdkPath
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.elasticsearch.gradle.util.Pair
import org.elasticsearch.gradle.util.GradleUtils
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.internal.test.TestUtil
import org.jetbrains.gradle.ext.JUnit

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

// this path is produced by the extractLibs task above
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")

idea {
project {
vcs = 'Git'
Expand Down Expand Up @@ -162,6 +167,8 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
'-ea',
'-Djava.security.manager=allow',
'-Djava.locale.providers=SPI,COMPAT',
'-Djava.library.path=' + testLibraryPath,
'-Djna.library.path=' + testLibraryPath,
// TODO: only open these for mockito when it is modularized
'--add-opens=java.base/java.security.cert=ALL-UNNAMED',
'--add-opens=java.base/java.nio.channels=ALL-UNNAMED',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
import org.elasticsearch.gradle.internal.conventions.precommit.PrecommitTaskPlugin;
import org.elasticsearch.gradle.internal.info.BuildParams;
import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin;
import org.elasticsearch.gradle.internal.test.TestUtil;
import org.elasticsearch.gradle.test.SystemPropertyCommandLineArgumentProvider;
import org.elasticsearch.gradle.util.GradleUtils;
import org.gradle.api.JavaVersion;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ResolutionStrategy;
import org.gradle.api.file.FileCollection;
import org.gradle.api.plugins.JavaBasePlugin;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.provider.Provider;
Expand All @@ -26,10 +30,13 @@
import org.gradle.api.tasks.compile.CompileOptions;
import org.gradle.api.tasks.compile.GroovyCompile;
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.api.tasks.testing.Test;
import org.gradle.jvm.toolchain.JavaLanguageVersion;
import org.gradle.jvm.toolchain.JavaToolchainService;

import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

import javax.inject.Inject;

Expand Down Expand Up @@ -59,6 +66,7 @@ public void apply(Project project) {
configureConfigurations(project);
configureCompile(project);
configureInputNormalization(project);
configureNativeLibraryPath(project);

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

private static void configureNativeLibraryPath(Project project) {
String nativeProject = ":libs:elasticsearch-native:elasticsearch-native-libraries";
Configuration nativeConfig = project.getConfigurations().create("nativeLibs");
nativeConfig.defaultDependencies(deps -> {
deps.add(project.getDependencies().project(Map.of("path", nativeProject, "configuration", "default")));
});
// This input to the following lambda needs to be serializable. Configuration is not serializable, but FileCollection is.
FileCollection nativeConfigFiles = nativeConfig;

project.getTasks().withType(Test.class).configureEach(test -> {
var systemProperties = test.getExtensions().getByType(SystemPropertyCommandLineArgumentProvider.class);
var libraryPath = (Supplier<String>) () -> TestUtil.getTestLibraryPath(nativeConfigFiles.getAsPath());

test.dependsOn(nativeConfigFiles);
// we may use JNA or the JDK's foreign function api to load libraries, so we set both sysprops
systemProperties.systemProperty("java.library.path", libraryPath);
systemProperties.systemProperty("jna.library.path", libraryPath);
});
}

private static Provider<Integer> releaseVersionProviderFromCompileTask(Project project, AbstractCompile compileTask) {
return project.provider(() -> {
JavaVersion javaVersion = JavaVersion.toVersion(compileTask.getTargetCompatibility());
Expand Down
Loading

0 comments on commit 64e8e43

Please sign in to comment.