Merge branch 'v1.11' into issue_1554

This commit is contained in:
Hannah Hunter 2023-07-27 11:12:46 -04:00 committed by GitHub
commit befc8e1b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 257 deletions

View File

@ -100,16 +100,29 @@ Dapr solves multi-tenancy at-scale with [namespaces for consumer groups]({{< ref
### At-least-once guarantee
Dapr guarantees at-least-once semantics for message delivery. When an application publishes a message to a topic using the pub/sub API, Dapr ensures the message is delivered *at least once* to every subscriber.
Dapr guarantees at-least-once semantics for message delivery. When an application publishes a message to a topic using the pub/sub API, Dapr ensures the message is delivered *at least once* to every subscriber.
Even if the message fails to deliver, or your application crashes, Dapr attempts to redeliver the message until successful delivery.
All Dapr pub/sub components support the at-least-once guarantee.
### Consumer groups and competing consumers pattern
Dapr automatically handles the burden of dealing with concepts like consumer groups and competing consumers pattern. The competing consumers pattern refers to multiple application instances using a single consumer group. When multiple instances of the same application (running same Dapr app ID) subscribe to a topic, Dapr delivers each message to *only one instance of **that** application*. This concept is illustrated in the diagram below.
Dapr handles the burden of dealing with consumer groups and the competing consumers pattern. In the competing consumers pattern, multiple application instances using a single consumer group compete for the message. Dapr enforces the competing conusmer pattern when replicas use the same `app-id` without explict consumer group overrides.
When multiple instances of the same application (with same `app-id`) subscribe to a topic, Dapr delivers each message to *only one instance of **that** application*. This concept is illustrated in the diagram below.
<img src="/images/pubsub-overview-pattern-competing-consumers.png" width=1000>
<br></br>
Similarly, if two different applications (with different app-IDs) subscribe to the same topic, Dapr delivers each message to *only one instance of **each** application*.
Similarly, if two different applications (with different `app-id`) subscribe to the same topic, Dapr delivers each message to *only one instance of **each** application*.
Not all Dapr pub/sub components support the competing consumer pattern. Currently, the following (non-exhaustive) pub/sub components support this:
- [Apache Kafka]({{< ref setup-apache-kafka >}})
- [Azure Service Bus Queues]({{< ref setup-azure-servicebus-queues >}})
- [RabbitMQ]({{< ref setup-rabbitmq >}})
- [Redis Streams]({{< ref setup-redis-pubsub >}})
### Scoping topics for added security

View File

@ -45,11 +45,12 @@ The table below shows the versions of Dapr releases that have been tested togeth
| Release date | Runtime | CLI | SDKs | Dashboard | Status |
|--------------------|:--------:|:--------|---------|---------|---------|
| July 20th 2023 | 1.11.2</br> | 1.11.0 | Java 1.9.0 </br>Go 1.8.0 </br>PHP 1.1.0 </br>Python 1.10.0 </br>.NET 1.11.0 </br>JS 3.1.0 | 0.13.0 | Supported (current) |
| June 22nd 2023 | 1.11.1</br> | 1.11.0 | Java 1.9.0 </br>Go 1.8.0 </br>PHP 1.1.0 </br>Python 1.10.0 </br>.NET 1.11.0 </br>JS 3.1.0 | 0.13.0 | Supported (current) |
| June 12th 2023 | 1.11.0</br> | 1.11.0 | Java 1.9.0 </br>Go 1.8.0 </br>PHP 1.1.0 </br>Python 1.10.0 </br>.NET 1.11.0 </br>JS 3.1.0 | 0.13.0 | Supported (current) |
| May 15th 2023 | 1.10.7</br> | 1.10.0 | Java 1.8.0 </br>Go 1.7.0 </br>PHP 1.1.0 </br>Python 1.9.0 </br>.NET 1.10.0 </br>JS 3.0.0 | 0.11.0 | Supported |
| May 12th 2023 | 1.10.6</br> | 1.10.0 | Java 1.8.0 </br>Go 1.7.0 </br>PHP 1.1.0 </br>Python 1.9.0 </br>.NET 1.10.0 </br>JS 3.0.0 | 0.11.0 | Supported |
| April 13 2023 |1.10.5</br> | 1.10.0 | Java 1.8.0 </br>Go 1.6.0 </br>PHP 1.1.0 </br>Python 1.9.0 </br>.NET 1.10.0 </br>JS 3.0.0 | 0.11.0 | Supported (current) |
| April 13 2023 |1.10.5</br> | 1.10.0 | Java 1.8.0 </br>Go 1.6.0 </br>PHP 1.1.0 </br>Python 1.9.0 </br>.NET 1.10.0 </br>JS 3.0.0 | 0.11.0 | Supported |
| March 16 2023 | 1.10.4</br> | 1.10.0 | Java 1.8.0 </br>Go 1.6.0 </br>PHP 1.1.0 </br>Python 1.9.0 </br>.NET 1.10.0 </br>JS 2.5.0 | 0.11.0 | Supported |
| March 14 2023 | 1.10.3</br> | 1.10.0 | Java 1.8.0 </br>Go 1.6.0 </br>PHP 1.1.0 </br>Python 1.9.0 </br>.NET 1.10.0 </br>JS 2.5.0 | 0.11.0 | Supported |
| February 24 2023 | 1.10.2</br> | 1.10.0 | Java 1.8.0 </br>Go 1.6.0 </br>PHP 1.1.0 </br>Python 1.9.0 </br>.NET 1.10.0 </br>JS 2.5.0 | 0.11.0 | Supported |
@ -118,7 +119,7 @@ General guidance on upgrading can be found for [self hosted mode]({{< ref self-h
| 1.8.0 to 1.8.6 | N/A | 1.9.6 |
| 1.9.0 | N/A | 1.9.6 |
| 1.10.0 | N/A | 1.10.8 |
| 1.11.0 | N/A | 1.11.1 |
| 1.11.0 | N/A | 1.11.2 |
## Upgrade on Hosting platforms

View File

@ -1,239 +0,0 @@
---
type: docs
title: "Azure OpenAI binding spec"
linkTitle: "Azure OpenAI"
description: "Detailed documentation on the Azure OpenAI binding component"
aliases:
- "/operations/components/setup-bindings/supported-bindings/openai/"
---
## Component format
To setup an Azure OpenAI binding create a component of type `bindings.azure.openai`. See [this guide]({{< ref "howto-bindings.md#1-create-a-binding" >}}) on how to create and apply a binding configuration.
See [this](https://learn.microsoft.com/azure/cognitive-services/openai/overview/) for the documentation for Azure OpenAI Service.
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
spec:
type: bindings.azure.openai
version: v1
metadata:
- name: apiKey # Required
value: "1234567890abcdef"
- name: endpoint # Required
value: "https://myopenai.openai.azure.com"
- name: deploymentId # Required
value: "my-model"
```
{{% alert title="Warning" color="warning" %}}
The above example uses `apiKey` as a plain string. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Spec metadata fields
| Field | Required | Binding support | Details | Example |
|--------------------|:--------:|--------|---------|---------|
| `endpoint` | Y | Output | Azure OpenAI service endpoint URL. | `"https://myopenai.openai.azure.com"` |
| `apiKey` | Y* | Output | The access key of the Azure OpenAI service. Only required when not using Azure AD authentication. | `"1234567890abcdef"` |
| `deploymentId` | Y | Output | The name of the model deployment. | `"my-model"` |
| `azureTenantId` | Y* | Input | The tenant ID of the Azure OpenAI resource. Only required when `apiKey` is not provided. | `"tenentID"` |
| `azureClientId` | Y* | Input | The client ID that should be used by the binding to create or update the Azure OpenAI Subscription and to authenticate incoming messages. Only required when `apiKey` is not provided.| `"clientId"` |
| `azureClientSecret` | Y* | Input | The client secret that should be used by the binding to create or update the Azure OpenAI Subscription and to authenticate incoming messages. Only required when `apiKey` is not provided. | `"clientSecret"` |
### Azure Active Directory (AAD) authentication
The Azure OpenAI binding component supports authentication using all Azure Active Directory mechanisms. For further information and the relevant component metadata fields to provide depending on the choice of AAD authentication mechanism, see the [docs for authenticating to Azure]({{< ref authenticating-azure.md >}}).
#### Example Configuration
```yaml
apiVersion: dapr.io/v1alpha1
kind: component
metadata:
name: <NAME>
spec:
type: bindings.azure.openai
version: v1
metadata:
- name: endpoint
value: "https://myopenai.openai.azure.com"
- name: deploymentId
value: "my-model"
- name: azureTenantId
value: "***"
- name: azureClientId
value: "***"
- name: azureClientSecret
value: "***"
```
## Binding support
This component supports **output binding** with the following operations:
- `completion` : [Completion API](#completion-api)
- `chat-completion` : [Chat Completion API](#chat-completion-api)
### Completion API
To call the completion API with a prompt, invoke the Azure OpenAI binding with a `POST` method and the following JSON body:
```json
{
"operation": "create",
"data": {
"prompt": "A dog is",
"maxTokens":5
}
}
```
The data parameters are:
- `prompt` - string that specifies the prompt to generate completions for.
- `maxTokens` - (optional) defines the max number of tokens to generate. Defaults to 16 for completion API.
- `temperature` - (optional) defines the sampling temperature between 0 and 2. Higher values like 0.8 make the output more random, while lower values like 0.2 make it more focused and deterministic. Defaults to 1.0 for completion API.
- `topP` - (optional) defines the sampling temperature. Defaults to 1.0 for completion API.
- `n` - (optional) defines the number of completions to generate. Defaults to 1 for completion API.
- `presencePenalty` - (optional) Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Defaults to 0.0 for completion API.
- `frequencyPenalty` - (optional) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Defaults to 0.0 for completion API.
Read more about the importance and usage of these parameters in the [Azure OpenAI API documentation](https://learn.microsoft.com/azure/ai-services/openai/reference).
#### Examples
{{< tabs Linux >}}
{{% codetab %}}
```bash
curl -d '{ "data": {"prompt": "A dog is ", "maxTokens":15}, "operation": "completion" }' \
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
```
{{% /codetab %}}
{{< /tabs >}}
#### Response
The response body contains the following JSON:
```json
[
{
"finish_reason": "length",
"index": 0,
"text": " a pig in a dress.\n\nSun, Oct 20, 2013"
},
{
"finish_reason": "length",
"index": 1,
"text": " the only thing on earth that loves you\n\nmore than he loves himself.\"\n\n"
}
]
```
### Chat Completion API
To perform a chat-completion operation, invoke the Azure OpenAI binding with a `POST` method and the following JSON body:
```json
{
"operation": "chat-completion",
"data": {
"messages": [
{
"role": "system",
"message": "You are a bot that gives really short replies"
},
{
"role": "user",
"message": "Tell me a joke"
}
],
"n": 2,
"maxTokens": 30,
"temperature": 1.2
}
}
```
The data parameters are:
- `messages` - array of messages that will be used to generate chat completions.
Each message is of the form:
- `role` - string that specifies the role of the message. Can be either `user`, `system` or `assistant`.
- `message` - string that specifies the conversation message for the role.
- `maxTokens` - (optional) defines the max number of tokens to generate. Defaults to 16 for the chat completion API.
- `temperature` - (optional) defines the sampling temperature between 0 and 2. Higher values like 0.8 make the output more random, while lower values like 0.2 make it more focused and deterministic. Defaults to 1.0 for the chat completion API.
- `topP` - (optional) defines the sampling temperature. Defaults to 1.0 for the chat completion API.
- `n` - (optional) defines the number of completions to generate. Defaults to 1 for the chat completion API.
- `presencePenalty` - (optional) Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Defaults to 0.0 for the chat completion API.
- `frequencyPenalty` - (optional) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Defaults to 0.0 for the chat completion API.
#### Example
{{< tabs Linux >}}
{{% codetab %}}
```bash
curl -d '{
"data": {
"messages": [
{
"role": "system",
"message": "You are a bot that gives really short replies"
},
{
"role": "user",
"message": "Tell me a joke"
}
],
"n": 2,
"maxTokens": 30,
"temperature": 1.2
},
"operation": "chat-completion"
}' \
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
```
{{% /codetab %}}
{{< /tabs >}}
#### Response
The response body contains the following JSON:
```json
[
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Why was the math book sad? Because it had too many problems.",
"role": "assistant"
}
},
{
"finish_reason": "stop",
"index": 1,
"message": {
"content": "Why did the tomato turn red? Because it saw the salad dressing!",
"role": "assistant"
}
}
]
```
## Related links
- [Basic schema for a Dapr component]({{< ref component-schema >}})
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})
- [Azure OpenAI Rest examples](https://learn.microsoft.com/azure/ai-services/openai/reference)

View File

@ -20,8 +20,8 @@ scopes:
- <REPLACE-WITH-SCOPED-APPIDS>
spec:
policies: # Required
timeouts: # Replace with any unique name
timeoutName: <REPLACE-WITH-TIME-VALUE>
timeouts:
timeoutName: <REPLACE-WITH-TIME-VALUE> # Replace with any unique name
retries:
retryName: # Replace with any unique name
policy: <REPLACE-WITH-VALUE>
@ -62,4 +62,4 @@ targets: # Required
## Related links
[Learn more about resiliency policies and targets]({{< ref resiliency-overview.md >}})
[Learn more about resiliency policies and targets]({{< ref resiliency-overview.md >}})

View File

@ -61,12 +61,4 @@
since: "1.0"
features:
input: true
output: true
- component: Azure OpenAI
link: openai
state: Alpha
version: v1
since: "1.12"
features:
input: false
output: true
output: true

View File

@ -1 +1 @@
{{- if .Get "short" }}1.11{{ else if .Get "long" }}1.11.1{{ else if .Get "cli" }}1.11.0{{ else }}1.11.1{{ end -}}
{{- if .Get "short" }}1.11{{ else if .Get "long" }}1.11.2{{ else if .Get "cli" }}1.11.0{{ else }}1.11.2{{ end -}}