Skip to content

Commit

Permalink
Merge branch 'main' into remove-consistent-secure-settings-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
albertzaharovits committed Jul 16, 2024
2 parents bd50049 + 199910c commit 1fe812b
Show file tree
Hide file tree
Showing 149 changed files with 4,046 additions and 1,878 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ public Set<String> getMissingClassExcludes() {
@SkipWhenEmpty
public abstract ConfigurableFileCollection getJarsToScan();

@Classpath
public FileCollection getClasspath() {
return classpath;
}

@TaskAction
public void runThirdPartyAudit() throws IOException {
Set<File> jars = getJarsToScan().getFiles();
Expand Down
5 changes: 0 additions & 5 deletions docs/changelog/110352.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions docs/changelog/110593.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 110593
summary: "[ES|QL] add tests for stats by constant"
area: ES|QL
type: bug
issues:
- 105383
5 changes: 5 additions & 0 deletions docs/changelog/110677.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 110677
summary: Add validation for synthetic source mode in logs mode indices
area: Logs
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/110718.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 110718
summary: "ESQL: Add boolean support to TOP aggregation"
area: ES|QL
type: feature
issues: []
7 changes: 7 additions & 0 deletions docs/changelog/110793.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pr: 110793
summary: Fix for union-types for multiple columns with the same name
area: ES|QL
type: bug
issues:
- 110490
- 109916
13 changes: 9 additions & 4 deletions docs/reference/esql/esql-across-clusters.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

preview::["{ccs-cap} for {esql} is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features."]

[NOTE]
====
For {ccs-cap} with {esql} on version 8.16 or later, remote clusters must also be on version 8.16 or later.
====

With {esql}, you can execute a single query across multiple clusters.

[discrete]
Expand Down Expand Up @@ -64,7 +69,7 @@ You will need to:
* Create an API key on the *remote cluster* using the <<security-api-create-cross-cluster-api-key,Create cross-cluster API key>> API or using the {kibana-ref}/api-keys.html[Kibana API keys UI].
* Add the API key to the keystore on the *local cluster*, as part of the steps in <<remote-clusters-security-api-key-local-actions,configuring the local cluster>>. All cross-cluster requests from the local cluster are bound by the API key’s privileges.

Using {esql} with the API key based security model requires some additional permissions that may not be needed when using the traditional query DSL based search.
Using {esql} with the API key based security model requires some additional permissions that may not be needed when using the traditional query DSL based search.
The following example API call creates a role that can query remote indices using {esql} when using the API key based security model.

[source,console]
Expand All @@ -73,11 +78,11 @@ POST /_security/role/remote1
{
"cluster": ["cross_cluster_search"], <1>
"indices": [
{
{
"names" : [""], <2>
"privileges": ["read"]
}
],
],
"remote_indices": [ <3>
{
"names": [ "logs-*" ],
Expand All @@ -93,7 +98,7 @@ POST /_security/role/remote1
<3> The indices allowed read access to the remote cluster. The configured <<security-api-create-cross-cluster-api-key,cross-cluster API key>> must also allow this index to be read.
<4> The `read_cross_cluster` privilege is always required when using {esql} across clusters with the API key based security model.
<5> The remote clusters to which these privileges apply.
This remote cluster must be configured with a <<security-api-create-cross-cluster-api-key,cross-cluster API key>> and connected to the remote cluster before the remote index can be queried.
This remote cluster must be configured with a <<security-api-create-cross-cluster-api-key,cross-cluster API key>> and connected to the remote cluster before the remote index can be queried.
Verify connection using the <<cluster-remote-info, Remote cluster info>> API.

You will then need a user or API key with the permissions you created above. The following example API call creates a user with the `remote1` role.
Expand Down
24 changes: 24 additions & 0 deletions docs/reference/esql/functions/kibana/definition/top.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/reference/esql/functions/types/top.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions docs/reference/inference/service-anthropic.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
[[infer-service-anthropic]]
=== Anthropic {infer} service

Creates an {infer} endpoint to perform an {infer} task with the `anthropic` service.


[discrete]
[[infer-service-anthropic-api-request]]
==== {api-request-title}

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

[discrete]
[[infer-service-anthropic-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:

* `completion`
--

[discrete]
[[infer-service-anthropic-api-request-body]]
==== {api-request-body-title}

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

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

`api_key`:::
(Required, string)
A valid API key for the Anthropic API.

`model_id`:::
(Required, string)
The name of the model to use for the {infer} task.
You can find the supported models at https://docs.anthropic.com/en/docs/about-claude/models#model-names[Anthropic models].

`rate_limit`:::
(Optional, object)
By default, the `anthropic` service sets the number of requests allowed per minute to `50`.
This helps to minimize the number of rate limit errors returned from Anthropic.
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`::
(Required, object)
include::inference-shared.asciidoc[tag=task-settings]
+
.`task_settings` for the `completion` task type
[%collapsible%closed]
=====
`max_tokens`:::
(Required, integer)
The maximum number of tokens to generate before stopping.
`temperature`:::
(Optional, float)
The amount of randomness injected into the response.
+
For more details about the supported range, see the https://docs.anthropic.com/en/api/messages[Anthropic messages API].
`top_k`:::
(Optional, integer)
Specifies to only sample from the top K options for each subsequent token.
+
Recommended for advanced use cases only. You usually only need to use `temperature`.
+
For more details, see the https://docs.anthropic.com/en/api/messages[Anthropic messages API].
`top_p`:::
(Optional, float)
Specifies to use Anthropic's nucleus sampling.
+
In nucleus sampling, Anthropic computes the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
Recommended for advanced use cases only. You usually only need to use `temperature`.
+
For more details, see the https://docs.anthropic.com/en/api/messages[Anthropic messages API].
=====

[discrete]
[[inference-example-anthropic]]
==== Anthropic service example

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

[source,console]
------------------------------------------------------------
PUT _inference/completion/anthropic_completion
{
"service": "anthropic",
"service_settings": {
"api_key": "<api_key>",
"model_id": "<model_id>"
},
"task_settings": {
"max_tokens": 1024
}
}
------------------------------------------------------------
// TEST[skip:TBD]
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,32 @@ public void testOverrideIndexSorting() throws IOException {
assertThat(type, equalTo("date"));
}

public void testConfigureStoredSource() throws IOException {
var storedSourceMapping = """
{
"template": {
"mappings": {
"_source": {
"mode": "stored"
}
}
}
}""";

Exception e = assertThrows(ResponseException.class, () -> putComponentTemplate(client, "logs@custom", storedSourceMapping));
assertThat(
e.getMessage(),
containsString("updating component template [logs@custom] results in invalid composable template [logs]")
);
assertThat(e.getMessage(), containsString("Indices with with index mode [logs] only support synthetic source"));

assertOK(createDataStream(client, "logs-custom-dev"));

var mapping = getMapping(client, getDataStreamBackingIndex(client, "logs-custom-dev", 0));
String sourceMode = (String) subObject("_source").apply(mapping).get("mode");
assertThat(sourceMode, equalTo("synthetic"));
}

public void testOverrideIndexCodec() throws IOException {
var indexCodecOverrideTemplate = """
{
Expand Down
Loading

0 comments on commit 1fe812b

Please sign in to comment.