Skip to content

Commit 4d3c5b5

Browse files
committed
Merge branch 'main' into add_min_score_linear_retriever
2 parents 5ef28a8 + ceaa01a commit 4d3c5b5

File tree

580 files changed

+13503
-6209
lines changed

Some content is hidden

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

580 files changed

+13503
-6209
lines changed

.buildkite/pipelines/pull-request/part-1-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-1-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart1

.buildkite/pipelines/pull-request/part-2-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-2-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart2

.buildkite/pipelines/pull-request/part-3-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-3-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart3

.buildkite/pipelines/pull-request/part-4-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-4-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart4

.buildkite/pipelines/pull-request/part-5-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-5-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart5

benchmarks/README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,21 @@ To get realistic results, you should exercise care when running benchmarks. Here
8282
NOTE: Linux only. Sorry Mac and Windows.
8383

8484
Disassembling is fun! Maybe not always useful, but always fun! Generally, you'll want to install `perf` and the JDK's `hsdis`.
85-
`perf` is generally available via `apg-get install perf` or `pacman -S perf`. `hsdis` you'll want to compile from source. is a little more involved. This worked
85+
`perf` is generally available via `apg-get install perf` or `pacman -S perf linux-tools`. `hsdis` you'll want to compile from source. is a little more involved. This worked
8686
on 2020-08-01:
8787

8888
```
8989
git clone [email protected]:openjdk/jdk.git
9090
cd jdk
91-
git checkout jdk-17-ga
92-
cd src/utils/hsdis
91+
git checkout jdk-24-ga
9392
# Get a known good binutils
9493
wget https://ftp.gnu.org/gnu/binutils/binutils-2.35.tar.gz
9594
tar xf binutils-2.35.tar.gz
96-
make BINUTILS=binutils-2.35 ARCH=amd64
97-
sudo cp build/linux-amd64/hsdis-amd64.so /usr/lib/jvm/java-17-openjdk/lib/server/
95+
bash configure --with-hsdis=binutils --with-binutils-src=binutils-2.35 \
96+
--with-boot-jdk=~/.gradle/jdks/oracle_corporation-24-amd64-linux.2
97+
make build-hsdis
98+
cp ./build/linux-x86_64-server-release/jdk/lib/hsdis-amd64.so \
99+
~/.gradle/jdks/oracle_corporation-24-amd64-linux.2/lib/hsdis.so
98100
```
99101

100102
If you want to disassemble a single method do something like this:
@@ -105,6 +107,30 @@ gradlew -p benchmarks run --args ' MemoryStatsBenchmark -jvmArgs "-XX:+UnlockDia
105107

106108
If you want `perf` to find the hot methods for you, then do add `-prof perfasm`.
107109

