Skip to content

Commit 51f5a80

Browse files
Merge branch 'main' into azurecore-patcher-reduce-noise
2 parents e266547 + ecbc360 commit 51f5a80

File tree

478 files changed

+15082
-7115
lines changed

Some content is hidden

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

478 files changed

+15082
-7115
lines changed

.buildkite/pipelines/periodic.template.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ steps:
204204
image: family/elasticsearch-ubuntu-2404
205205
machineType: n2-standard-8
206206
buildDirectory: /dev/shm/bk
207+
- label: third-party / ms-graph
208+
command: |
209+
.ci/scripts/run-gradle.sh msGraphThirdPartyTest
210+
env:
211+
USE_3RD_PARTY_MS_GRAPH_CREDENTIALS: "true"
212+
timeout_in_minutes: 30
213+
agents:
214+
provider: gcp
215+
image: family/elasticsearch-ubuntu-2404
216+
machineType: n2-standard-8
217+
buildDirectory: /dev/shm/bk
207218
- group: lucene-compat
208219
steps:
209220
- label: "{{matrix.LUCENE_VERSION}} / lucene-compat"

.buildkite/pipelines/periodic.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,17 @@ steps:
642642
image: family/elasticsearch-ubuntu-2404
643643
machineType: n2-standard-8
644644
buildDirectory: /dev/shm/bk
645+
- label: third-party / ms-graph
646+
command: |
647+
.ci/scripts/run-gradle.sh msGraphThirdPartyTest
648+
env:
649+
USE_3RD_PARTY_MS_GRAPH_CREDENTIALS: "true"
650+
timeout_in_minutes: 30
651+
agents:
652+
provider: gcp
653+
image: family/elasticsearch-ubuntu-2404
654+
machineType: n2-standard-8
655+
buildDirectory: /dev/shm/bk
645656
- group: lucene-compat
646657
steps:
647658
- label: "{{matrix.LUCENE_VERSION}} / lucene-compat"

.buildkite/scripts/third-party-test-credentials.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,23 @@ if [[ "${USE_3RD_PARTY_GCS_CREDENTIALS:-}" == "true" ]]; then
4848
.buildkite/scripts/third-party-test-credentials.gcs.sh "$google_storage_service_account"
4949
fi
5050

51+
if [[ "${USE_3RD_PARTY_MS_GRAPH_CREDENTIALS:-}" == "true" ]]; then
52+
json=$(vault read -format=json secret/ci/elastic-elasticsearch/ms_graph_thirdparty_test_creds)
5153

54+
MS_GRAPH_TENANT_ID=$(echo "$json" | jq -r .data.tenant_id)
55+
export ms_graph_tenant_id="$MS_GRAPH_TENANT_ID"
56+
57+
MS_GRAPH_CLIENT_ID=$(echo "$json" | jq -r .data.client_id)
58+
export ms_graph_client_id="$MS_GRAPH_CLIENT_ID"
59+
60+
MS_GRAPH_CLIENT_SECRET=$(echo "$json" | jq -r .data.client_secret)
61+
export ms_graph_client_secret="$MS_GRAPH_CLIENT_SECRET"
62+
63+
MS_GRAPH_USERNAME=$(echo "$json" | jq -r .data.username)
64+
export ms_graph_username="$MS_GRAPH_USERNAME"
65+
66+
MS_GRAPH_GROUP_ID=$(echo "$json" | jq -r .data.group_id)
67+
export ms_graph_group_id="$MS_GRAPH_GROUP_ID"
68+
fi
5269

5370
unset json

