Skip to content

Commit

Permalink
Merge branch 'main' into deprecation-api-handle-hidden-indices9
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Dec 12, 2024
2 parents 2293297 + 2f1e1f8 commit 31e7cf6
Show file tree
Hide file tree
Showing 1,279 changed files with 37,848 additions and 14,499 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipelines/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ steps:
timeout_in_minutes: 300
matrix:
setup:
BWC_VERSION: ["8.15.6", "8.16.2", "8.17.0", "8.18.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
6 changes: 1 addition & 5 deletions .buildkite/pipelines/periodic-packaging.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ steps:
matrix:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
- sles-12
- sles-15
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- rocky-8
- rocky-9
- rhel-7
- rhel-8
- rhel-9
- almalinux-8
- almalinux-9
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
Expand Down
12 changes: 4 additions & 8 deletions .buildkite/pipelines/periodic-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,18 @@ steps:
matrix:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
- sles-12
- sles-15
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- rocky-8
- rocky-9
- rhel-7
- rhel-8
- rhel-9
- almalinux-8
- almalinux-9
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
Expand Down Expand Up @@ -273,8 +269,8 @@ steps:
env:
BWC_VERSION: 8.14.3

- label: "{{matrix.image}} / 8.15.6 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.15.6
- label: "{{matrix.image}} / 8.15.5 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.15.5
timeout_in_minutes: 300
matrix:
setup:
Expand All @@ -287,7 +283,7 @@ steps:
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.15.6
BWC_VERSION: 8.15.5

- label: "{{matrix.image}} / 8.16.2 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.2
Expand Down
7 changes: 1 addition & 6 deletions .buildkite/pipelines/periodic-platform-support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ steps:
matrix:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
- sles-12
- sles-15
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- rocky-8
- rocky-9
- rhel-7
- rhel-8
- rhel-9
- almalinux-8
- almalinux-9
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
Expand Down Expand Up @@ -90,7 +86,6 @@ steps:
setup:
image:
- amazonlinux-2023
- amazonlinux-2
agents:
provider: aws
imagePrefix: elasticsearch-{{matrix.image}}
Expand Down
10 changes: 5 additions & 5 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ steps:
- signal_reason: agent_stop
limit: 3

- label: 8.15.6 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.15.6#bwcTest
- label: 8.15.5 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.15.5#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
Expand All @@ -297,7 +297,7 @@ steps:
buildDirectory: /dev/shm/bk
preemptible: true
env:
BWC_VERSION: 8.15.6
BWC_VERSION: 8.15.5
retry:
automatic:
- exit_status: "-1"
Expand Down Expand Up @@ -448,7 +448,7 @@ steps:
setup:
ES_RUNTIME_JAVA:
- openjdk21
BWC_VERSION: ["8.15.6", "8.16.2", "8.17.0", "8.18.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down Expand Up @@ -490,7 +490,7 @@ steps:
ES_RUNTIME_JAVA:
- openjdk21
- openjdk23
BWC_VERSION: ["8.15.6", "8.16.2", "8.17.0", "8.18.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
6 changes: 1 addition & 5 deletions .buildkite/pipelines/pull-request/packaging-tests-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,18 @@ steps:
matrix:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
- sles-12
- sles-15
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- rocky-8
- rocky-9
- rhel-7
- rhel-8
- rhel-9
- almalinux-8
- almalinux-9
PACKAGING_TASK:
- docker
- docker-cloud-ess
Expand Down
2 changes: 1 addition & 1 deletion .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BWC_VERSION:
- "8.12.2"
- "8.13.4"
- "8.14.3"
- "8.15.6"
- "8.15.5"
- "8.16.2"
- "8.17.0"
- "8.18.0"
Expand Down
1 change: 0 additions & 1 deletion .ci/snapshotBwcVersions
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
BWC_VERSION:
- "8.15.6"
- "8.16.2"
- "8.17.0"
- "8.18.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void setup() throws IOException {
);
includesSet = Set.of(fetchContext.includes());
excludesSet = Set.of(fetchContext.excludes());
parserConfig = XContentParserConfiguration.EMPTY.withFiltering(includesSet, excludesSet, false);
parserConfig = XContentParserConfiguration.EMPTY.withFiltering(null, includesSet, excludesSet, false);
}

private BytesReference read300BytesExample() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private XContentParserConfiguration buildParseConfig(boolean matchDotsInFieldNam
includes = null;
excludes = filters;
}
return XContentParserConfiguration.EMPTY.withFiltering(includes, excludes, matchDotsInFieldNames);
return XContentParserConfiguration.EMPTY.withFiltering(null, includes, excludes, matchDotsInFieldNames);
}