110+
NOTE: `perfasm` will need more access:
111+
```
112+
sudo bash
113+
echo -1 > /proc/sys/kernel/perf_event_paranoid
114+
exit
115+
```
116+
117+
If you get warnings like:
118+
```
119+
The perf event count is suspiciously low (0).
120+
```
121+
then check if you are bumping into [this](https://man.archlinux.org/man/perf-stat.1.en#INTEL_HYBRID_SUPPORT)
122+
by running:
123+
```
124+
perf stat -B dd if=/dev/zero of=/dev/null count=1000000
125+
```
126+
127+
If you see lines like:
128+
```
129+
765019980 cpu_atom/cycles/ # 1.728 GHz (0.60%)
130+
2258845959 cpu_core/cycles/ # 5.103 GHz (99.18%)
131+
```
132+
then `perf` is just not going to work for you.
133+
108134
## Async Profiler
109135

110136
Note: Linux and Mac only. Sorry Windows.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.benchmark.compute.operator;
11+
12+
import org.apache.lucene.document.InetAddressPoint;
13+
import org.apache.lucene.util.BytesRef;
14+
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
15+
import org.elasticsearch.common.network.InetAddresses;
16+
import org.elasticsearch.compute.operator.BreakingBytesRefBuilder;
17+
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.ParseIp;
18+
import org.openjdk.jmh.annotations.Benchmark;
19+
import org.openjdk.jmh.annotations.BenchmarkMode;
20+
import org.openjdk.jmh.annotations.Fork;
21+
import org.openjdk.jmh.annotations.Measurement;
22+
import org.openjdk.jmh.annotations.Mode;
23+
import org.openjdk.jmh.annotations.OutputTimeUnit;
24+
import org.openjdk.jmh.annotations.Scope;
25+
import org.openjdk.jmh.annotations.State;
26+
import org.openjdk.jmh.annotations.Warmup;
27+
28+
import java.net.InetAddress;
29+
import java.util.concurrent.TimeUnit;
30+
31+
@Warmup(iterations = 5)
32+
@Measurement(iterations = 7)
33+
@BenchmarkMode(Mode.AverageTime)
34+
@OutputTimeUnit(TimeUnit.NANOSECONDS)
35+
@State(Scope.Thread)
36+
@Fork(1)
37+
public class ParseIpBenchmark {
38+
private final BytesRef ip = new BytesRef("192.168.0.1");
39+
private final BreakingBytesRefBuilder scratch = ParseIp.buildScratch(new NoopCircuitBreaker("request"));
40+
41+
@Benchmark
42+
public BytesRef leadingZerosRejected() {
43+
return ParseIp.leadingZerosRejected(ip, scratch);
44+
}
45+
46+
@Benchmark
47+
public BytesRef leadingZerosAreDecimal() {
48+
return ParseIp.leadingZerosAreDecimal(ip, scratch);
49+
}
50+
51+
@Benchmark
52+
public BytesRef leadingZerosAreOctal() {
53+
return ParseIp.leadingZerosAreOctal(ip, scratch);
54+
}
55+
56+
@Benchmark
57+
public BytesRef original() {
58+
InetAddress inetAddress = InetAddresses.forString(ip.utf8ToString());
59+
return new BytesRef(InetAddressPoint.encode(inetAddress));
60+
}
61+
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ private void configureDraRepository(
7373
patternLayout.artifact(
7474
String.format("/%s/%s/downloads/%s/[module]/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
7575
);
76+
77+
if ("beats".equals(draKey)) {
78+
// we don't have a good pattern here for beats fips specific images
79+
patternLayout.artifact(
80+
String.format("/%s/%s/downloads/%s/metricbeat/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
81+
);
82+
patternLayout.artifact(
83+
String.format("/%s/%s/downloads/%s/filebeat/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
84+
);
85+
}
7686
});
7787
repo.metadataSources(metadataSources -> metadataSources.artifact());
7888
repo.content(repositoryContentDescriptor -> repositoryContentDescriptor.includeVersionByRegex(".*", ".*", includeVersionRegex));

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/NoopPlugin.java

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

11-
import org.elasticsearch.action.ActionRequest;
12-
import org.elasticsearch.action.ActionResponse;
1311
import org.elasticsearch.action.ActionType;
1412
import org.elasticsearch.action.bulk.BulkResponse;
1513
import org.elasticsearch.action.search.SearchResponse;
@@ -41,10 +39,10 @@ public class NoopPlugin extends Plugin implements ActionPlugin {
4139
public static final ActionType<BulkResponse> NOOP_BULK_ACTION = new ActionType<>("mock:data/write/bulk");
4240

4341
@Override
44-
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
42+
public List<ActionHandler> getActions() {
4543
return Arrays.asList(
46-
new ActionHandler<>(NOOP_BULK_ACTION, TransportNoopBulkAction.class),
47-
new ActionHandler<>(NOOP_SEARCH_ACTION, TransportNoopSearchAction.class)
44+
new ActionHandler(NOOP_BULK_ACTION, TransportNoopBulkAction.class),
45+
new ActionHandler(NOOP_SEARCH_ACTION, TransportNoopSearchAction.class)
4846
);
4947
}
5048

distribution/docker/build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ if (useDra == false) {
5757
patternLayout {
5858
if (VersionProperties.isElasticsearchSnapshot()) {
5959
artifact '/[organization]/[revision]/downloads/[organization]/[module]/[module]-[revision]-[classifier].[ext]'
60+
artifact '/[organization]/[revision]/downloads/[organization]/filebeat/[module]-[revision]-[classifier].[ext]'
61+
artifact '/[organization]/[revision]/downloads/[organization]/metricbeat/[module]-[revision]-[classifier].[ext]'
6062
} else {
6163
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
6264
// Release builds are always done with a local repo.
6365
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/[module]/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
66+
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/filebeat/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
67+
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/metricbeat/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
6468
}
6569
}
6670
}
@@ -93,9 +97,13 @@ configurations {
9397
tini
9498
allPlugins
9599
filebeat_aarch64
100+
filebeat_fips_aarch64
96101
filebeat_x86_64
102+
filebeat_fips_x86_64
97103
metricbeat_aarch64
104+
metricbeat_fips_aarch64
98105
metricbeat_x86_64
106+
metricbeat_fips_x86_64
99107
fips
100108
}
101109

@@ -111,8 +119,15 @@ dependencies {
111119
allPlugins project(path: ':plugins', configuration: 'allPlugins')
112120
filebeat_aarch64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
113121
filebeat_x86_64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
122+
filebeat_fips_aarch64 "beats:filebeat-fips:${VersionProperties.elasticsearch}:[email protected]"
123+
filebeat_fips_x86_64 "beats:filebeat-fips:${VersionProperties.elasticsearch}:[email protected]"
124+
114125
metricbeat_aarch64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
115126
metricbeat_x86_64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
127+
128+
metricbeat_fips_aarch64 "beats:metricbeat-fips:${VersionProperties.elasticsearch}:[email protected]"
129+
metricbeat_fips_x86_64 "beats:metricbeat-fips:${VersionProperties.elasticsearch}:[email protected]"
130+
116131
fips "org.bouncycastle:bc-fips:1.0.2.5"
117132
fips "org.bouncycastle:bctls-fips:1.0.19"
118133
}
@@ -301,8 +316,8 @@ void addBuildDockerContextTask(Architecture architecture, DockerBase base) {
301316
boolean includeBeats = VersionProperties.isElasticsearchSnapshot() == true || buildId != null || useDra
302317

303318
if (includeBeats) {
304-
from configurations.getByName("filebeat_${architecture.classifier}")
305-
from configurations.getByName("metricbeat_${architecture.classifier}")
319+
from configurations.getByName("filebeat_fips_${architecture.classifier}")
320+
from configurations.getByName("metricbeat_fips_${architecture.classifier}")
306321
// For some reason, the artifact name can differ depending on what repository we used.
307322
rename ~/((?:file|metric)beat)-.*\.tar\.gz$/, "\$1-${VersionProperties.elasticsearch}.tar.gz"
308323
}

0 commit comments

Comments
 (0)