Skip to content

Commit a8f83fb

Browse files
committed
Merge remote-tracking branch 'upstream/main' into 04212025/PauseIndexingES11516
refresh
2 parents 0969087 + 99f67fa commit a8f83fb

File tree

170 files changed

+2637
-2585
lines changed

Some content is hidden

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

170 files changed

+2637
-2585
lines changed

.buildkite/scripts/dra-workflow.trigger.sh

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,34 @@
22

33
set -euo pipefail
44

5-
echo "steps:"
6-
75
source .buildkite/scripts/branches.sh
86

7+
# We use that filtering to keep different schedule for different branches
8+
if [ -n "${INCLUDED_BRANCHES:-}" ]; then
9+
# If set, only trigger the pipeline for the specified branches
10+
IFS=',' read -r -a BRANCHES <<< "${INCLUDED_BRANCHES}"
11+
elif [ -n "${EXCLUDED_BRANCHES:-}" ]; then
12+
# If set, listed branches will be excluded from the list of branches in branches.json
13+
IFS=',' read -r -a EXCLUDED_BRANCHES <<< "${EXCLUDED_BRANCHES}"
14+
FILTERED_BRANCHES=()
15+
for BRANCH in "${BRANCHES[@]}"; do
16+
EXCLUDE=false
17+
for EXCLUDED_BRANCH in "${EXCLUDED_BRANCHES[@]}"; do
18+
if [ "$BRANCH" == "$EXCLUDED_BRANCH" ]; then
19+
EXCLUDE=true
20+
break
21+
fi
22+
done
23+
if [ "$EXCLUDE" = false ]; then
24+
FILTERED_BRANCHES+=("$BRANCH")
25+
fi
26+
done
27+
BRANCHES=("${FILTERED_BRANCHES[@]}")
28+
fi
29+
30+
31+
echo "steps:"
32+
933
for BRANCH in "${BRANCHES[@]}"; do
1034
INTAKE_PIPELINE_SLUG="elasticsearch-intake"
1135
BUILD_JSON=$(curl -sH "Authorization: Bearer ${BUILDKITE_API_TOKEN}" "https://api.buildkite.com/v2/organizations/elastic/pipelines/${INTAKE_PIPELINE_SLUG}/builds?branch=${BRANCH}&state=passed&per_page=1" | jq '.[0] | {commit: .commit, url: .web_url}')

benchmarks/src/main/java/org/elasticsearch/benchmark/esql/QueryPlanningBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private LogicalPlan plan(String query) {
123123
}
124124

125125
@Benchmark
126-
public void run(Blackhole blackhole) {
126+
public void manyFields(Blackhole blackhole) {
127127
blackhole.consume(plan("FROM test | LIMIT 10"));
128128
}
129129
}

build-tools-internal/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
3+
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestApiTask.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
import org.gradle.api.tasks.SkipWhenEmpty;
2626
import org.gradle.api.tasks.TaskAction;
2727
import org.gradle.api.tasks.util.PatternFilterable;
28-
import org.gradle.api.tasks.util.PatternSet;
29-
import org.gradle.internal.Factory;
28+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
3029