.github/workflows/docs-preview-comment.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/ValuesAggregatorBenchmark.java

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ static void selfTest() {
9595
try {
9696
for (String groups : ValuesAggregatorBenchmark.class.getField("groups").getAnnotationsByType(Param.class)[0].value()) {
9797
for (String dataType : ValuesAggregatorBenchmark.class.getField("dataType").getAnnotationsByType(Param.class)[0].value()) {
98-
run(Integer.parseInt(groups), dataType, 10);
98+
run(Integer.parseInt(groups), dataType, 10, 0);
99+
run(Integer.parseInt(groups), dataType, 10, 1);
99100
}
100101
}
101102
} catch (NoSuchFieldException e) {
@@ -113,7 +114,10 @@ static void selfTest() {
113114
@Param({ BYTES_REF, INT, LONG })
114115
public String dataType;
115116

116-
private static Operator operator(DriverContext driverContext, int groups, String dataType) {
117+
@Param({ "0", "1" })
118+
public int numOrdinalMerges;
119+
120+
private static Operator operator(DriverContext driverContext, int groups, String dataType, int numOrdinalMerges) {
117121
if (groups == 1) {
118122
return new AggregationOperator(
119123
List.of(supplier(dataType).aggregatorFactory(AggregatorMode.SINGLE, List.of(0)).apply(driverContext)),
@@ -125,7 +129,24 @@ private static Operator operator(DriverContext driverContext, int groups, String
125129
List.of(supplier(dataType).groupingAggregatorFactory(AggregatorMode.SINGLE, List.of(1))),
126130
() -> BlockHash.build(groupSpec, driverContext.blockFactory(), 16 * 1024, false),
127131
driverContext
128-
);
132+
) {
133+
@Override
134+
public Page getOutput() {
135+
mergeOrdinal();
136+
return super.getOutput();
137+
}
138+
139+
// simulate OrdinalsGroupingOperator
140+
void mergeOrdinal() {
141+
var merged = supplier(dataType).groupingAggregatorFactory(AggregatorMode.SINGLE, List.of(1)).apply(driverContext);
142+
for (int i = 0; i < numOrdinalMerges; i++) {
143+
for (int p = 0; p < groups; p++) {
144+
merged.addIntermediateRow(p, aggregators.getFirst(), p);
145+
}
146+
}
147+
aggregators.set(0, merged);
148+
}
149+
};
129150
}
130151

131152
private static AggregatorFunctionSupplier supplier(String dataType) {
@@ -331,12 +352,12 @@ private static Block groupingBlock(int groups) {
331352

332353
@Benchmark
333354
public void run() {
334-
run(groups, dataType, OP_COUNT);
355+
run(groups, dataType, OP_COUNT, numOrdinalMerges);
335356
}
336357

337-
private static void run(int groups, String dataType, int opCount) {
358+
private static void run(int groups, String dataType, int opCount, int numOrdinalMerges) {
338359
DriverContext driverContext = driverContext();
339-
try (Operator operator = operator(driverContext, groups, dataType)) {
360+
try (Operator operator = operator(driverContext, groups, dataType, numOrdinalMerges)) {
340361
Page page = page(groups, dataType);
341362
for (int i = 0; i < opCount; i++) {
342363
operator.addInput(page.shallowCopy());

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/ValuesSourceReaderBenchmark.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
import org.elasticsearch.compute.data.Page;
4242
import org.elasticsearch.compute.lucene.LuceneSourceOperator;
4343
import org.elasticsearch.compute.lucene.ShardRefCounted;
44-
import org.elasticsearch.compute.lucene.ValuesSourceReaderOperator;
44+
import org.elasticsearch.compute.lucene.read.ValuesSourceReaderOperator;
45+
import org.elasticsearch.compute.lucene.read.ValuesSourceReaderOperatorStatus;
4546
import org.elasticsearch.compute.operator.topn.TopNOperator;
4647
import org.elasticsearch.core.IOUtils;
4748
import org.elasticsearch.index.IndexSettings;
@@ -343,7 +344,7 @@ public void benchmark() {
343344
);
344345
long sum = 0;
345346
for (Page page : pages) {
346-
op.addInput(page);
347+
op.addInput(page.shallowCopy());
347348
switch (name) {
348349
case "long" -> {
349350
LongVector values = op.getOutput().<LongBlock>getBlock(1).asVector();
@@ -411,7 +412,7 @@ public void benchmark() {
411412
throw new AssertionError("[" + layout + "][" + name + "] expected [" + expected + "] but was [" + sum + "]");
412413
}
413414
boolean foundStoredFieldLoader = false;
414-
ValuesSourceReaderOperator.Status status = (ValuesSourceReaderOperator.Status) op.status();
415+
ValuesSourceReaderOperatorStatus status = (ValuesSourceReaderOperatorStatus) op.status();
415416
for (Map.Entry<String, Integer> e : status.readersBuilt().entrySet()) {
416417
if (e.getKey().indexOf("stored_fields") >= 0) {
417418
foundStoredFieldLoader = true;

benchmarks/src/main/java/org/elasticsearch/benchmark/vector/VectorScorerBenchmark.java renamed to benchmarks/src/main/java/org/elasticsearch/benchmark/vector/Int7uScorerBenchmark.java

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,23 @@
5555
/**
5656
* Benchmark that compares various scalar quantized vector similarity function
5757
* implementations;: scalar, lucene's panama-ized, and Elasticsearch's native.
58-
* Run with ./gradlew -p benchmarks run --args 'VectorScorerBenchmark'
58+
* Run with ./gradlew -p benchmarks run --args 'Int7uScorerBenchmark'
5959
*/
60-
public class VectorScorerBenchmark {
60+
public class Int7uScorerBenchmark {
6161

6262
static {
6363
LogConfigurator.configureESLogging(); // native access requires logging to be initialized
6464
}
6565

6666
@Param({ "96", "768", "1024" })
67-
int dims;
68-
int size = 2; // there are only two vectors to compare
67+
public int dims;
68+
final int size = 2; // there are only two vectors to compare
6969

7070
Directory dir;
7171
IndexInput in;
7272
VectorScorerFactory factory;
7373

74-
byte[] vec1;
75-
byte[] vec2;
74+
byte[] vec1, vec2;
7675
float vec1Offset;
7776
float vec2Offset;
7877
float scoreCorrectionConstant;
@@ -139,39 +138,6 @@ public void setup() throws IOException {
139138
nativeDotScorerQuery = factory.getInt7SQVectorScorer(VectorSimilarityFunction.DOT_PRODUCT, values, queryVec).get();
140139
luceneSqrScorerQuery = luceneScorer(values, VectorSimilarityFunction.EUCLIDEAN, queryVec);
141140
nativeSqrScorerQuery = factory.getInt7SQVectorScorer(VectorSimilarityFunction.EUCLIDEAN, values, queryVec).get();
142-
143-
// sanity
144-
var f1 = dotProductLucene();
145-
var f2 = dotProductNative();
146-
var f3 = dotProductScalar();
147-
if (f1 != f2) {
148-
throw new AssertionError("lucene[" + f1 + "] != " + "native[" + f2 + "]");
149-
}
150-
if (f1 != f3) {
151-
throw new AssertionError("lucene[" + f1 + "] != " + "scalar[" + f3 + "]");
152-
}
153-
// square distance
154-
f1 = squareDistanceLucene();
155-
f2 = squareDistanceNative();
156-
f3 = squareDistanceScalar();
157-
if (f1 != f2) {
158-
throw new AssertionError("lucene[" + f1 + "] != " + "native[" + f2 + "]");
159-
}
160-
if (f1 != f3) {
161-
throw new AssertionError("lucene[" + f1 + "] != " + "scalar[" + f3 + "]");
162-
}
163-
164-
var q1 = dotProductLuceneQuery();
165-
var q2 = dotProductNativeQuery();
166-
if (q1 != q2) {
167-
throw new AssertionError("query: lucene[" + q1 + "] != " + "native[" + q2 + "]");
168-
}
169-
170-
var sqr1 = squareDistanceLuceneQuery();
171-
var sqr2 = squareDistanceNativeQuery();
172-
if (sqr1 != sqr2) {
173-
throw new AssertionError("query: lucene[" + q1 + "] != " + "native[" + q2 + "]");
174-
}
175141
}
176142

177143
@TearDown

0 commit comments

Comments
 (0)