Skip to content

Commit

Permalink
Merge branch 'main' into create-index-avoid-cluster-state-build
Browse files Browse the repository at this point in the history
  • Loading branch information
albertzaharovits committed Aug 29, 2024
2 parents c2c8a43 + 2c29a3a commit bcd9ea2
Show file tree
Hide file tree
Showing 136 changed files with 6,394 additions and 738 deletions.
16 changes: 5 additions & 11 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.internal.test.TestUtil

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
Expand Down Expand Up @@ -29,6 +30,7 @@ tasks.named("javadoc").configure { enabled = false }
configurations {
expression
painless
nativeLib
}

dependencies {
Expand All @@ -45,6 +47,7 @@ dependencies {
implementation project(path: ':libs:elasticsearch-simdvec')
expression(project(path: ':modules:lang-expression', configuration: 'zip'))
painless(project(path: ':modules:lang-painless', configuration: 'zip'))
nativeLib(project(':libs:elasticsearch-native'))
api "org.openjdk.jmh:jmh-core:$versions.jmh"
annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh"
// Dependencies of JMH
Expand Down Expand Up @@ -76,17 +79,8 @@ tasks.register("copyPainless", Copy) {
tasks.named("run").configure {
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args << "-Dplugins.dir=${buildDir}/plugins" << "-Dtests.index=${buildDir}/index"
dependsOn "copyExpression", "copyPainless"
systemProperty 'es.nativelibs.path', file("../libs/native/libraries/build/platform/${platformName()}-${os.arch}")
}

String platformName() {
String name = System.getProperty("os.name");
if (name.startsWith("Mac")) {
return "darwin";
} else {
return name.toLowerCase(Locale.ROOT);
}
dependsOn "copyExpression", "copyPainless", configurations.nativeLib
systemProperty 'es.nativelibs.path', TestUtil.getTestLibraryPath(file("../libs/native/libraries/build/platform/").toString())
}

spotless {
Expand Down
2 changes: 1 addition & 1 deletion distribution/docker/src/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<% if (docker_base == 'iron_bank') { %>
ARG BASE_REGISTRY=registry1.dso.mil
ARG BASE_IMAGE=ironbank/redhat/ubi/ubi9
ARG BASE_TAG=9.3
ARG BASE_TAG=9.4
<% } %>
################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tags:
# Build args passed to Dockerfile ARGs
args:
BASE_IMAGE: "redhat/ubi/ubi9"
BASE_TAG: "9.3"
BASE_TAG: "9.4"

# Docker image labels
labels:
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog/112066.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 112066
summary: Do not treat replica as unassigned if primary recently created and unassigned
time is below a threshold
area: Health
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/112178.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 112178
summary: Avoid wrapping rejection exception in exchange
area: ES|QL
type: bug
issues:
- 112106
5 changes: 5 additions & 0 deletions docs/changelog/112242.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112242
summary: Fix toReleaseVersion() when called on the current version id
area: Infra/Core
type: bug
issues: [111900]
6 changes: 6 additions & 0 deletions docs/changelog/112260.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 112260
summary: Fix DLS over Runtime Fields
area: "Authorization"
type: bug
issues:
- 111637
5 changes: 5 additions & 0 deletions docs/changelog/112273.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 111181
summary: "[Inference API] Add Docs for AlibabaCloud AI Search Support for the Inference API"
area: Machine Learning
type: enhancement
issues: [ ]
5 changes: 5 additions & 0 deletions docs/changelog/112277.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112277
summary: Upgrade `repository-azure` dependencies
area: Snapshot/Restore
type: upgrade
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/112320.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112320
summary: Upgrade xcontent to Jackson 2.17.2
area: Infra/Core
type: upgrade
issues: []
1 change: 1 addition & 0 deletions docs/reference/inference/inference-apis.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ include::delete-inference.asciidoc[]
include::get-inference.asciidoc[]
include::post-inference.asciidoc[]
include::put-inference.asciidoc[]
include::service-alibabacloud-ai-search.asciidoc[]
include::service-amazon-bedrock.asciidoc[]
include::service-anthropic.asciidoc[]
include::service-azure-ai-studio.asciidoc[]
Expand Down
1 change: 1 addition & 0 deletions docs/reference/inference/put-inference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The create {infer} API enables you to create an {infer} endpoint and configure a

The following services are available through the {infer} API, click the links to review the configuration details of the services:

* <<infer-service-alibabacloud-ai-search,AlibabaCloud AI Search>>
* <<infer-service-amazon-bedrock,Amazon Bedrock>>
* <<infer-service-anthropic,Anthropic>>
* <<infer-service-azure-ai-studio,Azure AI Studio>>
Expand Down
184 changes: 184 additions & 0 deletions docs/reference/inference/service-alibabacloud-ai-search.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
[[infer-service-alibabacloud-ai-search]]
=== AlibabaCloud AI Search {infer} service

Creates an {infer} endpoint to perform an {infer} task with the `alibabacloud-ai-search` service.

[discrete]
[[infer-service-alibabacloud-ai-search-api-request]]
==== {api-request-title}

`PUT /_inference/<task_type>/<inference_id>`

[discrete]
[[infer-service-alibabacloud-ai-search-api-path-params]]
==== {api-path-parms-title}

`<inference_id>`::
(Required, string)
include::inference-shared.asciidoc[tag=inference-id]

`<task_type>`::
(Required, string)
include::inference-shared.asciidoc[tag=task-type]
+
--
Available task types:

* `text_embedding`,
* `sparse_embedding`.
* `rerank`.
--

[discrete]
[[infer-service-alibabacloud-ai-search-api-request-body]]
==== {api-request-body-title}

`service`::
(Required, string) The type of service supported for the specified task type.
In this case,
`alibabacloud-ai-search`.

`service_settings`::
(Required, object)
include::inference-shared.asciidoc[tag=service-settings]
+
--
These settings are specific to the `alibabacloud-ai-search` service.
--

`api_key`:::
(Required, string)
A valid API key for the AlibabaCloud AI Search API.

`service_id`:::
(Required, string)
The name of the model service to use for the {infer} task.
+
--
Available service_ids for the `text_embedding` task:

* `ops-text-embedding-001`
* `ops-text-embedding-zh-001`
* `ops-text-embedding-en-001`
* `ops-text-embedding-002`

For the supported `text_embedding` service_ids, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[documentation].

Available service_id for the `sparse_embedding` task:

* `ops-text-sparse-embedding-001`

For the supported `sparse_embedding` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-sparse-embedding-api-details[documentation].

Available service_id for the `rerank` task is:

* `ops-bge-reranker-larger`

For the supported `rerank` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/ranker-api-details[documentation].
--

`host`:::
(Required, string)
The name of the host address used for the {infer} task. You can find the host address at https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[ the API keys section] of the documentation.

`workspace`:::
(Required, string)
The name of the workspace used for the {infer} task.

`rate_limit`:::
(Optional, object)
By default, the `alibabacloud-ai-search` service sets the number of requests allowed per minute to `1000`.
This helps to minimize the number of rate limit errors returned from AlibabaCloud AI Search.
To modify this, set the `requests_per_minute` setting of this object in your service settings:
+
--
include::inference-shared.asciidoc[tag=request-per-minute-example]
--


`task_settings`::
(Optional, object)
include::inference-shared.asciidoc[tag=task-settings]
+
.`task_settings` for the `text_embedding` task type
[%collapsible%closed]
=====
`input_type`:::
(Optional, string)
Specifies the type of input passed to the model.
Valid values are:
* `ingest`: for storing document embeddings in a vector database.
* `search`: for storing embeddings of search queries run against a vector database to find relevant documents.
=====
+
.`task_settings` for the `sparse_embedding` task type
[%collapsible%closed]
=====
`input_type`:::
(Optional, string)
Specifies the type of input passed to the model.
Valid values are:
* `ingest`: for storing document embeddings in a vector database.
* `search`: for storing embeddings of search queries run against a vector database to find relevant documents.
`return_token`:::
(Optional, boolean)
If `true`, the token name will be returned in the response. Defaults to `false` which means only the token ID will be returned in the response.
=====

[discrete]
[[inference-example-alibabacloud-ai-search]]
==== AlibabaCloud AI Search service examples

The following example shows how to create an {infer} endpoint called `alibabacloud_ai_search_embeddings` to perform a `text_embedding` task type.

[source,console]
------------------------------------------------------------
PUT _inference/text_embedding/alibabacloud_ai_search_embeddings
{
"service": "alibabacloud-ai-search",
"service_settings": {
"api_key": "<api_key>",
"service_id": "ops-text-embedding-001",
"host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
"workspace": "default"
}
}
------------------------------------------------------------
// TEST[skip:TBD]

The following example shows how to create an {infer} endpoint called
`alibabacloud_ai_search_sparse` to perform a `sparse_embedding` task type.

[source,console]
------------------------------------------------------------
PUT _inference/sparse_embedding/alibabacloud_ai_search_sparse
{
"service": "alibabacloud-ai-search",
"service_settings": {
"api_key": "<api_key>",
"service_id": "ops-text-sparse-embedding-001",
"host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
"workspace": "default"
}
}
------------------------------------------------------------
// TEST[skip:TBD]

The next example shows how to create an {infer} endpoint called
`alibabacloud_ai_search_rerank` to perform a `rerank` task type.

[source,console]
------------------------------------------------------------
PUT _inference/rerank/alibabacloud_ai_search_rerank
{
"service": "alibabacloud-ai-search",
"service_settings": {
"api_key": "<api_key>",
"service_id": "ops-bge-reranker-larger",
"host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
"workspace": "default"
}
}
------------------------------------------------------------
// TEST[skip:TBD]
Loading

0 comments on commit bcd9ea2

Please sign in to comment.