3130
import java.io.File;
3231
import java.io.IOException;
@@ -65,14 +64,14 @@ public class CopyRestApiTask extends DefaultTask {
6564
@Inject
6665
public CopyRestApiTask(
6766
ProjectLayout projectLayout,
68-
Factory<PatternSet> patternSetFactory,
67+
PatternSetFactory patternSetFactory,
6968
FileSystemOperations fileSystemOperations,
7069
ObjectFactory objectFactory
7170
) {
7271
this.include = objectFactory.listProperty(String.class);
7372
this.outputResourceDir = objectFactory.directoryProperty();
7473
this.additionalYamlTestsDir = objectFactory.directoryProperty();
75-
this.patternSet = patternSetFactory.create();
74+
this.patternSet = patternSetFactory.createPatternSet();
7675
this.projectLayout = projectLayout;
7776
this.fileSystemOperations = fileSystemOperations;
7877
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestTestsTask.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
import org.gradle.api.tasks.SkipWhenEmpty;
3030
import org.gradle.api.tasks.TaskAction;
3131
import org.gradle.api.tasks.util.PatternFilterable;
32-
import org.gradle.api.tasks.util.PatternSet;
33-
import org.gradle.internal.Factory;
32+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
3433

3534
import java.io.File;
3635
import java.util.Map;
@@ -66,25 +65,25 @@ public abstract class CopyRestTestsTask extends DefaultTask {
6665
private final ProjectLayout projectLayout;
6766
private final FileSystemOperations fileSystemOperations;
6867

69-
@Inject
70-
public abstract FileOperations getFileOperations();
71-
7268
@Inject
7369
public CopyRestTestsTask(
7470
ProjectLayout projectLayout,
75-
Factory<PatternSet> patternSetFactory,
71+
PatternSetFactory patternSetFactory,
7672
FileSystemOperations fileSystemOperations,
7773
ObjectFactory objectFactory
7874
) {
7975
this.includeCore = objectFactory.listProperty(String.class);
8076
this.includeXpack = objectFactory.listProperty(String.class);
8177
this.outputResourceDir = objectFactory.directoryProperty();
82-
this.corePatternSet = patternSetFactory.create();
83-
this.xpackPatternSet = patternSetFactory.create();
78+
this.corePatternSet = patternSetFactory.createPatternSet();
79+
this.xpackPatternSet = patternSetFactory.createPatternSet();
8480
this.projectLayout = projectLayout;
8581
this.fileSystemOperations = fileSystemOperations;
8682
}
8783

84+
@Inject
85+
public abstract FileOperations getFileOperations();
86+
8887
@Input
8988
public ListProperty<String> getIncludeCore() {
9089
return includeCore;

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
import org.gradle.api.tasks.TaskAction;
5959
import org.gradle.api.tasks.util.PatternFilterable;
6060
import org.gradle.api.tasks.util.PatternSet;
61-
import org.gradle.internal.Factory;
61+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
6262

6363
import java.io.File;
6464
import java.io.IOException;
@@ -98,25 +98,23 @@ public abstract class RestCompatTestTransformTask extends DefaultTask {
9898
// PatternFilterable -> list of full test names and reasons. Needed for 1 pattern may include many tests and reasons
9999
private final Map<PatternFilterable, List<Pair<String, String>>> skippedTestByTestNameTransformations = new HashMap<>();
100100

101-
@Inject
102-
protected Factory<PatternSet> getPatternSetFactory() {
103-
throw new UnsupportedOperationException();
104-
}
105-
106101
@Inject
107102
public RestCompatTestTransformTask(FileSystemOperations fileSystemOperations, ObjectFactory objectFactory) {
108103
this.fileSystemOperations = fileSystemOperations;
109104
this.compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1;
110105
this.sourceDirectory = objectFactory.directoryProperty();
111106
this.outputDirectory = objectFactory.directoryProperty();
112-
this.testPatternSet = getPatternSetFactory().create();
107+
this.testPatternSet = getPatternSetFactory().createPatternSet();
113108
this.testPatternSet.include("/*" + "*/*.yml"); // concat these strings to keep build from thinking this is invalid javadoc
114109
// always inject compat headers
115110
headers.put("Content-Type", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
116111
headers.put("Accept", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
117112
getTransformations().add(new InjectHeaders(headers, Sets.newHashSet(RestCompatTestTransformTask::doesNotHaveCatOperation)));
118113
}
119114

115+
@Inject
116+
protected abstract PatternSetFactory getPatternSetFactory();
117+
120118
private static boolean doesNotHaveCatOperation(ObjectNode doNodeValue) {
121119
final Iterator<String> fieldNamesIterator = doNodeValue.fieldNames();
122120
while (fieldNamesIterator.hasNext()) {
@@ -144,7 +142,7 @@ public void skipTest(String fullTestName, String reason) {
144142
);
145143
}
146144

147-
PatternSet skippedPatternSet = getPatternSetFactory().create();
145+
PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
148146
// create file patterns for all a1/a2/a3/b.yml possibilities.
149147
for (int i = testParts.length - 1; i > 1; i--) {
150148
final String lastPart = testParts[i];
@@ -158,7 +156,7 @@ public void skipTest(String fullTestName, String reason) {
158156
}
159157

160158
public void skipTestsByFilePattern(String filePattern, String reason) {
161-
PatternSet skippedPatternSet = getPatternSetFactory().create();
159+
PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
162160
skippedPatternSet.include(filePattern);
163161
skippedTestByFilePatternTransformations.put(skippedPatternSet, reason);
164162
}

build-tools-internal/src/main/resources/checkstyle.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868

6969
<!-- Unused imports are forbidden -->
7070
<module name="UnusedImports" />
71+
<module name="SuppressionCommentFilter">
72+
<property name="offCommentFormat" value="begin generated imports"/>
73+
<property name="onCommentFormat" value="end generated imports"/>
74+
<property name="checkFormat" value="UnusedImports"/>
75+
</module>
7176

7277
<!-- Non-inner classes must be in files that match their names. -->
7378
<module name="OuterTypeFilename" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.12.1
1+
8.14

build-tools/src/main/java/org/elasticsearch/gradle/test/SystemPropertyCommandLineArgumentProvider.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
package org.elasticsearch.gradle.test;
1010

11-
import org.gradle.api.provider.Provider;
1211
import org.gradle.api.tasks.Input;
1312
import org.gradle.process.CommandLineArgumentProvider;
1413

@@ -20,10 +19,6 @@
2019
public class SystemPropertyCommandLineArgumentProvider implements CommandLineArgumentProvider {
2120
private final Map<String, Object> systemProperties = new LinkedHashMap<>();
2221

23-
public void systemProperty(String key, Provider<Object> value) {
24-
systemProperties.put(key, (Supplier<String>) () -> String.valueOf(value.get()));
25-
}
26-
2722
public void systemProperty(String key, Supplier<String> value) {
2823
systemProperties.put(key, value);
2924
}

distribution/docker/src/docker/Dockerfile.ess-fips

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,6 @@ COPY fips/resources/fips_java.policy /usr/share/elasticsearch/config/fips_java.p
9696

9797
WORKDIR /usr/share/elasticsearch/config
9898

99-
## Add fips specific JVM options
100-
RUN cat <<EOF > /usr/share/elasticsearch/config/jvm.options.d/fips.options
101-
-Djavax.net.ssl.keyStoreType=BCFKS
102-
-Dorg.bouncycastle.fips.approved_only=true
103-
-Djava.security.properties=config/fips_java.security
104-
-Djava.security.policy=config/fips_java.policy
105-
EOF
106-
107-
10899
################################################################################
109100
# Build stage 2 (the actual Elasticsearch image):
110101
#
@@ -136,6 +127,10 @@ ENV ELASTIC_CONTAINER=true
136127
WORKDIR /usr/share/elasticsearch
137128

138129
COPY --from=builder --chown=0:0 /usr/share/elasticsearch /usr/share/elasticsearch
130+
COPY --from=builder --chown=0:0 /fips/libs/*.jar /usr/share/elasticsearch/lib/
131+
COPY --from=builder --chown=0:0 /opt /opt
132+
133+
ENV ES_PLUGIN_ARCHIVE_DIR=/opt/plugins/archive
139134
ENV PATH=/usr/share/elasticsearch/bin:\$PATH
140135
ENV SHELL=/bin/bash
141136
COPY ${bin_dir}/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
@@ -159,6 +154,28 @@ RUN chmod g=u /etc/passwd && \\
159154

160155
RUN ln -sf /etc/ssl/certs/java/cacerts /usr/share/elasticsearch/jdk/lib/security/cacerts
161156

157+
# Convert cacerts (PKCS12) to BCFKS format using POSIX-compatible shell syntax
158+
RUN printf "\\n" | jdk/bin/keytool -importkeystore \
159+
-srckeystore /usr/share/elasticsearch/jdk/lib/security/cacerts \
160+
-srcstoretype PKCS12 \
161+
-destkeystore config/cacerts.bcfks \
162+
-deststorepass passwordcacert \
163+
-deststoretype BCFKS \
164+
-providerclass org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider \
165+
-providerpath lib/bc-fips-1.0.2.5.jar \
166+
-destprovidername BCFIPS
167+
168+
169+
## Add fips specific JVM options
170+
RUN cat <<EOF > /usr/share/elasticsearch/config/jvm.options.d/fips.options
171+
-Djavax.net.ssl.keyStoreType=BCFKS
172+
-Dorg.bouncycastle.fips.approved_only=true
173+
-Djava.security.properties=config/fips_java.security
174+
-Djava.security.policy=config/fips_java.policy
175+
-Djavax.net.ssl.trustStore=config/cacerts.bcfks
176+
-Djavax.net.ssl.trustStorePassword=passwordcacert
177+
EOF
178+
162179
EXPOSE 9200 9300
163180

164181
LABEL org.label-schema.build-date="${build_date}" \\
@@ -196,11 +213,6 @@ CMD ["/app/elasticsearch.sh"]
196213

197214
USER 1000:0
198215

199-
COPY --from=builder --chown=0:0 /opt /opt
200-
ENV ES_PLUGIN_ARCHIVE_DIR=/opt/plugins/archive
201-
WORKDIR /usr/share/elasticsearch
202-
COPY --from=builder --chown=0:0 /fips/libs/*.jar /usr/share/elasticsearch/lib/
203-
204216
################################################################################
205217
# End of multi-stage Dockerfile
206218
################################################################################

0 commit comments

Comments
 (0)