mirror of https://github.com/dapr/docs.git
Upmerge v1.0 to v1.1
This commit is contained in:
commit
f251137041
|
|
@ -1,5 +1,5 @@
|
|||
# Site Configuration
|
||||
baseURL = "https://v1-0.docs.dapr.io/"
|
||||
baseURL = "https://docs.dapr.io/"
|
||||
title = "Dapr Docs"
|
||||
theme = "docsy"
|
||||
disableFastRender = true
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ In container hosting environments such as Kubernetes, Dapr runs as a side-car co
|
|||
|
||||
## Developer language SDKs and frameworks
|
||||
|
||||
To make using Dapr more natural for different languages, it also includes [language specific SDKs]({{<ref sdks>}}) for Go, Java, JavaScript, .NET, PHP and Python. These SDKs expose the functionality in the Dapr building blocks, such as saving state, publishing an event or creating an actor, through a typed, language API rather than calling the http/gRPC API. This enables you to write a combination of stateless and stateful functions and actors all in the language of their choice. And because these SDKs share the Dapr runtime, you get cross-language actor and functions support.
|
||||
To make using Dapr more natural for different languages, it also includes [language specific SDKs]({{<ref sdks>}}) for C++, Go, Java, JavaScript, Python, Rust .NET and PHP. These SDKs expose the functionality in the Dapr building blocks, such as saving state, publishing an event or creating an actor, through a typed, language API rather than calling the http/gRPC API. This enables you to write a combination of stateless and stateful functions and actors all in the language of their choice. And because these SDKs share the Dapr runtime, you get cross-language actor and functions support.
|
||||
|
||||
### SDKs
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ To make using Dapr more natural for different languages, it also includes [langu
|
|||
Dapr can be used from any developer framework. Here are some that have been integrated with Dapr.
|
||||
|
||||
#### Web
|
||||
In the Dapr [.NET SDK](https://github.com/dapr/dotnet-sdk) you can find ASP.NET Core integration, which brings stateful routing controllers that respond to pub/sub events from other services.
|
||||
In the Dapr [.NET SDK](https://github.com/dapr/dotnet-sdk) you can find [ASP.NET Core](https://dotnet.microsoft.com/apps/aspnet) integration, which brings stateful routing controllers that respond to pub/sub events from other services.
|
||||
|
||||
In the Dapr [Java SDK](https://github.com/dapr/java-sdk) you can find [Spring Boot](https://spring.io/) integration.
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ As an example, for this specific section the complete reference to the page and
|
|||
```
|
||||
|
||||
### Images
|
||||
The markdown spec used by Docsy and Hugo does not give an option to resize images using markdown notation. Instead, raw HMTL is used.
|
||||
The markdown spec used by Docsy and Hugo does not give an option to resize images using markdown notation. Instead, raw HTML is used.
|
||||
|
||||
Begin by placing images under `/daprdocs/static/images` with the naming convention of `[page-name]-[image-name].[png|jpg|svg]`.
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ dapr run --app-id myapp --dapr-http-port 3500
|
|||
|
||||
Then in a separate terminal save a key/value pair into your statestore:
|
||||
```bash
|
||||
curl -X POST -H "Content-Type: application/json" -d '{ "key": "key1", "value": "value1"}' http://localhost:3500/v1.0/state/statestore
|
||||
curl -X POST -H "Content-Type: application/json" -d '[{ "key": "key1", "value": "value1"}]' http://localhost:3500/v1.0/state/statestore
|
||||
```
|
||||
|
||||
Now get the state you just saved:
|
||||
|
|
@ -98,7 +98,7 @@ dapr --app-id myapp --port 3500 run
|
|||
|
||||
Then in a separate terminal save a key/value pair into your statestore:
|
||||
```powershell
|
||||
Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '{"key": "key1", "value": "value1"}' -Uri 'http://localhost:3500/v1.0/state/statestore'
|
||||
Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '[{"key": "key1", "value": "value1"}]' -Uri 'http://localhost:3500/v1.0/state/statestore'
|
||||
```
|
||||
|
||||
Now get the state you just saved:
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ no_list: true
|
|||
|
||||
### HTTP
|
||||
|
||||
| Name | Description | Status |
|
||||
|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|----------------------------|
|
||||
| [Rate limit]({{< ref middleware-rate-limit.md >}}) | Restricts the maximum number of allowed HTTP requests per second | Alpha |
|
||||
| [OAuth2]({{< ref middleware-oauth2.md >}}) | Enables the [OAuth2 Authorization Grant flow](https://tools.ietf.org/html/rfc6749#section-4.1) on a Web API | Alpha |
|
||||
| [OAuth2 client credentials]({{< ref middleware-oauth2clientcredentials.md >}}) | Enables the [OAuth2 Client Credentials Grant flow](https://tools.ietf.org/html/rfc6749#section-4.4) on a Web API | Alpha |
|
||||
| [Bearer]({{< ref middleware-bearer.md >}}) | Verifies a [Bearer Token](https://tools.ietf.org/html/rfc6750) using [OpenID Connect](https://openid.net/connect/) on a Web API | Alpha |
|
||||
| [Open Policy Agent]({{< ref middleware-opa.md >}}) | Applies [Rego/OPA Policies](https://www.openpolicyagent.org/) to incoming Dapr HTTP requests | Alpha |
|
||||
| [Uppercase]({{< ref middleware-uppercase.md >}}) | Converts the body of the request to uppercase letters | GA (For local development) |
|
||||
| Name | Description | Status | Component version |
|
||||
|------------|----------------|-----------|--------------------|
|
||||
| [Rate limit]({{< ref middleware-rate-limit.md >}}) | Restricts the maximum number of allowed HTTP requests per second | Alpha | v1|
|
||||
| [OAuth2]({{< ref middleware-oauth2.md >}}) | Enables the [OAuth2 Authorization Grant flow](https://tools.ietf.org/html/rfc6749#section-4.1) on a Web API | Alpha | v1|
|
||||
| [OAuth2 client credentials]({{< ref middleware-oauth2clientcredentials.md >}}) | Enables the [OAuth2 Client Credentials Grant flow](https://tools.ietf.org/html/rfc6749#section-4.4) on a Web API | Alpha | v1|
|
||||
| [Bearer]({{< ref middleware-bearer.md >}}) | Verifies a [Bearer Token](https://tools.ietf.org/html/rfc6750) using [OpenID Connect](https://openid.net/connect/) on a Web API | Alpha | v1|
|
||||
| [Open Policy Agent]({{< ref middleware-opa.md >}}) | Applies [Rego/OPA Policies](https://www.openpolicyagent.org/) to incoming Dapr HTTP requests | Alpha | v1|
|
||||
| [Uppercase]({{< ref middleware-uppercase.md >}}) | Converts the body of the request to uppercase letters | GA (For local development) | v1|
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ metadata:
|
|||
name: ratelimit
|
||||
spec:
|
||||
type: middleware.http.ratelimit
|
||||
version: v1
|
||||
metadata:
|
||||
- name: maxRequestsPerSecond
|
||||
value: 10
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ The uppercase [HTTP middleware]({{< ref middleware-concept.md >}}) converts the
|
|||
## Component format
|
||||
|
||||
In the following definition, the maximum requests per second are set to 10:
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
|
|
@ -18,6 +19,7 @@ metadata:
|
|||
name: uppercase
|
||||
spec:
|
||||
type: middleware.http.uppercase
|
||||
version: v1
|
||||
```
|
||||
|
||||
This component has no `metadata` to configure.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '[{ "key":
|
|||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Step 2: Get state
|
||||
## Step 3: Get state
|
||||
|
||||
Now get the state you just stored using a key with the state management API:
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ Invoke-RestMethod -Uri 'http://localhost:3500/v1.0/state/statestore/name'
|
|||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Step 3: See how the state is stored in Redis
|
||||
## Step 4: See how the state is stored in Redis
|
||||
|
||||
You can look in the Redis container and verify Dapr is using it as a state store. Run the following to use the Redis CLI:
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ spec:
|
|||
value: "0"
|
||||
- name: reconnectWait
|
||||
value: "0"
|
||||
- name: concurrency
|
||||
- name: concurrencyMode
|
||||
value: parallel
|
||||
```
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
|
|
@ -52,7 +52,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
|||
| requeueInFailure | N | Whether or not to requeue when sending a [negative acknolwedgement](https://www.rabbitmq.com/nack.html) in case of a failure. Defaults to `"false"` | `"true"`, `"false"`
|
||||
| prefetchCount | N | Number of messages to [prefecth](https://www.rabbitmq.com/consumer-prefetch.html). Consider changing this to a non-zero value for production environments. Defaults to `"0"`, which means that all available messages will be pre-fetched. | `"2"`
|
||||
| reconnectWait | N | How long to wait (in seconds) before reconnecting if a connection failure occurs | `"0"`
|
||||
| concurrency | N | `paralell` is the default, and allows processing multiple messages in paralell (limited by the `app-max-concurrency` annotation, if configured). Set to `single` to disable paralell processing. In most situations there's no reason to change this. | `paralell`, `single`
|
||||
| concurrencyMode | N | `parallel` is the default, and allows processing multiple messages in parallel (limited by the `app-max-concurrency` annotation, if configured). Set to `single` to disable parallel processing. In most situations there's no reason to change this. | `parallel`, `single`
|
||||
|
||||
|
||||
## Create a RabbitMQ server
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ You can install Dapr to a Kubernetes cluster using the [Dapr CLI]({{< ref instal
|
|||
The `-k` flag initializes Dapr on the Kubernetes cluster in your current context.
|
||||
|
||||
{{% alert title="Target cluster" color="primary" %}}
|
||||
Make sure the correct "target" cluster is set. Check `kubectl context (kubectl config kubectl config get-contexts)` to verify. You can set a different context using `kubectl config use-context <CONTEXT>`.
|
||||
Make sure the correct "target" cluster is set. Check `kubectl context (kubectl config get-contexts)` to verify. You can set a different context using `kubectl config use-context <CONTEXT>`.
|
||||
{{% /alert %}}
|
||||
|
||||
Run on your local machine:
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ helm install elasticsearch elastic/elasticsearch -n dapr-monitoring
|
|||
If you are using minikube or want to disable persistent volumes for development purposes, you can disable it by using the following command:
|
||||
|
||||
```bash
|
||||
helm install elasticsearch elastic/elasticsearch -n dapr-monitoring --set persistence.enabled=false --replicas=1
|
||||
helm install elasticsearch elastic/elasticsearch -n dapr-monitoring --set persistence.enabled=false,replicas=1
|
||||
```
|
||||
|
||||
4. Install Kibana
|
||||
|
|
|
|||
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Actors activation performance"
|
||||
linkTitle: "Actors activation performance"
|
||||
weight: 20000
|
||||
description: ""
|
||||
---
|
||||
This article provides service invocation API performance benchmarks and resource utilization for actors in Dapr on Kubernetes.
|
||||
|
||||
## System overview
|
||||
|
||||
For applications using actors in Dapr there are two aspects to be considered. First, is the routing of actor invocations handled by Dapr sidecar. Second, is the actors runtime that is implemented and handled on the application side and depends on the SDK. For now, the performance tests are using the Java SDK to provide an actors runtime in the application.
|
||||
|
||||
### Kubernetes components
|
||||
|
||||
* Sidecar (data plane)
|
||||
* Placement (required for actors, control plane mapping actor types to hosts)
|
||||
* Operator (control plane)
|
||||
* Sidecar Injector (control plane)
|
||||
* Sentry (optional, control plane)
|
||||
|
||||
## Performance summary for Dapr v1.0
|
||||
|
||||
The actors API in Dapr sidecar will identify which hosts are registered for a given actor type and route the request to the appropriate host for a given actor ID. The host runs an instance of the application and uses the Dapr SDK (.Net, Java, Python or PHP) to handle actors requests via HTTP.
|
||||
|
||||
This test uses invokes actors via Dapr's HTTP API directly.
|
||||
|
||||
For more information see [actors overview]({{< ref actors-overview.md >}}).
|
||||
|
||||
### Kubernetes performance test setup
|
||||
|
||||
The test was conducted on a 3 node Kubernetes cluster, using commodity hardware running 4 cores and 8GB of RAM, without any network acceleration.
|
||||
The setup included a load tester ([Fortio](https://github.com/fortio/fortio)) pod with a Dapr sidecar injected into it that called the service invocation API to reach a pod on a different node.
|
||||
|
||||
Test parameters:
|
||||
|
||||
* 500 requests per second
|
||||
* 1 replica
|
||||
* 1 minute duration
|
||||
* Sidecar limited to 0.5 vCPU
|
||||
* mTLS enabled
|
||||
* Sidecar telemetry enabled (tracing with a sampling rate of 0.1)
|
||||
* Payload of an empty JSON object: `{}`
|
||||
|
||||
### Results
|
||||
|
||||
* The actual throughput was ~500 qps.
|
||||
* The tp90 latency was ~3ms.
|
||||
* The tp99 latency was ~6.2ms.
|
||||
* Dapr app consumed ~523m CPU and ~304.7Mb of Memory
|
||||
* Dapr sidecar consumed 2m CPU and ~18.2Mb of Memory
|
||||
* No app restarts
|
||||
* No sidecar restarts
|
||||
|
||||
## Related links
|
||||
* For more information see [overview of Dapr on Kubernetes]({{< ref kubernetes-overview.md >}})
|
||||
|
|
@ -61,6 +61,8 @@ Note: Components have a production usage lifecycle status: Alpha, Beta and GA (s
|
|||
* List of [secret store components]({{< ref supported-secret-stores.md >}})
|
||||
* List of [binding components]({{< ref supported-bindings.md >}})
|
||||
|
||||
For more information on component versioning read [Version 2 and beyond of a component](https://github.com/dapr/components-contrib/blob/master/docs/developing-component.md#version-2-and-beyond-of-a-component)
|
||||
|
||||
### Component schemas
|
||||
|
||||
Versioning for component YAMLs comes in two forms:
|
||||
|
|
@ -84,6 +86,7 @@ spec:
|
|||
- name: redisPassword
|
||||
value: general-kenobi
|
||||
```
|
||||
|
||||
### Component manifest version
|
||||
The Component YAML manifest is versioned with `dapr.io/v1alpha1`.
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// Your apiKey and indexName will be given to you once
|
||||
// we create your config
|
||||
apiKey: '54ae43aa28ce8f00c54c8d5f544d29b9',
|
||||
indexName: 'crawler_dapr-rc3',
|
||||
indexName: 'crawler_dapr',
|
||||
appId: 'O0QLQGNF38',
|
||||
// Replace inputSelector with a CSS selector
|
||||
// matching your search input
|
||||
|
|
|
|||
Loading…
Reference in New Issue