private BytesReference filter(XContentParserConfiguration contentParserConfiguration) throws IOException {
Expand Down
3 changes: 0 additions & 3 deletions branches.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
{
"branch": "8.x"
},
{
"branch": "8.15"
},
{
"branch": "7.17"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import org.gradle.api.Project;

import java.io.File;
import java.util.Arrays;
import java.util.Map;

/**
* This plugin configures formatting for Java source using Spotless
Expand Down Expand Up @@ -66,8 +64,7 @@ public void apply(Project project) {
java.importOrderFile(new File(elasticsearchWorkspace, importOrderPath));

// Most formatting is done through the Eclipse formatter
java.eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/"))
.configFile(new File(elasticsearchWorkspace, formatterConfigPath));
java.eclipse().configFile(new File(elasticsearchWorkspace, formatterConfigPath));

// Ensure blank lines are actually empty. Since formatters are applied in
// order, apply this one last, otherwise non-empty blank lines can creep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ private List<Version> getReleased() {
.toList();
}

public List<Version> getReadOnlyIndexCompatible() {
// Lucene can read indices in version N-2
int compatibleMajor = currentVersion.getMajor() - 2;
return versions.stream().filter(v -> v.getMajor() == compatibleMajor).sorted(Comparator.naturalOrder()).toList();
}

public void withLatestReadOnlyIndexCompatible(Consumer<Version> versionAction) {
var compatibleVersions = getReadOnlyIndexCompatible();
if (compatibleVersions == null || compatibleVersions.isEmpty()) {
throw new IllegalStateException("No read-only compatible version found.");
}
versionAction.accept(compatibleVersions.getLast());
}

/**
* Return versions of Elasticsearch which are index compatible with the current version.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* This class models the different Docker base images that are used to build Docker distributions of Elasticsearch.
*/
public enum DockerBase {
// "latest" here is intentional, since the image name specifies "8"
DEFAULT("docker.elastic.co/ubi8/ubi-minimal:latest", "", "microdnf"),
// "latest" here is intentional, since the image name specifies "9"
DEFAULT("docker.elastic.co/ubi9/ubi-minimal:latest", "", "microdnf"),

// The Iron Bank base image is UBI (albeit hardened), but we are required to parameterize the Docker build
IRON_BANK("${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}", "-ironbank", "yum"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.elasticsearch.gradle.test.GradleTestPolicySetupPlugin;
import org.elasticsearch.gradle.test.SystemPropertyCommandLineArgumentProvider;
import org.gradle.api.Action;
import org.gradle.api.JavaVersion;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
Expand Down Expand Up @@ -112,7 +113,6 @@ public void execute(Task t) {
test.jvmArgs(
"-Xmx" + System.getProperty("tests.heap.size", "512m"),
"-Xms" + System.getProperty("tests.heap.size", "512m"),
"-Djava.security.manager=allow",
"-Dtests.testfeatures.enabled=true",
"--add-opens=java.base/java.util=ALL-UNNAMED",
// TODO: only open these for mockito when it is modularized
Expand All @@ -127,6 +127,13 @@ public void execute(Task t) {
);

test.getJvmArgumentProviders().add(new SimpleCommandLineArgumentProvider("-XX:HeapDumpPath=" + heapdumpDir));
test.getJvmArgumentProviders().add(() -> {
if (test.getJavaVersion().compareTo(JavaVersion.VERSION_23) <= 0) {
return List.of("-Djava.security.manager=allow");
} else {
return List.of();
}
});

String argline = System.getProperty("tests.jvm.argline");
if (argline != null) {
Expand Down
4 changes: 3 additions & 1 deletion build-tools-internal/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jna = 5.12.1
netty = 4.1.115.Final
commons_lang3 = 3.9
google_oauth_client = 1.34.1
awsv1sdk = 1.12.270
awsv2sdk = 2.28.13

antlr4 = 4.13.1
# bouncy castle version for non-fips. fips jars use a different version
Expand All @@ -33,7 +35,7 @@ commonscodec = 1.15
protobuf = 3.25.5

# test dependencies
randomizedrunner = 2.8.0
randomizedrunner = 2.8.2
junit = 4.13.2
junit5 = 5.7.1
hamcrest = 2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@

package org.elasticsearch.gradle.test;

import org.gradle.api.JavaVersion;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.invocation.Gradle;
import org.gradle.api.tasks.testing.Test;

import java.util.List;

public class GradleTestPolicySetupPlugin implements Plugin<Project> {

@Override
Expand All @@ -23,8 +26,13 @@ public void apply(Project project) {
test.systemProperty("tests.gradle", true);
test.systemProperty("tests.task", test.getPath());

// Flag is required for later Java versions since our tests use a custom security manager
test.jvmArgs("-Djava.security.manager=allow");
test.getJvmArgumentProviders().add(() -> {
if (test.getJavaVersion().compareTo(JavaVersion.VERSION_23) <= 0) {
return List.of("-Djava.security.manager=allow");
} else {
return List.of();
}
});

SystemPropertyCommandLineArgumentProvider nonInputProperties = new SystemPropertyCommandLineArgumentProvider();
// don't track these as inputs since they contain absolute paths and break cache relocatability
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ allprojects {
if (project.path.contains(":distribution:docker")) {
enabled = false
}

if (project.path.contains(":libs:cli")) {
// ensure we resolve p2 dependencies for the spotless eclipse formatter
dependsOn "spotlessJavaCheck"
}
}

plugins.withId('lifecycle-base') {
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/publish_zstd_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ build_linux_jar() {
}

echo 'Building Linux jars...'
LINUX_ARM_JAR=$(build_linux_jar "linux/amd64" "x86-64")
LINUX_X86_JAR=$(build_linux_jar "linux/arm64" "aarch64")
LINUX_ARM_JAR=$(build_linux_jar "linux/arm64" "aarch64")
LINUX_X86_JAR=$(build_linux_jar "linux/amd64" "x86-64")

build_windows_jar() {
ARTIFACT="$TEMP/zstd-$VERSION-windows-x86-64.jar"
Expand Down
6 changes: 3 additions & 3 deletions distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ tasks.register("generateDependenciesReport", ConcatFilesTask) {
// Explicitly add the dependency on the RHEL UBI Docker base image
String[] rhelUbiFields = [
'Red Hat Universal Base Image minimal',
'8',
'https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8',
'9',
'https://catalog.redhat.com/software/containers/ubi9-minimal/61832888c0d15aff4912fe0d',
'Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf',
'https://oss-dependencies.elastic.co/red-hat-universal-base-image-minimal/8/ubi-minimal-8-source.tar.gz'
'https://oss-dependencies.elastic.co/red-hat-universal-base-image-minimal/9/ubi-minimal-9-source.tar.gz'
]
additionalLines << rhelUbiFields.join(',')
}
Expand Down
Loading

0 comments on commit 31e7cf6

Please sign in to comment.