Developer Tooling docs and adding links for Bindings and to other HowTo topics to concepts specs. (#429)

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
This commit is contained in:
Mark Fussell 2020-03-12 10:07:00 -07:00 committed by GitHub
parent fdb5d93815
commit 57bb1df233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 93 additions and 22 deletions

View File

@ -67,7 +67,7 @@ In order to receive events from an input binding:
> On startup Dapr sends a ```OPTIONS``` request for all defined input bindings to the application and expects a different status code as ```NOT FOUND (404)``` if this application wants to subscribe to the binding. > On startup Dapr sends a ```OPTIONS``` request for all defined input bindings to the application and expects a different status code as ```NOT FOUND (404)``` if this application wants to subscribe to the binding.
Read the [How To](../../howto/trigger-app-with-input-binding) section to get started with input bindings. Read the [Create an event-driven app using input bindings](../../howto/trigger-app-with-input-binding) section to get started with input bindings.
## Output bindings ## Output bindings
@ -79,4 +79,10 @@ In order to invoke an output binding:
1. Define the component YAML that describes the type of binding and its metadata (connection info, etc.) 1. Define the component YAML that describes the type of binding and its metadata (connection info, etc.)
2. Use the HTTP endpoint or gRPC method to invoke the binding with an optional payload 2. Use the HTTP endpoint or gRPC method to invoke the binding with an optional payload
Read the [How To](../../howto/send-events-with-output-bindings) section to get started with output bindings. Read the [Send events to external systems using Output Bindings](../../howto/send-events-with-output-bindings) section to get started with output bindings.
## Related Topics
* [Implementing a new binding](https://github.com/dapr/docs/tree/master/reference/specs/bindings)
* [Trigger a service from different resources with input bindings](./trigger-app-with-input-binding)
* [Invoke different resources using output bindings](./send-events-with-output-bindings)

View File

@ -2,11 +2,27 @@
Here you'll find a list of How To guides that walk you through accomplishing specific tasks. Here you'll find a list of How To guides that walk you through accomplishing specific tasks.
## Contents
- [Service invocation](#service-invocation)
- [State Management](#state-management)
- [Pub/Sub](#Pub/Sub)
- [Bindings and Triggers](#bindings-and-triggers)
- [Actors](#actors)
- [Observerability](#observerability)
- [Security](#security)
- [Components](#components)
- [Developer Tooling](#developer-experience)
- [Infrastructure integration](#Infrastructure-integration)
## Service invocation ## Service invocation
* [Invoke other services in your cluster or environment](./invoke-and-discover-services) * [Invoke other services in your cluster or environment](./invoke-and-discover-services)
* [Create a gRPC enabled app, and invoke Dapr over gRPC](./create-grpc-app) * [Create a gRPC enabled app, and invoke Dapr over gRPC](./create-grpc-app)
### Middleware
* [Authorization with oAuth](./authorization-with-oauth)
## State Management ## State Management
* [Setup Dapr state store](./setup-state-store) * [Setup Dapr state store](./setup-state-store)
@ -14,31 +30,37 @@ Here you'll find a list of How To guides that walk you through accomplishing spe
* [Query the underlying state store](./query-state-store) * [Query the underlying state store](./query-state-store)
* [Create a stateful, replicated service with different consistency/concurrency levels](./stateful-replicated-service) * [Create a stateful, replicated service with different consistency/concurrency levels](./stateful-replicated-service)
* [Control your app's throttling using rate limiting features](./control-concurrency) * [Control your app's throttling using rate limiting features](./control-concurrency)
* [Configuring Redis for state management ](./configure-redis)
## Pub/Sub ## Pub/Sub
* [Setup Dapr Pub/Sub](./setup-pub-sub-message-broker) * [Setup Dapr Pub/Sub](./setup-pub-sub-message-broker)
* [Use Pub/Sub to publish messages to a given topic](./publish-topic) * [Use Pub/Sub to publish messages to a given topic](./publish-topic)
* [Use Pub/Sub to consume events from a topic](./consume-topic) * [Use Pub/Sub to consume events from a topic](./consume-topic)
* [Configuring Redis for pub/sub ](./configure-redis)
## Bindings and Triggers ## Bindings and Triggers
* [Implementing a new binding](https://github.com/dapr/docs/tree/master/reference/specs/bindings)
* [Trigger a service from different resources with input bindings](./trigger-app-with-input-binding) * [Trigger a service from different resources with input bindings](./trigger-app-with-input-binding)
* [Invoke different resources using output bindings](./send-events-with-output-bindings) * [Invoke different resources using output bindings](./send-events-with-output-bindings)
## Middleware ## Actors
For Actors How Tos see the SDK documentation
* [.NET Actors](https://github.com/dapr/dotnet-sdk/blob/master/docs/get-started-dapr-actor.md)
* [Java Actors](https://github.com/dapr/java-sdk)
* [Authorization with oAuth](./authorization-with-oauth) ## Observerability
### Distributed Tracing
## Distributed Tracing
* [Diagnose your services with distributed tracing](./diagnose-with-tracing) * [Diagnose your services with distributed tracing](./diagnose-with-tracing)
## Mutual Transport Layer Security (TLS) ## Security
### Mutual Transport Layer Security (TLS)
* [Setup and configure mutual TLS between Dapr instances](./configure-mtls) * [Setup and configure mutual TLS between Dapr instances](./configure-mtls)
## Secrets ### Secrets
* [Configure component secrets using Dapr secret stores](./setup-secret-store) * [Configure component secrets using Dapr secret stores](./setup-secret-store)
* [Using the Secrets API to get application secrets](./get-secrets) * [Using the Secrets API to get application secrets](./get-secrets)
@ -47,18 +69,22 @@ Here you'll find a list of How To guides that walk you through accomplishing spe
* [Limit components for one or more applications using scopes](./components-scopes) * [Limit components for one or more applications using scopes](./components-scopes)
## Autoscaling ## Developer experience
### Using Visual Studio Code
* [Autoscale on Kubernetes using KEDA and Dapr bindings](./autoscale-with-keda) * [Using Remote Containers for application development](./vscode-remote-containers-daprd)
* [Developing and debugging Dapr applications](./vscode-debugging-daprd)
## Configuring Visual Studio Code * [Setup development environment for Dapr runtime development ](https://github.com/dapr/dapr/blob/master/docs/development/setup-dapr-development-using-vscode.md)
* [Debugging with daprd](./vscode-debugging-daprd) ### Using IntelliJ
## Configuring IntelliJ * [Developing and debugging with daprd](./intellij-debugging-daprd)
* [Debugging with daprd](./intellij-debugging-daprd) ### SDKs
## SDKs * [Serialization in Dapr's SDKs](./serialize)
* [Serialize objects](./serialize) ## Infrastructure integration
* [Autoscale on Kubernetes using KEDA and Dapr bindings](./autoscale-with-keda)

View File

@ -228,3 +228,7 @@ On Kubernetes, set the required `dapr.io/protocol: "grpc"` and `dapr.io/port: "4
You can use Dapr with any language supported by Protobuf, and not just with the currently available generated SDKs. You can use Dapr with any language supported by Protobuf, and not just with the currently available generated SDKs.
Using the [protoc](https://developers.google.com/protocol-buffers/docs/downloads) tool you can generate the Dapr clients for other languages like Ruby, C++, Rust and others. Using the [protoc](https://developers.google.com/protocol-buffers/docs/downloads) tool you can generate the Dapr clients for other languages like Ruby, C++, Rust and others.
## Related Topics
* [Service invocation concepts](../../concepts/service-invocation/README.md)
* [Service invocation API specification](../../reference/api/service_invocation_api.md)

View File

@ -101,3 +101,7 @@ The example above showed you how to directly invoke a different service running
Dapr outputs metrics and tracing information allowing you to visualize a call graph between services, log errors and optionally log the payload body. Dapr outputs metrics and tracing information allowing you to visualize a call graph between services, log errors and optionally log the payload body.
For more information on tracing, visit [this link](../../best-practices/troubleshooting/tracing.md). For more information on tracing, visit [this link](../../best-practices/troubleshooting/tracing.md).
## Related Topics
* [Service invocation concepts](../../concepts/service-invocation/README.md)
* [Service invocation API specification](../../reference/api/service_invocation_api.md)

View File

@ -43,4 +43,4 @@ curl -X POST -H http://localhost:3500/v1.0/bindings/myEvent -d '{ "data": { "me
As seen above, we invoked the `/binding` endpoint with the name of the binding to invoke, in our case its `myEvent`. As seen above, we invoked the `/binding` endpoint with the name of the binding to invoke, in our case its `myEvent`.
The payload goes inside the `data` field. The payload goes inside the `data` field.

View File

@ -39,6 +39,9 @@ To setup a state store in Kubernetes, use `kubectl` to apply the component file:
```bash ```bash
kubectl apply -f statestore.yaml kubectl apply -f statestore.yaml
``` ```
## Related Topics
* [State management concepts](../../concepts/state-management/README.md)
* [State management API specification](../../reference/api/state_api.md)
## Reference ## Reference

View File

@ -1,4 +1,16 @@
# Configuring Visual Studio Code for debugging with daprd # Application development with Visual Studio Code
## Visual Studio Code Dapr extension
It is recommended to use the *preview* of the [Dapr Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-dapr) available in the Visual Studio marketplace for local development and debugging of your Dapr applications.
Watch this [20 min video](https://www.youtube.com/watch?v=OtbYCBt9C34&t=85) on how to use the Dapr VS Code extension.
### Debugging multiple Dapr applications at the same time
Using the VS Code extension you can debug multiple Dapr applications at the same time with [Multi-target debugging](https://code.visualstudio.com/docs/editor/debugging#_multitarget-debugging)
## Manually configuring Visual Studio Code for debugging with daprd
If instead of using the Dapr VS Code extension you wish to configure a project to use Dapr in the [tasks.json](https://code.visualstudio.com/Docs/editor/tasks) and [launch.json](https://code.visualstudio.com/Docs/editor/debugging) files these are the manual steps.
When developing Dapr applications, you typically use the dapr cli to start your daprized service similar to this: When developing Dapr applications, you typically use the dapr cli to start your daprized service similar to this:
@ -16,7 +28,7 @@ Using the [tasks.json](https://code.visualstudio.com/Docs/editor/tasks) and [lau
Let's get started! Let's get started!
## Modifying launch.json configurations to include a preLaunchTask ### Modifying launch.json configurations to include a preLaunchTask
In your [launch.json](https://code.visualstudio.com/Docs/editor/debugging) file add a [preLaunchTask](https://code.visualstudio.com/Docs/editor/debugging#_launchjson-attributes) for each configuration that you want daprd launched. The [preLaunchTask](https://code.visualstudio.com/Docs/editor/debugging#_launchjson-attributes) will reference tasks that you define in your tasks.json file. Here is an example for both Node and .NET Core. Notice the [preLaunchTasks](https://code.visualstudio.com/Docs/editor/debugging#_launchjson-attributes) referenced: daprd-web and daprd-leaderboard. In your [launch.json](https://code.visualstudio.com/Docs/editor/debugging) file add a [preLaunchTask](https://code.visualstudio.com/Docs/editor/debugging#_launchjson-attributes) for each configuration that you want daprd launched. The [preLaunchTask](https://code.visualstudio.com/Docs/editor/debugging#_launchjson-attributes) will reference tasks that you define in your tasks.json file. Here is an example for both Node and .NET Core. Notice the [preLaunchTasks](https://code.visualstudio.com/Docs/editor/debugging#_launchjson-attributes) referenced: daprd-web and daprd-leaderboard.
@ -155,10 +167,9 @@ Let's take a quick look at the args that are being passed to the daprd command.
} }
``` ```
## Wrapping up ### Wrapping up
Once you have made the required changes, you should be able to switch to the [debug](https://code.visualstudio.com/Docs/editor/debugging) view in VSCode and launch your daprized configurations by clicking the "play" button. If everything was configured correctly, you should see daprd launch in the VSCode terminal window and the [debugger](https://code.visualstudio.com/Docs/editor/debugging) should attach to your application (you should see it's output in the debug window). Once you have made the required changes, you should be able to switch to the [debug](https://code.visualstudio.com/Docs/editor/debugging) view in VSCode and launch your daprized configurations by clicking the "play" button. If everything was configured correctly, you should see daprd launch in the VSCode terminal window and the [debugger](https://code.visualstudio.com/Docs/editor/debugging) should attach to your application (you should see it's output in the debug window).
>Note: Since you didn't launch the service(s) using the **dapr** ***run*** cli command, but instead by running **daprd**, the **dapr** ***list*** command will not show a list of apps that are currently running. >Note: Since you didn't launch the service(s) using the **dapr** ***run*** cli command, but instead by running **daprd**, the **dapr** ***list*** command will not show a list of apps that are currently running.
Happy debugging!

View File

@ -0,0 +1,17 @@
# Application development with Visual Studio Code
## Using remote containers for your application development
The Visual Studio Code Remote - Containers extension lets you use a Docker container as a full-featured development environment enabling you to [develop inside a container](https://code.visualstudio.com/docs/remote/containers).
Dapr has pre-built Docker remote containers for each of the language SDKs. You can pick the one of your choice for a ready made environment. Note these pre-built containers automatically update to the latest Dapr release.
These are the steps
1. Open your application workspace in VS Code
2. In the command command palette select the `Remote-Containers: Add Development Container Configuration Files...` command
3. Type `dapr` to filter the list to available Dapr remote containers and choose the language container that matches your application. See screen shot below.
4. Follow the prompts to rebuild your application in container.
<img src="../../images/vscode_remote_containers.png" width=800>
Watch this [video](https://www.youtube.com/watch?v=D2dO4aGpHcg&t=120) on how to use the Dapr VS Code Remote Containers with your application.

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB