diff --git a/.github/workflows/stale-pr-monitor.yml b/.github/workflows/stale-pr-monitor.yml index ee56977ab37..44f106127de 100644 --- a/.github/workflows/stale-pr-monitor.yml +++ b/.github/workflows/stale-pr-monitor.yml @@ -18,4 +18,4 @@ jobs: stale-pr-message: 'Stale PR, paging all reviewers' stale-pr-label: 'stale' exempt-pr-labels: 'question,"help wanted",do-not-merge,waiting-on-code-pr' - days-before-stale: 5 + days-before-stale: 90 diff --git a/daprdocs/content/en/concepts/dapr-services/sidecar.md b/daprdocs/content/en/concepts/dapr-services/sidecar.md index 1d783b78f14..8e57144a3b9 100644 --- a/daprdocs/content/en/concepts/dapr-services/sidecar.md +++ b/daprdocs/content/en/concepts/dapr-services/sidecar.md @@ -52,7 +52,7 @@ For a detailed list of all available arguments run `daprd --help` or see this [t 1. Specify the port your application is listening to ```bash - daprd --app-id --app-port 5000 + daprd --app-id myapp --app-port 5000 ``` 1. If you are using several custom resources and want to specify the location of the resource definition files, use the `--resources-path` argument: diff --git a/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md b/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md index 99b08040217..61a6e671f51 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md +++ b/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md @@ -195,12 +195,8 @@ func configHandler(w http.ResponseWriter, r *http.Request) { {{< /tabs >}} -## Next steps - -{{< button text="Enable actor reminder partitioning >>" page="howto-actors-partitioning.md" >}} - ## Related links - Refer to the [Dapr SDK documentation and examples]({{< ref "developing-applications/sdks/#sdk-languages" >}}). - [Actors API reference]({{< ref actors_api.md >}}) -- [Actors overview]({{< ref actors-overview.md >}}) \ No newline at end of file +- [Actors overview]({{< ref actors-overview.md >}}) diff --git a/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md b/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md index 79c7303aba1..843e656f0fd 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md +++ b/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md @@ -8,6 +8,13 @@ aliases: - "/developing-applications/building-blocks/actors/actors-background" --- +{{% alert title="Warning" color="warning" %}} +This feature is only relevant when using state store actor reminders, no longer enabled by default. +As of v1.15, Dapr uses the far more performant [Scheduler Actor Reminders]({{< ref "scheduler.md#actor-reminders" >}}) by default. +This page is only relevant if you are using the legacy state store actor reminders, enabled via setting the [`SchedulerReminders` feature flag]({{< ref "support-preview-features.md#current-preview-features" >}}) to false. +It is highly recommended you use using the Scheduler Actor Reminders feature. +{{% /alert %}} + [Actor reminders]({{< ref "actors-timers-reminders.md#actor-reminders" >}}) are persisted and continue to be triggered after sidecar restarts. Applications with multiple reminders registered can experience the following issues: - Low throughput on reminders registration and de-registration @@ -193,4 +200,4 @@ Watch [this video for a demo of actor reminder partitioning](https://youtu.be/Zw ## Related links - [Actors API reference]({{< ref actors_api.md >}}) -- [Actors overview]({{< ref actors-overview.md >}}) \ No newline at end of file +- [Actors overview]({{< ref actors-overview.md >}}) diff --git a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md index 02df63c2078..a67fdeb96da 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md +++ b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md @@ -110,40 +110,30 @@ The code examples below leverage Dapr SDKs to invoke the output bindings endpoin {{% codetab %}} +Here's an example of using a console app with top-level statements in .NET 6+: + ```csharp -//dependencies -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Net.Http.Headers; +using System.Text; using System.Threading.Tasks; using Dapr.Client; -using Microsoft.AspNetCore.Mvc; -using System.Threading; -//code -namespace EventService +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); +var app = builder.Build(); + +const string BINDING_NAME = "checkout"; +const string BINDING_OPERATION = "create"; + +var random = new Random(); +using var daprClient = app.Services.GetRequiredService(); + +while (true) { - class Program - { - static async Task Main(string[] args) - { - string BINDING_NAME = "checkout"; - string BINDING_OPERATION = "create"; - while(true) - { - System.Threading.Thread.Sleep(5000); - Random random = new Random(); - int orderId = random.Next(1,1000); - using var client = new DaprClientBuilder().Build(); - //Using Dapr SDK to invoke output binding - await client.InvokeBindingAsync(BINDING_NAME, BINDING_OPERATION, orderId); - Console.WriteLine("Sending message: " + orderId); - } - } - } + await Task.Delay(TimeSpan.FromSeconds(5)); + var orderId = random.Next(1, 1000); + await client.InvokeBindingAsync(BINDING_NAME, BINDING_OPERATION, orderId); + Console.WriteLine($"Sending message: {orderId}"); } - ``` {{% /codetab %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md index 4a5f6d4dd7f..2f47547e69b 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md +++ b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md @@ -113,34 +113,41 @@ Configure your application to receive incoming events. If you're using HTTP, you - Listen on a `POST` endpoint with the name of the binding, as specified in `metadata.name` in the `binding.yaml` file. - Verify your application allows Dapr to make an `OPTIONS` request for this endpoint. -Below are code examples that leverage Dapr SDKs to demonstrate an output binding. +Below are code examples that leverage Dapr SDKs to demonstrate an input binding. {{< tabs ".NET" Java Python Go JavaScript>}} {{% codetab %}} +The following example demonstrates how to configure an input binding using ASP.NET Core controllers. + ```csharp -//dependencies using System.Collections.Generic; using System.Threading.Tasks; using System; using Microsoft.AspNetCore.Mvc; -//code -namespace CheckoutService.controller +namespace CheckoutService.controller; + +[ApiController] +public sealed class CheckoutServiceController : ControllerBase { - [ApiController] - public class CheckoutServiceController : Controller + [HttpPost("/checkout")] + public ActionResult getCheckout([FromBody] int orderId) { - [HttpPost("/checkout")] - public ActionResult getCheckout([FromBody] int orderId) - { - Console.WriteLine("Received Message: " + orderId); - return "CID" + orderId; - } + Console.WriteLine($"Received Message: {orderId}"); + return $"CID{orderId}"; } } +``` +The following example demonstrates how to configure the same input binding using a minimal API approach: +```csharp +app.MapPost("checkout", ([FromBody] int orderId) => +{ + Console.WriteLine($"Received Message: {orderId}"); + return $"CID{orderId}" +}); ``` {{% /codetab %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md b/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md index 25d4169e20f..5b663c3ea46 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md +++ b/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md @@ -76,27 +76,21 @@ The following example shows how to get a saved configuration item using the Dapr {{% codetab %}} ```csharp -//dependencies using System; using System.Collections.Generic; using System.Threading.Tasks; using Dapr.Client; -//code -namespace ConfigurationApi -{ - public class Program - { - private static readonly string CONFIG_STORE_NAME = "configstore"; - - public static async Task Main(string[] args) - { - using var client = new DaprClientBuilder().Build(); - var configuration = await client.GetConfiguration(CONFIG_STORE_NAME, new List() { "orderId1", "orderId2" }); - Console.WriteLine($"Got key=\n{configuration[0].Key} -> {configuration[0].Value}\n{configuration[1].Key} -> {configuration[1].Value}"); - } - } -} +const string CONFIG_STORE_NAME = "configstore"; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); +var app = builder.Build(); + +using var client = app.Services.GetRequiredServices(); + +var configuration = await client.GetConfiguration(CONFIG_STORE_NAME, [ "orderId1", "orderId2" ]); +Console.WriteLine($"Got key=\n{configuration[0].Key} -> {configuration[0].Value}\n{configuration[1].Key} -> {configuration[1].Value}"); ``` {{% /codetab %}} @@ -261,13 +255,19 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using Dapr.Client; +using System.Text.Json; const string DAPR_CONFIGURATION_STORE = "configstore"; -var CONFIGURATION_KEYS = new List { "orderId1", "orderId2" }; -var client = new DaprClientBuilder().Build(); +var CONFIGURATION_ITEMS = new List { "orderId1", "orderId2" }; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); +var app = builder.Build(); + +var client = app.Services.GetRequiredService(); // Subscribe for configuration changes -SubscribeConfigurationResponse subscribe = await client.SubscribeConfiguration(DAPR_CONFIGURATION_STORE, CONFIGURATION_ITEMS); +var subscribe = await client.SubscribeConfiguration(DAPR_CONFIGURATION_STORE, CONFIGURATION_ITEMS); // Print configuration changes await foreach (var items in subscribe.Source) @@ -279,7 +279,7 @@ await foreach (var items in subscribe.Source) subscriptionId = subscribe.Id; continue; } - var cfg = System.Text.Json.JsonSerializer.Serialize(items); + var cfg = JsonSerializer.Serialize(items); Console.WriteLine("Configuration update " + cfg); } ``` @@ -303,40 +303,23 @@ using Dapr.Extensions.Configuration; using System.Collections.Generic; using System.Threading; -namespace ConfigurationApi -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Starting application."); - CreateHostBuilder(args).Build().Run(); - Console.WriteLine("Closing application."); - } - - /// - /// Creates WebHost Builder. - /// - /// Arguments. - /// Returns IHostbuilder. - public static IHostBuilder CreateHostBuilder(string[] args) - { - var client = new DaprClientBuilder().Build(); - return Host.CreateDefaultBuilder(args) - .ConfigureAppConfiguration(config => - { - // Get the initial value and continue to watch it for changes. - config.AddDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20)); - config.AddStreamingDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20)); - - }) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } - } -} +Console.WriteLine("Starting application."); +var builder = WebApplication.CreateBuilder(args); + +// Unlike most other situations, we build a `DaprClient` here using its factory because we cannot rely on `IConfiguration` +// or other injected services to configure it because we haven't yet built the DI container. +var client = new DaprClientBuilder().Build(); + +// In a real-world application, you'd also add the following line to register the `DaprClient` with the DI container so +// it can be injected into other services. In this demonstration, it's not necessary as we're not injecting it anywhere. +// builder.Services.AddDaprClient(); + +// Get the initial value and continue to watch it for changes +builder.Configuration.AddDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20)); +builder.Configuration.AddStreamingDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20)); + +await builder.Build().RunAsync(); +Console.WriteLine("Closing application."); ``` Navigate to the directory containing the above code, then run the following command to launch both a Dapr sidecar and the subscriber application: @@ -524,29 +507,23 @@ Following are the code examples showing how you can unsubscribe to configuration {{< tabs ".NET" Java Python Go JavaScript "HTTP API (BASH)" "HTTP API (Powershell)">}} {{% codetab %}} + ```csharp using System; using System.Collections.Generic; using System.Threading.Tasks; using Dapr.Client; +var builder = WebApplication.CreateBuilder(); +builder.Services.AddDaprClient(); +var app = builder.Build(); + const string DAPR_CONFIGURATION_STORE = "configstore"; -var client = new DaprClientBuilder().Build(); +const string SubscriptionId = "abc123"; //Replace with the subscription identifier to unsubscribe from +var client = app.Services.GetRequiredService(); -// Unsubscribe to config updates and exit the app -async Task unsubscribe(string subscriptionId) -{ - try - { - await client.UnsubscribeConfiguration(DAPR_CONFIGURATION_STORE, subscriptionId); - Console.WriteLine("App unsubscribed from config changes"); - Environment.Exit(0); - } - catch (Exception ex) - { - Console.WriteLine("Error unsubscribing from config updates: " + ex.Message); - } -} +await client.UnsubscribeConfiguration(DAPR_CONFIGURATION_STORE, SubscriptionId); +Console.WriteLine("App unsubscribed from config changes"); ``` {{% /codetab %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md b/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md index 3f2f79defa1..138f60f27ef 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md +++ b/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md @@ -30,7 +30,7 @@ Prompt caching optimizes performance by storing and reusing prompts that are oft ### Personally identifiable information (PII) obfuscation -The PII obfuscation feature identifies and removes any form of sensitve user information from a conversation response. Simply enable PII obfuscation on input and output data to protect your privacy and scrub sensitive details that could be used to identify an individual. +The PII obfuscation feature identifies and removes any form of sensitive user information from a conversation response. Simply enable PII obfuscation on input and output data to protect your privacy and scrub sensitive details that could be used to identify an individual. The PII scrubber obfuscates the following user information: - Phone number @@ -59,7 +59,7 @@ Want to put the Dapr conversation API to the test? Walk through the following qu | Quickstart/tutorial | Description | | ------------------- | ----------- | -| [Conversation quickstart](todo) | TODO | +| [Conversation quickstart]({{< ref conversation-quickstart.md >}}) | Learn how to interact with Large Language Models (LLMs) using the conversation API. | ### Start using the conversation API directly in your app diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md index 86e8f2491fa..1778b7716aa 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md @@ -199,7 +199,6 @@ Below are code examples that leverage Dapr SDKs to subscribe to the topic you de {{% codetab %}} ```csharp -//dependencies using System.Collections.Generic; using System.Threading.Tasks; using System; @@ -207,19 +206,17 @@ using Microsoft.AspNetCore.Mvc; using Dapr; using Dapr.Client; -//code -namespace CheckoutService.controller +namespace CheckoutService.Controllers; + +[ApiController] +public sealed class CheckoutServiceController : ControllerBase { - [ApiController] - public class CheckoutServiceController : Controller + //Subscribe to a topic called "orders" from the "order-pub-sub" compoennt + [Topic("order-pub-sub", "orders")] + [HttpPost("checkout")] + public void GetCheckout([FromBody] int orderId) { - //Subscribe to a topic - [Topic("order-pub-sub", "orders")] - [HttpPost("checkout")] - public void getCheckout([FromBody] int orderId) - { - Console.WriteLine("Subscriber received : " + orderId); - } + Console.WriteLine("Subscriber received : " + orderId); } } ``` @@ -435,38 +432,34 @@ Below are code examples that leverage Dapr SDKs to publish a topic. {{% codetab %}} ```csharp -//dependencies using System; using System.Collections.Generic; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Dapr.Client; -using Microsoft.AspNetCore.Mvc; using System.Threading; -//code -namespace EventService -{ - class Program - { - static async Task Main(string[] args) - { - string PUBSUB_NAME = "order-pub-sub"; - string TOPIC_NAME = "orders"; - while(true) { - System.Threading.Thread.Sleep(5000); - Random random = new Random(); - int orderId = random.Next(1,1000); - CancellationTokenSource source = new CancellationTokenSource(); - CancellationToken cancellationToken = source.Token; - using var client = new DaprClientBuilder().Build(); - //Using Dapr SDK to publish a topic - await client.PublishEventAsync(PUBSUB_NAME, TOPIC_NAME, orderId, cancellationToken); - Console.WriteLine("Published data: " + orderId); - } - } - } +const string PUBSUB_NAME = "order-pub-sub"; +const string TOPIC_NAME = "orders"; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); + +var app = builder.Build(); +var random = new Random(); + +var client = app.Services.GetRequiredService(); + +while(true) { + await Task.Delay(TimeSpan.FromSeconds(5)); + var orderId = random.Next(1,1000); + var source = new CancellationTokenSource(); + var cancellationToken = source.Token; + + //Using Dapr SDK to publish a topic + await client.PublishEventAsync(PUBSUB_NAME, TOPIC_NAME, orderId, cancellationToken); + Console.WriteLine("Published data: " + orderId); } ``` diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md index 5b4fe2c1b2b..948e2cd2680 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md @@ -6,7 +6,7 @@ weight: 2200 description: "Learn when you might not use CloudEvents and how to disable them." --- -When adding Dapr to your application, some services may still need to communicate via pub/sub messages not encapsulated in CloudEvents, due to either compatibility reasons or some apps not using Dapr. These are referred to as "raw" pub/sub messages. Dapr enables apps to [publish and subscribe to raw events]({{< ref "pubsub-cloudevents.md#publishing-raw-messages" >}}) not wrapped in a CloudEvent for compatibility. +When adding Dapr to your application, some services may still need to communicate via pub/sub messages not encapsulated in CloudEvents, due to either compatibility reasons or some apps not using Dapr. These are referred to as "raw" pub/sub messages. Dapr enables apps to [publish and subscribe to raw events]({{< ref "pubsub-cloudevents.md#publishing-raw-messages" >}}) not wrapped in a CloudEvent for compatibility and to send data that is not JSON serializable. ## Publishing raw messages @@ -105,13 +105,15 @@ $app->run(function(\DI\FactoryInterface $factory) { ## Subscribing to raw messages -Dapr apps are also able to subscribe to raw events coming from existing pub/sub topics that do not use CloudEvent encapsulation. +Dapr apps can subscribe to raw messages from pub/sub topics, even if they weren’t published as CloudEvents. However, the subscribing Dapr process still wraps these raw messages in a CloudEvent before delivering them to the subscribing application. Diagram showing how to subscribe with Dapr when publisher does not use Dapr or CloudEvent ### Programmatically subscribe to raw events -When subscribing programmatically, add the additional metadata entry for `rawPayload` to allow the subscriber to receive a message that is not wrapped by a CloudEvent. For .NET, this metadata entry is called `isRawPayload`. +When subscribing programmatically, add the additional metadata entry for `rawPayload` to allow the subscriber to receive a message that is not wrapped by a CloudEvent. For .NET, this metadata entry is called `isRawPayload`. + +When using raw payloads the message is always base64 encoded with content type `application/octet-stream`. {{< tabs ".NET" "Python" "PHP" >}} @@ -242,4 +244,4 @@ scopes: - Learn more about [publishing and subscribing messages]({{< ref pubsub-overview.md >}}) - List of [pub/sub components]({{< ref supported-pubsub >}}) - Read the [API reference]({{< ref pubsub_api.md >}}) -- Read the .NET sample on how to [consume Kafka messages without CloudEvents](https://github.com/dapr/samples/pubsub-raw-payload) \ No newline at end of file +- Read the .NET sample on how to [consume Kafka messages without CloudEvents](https://github.com/dapr/samples/pubsub-raw-payload) diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md index 5c31057ee32..b5496419a71 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md @@ -203,7 +203,55 @@ As messages are sent to the given message handler code, there is no concept of r The example below shows the different ways to stream subscribe to a topic. -{{< tabs Python Go >}} +{{< tabs ".NET" Python Go >}} + +{{% codetab %}} + +You can use the `SubscribeAsync` method on the `DaprPublishSubscribeClient` to configure the message handler to use to pull messages from the stream. + +```c# +using System.Text; +using Dapr.Messaging.PublishSubscribe; +using Dapr.Messaging.PublishSubscribe.Extensions; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprPubSubClient(); +var app = builder.Build(); + +var messagingClient = app.Services.GetRequiredService(); + +//Create a dynamic streaming subscription and subscribe with a timeout of 30 seconds and 10 seconds for message handling +var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); +var subscription = await messagingClient.SubscribeAsync("pubsub", "myTopic", + new DaprSubscriptionOptions(new MessageHandlingPolicy(TimeSpan.FromSeconds(10), TopicResponseAction.Retry)), + HandleMessageAsync, cancellationTokenSource.Token); + +await Task.Delay(TimeSpan.FromMinutes(1)); + +//When you're done with the subscription, simply dispose of it +await subscription.DisposeAsync(); +return; + +//Process each message returned from the subscription +Task HandleMessageAsync(TopicMessage message, CancellationToken cancellationToken = default) +{ + try + { + //Do something with the message + Console.WriteLine(Encoding.UTF8.GetString(message.Data.Span)); + return Task.FromResult(TopicResponseAction.Success); + } + catch + { + return Task.FromResult(TopicResponseAction.Retry); + } +} +``` + +[Learn more about streaming subscriptions using the .NET SDK client.]({{< ref "dotnet-messaging-pubsub-howto.md" >}}) + +{{% /codetab %}} + {{% codetab %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md b/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md index d45be463684..104acc93097 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md +++ b/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md @@ -76,32 +76,25 @@ Now that you've set up the local secret store, call Dapr to get the secrets from {{% codetab %}} ```csharp -//dependencies using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Net.Http.Headers; using System.Threading.Tasks; using Dapr.Client; -using Microsoft.AspNetCore.Mvc; -using System.Threading; -using System.Text.Json; -//code -namespace EventService -{ - class Program - { - static async Task Main(string[] args) - { - string SECRET_STORE_NAME = "localsecretstore"; - using var client = new DaprClientBuilder().Build(); - //Using Dapr SDK to get a secret - var secret = await client.GetSecretAsync(SECRET_STORE_NAME, "secret"); - Console.WriteLine($"Result: {string.Join(", ", secret)}"); - } - } -} +namespace EventService; + +const string SECRET_STORE_NAME = "localsecretstore"; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); +var app = builder.Build(); + +//Resolve a DaprClient from DI +var daprClient = app.Services.GetRequiredService(); + +//Use the Dapr SDK to get a secret +var secret = await daprClient.GetSecretAsync(SECRET_STORE_NAME, "secret"); + +Console.WriteLine($"Result: {string.Join(", ", secret)}"); ``` {{% /codetab %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md index 9466fd4d3b1..4416242e003 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md +++ b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md @@ -413,7 +413,7 @@ dapr invoke --app-id checkout --method checkout/100 You can also append a query string or a fragment to the end of the URL and Dapr will pass it through unchanged. This means that if you need to pass some additional arguments in your service invocation that aren't part of a payload or the path, you can do so by appending a `?` to the end of the URL, followed by the key/value pairs separated by `=` signs and delimited by `&`. For example: ```bash -curl 'http://dapr-app-id:checkout@localhost:3602/checkout/100?basket=1234&key=abc` -X POST +curl 'http://dapr-app-id:checkout@localhost:3602/checkout/100?basket=1234&key=abc' -X POST ``` ### Namespaces diff --git a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md index e630365db3f..727ea207c4f 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md +++ b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md @@ -72,38 +72,27 @@ The following example shows how to save and retrieve a single key/value pair usi ```csharp -//dependencies -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Net.Http.Headers; +using System.Text; using System.Threading.Tasks; using Dapr.Client; -using Microsoft.AspNetCore.Mvc; -using System.Threading; -using System.Text.Json; -//code -namespace EventService +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); +var app = builder.Build(); + +var random = new Random(); +//Resolve the DaprClient from its dependency injection registration +using var client = app.Services.GetRequiredService(); + +while(true) { - class Program - { - static async Task Main(string[] args) - { - string DAPR_STORE_NAME = "statestore"; - while(true) { - System.Threading.Thread.Sleep(5000); - using var client = new DaprClientBuilder().Build(); - Random random = new Random(); - int orderId = random.Next(1,1000); - //Using Dapr SDK to save and get state - await client.SaveStateAsync(DAPR_STORE_NAME, "order_1", orderId.ToString()); - await client.SaveStateAsync(DAPR_STORE_NAME, "order_2", orderId.ToString()); - var result = await client.GetStateAsync(DAPR_STORE_NAME, "order_1"); - Console.WriteLine("Result after get: " + result); - } - } - } + await Task.Delay(TimeSpan.FromSeconds(5)); + var orderId = random.Next(1,1000); + //Using Dapr SDK to save and get state + await client.SaveStateAsync(DAPR_STORE_NAME, "order_1", orderId.ToString()); + await client.SaveStateAsync(DAPR_STORE_NAME, "order_2", orderId.ToString()); + var result = await client.GetStateAsync(DAPR_STORE_NAME, "order_1"); + Console.WriteLine($"Result after get: {result}"); } ``` @@ -359,23 +348,20 @@ Below are code examples that leverage Dapr SDKs for deleting the state. {{% codetab %}} ```csharp -//dependencies using Dapr.Client; +using System.Threading.Tasks; -//code -namespace EventService -{ - class Program - { - static async Task Main(string[] args) - { - string DAPR_STORE_NAME = "statestore"; - //Using Dapr SDK to delete the state - using var client = new DaprClientBuilder().Build(); - await client.DeleteStateAsync(DAPR_STORE_NAME, "order_1", cancellationToken: cancellationToken); - } - } -} +const string DAPR_STORE_NAME = "statestore"; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); +var app = builder.Build(); + +//Resolve the DaprClient from the dependency injection registration +using var client = app.Services.GetRequiredService(); + +//Use the DaprClient to delete the state +await client.DeleteStateAsync(DAPR_STORE_NAME, "order_1", cancellationToken: cancellationToken); ``` To launch a Dapr sidecar for the above example application, run a command similar to the following: @@ -540,22 +526,19 @@ Below are code examples that leverage Dapr SDKs for saving and retrieving multip {{% codetab %}} ```csharp -//dependencies using Dapr.Client; -//code -namespace EventService -{ - class Program - { - static async Task Main(string[] args) - { - string DAPR_STORE_NAME = "statestore"; - //Using Dapr SDK to retrieve multiple states - using var client = new DaprClientBuilder().Build(); - IReadOnlyList multipleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "order_1", "order_2" }, parallelism: 1); - } - } -} +using System.Threading.Tasks; + +const string DAPR_STORE_NAME = "statestore"; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDaprClient(); +var app = builder.Build(); + +//Resolve the DaprClient from the dependency injection registration +using var client = app.Services.GetRequiredService(); + +IReadOnlyList multipleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "order_1", "order_2" }, parallelism: 1); ``` To launch a Dapr sidecar for the above example application, run a command similar to the following: @@ -567,28 +550,21 @@ dapr run --app-id orderprocessing --app-port 6001 --dapr-http-port 3601 --dapr-g The above example returns a `BulkStateItem` with the serialized format of the value you saved to state. If you prefer that the value be deserialized by the SDK across each of your bulk response items, you can instead use the following: ```csharp -//dependencies using Dapr.Client; -//code -namespace EventService -{ - class Program - { - static async Task Main(string[] args) - { - string DAPR_STORE_NAME = "statestore"; - //Using Dapr SDK to retrieve multiple states - using var client = new DaprClientBuilder().Build(); - IReadOnlyList> mulitpleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "widget_1", "widget_2" }, parallelism: 1); - } - } +using System.Threading.Tasks; - class Widget - { - string Size { get; set; } - string Color { get; set; } - } -} +const string DAPR_STORE_NAME = "statestore"; + +var builder = WebApplication.CreateBuilder(args); +builder.Serivces.AddDaprClient(); +var app = builder.Build(); + +//Resolve the DaprClient from the dependency injection registration +using var client = app.Services.GetRequiredService(); + +IReadOnlyList> mulitpleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "widget_1", "widget_2" }, parallelism: 1); + +record Widget(string Size, string Color); ``` {{% /codetab %}} @@ -791,44 +767,36 @@ Below are code examples that leverage Dapr SDKs for performing state transaction {{% codetab %}} ```csharp -//dependencies -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Threading.Tasks; using Dapr.Client; -using Microsoft.AspNetCore.Mvc; -using System.Threading; -using System.Text.Json; +using System.Threading.Tasks; -//code -namespace EventService +const string DAPR_STORE_NAME = "statestore"; + +var builder = WebApplication.CreateBuilder(args); +builder.Serivces.AddDaprClient(); +var app = builder.Build(); + +//Resolve the DaprClient from the dependency injection registration +using var client = app.Services.GetRequiredService(); + +var random = new Random(); + +while (true) { - class Program - { - static async Task Main(string[] args) - { - string DAPR_STORE_NAME = "statestore"; - while(true) { - System.Threading.Thread.Sleep(5000); - Random random = new Random(); - int orderId = random.Next(1,1000); - using var client = new DaprClientBuilder().Build(); - var requests = new List() - { - new StateTransactionRequest("order_3", JsonSerializer.SerializeToUtf8Bytes(orderId.ToString()), StateOperationType.Upsert), - new StateTransactionRequest("order_2", null, StateOperationType.Delete) - }; - CancellationTokenSource source = new CancellationTokenSource(); - CancellationToken cancellationToken = source.Token; - //Using Dapr SDK to perform the state transactions - await client.ExecuteStateTransactionAsync(DAPR_STORE_NAME, requests, cancellationToken: cancellationToken); - Console.WriteLine("Order requested: " + orderId); - Console.WriteLine("Result: " + result); - } - } - } + await Task.Delay(TimeSpan.FromSeconds(5)); + var orderId = random.Next(1, 1000); + var requests = new List + { + new StateTransactionRequest("order_3", JsonSerializer.SerializeToUtf8Bytes(orderId.ToString()), StateOperationType.Upsert), + new StateTransactionRequest("order_2", null, StateOperationType.Delete) + }; + var cancellationTokenSource = new CancellationTokenSource(); + var cancellationToken = cancellationTokenSource.Token; + + //Use the DaprClient to perform the state transactions + await client.ExecuteStateTransactionAsync(DAPR_STORE_NAME, requests, cancellationToken: cancellationToken); + Console.WriteLine($"Order requested: {orderId}"); + Console.WriteLine($"Result: {result}"); } ``` diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md index 3345b97b2a8..009850fae7c 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md @@ -39,13 +39,14 @@ The Dapr sidecar doesn’t load any workflow definitions. Rather, the sidecar si Define the workflow activities you'd like your workflow to perform. Activities are a function definition and can take inputs and outputs. The following example creates a counter (activity) called `hello_act` that notifies users of the current counter value. `hello_act` is a function derived from a class called `WorkflowActivityContext`. ```python -def hello_act(ctx: WorkflowActivityContext, input): +@wfr.activity(name='hello_act') +def hello_act(ctx: WorkflowActivityContext, wf_input): global counter - counter += input + counter += wf_input print(f'New counter value is: {counter}!', flush=True) ``` -[See the `hello_act` workflow activity in context.](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py#LL40C1-L43C59) +[See the task chaining workflow activity in context.](https://github.com/dapr/python-sdk/blob/main/examples/workflow/simple.py) {{% /codetab %}} @@ -226,19 +227,32 @@ Next, register and call the activites in a workflow. -The `hello_world_wf` function is derived from a class called `DaprWorkflowContext` with input and output parameter types. It also includes a `yield` statement that does the heavy lifting of the workflow and calls the workflow activities. +The `hello_world_wf` function is a function derived from a class called `DaprWorkflowContext` with input and output parameter types. It also includes a `yield` statement that does the heavy lifting of the workflow and calls the workflow activities. ```python -def hello_world_wf(ctx: DaprWorkflowContext, input): - print(f'{input}') +@wfr.workflow(name='hello_world_wf') +def hello_world_wf(ctx: DaprWorkflowContext, wf_input): + print(f'{wf_input}') yield ctx.call_activity(hello_act, input=1) yield ctx.call_activity(hello_act, input=10) - yield ctx.wait_for_external_event("event1") + yield ctx.call_activity(hello_retryable_act, retry_policy=retry_policy) + yield ctx.call_child_workflow(child_retryable_wf, retry_policy=retry_policy) + + # Change in event handling: Use when_any to handle both event and timeout + event = ctx.wait_for_external_event(event_name) + timeout = ctx.create_timer(timedelta(seconds=30)) + winner = yield when_any([event, timeout]) + + if winner == timeout: + print('Workflow timed out waiting for event') + return 'Timeout' + yield ctx.call_activity(hello_act, input=100) yield ctx.call_activity(hello_act, input=1000) + return 'Completed' ``` -[See the `hello_world_wf` workflow in context.](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py#LL32C1-L38C51) +[See the `hello_world_wf` workflow in context.](https://github.com/dapr/python-sdk/blob/main/examples/workflow/simple.py) {{% /codetab %}} @@ -405,89 +419,177 @@ Finally, compose the application using the workflow. -[In the following example](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py), for a basic Python hello world application using the Python SDK, your project code would include: +[In the following example](https://github.com/dapr/python-sdk/blob/main/examples/workflow/simple.py), for a basic Python hello world application using the Python SDK, your project code would include: - A Python package called `DaprClient` to receive the Python SDK capabilities. - A builder with extensions called: - - `WorkflowRuntime`: Allows you to register workflows and workflow activities + - `WorkflowRuntime`: Allows you to register the workflow runtime. - `DaprWorkflowContext`: Allows you to [create workflows]({{< ref "#write-the-workflow" >}}) - `WorkflowActivityContext`: Allows you to [create workflow activities]({{< ref "#write-the-workflow-activities" >}}) -- API calls. In the example below, these calls start, pause, resume, purge, and terminate the workflow. +- API calls. In the example below, these calls start, pause, resume, purge, and completing the workflow. ```python -from dapr.ext.workflow import WorkflowRuntime, DaprWorkflowContext, WorkflowActivityContext -from dapr.clients import DaprClient +from datetime import timedelta +from time import sleep +from dapr.ext.workflow import ( + WorkflowRuntime, + DaprWorkflowContext, + WorkflowActivityContext, + RetryPolicy, + DaprWorkflowClient, + when_any, +) +from dapr.conf import Settings +from dapr.clients.exceptions import DaprInternalError + +settings = Settings() + +counter = 0 +retry_count = 0 +child_orchestrator_count = 0 +child_orchestrator_string = '' +child_act_retry_count = 0 +instance_id = 'exampleInstanceID' +child_instance_id = 'childInstanceID' +workflow_name = 'hello_world_wf' +child_workflow_name = 'child_wf' +input_data = 'Hi Counter!' +event_name = 'event1' +event_data = 'eventData' +non_existent_id_error = 'no such instance exists' + +retry_policy = RetryPolicy( + first_retry_interval=timedelta(seconds=1), + max_number_of_attempts=3, + backoff_coefficient=2, + max_retry_interval=timedelta(seconds=10), + retry_timeout=timedelta(seconds=100), +) + +wfr = WorkflowRuntime() + + +@wfr.workflow(name='hello_world_wf') +def hello_world_wf(ctx: DaprWorkflowContext, wf_input): + print(f'{wf_input}') + yield ctx.call_activity(hello_act, input=1) + yield ctx.call_activity(hello_act, input=10) + yield ctx.call_activity(hello_retryable_act, retry_policy=retry_policy) + yield ctx.call_child_workflow(child_retryable_wf, retry_policy=retry_policy) + + # Change in event handling: Use when_any to handle both event and timeout + event = ctx.wait_for_external_event(event_name) + timeout = ctx.create_timer(timedelta(seconds=30)) + winner = yield when_any([event, timeout]) + + if winner == timeout: + print('Workflow timed out waiting for event') + return 'Timeout' + + yield ctx.call_activity(hello_act, input=100) + yield ctx.call_activity(hello_act, input=1000) + return 'Completed' + + +@wfr.activity(name='hello_act') +def hello_act(ctx: WorkflowActivityContext, wf_input): + global counter + counter += wf_input + print(f'New counter value is: {counter}!', flush=True) + + +@wfr.activity(name='hello_retryable_act') +def hello_retryable_act(ctx: WorkflowActivityContext): + global retry_count + if (retry_count % 2) == 0: + print(f'Retry count value is: {retry_count}!', flush=True) + retry_count += 1 + raise ValueError('Retryable Error') + print(f'Retry count value is: {retry_count}! This print statement verifies retry', flush=True) + retry_count += 1 + + +@wfr.workflow(name='child_retryable_wf') +def child_retryable_wf(ctx: DaprWorkflowContext): + global child_orchestrator_string, child_orchestrator_count + if not ctx.is_replaying: + child_orchestrator_count += 1 + print(f'Appending {child_orchestrator_count} to child_orchestrator_string!', flush=True) + child_orchestrator_string += str(child_orchestrator_count) + yield ctx.call_activity( + act_for_child_wf, input=child_orchestrator_count, retry_policy=retry_policy + ) + if child_orchestrator_count < 3: + raise ValueError('Retryable Error') + + +@wfr.activity(name='act_for_child_wf') +def act_for_child_wf(ctx: WorkflowActivityContext, inp): + global child_orchestrator_string, child_act_retry_count + inp_char = chr(96 + inp) + print(f'Appending {inp_char} to child_orchestrator_string!', flush=True) + child_orchestrator_string += inp_char + if child_act_retry_count % 2 == 0: + child_act_retry_count += 1 + raise ValueError('Retryable Error') + child_act_retry_count += 1 -# ... def main(): - with DaprClient() as d: - host = settings.DAPR_RUNTIME_HOST - port = settings.DAPR_GRPC_PORT - workflowRuntime = WorkflowRuntime(host, port) - workflowRuntime = WorkflowRuntime() - workflowRuntime.register_workflow(hello_world_wf) - workflowRuntime.register_activity(hello_act) - workflowRuntime.start() - - # Start workflow - print("==========Start Counter Increase as per Input:==========") - start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent, - workflow_name=workflowName, input=inputData, workflow_options=workflowOptions) - print(f"start_resp {start_resp.instance_id}") - - # ... - - # Pause workflow - d.pause_workflow(instance_id=instanceId, workflow_component=workflowComponent) - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after pause call: {getResponse.runtime_status}") - - # Resume workflow - d.resume_workflow(instance_id=instanceId, workflow_component=workflowComponent) - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after resume call: {getResponse.runtime_status}") - - sleep(1) - # Raise workflow - d.raise_workflow_event(instance_id=instanceId, workflow_component=workflowComponent, - event_name=eventName, event_data=eventData) - - sleep(5) - # Purge workflow - d.purge_workflow(instance_id=instanceId, workflow_component=workflowComponent) - try: - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - except DaprInternalError as err: - if nonExistentIDError in err._message: - print("Instance Successfully Purged") - - # Kick off another workflow for termination purposes - start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent, - workflow_name=workflowName, input=inputData, workflow_options=workflowOptions) - print(f"start_resp {start_resp.instance_id}") - - # Terminate workflow - d.terminate_workflow(instance_id=instanceId, workflow_component=workflowComponent) - sleep(1) - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after terminate call: {getResponse.runtime_status}") - - # Purge workflow - d.purge_workflow(instance_id=instanceId, workflow_component=workflowComponent) - try: - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - except DaprInternalError as err: - if nonExistentIDError in err._message: - print("Instance Successfully Purged") - - workflowRuntime.shutdown() + wfr.start() + wf_client = DaprWorkflowClient() + + print('==========Start Counter Increase as per Input:==========') + wf_client.schedule_new_workflow( + workflow=hello_world_wf, input=input_data, instance_id=instance_id + ) + + wf_client.wait_for_workflow_start(instance_id) + + # Sleep to let the workflow run initial activities + sleep(12) + + assert counter == 11 + assert retry_count == 2 + assert child_orchestrator_string == '1aa2bb3cc' + + # Pause Test + wf_client.pause_workflow(instance_id=instance_id) + metadata = wf_client.get_workflow_state(instance_id=instance_id) + print(f'Get response from {workflow_name} after pause call: {metadata.runtime_status.name}') + + # Resume Test + wf_client.resume_workflow(instance_id=instance_id) + metadata = wf_client.get_workflow_state(instance_id=instance_id) + print(f'Get response from {workflow_name} after resume call: {metadata.runtime_status.name}') + + sleep(2) # Give the workflow time to reach the event wait state + wf_client.raise_workflow_event(instance_id=instance_id, event_name=event_name, data=event_data) + + print('========= Waiting for Workflow completion', flush=True) + try: + state = wf_client.wait_for_workflow_completion(instance_id, timeout_in_seconds=30) + if state.runtime_status.name == 'COMPLETED': + print('Workflow completed! Result: {}'.format(state.serialized_output.strip('"'))) + else: + print(f'Workflow failed! Status: {state.runtime_status.name}') + except TimeoutError: + print('*** Workflow timed out!') + + wf_client.purge_workflow(instance_id=instance_id) + try: + wf_client.get_workflow_state(instance_id=instance_id) + except DaprInternalError as err: + if non_existent_id_error in err._message: + print('Instance Successfully Purged') + + wfr.shutdown() + if __name__ == '__main__': main() ``` - {{% /codetab %}} {{% codetab %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md index f03f4a4c471..13c0a44ca95 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md @@ -14,13 +14,13 @@ Now that you've [authored the workflow and its activities in your application]({ {{% codetab %}} Manage your workflow within your code. In the workflow example from the [Author a workflow]({{< ref "howto-author-workflow.md#write-the-application" >}}) guide, the workflow is registered in the code using the following APIs: -- **start_workflow**: Start an instance of a workflow -- **get_workflow**: Get information on the status of the workflow +- **schedule_new_workflow**: Start an instance of a workflow +- **get_workflow_state**: Get information on the status of the workflow - **pause_workflow**: Pauses or suspends a workflow instance that can later be resumed - **resume_workflow**: Resumes a paused workflow instance - **raise_workflow_event**: Raise an event on a workflow - **purge_workflow**: Removes all metadata related to a specific workflow instance -- **terminate_workflow**: Terminate or stop a particular instance of a workflow +- **wait_for_workflow_completion**: Complete a particular instance of a workflow ```python from dapr.ext.workflow import WorkflowRuntime, DaprWorkflowContext, WorkflowActivityContext @@ -34,27 +34,28 @@ eventName = "event1" eventData = "eventData" # Start the workflow -start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent, - workflow_name=workflowName, input=inputData, workflow_options=workflowOptions) +wf_client.schedule_new_workflow( + workflow=hello_world_wf, input=input_data, instance_id=instance_id + ) # Get info on the workflow -getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) +wf_client.get_workflow_state(instance_id=instance_id) # Pause the workflow -d.pause_workflow(instance_id=instanceId, workflow_component=workflowComponent) +wf_client.pause_workflow(instance_id=instance_id) + metadata = wf_client.get_workflow_state(instance_id=instance_id) # Resume the workflow -d.resume_workflow(instance_id=instanceId, workflow_component=workflowComponent) +wf_client.resume_workflow(instance_id=instance_id) # Raise an event on the workflow. - d.raise_workflow_event(instance_id=instanceId, workflow_component=workflowComponent, - event_name=eventName, event_data=eventData) +wf_client.raise_workflow_event(instance_id=instance_id, event_name=event_name, data=event_data) # Purge the workflow -d.purge_workflow(instance_id=instanceId, workflow_component=workflowComponent) +wf_client.purge_workflow(instance_id=instance_id) -# Terminate the workflow -d.terminate_workflow(instance_id=instanceId, workflow_component=workflowComponent) +# Wait for workflow completion +wf_client.wait_for_workflow_completion(instance_id, timeout_in_seconds=30) ``` {{% /codetab %}} @@ -137,31 +138,29 @@ Manage your workflow within your code. In the `OrderProcessingWorkflow` example ```csharp string orderId = "exampleOrderId"; -string workflowComponent = "dapr"; -string workflowName = "OrderProcessingWorkflow"; OrderPayload input = new OrderPayload("Paperclips", 99.95); Dictionary workflowOptions; // This is an optional parameter -// Start the workflow. This returns back a "StartWorkflowResponse" which contains the instance ID for the particular workflow instance. -StartWorkflowResponse startResponse = await daprClient.StartWorkflowAsync(orderId, workflowComponent, workflowName, input, workflowOptions); +// Start the workflow using the orderId as our workflow ID. This returns a string containing the instance ID for the particular workflow instance, whether we provide it ourselves or not. +await daprWorkflowClient.ScheduleNewWorkflowAsync(nameof(OrderProcessingWorkflow), orderId, input, workflowOptions); // Get information on the workflow. This response contains information such as the status of the workflow, when it started, and more! -GetWorkflowResponse getResponse = await daprClient.GetWorkflowAsync(orderId, workflowComponent, eventName); +WorkflowState currentState = await daprWorkflowClient.GetWorkflowStateAsync(orderId, orderId); // Terminate the workflow -await daprClient.TerminateWorkflowAsync(orderId, workflowComponent); +await daprWorkflowClient.TerminateWorkflowAsync(orderId); -// Raise an event (an incoming purchase order) that your workflow will wait for. This returns the item waiting to be purchased. -await daprClient.RaiseWorkflowEventAsync(orderId, workflowComponent, workflowName, input); +// Raise an event (an incoming purchase order) that your workflow will wait for +await daprWorkflowClient.RaiseEventAsync(orderId, "incoming-purchase-order", input); // Pause -await daprClient.PauseWorkflowAsync(orderId, workflowComponent); +await daprWorkflowClient.SuspendWorkflowAsync(orderId); // Resume -await daprClient.ResumeWorkflowAsync(orderId, workflowComponent); +await daprWorkflowClient.ResumeWorkflowAsync(orderId); // Purge the workflow, removing all inbox and history information from associated instance -await daprClient.PurgeWorkflowAsync(orderId, workflowComponent); +await daprWorkflowClient.PurgeInstanceAsync(orderId); ``` {{% /codetab %}} @@ -319,8 +318,8 @@ Manage your workflow using HTTP calls. The example below plugs in the properties To start your workflow with an ID `12345678`, run: -```http -POST http://localhost:3500/v1.0/workflows/dapr/OrderProcessingWorkflow/start?instanceID=12345678 +```shell +curl -X POST "http://localhost:3500/v1.0/workflows/dapr/OrderProcessingWorkflow/start?instanceID=12345678" ``` Note that workflow instance IDs can only contain alphanumeric characters, underscores, and dashes. @@ -329,16 +328,16 @@ Note that workflow instance IDs can only contain alphanumeric characters, unders To terminate your workflow with an ID `12345678`, run: -```http -POST http://localhost:3500/v1.0/workflows/dapr/12345678/terminate +```shell +curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/terminate" ``` ### Raise an event For workflow components that support subscribing to external events, such as the Dapr Workflow engine, you can use the following "raise event" API to deliver a named event to a specific workflow instance. -```http -POST http://localhost:3500/v1.0/workflows///raiseEvent/ +```shell +curl -X POST "http://localhost:3500/v1.0/workflows///raiseEvent/" ``` > An `eventName` can be any function. @@ -347,14 +346,14 @@ POST http://localhost:3500/v1.0/workflows///r To plan for down-time, wait for inputs, and more, you can pause and then resume a workflow. To pause a workflow with an ID `12345678` until triggered to resume, run: -```http -POST http://localhost:3500/v1.0/workflows/dapr/12345678/pause +```shell +curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/pause" ``` To resume a workflow with an ID `12345678`, run: -```http -POST http://localhost:3500/v1.0/workflows/dapr/12345678/resume +```shell +curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/resume" ``` ### Purge a workflow @@ -363,16 +362,16 @@ The purge API can be used to permanently delete workflow metadata from the under Only workflow instances in the COMPLETED, FAILED, or TERMINATED state can be purged. If the workflow is in any other state, calling purge returns an error. -```http -POST http://localhost:3500/v1.0/workflows/dapr/12345678/purge +```shell +curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/purge" ``` ### Get information about a workflow To fetch workflow information (outputs and inputs) with an ID `12345678`, run: -```http -GET http://localhost:3500/v1.0/workflows/dapr/12345678 +```shell +curl -X GET "http://localhost:3500/v1.0/workflows/dapr/12345678" ``` Learn more about these HTTP calls in the [workflow API reference guide]({{< ref workflow_api.md >}}). diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md index e19d7331b88..87c90ca14bc 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md @@ -23,7 +23,7 @@ The Dapr Workflow engine is internally powered by Dapr's actor runtime. The foll To use the Dapr Workflow building block, you write workflow code in your application using the Dapr Workflow SDK, which internally connects to the sidecar using a gRPC stream. This registers the workflow and any workflow activities, or tasks that workflows can schedule. -The engine is embedded directly into the sidecar and implemented using the [`durabletask-go`](https://github.com/microsoft/durabletask-go) framework library. This framework allows you to swap out different storage providers, including a storage provider created for Dapr that leverages internal actors behind the scenes. Since Dapr Workflows use actors, you can store workflow state in state stores. +The engine is embedded directly into the sidecar and implemented using the [`durabletask-go`](https://github.com/dapr/durabletask-go) framework library. This framework allows you to swap out different storage providers, including a storage provider created for Dapr that leverages internal actors behind the scenes. Since Dapr Workflows use actors, you can store workflow state in state stores. ## Sidecar interactions diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index 985c1cc11de..0adb7059f6e 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -147,9 +147,9 @@ Learn more about [external system interaction.]({{< ref "workflow-patterns.md#ex ## Workflow backend -Dapr Workflow relies on the Durable Task Framework for Go (a.k.a. [durabletask-go](https://github.com/microsoft/durabletask-go)) as the core engine for executing workflows. This engine is designed to support multiple backend implementations. For example, the [durabletask-go](https://github.com/microsoft/durabletask-go) repo includes a SQLite implementation and the Dapr repo includes an Actors implementation. +Dapr Workflow relies on the Durable Task Framework for Go (a.k.a. [durabletask-go](https://github.com/dapr/durabletask-go)) as the core engine for executing workflows. This engine is designed to support multiple backend implementations. For example, the [durabletask-go](https://github.com/dapr/durabletask-go) repo includes a SQLite implementation and the Dapr repo includes an Actors implementation. -By default, Dapr Workflow supports the Actors backend, which is stable and scalable. However, you can choose a different backend supported in Dapr Workflow. For example, [SQLite](https://github.com/microsoft/durabletask-go/tree/main/backend/sqlite)(TBD future release) could be an option for backend for local development and testing. +By default, Dapr Workflow supports the Actors backend, which is stable and scalable. However, you can choose a different backend supported in Dapr Workflow. For example, [SQLite](https://github.com/dapr/durabletask-go/tree/main/backend/sqlite)(TBD future release) could be an option for backend for local development and testing. The backend implementation is largely decoupled from the workflow core engine or the programming model that you see. The backend primarily impacts: - How workflow state is stored @@ -232,7 +232,7 @@ Do this: // Do this!! DateTime currentTime = context.CurrentUtcDateTime; Guid newIdentifier = context.NewGuid(); -string randomString = await context.CallActivityAsync("GetRandomString"); +string randomString = await context.CallActivityAsync(nameof("GetRandomString")); //Use "nameof" to prevent specifying an activity name that does not exist in your application ``` {{% /codetab %}} @@ -339,7 +339,7 @@ Do this: ```csharp // Do this!! string configuration = workflowInput.Configuration; // imaginary workflow input argument -string data = await context.CallActivityAsync("MakeHttpCall", "https://example.com/api/data"); +string data = await context.CallActivityAsync(nameof("MakeHttpCall"), "https://example.com/api/data"); ``` {{% /codetab %}} @@ -439,7 +439,7 @@ Do this: ```csharp // Do this!! -Task t = context.CallActivityAsync("DoSomething"); +Task t = context.CallActivityAsync(nameof("DoSomething")); await context.CreateTimer(5000).ConfigureAwait(true); ``` diff --git a/daprdocs/content/en/developing-applications/integrations/argo-cd.md b/daprdocs/content/en/developing-applications/integrations/argo-cd.md new file mode 100644 index 00000000000..0377a60990b --- /dev/null +++ b/daprdocs/content/en/developing-applications/integrations/argo-cd.md @@ -0,0 +1,17 @@ +--- +type: docs +title: "How to: Integrate with Argo CD" +linkTitle: "Argo CD" +weight: 9000 +description: "Integrate Dapr into your GitOps pipeline" +--- + +[Argo CD](https://argo-cd.readthedocs.io/en/stable/) is a declarative, GitOps continuous delivery tool for Kubernetes. It enables you to manage your Kubernetes deployments by tracking the desired application state in Git repositories and automatically syncing it to your clusters. + +## Integration with Dapr + +You can use Argo CD to manage the deployment of Dapr control plane components and Dapr-enabled applications. By adopting a GitOps approach, you ensure that Dapr's configurations and applications are consistently deployed, versioned, and auditable across your environments. Argo CD can be easily configured to deploy Helm charts, manifests, and Dapr components stored in Git repositories. + +## Sample code + +A sample project demonstrating Dapr deployment with Argo CD is available at [https://github.com/dapr/samples/tree/master/dapr-argocd](https://github.com/dapr/samples/tree/master/dapr-argocd). diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index ba7e3d17753..2392c4fd90c 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -254,14 +254,14 @@ The properties for the Multi-App Run template align with the `dapr run` CLI flag | `apiListenAddresses` | N | Dapr API listen addresses | | | `logLevel` | N | The log verbosity. | | | `appMaxConcurrency` | N | The concurrency level of the application; default is unlimited | | -| `placementHostAddress` | N | | | +| `placementHostAddress` | N | Comma separated list of addresses for Dapr placement servers | `127.0.0.1:50057,127.0.0.1:50058` | +| `schedulerHostAddress` | N | Dapr Scheduler Service host address | `localhost:50006` | | `appSSL` | N | Enable https when Dapr invokes the application | | -| `daprHTTPMaxRequestSize` | N | Max size of the request body in MB. | | -| `daprHTTPReadBufferSize` | N | Max size of the HTTP read buffer in KB. This also limits the maximum size of HTTP headers. The default 4 KB | | +| `maxBodySize` | N | Max size of the request body in MB. Set the value using size units (e.g., `16Mi` for 16MB). The default is `4Mi` | | +| `readBufferSize` | N | Max size of the HTTP read buffer in KB. This also limits the maximum size of HTTP headers. Set the value using size units, for example `32Ki` will support headers up to 32KB . Default is `4Ki` for 4KB | | | `enableAppHealthCheck` | N | Enable the app health check on the application | `true`, `false` | | `appHealthCheckPath` | N | Path to the health check file | `/healthz` | -| `appHealthProbeInterval` | N | Interval to probe for the health of the app in seconds - | | +| `appHealthProbeInterval` | N | Interval to probe for the health of the app in seconds | | | `appHealthProbeTimeout` | N | Timeout for app health probes in milliseconds | | | `appHealthThreshold` | N | Number of consecutive failures for the app to be considered unhealthy | | | `enableApiLogging` | N | Enable the logging of all API calls from application to Dapr | | @@ -303,10 +303,11 @@ The properties for the Multi-App Run template align with the `dapr run -k` CLI f | `apiListenAddresses` | N | Dapr API listen addresses | | | `logLevel` | N | The log verbosity. | | | `appMaxConcurrency` | N | The concurrency level of the application; default is unlimited | | -| `placementHostAddress` | N | | | -| `appSSL` | N | Enable https when Dapr invokes the application | | -| `daprHTTPMaxRequestSize` | N | Max size of the request body in MB. | | -| `daprHTTPReadBufferSize` | N | Max size of the HTTP read buffer in KB. This also limits the maximum size of HTTP headers. The default 4 KB | | +| `placementHostAddress` | N | Comma separated list of addresses for Dapr placement servers | `127.0.0.1:50057,127.0.0.1:50058` | +| `schedulerHostAddress` | N | Dapr Scheduler Service host address | `127.0.0.1:50006` | +| `appSSL` | N | Enable HTTPS when Dapr invokes the application | | +| `maxBodySize` | N | Max size of the request body in MB. Set the value using size units (e.g., `16Mi` for 16MB). The default is `4Mi` | `16Mi` | +| `readBufferSize` | N | Max size of the HTTP read buffer in KB. This also limits the maximum size of HTTP headers. Set the value using size units, for example `32Ki` will support headers up to 32KB . Default is `4Ki` for 4KB | `32Ki` | | `enableAppHealthCheck` | N | Enable the app health check on the application | `true`, `false` | | `appHealthCheckPath` | N | Path to the health check file | `/healthz` | | `appHealthProbeInterval` | N | Interval to probe for the health of the app in seconds | | diff --git a/daprdocs/content/en/developing-applications/local-development/sdk-serialization.md b/daprdocs/content/en/developing-applications/local-development/sdk-serialization.md index 4e22d8b58cb..172fab4cc77 100644 --- a/daprdocs/content/en/developing-applications/local-development/sdk-serialization.md +++ b/daprdocs/content/en/developing-applications/local-development/sdk-serialization.md @@ -8,16 +8,40 @@ aliases: - '/developing-applications/sdks/serialization/' --- -An SDK for Dapr should provide serialization for two use cases. First, for API objects sent through request and response payloads. Second, for objects to be persisted. For both these use cases, a default serialization is provided. In the Java SDK, it is the [DefaultObjectSerializer](https://dapr.github.io/java-sdk/io/dapr/serializer/DefaultObjectSerializer.html) class, providing JSON serialization. +Dapr SDKs provide serialization for two use cases. First, for API objects sent through request and response payloads. Second, for objects to be persisted. For both of these cases, a default serialization method is provided in each language SDK. + +| Language SDK | Default Serializer | +|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [.NET]({{< ref dotnet >}}) | [DataContracts](https://learn.microsoft.com/dotnet/framework/wcf/feature-details/using-data-contracts) for remoted actors, [System.Text.Json](https://www.nuget.org/packages/System.Text.Json) otherwise. Read more about .NET serialization [here]({{< ref dotnet-actors-serialization >}}) | | +| [Java]({{< ref java >}}) | [DefaultObjectSerializer](https://dapr.github.io/java-sdk/io/dapr/serializer/DefaultObjectSerializer.html) for JSON serialization | +| [JavaScript]({{< ref js >}}) | JSON | ## Service invocation +{{< tabs ".NET" "Java" >}} + + +{{% codetab %}} + +```csharp + using var client = (new DaprClientBuilder()).Build(); + await client.InvokeMethodAsync("myappid", "saySomething", "My Message"); +``` + +{{% /codetab %}} + + +{{% codetab %}} + ```java DaprClient client = (new DaprClientBuilder()).build(); - client.invokeService("myappid", "saySomething", "My Message", HttpExtension.POST).block(); + client.invokeMethod("myappid", "saySomething", "My Message", HttpExtension.POST).block(); ``` -In the example above, the app will receive a `POST` request for the `saySomething` method with the request payload as `"My Message"` - quoted since the serializer will serialize the input String to JSON. +{{% /codetab %}} + +In the example above, the app `myappid` receives a `POST` request for the `saySomething` method with the request payload as +`"My Message"` - quoted since the serializer will serialize the input String to JSON. ```text POST /saySomething HTTP/1.1 @@ -30,11 +54,35 @@ Content-Length: 12 ## State management +{{< tabs ".NET" "Java" >}} + + +{{% codetab %}} + +```csharp + using var client = (new DaprClientBuilder()).Build(); + var state = new Dictionary + { + { "key": "MyKey" }, + { "value": "My Message" } + }; + await client.SaveStateAsync("MyStateStore", "MyKey", state); +``` + +{{% /codetab %}} + + +{{% codetab %}} + ```java DaprClient client = (new DaprClientBuilder()).build(); client.saveState("MyStateStore", "MyKey", "My Message").block(); ``` -In this example, `My Message` will be saved. It is not quoted because Dapr's API will internally parse the JSON request object before saving it. + +{{% /codetab %}} + +In this example, `My Message` is saved. It is not quoted because Dapr's API internally parse the JSON request +object before saving it. ```JSON [ @@ -47,12 +95,45 @@ In this example, `My Message` will be saved. It is not quoted because Dapr's API ## PubSub +{{< tabs ".NET" "Java" >}} + + +{{% codetab %}} + +```csharp + using var client = (new DaprClientBuilder()).Build(); + await client.PublishEventAsync("MyPubSubName", "TopicName", "My Message"); +``` + +The event is published and the content is serialized to `byte[]` and sent to Dapr sidecar. The subscriber receives it as a [CloudEvent](https://github.com/cloudevents/spec). Cloud event defines `data` as String. The Dapr SDK also provides a built-in deserializer for `CloudEvent` object. + +```csharp +public async Task HandleMessage(string message) +{ + //ASP.NET Core automatically deserializes the UTF-8 encoded bytes to a string + return new Ok(); +} +``` + +or + +```csharp +app.MapPost("/TopicName", [Topic("MyPubSubName", "TopicName")] (string message) => { + return Results.Ok(); +} +``` + +{{% /codetab %}} + + +{{% codetab %}} + ```java DaprClient client = (new DaprClientBuilder()).build(); client.publishEvent("TopicName", "My Message").block(); ``` -The event is published and the content is serialized to `byte[]` and sent to Dapr sidecar. The subscriber will receive it as a [CloudEvent](https://github.com/cloudevents/spec). Cloud event defines `data` as String. Dapr SDK also provides a built-in deserializer for `CloudEvent` object. +The event is published and the content is serialized to `byte[]` and sent to Dapr sidecar. The subscriber receives it as a [CloudEvent](https://github.com/cloudevents/spec). Cloud event defines `data` as String. The Dapr SDK also provides a built-in deserializer for `CloudEvent` objects. ```java @PostMapping(path = "/TopicName") @@ -62,9 +143,50 @@ The event is published and the content is serialized to `byte[]` and sent to Dap } ``` +{{% /codetab %}} + ## Bindings -In this case, the object is serialized to `byte[]` as well and the input binding receives the raw `byte[]` as-is and deserializes it to the expected object type. +For output bindings the object is serialized to `byte[]` whereas the input binding receives the raw `byte[]` as-is and deserializes it to the expected object type. + +{{< tabs ".NET" "Java" >}} + + +{{% codetab %}} + +* Output binding: +```csharp + using var client = (new DaprClientBuilder()).Build(); + await client.InvokeBindingAsync("sample", "My Message"); +``` + +* Input binding (controllers): +```csharp + [ApiController] + public class SampleController : ControllerBase + { + [HttpPost("propagate")] + public ActionResult GetValue([FromBody] int itemId) + { + Console.WriteLine($"Received message: {itemId}"); + return $"itemID:{itemId}"; + } + } + ``` + +* Input binding (minimal API): +```csharp +app.MapPost("value", ([FromBody] int itemId) => +{ + Console.WriteLine($"Received message: {itemId}"); + return ${itemID:{itemId}"; +}); +* ``` + +{{% /codetab %}} + + +{{% codetab %}} * Output binding: ```java @@ -80,15 +202,49 @@ In this case, the object is serialized to `byte[]` as well and the input binding System.out.println(message); } ``` + +{{% /codetab %}} + It should print: ``` My Message ``` ## Actor Method invocation -Object serialization and deserialization for invocation of Actor's methods are same as for the service method invocation, the only difference is that the application does not need to deserialize the request or serialize the response since it is all done transparently by the SDK. +Object serialization and deserialization for Actor method invocation are same as for the service method invocation, +the only difference is that the application does not need to deserialize the request or serialize the response since it +is all done transparently by the SDK. + +For Actor methods, the SDK only supports methods with zero or one parameter. + +{{< tabs ".NET" "Java" >}} -For Actor's methods, the SDK only supports methods with zero or one parameter. +The .NET SDK supports two different serialization types based on whether you're using strongly-typed (DataContracts) +or weakly-typed (DataContracts or System.Text.JSON) actor client. [This document]({{< ref dotnet-actors-serialization >}}) +can provide more information about the differences between each and additional considerations to keep in mind. + + +{{% codetab %}} + +* Invoking an Actor's method using the weakly-typed client and System.Text.JSON: +```csharp + var proxy = this.ProxyFactory.Create(ActorId.CreateRandom(), "DemoActor"); + await proxy.SayAsync("My message"); +``` + +* Implementing an Actor's method: +```csharp +public Task SayAsync(string message) +{ + Console.WriteLine(message); + return Task.CompletedTask; +} +``` + +{{% /codetab %}} + + +{{% codetab %}} * Invoking an Actor's method: ```java @@ -105,13 +261,37 @@ public String say(String something) { return "OK"; } ``` + +{{% /codetab %}} + It should print: ``` My Message ``` ## Actor's state management -Actors can also have state. In this case, the state manager will serialize and deserialize the objects using the state serializer and handle it transparently to the application. +Actors can also have state. In this case, the state manager will serialize and deserialize the objects using the state +serializer and handle it transparently to the application. + + +{{% codetab %}} + +```csharp +public Task SayAsync(string message) +{ + // Reads state from a key + var previousMessage = await this.StateManager.GetStateAsync("lastmessage"); + + // Sets the new state for the key after serializing it + await this.StateManager.SetStateAsync("lastmessage", message); + return previousMessage; +} +``` + +{{% /codetab %}} + + +{{% codetab %}} ```java public String actorMethod(String message) { @@ -124,12 +304,17 @@ public String actorMethod(String message) { } ``` +{{% /codetab %}} + ## Default serializer The default serializer for Dapr is a JSON serializer with the following expectations: -1. Use of basic [JSON data types](https://www.w3schools.com/js/js_json_datatypes.asp) for cross-language and cross-platform compatibility: string, number, array, boolean, null and another JSON object. Every complex property type in application's serializable objects (DateTime, for example), should be represented as one of the JSON's basic types. -2. Data persisted with the default serializer should be saved as JSON objects too, without extra quotes or encoding. The example below shows how a string and a JSON object would look like in a Redis store. +1. Use of basic [JSON data types](https://www.w3schools.com/js/js_json_datatypes.asp) for cross-language and cross-platform compatibility: string, number, array, +boolean, null and another JSON object. Every complex property type in application's serializable objects (DateTime, +for example), should be represented as one of the JSON's basic types. +2. Data persisted with the default serializer should be saved as JSON objects too, without extra quotes or encoding. +The example below shows how a string and a JSON object would look like in a Redis store. ```bash redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928192||message "This is a message to be saved and retrieved." @@ -140,7 +325,8 @@ redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928 ``` 3. Custom serializers must serialize object to `byte[]`. 4. Custom serializers must deserialize `byte[]` to object. -5. When user provides a custom serializer, it should be transferred or persisted as `byte[]`. When persisting, also encode as Base64 string. This is done natively by most JSON libraries. +5. When user provides a custom serializer, it should be transferred or persisted as `byte[]`. When persisting, also +encode as Base64 string. This is done natively by most JSON libraries. ```bash redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928192||message "VGhpcyBpcyBhIG1lc3NhZ2UgdG8gYmUgc2F2ZWQgYW5kIHJldHJpZXZlZC4=" @@ -149,5 +335,3 @@ redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928 redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928192||mydata "eyJ2YWx1ZSI6Ik15IGRhdGEgdmFsdWUuIn0=" ``` - -*As of now, the [Java SDK](https://github.com/dapr/java-sdk/) is the only Dapr SDK that implements this specification. In the near future, other SDKs will also implement the same.* diff --git a/daprdocs/content/en/getting-started/quickstarts/actors-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/actors-quickstart.md index fef7c9de93c..47c698be345 100644 --- a/daprdocs/content/en/getting-started/quickstarts/actors-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/actors-quickstart.md @@ -33,7 +33,7 @@ For this example, you will need: - [Docker Desktop](https://www.docker.com/products/docker-desktop) -- [.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0), [.NET 8](https://dotnet.microsoft.com/download/dotnet/8.0) or [.NET 9](https://dotnet.microsoft.com/download/dotnet/9.0) installed +- [.NET 8](https://dotnet.microsoft.com/download/dotnet/8.0) installed **NOTE:** .NET 6 is the minimally supported version of .NET for the Dapr .NET SDK packages in this release. Only .NET 8 and .NET 9 will be supported in Dapr v1.16 and later releases. diff --git a/daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md index 8abed6f58d3..a9775c6199d 100644 --- a/daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md @@ -10,7 +10,7 @@ description: Get started with the Dapr conversation building block The conversation building block is currently in **alpha**. {{% /alert %}} -Let's take a look at how the [Dapr conversation building block]({{< ref conversation-overview.md >}}) makes interacting with Large Language Models (LLMs) easier. In this quickstart, you use the echo component to communicate with the mock LLM and ask it for a poem about Dapr. +Let's take a look at how the [Dapr conversation building block]({{< ref conversation-overview.md >}}) makes interacting with Large Language Models (LLMs) easier. In this quickstart, you use the echo component to communicate with the mock LLM and ask it to define Dapr. You can try out this conversation quickstart by either: @@ -18,7 +18,7 @@ You can try out this conversation quickstart by either: - [Running the application without the template]({{< ref "#run-the-app-without-the-template" >}}) {{% alert title="Note" color="primary" %}} -Currently, only the HTTP quickstart sample is available in Python and JavaScript. +Currently, you can only use JavaScript for the quickstart sample using HTTP, not the JavaScript SDK. {{% /alert %}} ## Run the app with the template file @@ -50,7 +50,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstarts directory, navigate into the conversation directory: ```bash -cd conversation/python/http/conversation +cd conversation/python/sdk/conversation ``` Install the dependencies: @@ -61,7 +61,7 @@ pip3 install -r requirements.txt ### Step 3: Launch the conversation service -Navigate back to the `http` directory and start the conversation service with the following command: +Navigate back to the `sdk` directory and start the conversation service with the following command: ```bash dapr run -f . @@ -96,7 +96,7 @@ apps: #### Echo mock LLM component -In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components) directly of the quickstart, the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yml) configures the echo LLM component. +In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components) directly of the quickstart, the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yaml) configures the echo LLM component. ```yml apiVersion: dapr.io/v1alpha1 @@ -117,37 +117,28 @@ In the application code: - The mock LLM echoes "What is dapr?". ```python -import logging -import requests -import os - -logging.basicConfig(level=logging.INFO) - -base_url = os.getenv('BASE_URL', 'http://localhost') + ':' + os.getenv( - 'DAPR_HTTP_PORT', '3500') - -CONVERSATION_COMPONENT_NAME = 'echo' - -input = { - 'name': 'echo', - 'inputs': [{'message':'What is dapr?'}], - 'parameters': {}, - 'metadata': {} +from dapr.clients import DaprClient +from dapr.clients.grpc._request import ConversationInput + +with DaprClient() as d: + inputs = [ + ConversationInput(content="What is dapr?", role='user', scrub_pii=True), + ] + + metadata = { + 'model': 'modelname', + 'key': 'authKey', + 'cacheTTL': '10m', } -# Send input to conversation endpoint -result = requests.post( - url='%s/v1.0-alpha1/conversation/%s/converse' % (base_url, CONVERSATION_COMPONENT_NAME), - json=input -) - -logging.info('Input sent: What is dapr?') + print('Input sent: What is dapr?') -# Parse conversation output -data = result.json() -output = data["outputs"][0]["result"] + response = d.converse_alpha1( + name='echo', inputs=inputs, temperature=0.7, context_id='chat-123', metadata=metadata + ) -logging.info('Output response: ' + output) + for output in response.outputs: + print(f'Output response: {output.result}') ``` {{% /codetab %}} @@ -224,7 +215,7 @@ apps: #### Echo mock LLM component -In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components) directly of the quickstart, the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yml) configures the echo LLM component. +In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components) directly of the quickstart, the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yaml) configures the echo LLM component. ```yml apiVersion: dapr.io/v1alpha1 @@ -354,7 +345,7 @@ apps: #### Echo mock LLM component -In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components), the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yml) configures the echo mock LLM component. +In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components), the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yaml) configures the echo mock LLM component. ```yml apiVersion: dapr.io/v1alpha1 @@ -484,7 +475,7 @@ apps: #### Echo mock LLM component -In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components) directly of the quickstart, the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yml) configures the echo LLM component. +In [`conversation/components`](https://github.com/dapr/quickstarts/tree/master/conversation/components) directly of the quickstart, the [`conversation.yaml` file](https://github.com/dapr/quickstarts/tree/master/conversation/components/conversation.yaml) configures the echo LLM component. ```yml apiVersion: dapr.io/v1alpha1 @@ -575,7 +566,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstarts directory, navigate into the conversation directory: ```bash -cd conversation/python/http/conversation +cd conversation/python/sdk/conversation ``` Install the dependencies: @@ -586,7 +577,7 @@ pip3 install -r requirements.txt ### Step 3: Launch the conversation service -Navigate back to the `http` directory and start the conversation service with the following command: +Navigate back to the `sdk` directory and start the conversation service with the following command: ```bash dapr run --app-id conversation --resources-path ../../../components -- python3 app.py diff --git a/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md index 5f50c6a9909..02929b31da4 100644 --- a/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md @@ -251,7 +251,6 @@ class WorkflowConsoleApp: if __name__ == '__main__': app = WorkflowConsoleApp() app.main() - ``` #### `order-processor/workflow.py` @@ -276,7 +275,6 @@ wfr = WorkflowRuntime() logging.basicConfig(level=logging.INFO) - @wfr.workflow(name="order_processing_workflow") def order_processing_workflow(ctx: DaprWorkflowContext, order_payload_str: str): """Defines the order processing workflow. @@ -343,7 +341,6 @@ def notify_activity(ctx: WorkflowActivityContext, input: Notification): logger = logging.getLogger('NotifyActivity') logger.info(input.message) - @wfr.activity(name="process_payment_activity") def process_payment_activity(ctx: WorkflowActivityContext, input: PaymentRequest): """Defines Process Payment Activity.This is used by the workflow to process a payment""" @@ -353,7 +350,6 @@ def process_payment_activity(ctx: WorkflowActivityContext, input: PaymentRequest +' USD') logger.info(f'Payment for request ID {input.request_id} processed successfully') - @wfr.activity(name="verify_inventory_activity") def verify_inventory_activity(ctx: WorkflowActivityContext, input: InventoryRequest) -> InventoryResult: @@ -377,8 +373,6 @@ def verify_inventory_activity(ctx: WorkflowActivityContext, return InventoryResult(True, inventory_item) return InventoryResult(False, None) - - @wfr.activity(name="update_inventory_activity") def update_inventory_activity(ctx: WorkflowActivityContext, input: PaymentRequest) -> InventoryResult: @@ -401,8 +395,6 @@ def update_inventory_activity(ctx: WorkflowActivityContext, client.save_state(store_name, input.item_being_purchased, new_val) logger.info(f'There are now {new_quantity} {input.item_being_purchased} left in stock') - - @wfr.activity(name="request_approval_activity") def request_approval_activity(ctx: WorkflowActivityContext, input: OrderPayload): @@ -413,7 +405,6 @@ def request_approval_activity(ctx: WorkflowActivityContext, logger.info('Requesting approval for payment of '+f'{input["total_cost"]}'+' USD for ' +f'{input["quantity"]}' +' ' +f'{input["item_name"]}') - ``` {{% /codetab %}} diff --git a/daprdocs/content/en/operations/configuration/api-allowlist.md b/daprdocs/content/en/operations/configuration/api-allowlist.md index dffb8db3910..eee4ad3b210 100644 --- a/daprdocs/content/en/operations/configuration/api-allowlist.md +++ b/daprdocs/content/en/operations/configuration/api-allowlist.md @@ -128,6 +128,7 @@ See this list of values corresponding to the different Dapr APIs: | [Distributed Lock]({{< ref distributed_lock_api.md >}}) | `lock` (`v1.0-alpha1`)
`unlock` (`v1.0-alpha1`) | `lock` (`v1alpha1`)
`unlock` (`v1alpha1`) | | [Cryptography]({{< ref cryptography_api.md >}}) | `crypto` (`v1.0-alpha1`) | `crypto` (`v1alpha1`) | | [Workflow]({{< ref workflow_api.md >}}) | `workflows` (`v1.0`) |`workflows` (`v1`) | +| [Conversation]({{< ref conversation_api.md >}}) | `conversation` (`v1.0-alpha1`) | `conversation` (`v1alpha1`) | | [Health]({{< ref health_api.md >}}) | `healthz` (`v1.0`) | n/a | | Shutdown | `shutdown` (`v1.0`) | `shutdown` (`v1`) | diff --git a/daprdocs/content/en/operations/configuration/secret-scope.md b/daprdocs/content/en/operations/configuration/secret-scope.md index bd718288d5c..96e7b12e3a1 100644 --- a/daprdocs/content/en/operations/configuration/secret-scope.md +++ b/daprdocs/content/en/operations/configuration/secret-scope.md @@ -7,8 +7,8 @@ description: "Define secret scopes by augmenting the existing configuration reso description: "Define secret scopes by augmenting the existing configuration resource with restrictive permissions." --- -In addition to [scoping which applications can access a given component]({{< ref "component-scopes.md">}}), you can also scop a named secret store component to one or more secrets for an application. By defining `allowedSecrets` and/or `deniedSecrets` lists, you restrict applications to access only specific secrets. -In addition to [scoping which applications can access a given component]({{< ref "component-scopes.md">}}), you can also scop a named secret store component to one or more secrets for an application. By defining `allowedSecrets` and/or `deniedSecrets` lists, you restrict applications to access only specific secrets. +In addition to [scoping which applications can access a given component]({{< ref "component-scopes.md">}}), you can also scope a named secret store component to one or more secrets for an application. By defining `allowedSecrets` and/or `deniedSecrets` lists, you restrict applications to access only specific secrets. +In addition to [scoping which applications can access a given component]({{< ref "component-scopes.md">}}), you can also scope a named secret store component to one or more secrets for an application. By defining `allowedSecrets` and/or `deniedSecrets` lists, you restrict applications to access only specific secrets. For more information about configuring a Configuration resource: - [Configuration overview]({{< ref configuration-overview.md >}}) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-aks.md b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-aks.md index 79d29f27497..2b390923203 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-aks.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-aks.md @@ -39,7 +39,7 @@ This guide walks you through installing an Azure Kubernetes Service (AKS) cluste 1. Create an AKS cluster. To use a specific version of Kubernetes, use `--kubernetes-version` (1.13.x or newer version required). ```bash - az aks create --resource-group [your_resource_group] --name [your_aks_cluster_name] --node-count 2 --enable-addons http_application_routing --generate-ssh-keys + az aks create --resource-group [your_resource_group] --name [your_aks_cluster_name] --location [region] --node-count 2 --enable-app-routing --generate-ssh-keys ``` 1. Get the access credentials for the AKS cluster. diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-dapr-shared.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-dapr-shared.md index 4bef59fe6e1..9839e129633 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-dapr-shared.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-dapr-shared.md @@ -36,7 +36,7 @@ No matter which deployment approach you choose, it is important to understand th {{% /alert %}} -### `DeamonSet`(Per-node) +### `DaemonSet`(Per-node) With Kubernetes `DaemonSet`, you can define applications that need to be deployed once per node in the cluster. This enables applications that are running on the same node to communicate with local Dapr APIs, no matter where the Kubernetes `Scheduler` schedules your workload. diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-persisting-scheduler.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-persisting-scheduler.md index 8c877d73c28..01f757756ea 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-persisting-scheduler.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-persisting-scheduler.md @@ -12,7 +12,7 @@ This means that there is no additional parameter required to run the scheduler s {{% alert title="Warning" color="warning" %}} The default storage size for the Scheduler is `1Gi`, which is likely not sufficient for most production deployments. -Remember that the Scheduler is used for [Actor Reminders]({{< ref actors-timers-reminders.md >}}) & [Workflows]({{< ref workflow-overview.md >}}) when the [SchedulerReminders]({{< ref support-preview-features.md >}}) preview feature is enabled, and the [Jobs API]({{< ref jobs_api.md >}}). +Remember that the Scheduler is used for [Actor Reminders]({{< ref actors-timers-reminders.md >}}) & [Workflows]({{< ref workflow-overview.md >}}), and the [Jobs API]({{< ref jobs_api.md >}}). You may want to consider reinstalling Dapr with a larger Scheduler storage of at least `16Gi` or more. For more information, see the [ETCD Storage Disk Size](#etcd-storage-disk-size) section below. {{% /alert %}} @@ -30,8 +30,8 @@ error running scheduler: etcdserver: mvcc: database space exceeded ``` Knowing the safe upper bound for your storage size is not an exact science, and relies heavily on the number, persistence, and the data payload size of your application jobs. -The [Job API]({{< ref jobs_api.md >}}) and [Actor Reminders]({{< ref actors-timers-reminders.md >}}) (with the [SchedulerReminders]({{< ref support-preview-features.md >}}) preview feature enabled) transparently maps one to one to the usage of your applications. -Workflows (when the [SchedulerReminders]({{< ref support-preview-features.md >}}) preview feature is enabled) create a large number of jobs as Actor Reminders, however these jobs are short lived- matching the lifecycle of each workflow execution. +The [Job API]({{< ref jobs_api.md >}}) and [Actor Reminders]({{< ref actors-timers-reminders.md >}}) transparently maps one to one to the usage of your applications. +Workflows create a large number of jobs as Actor Reminders, however these jobs are short lived- matching the lifecycle of each workflow execution. The data payload of jobs created by Workflows is typically empty or small. The Scheduler uses Etcd as its storage backend database. @@ -41,7 +41,7 @@ This means the actual disk usage of Scheduler will be higher than the current ob ### Setting the Storage Size on Installation If you need to increase an **existing** Scheduler storage size, see the [Increase Scheduler Storage Size](#increase-existing-scheduler-storage-size) section below. -To increase the storage size (in this example- `16Gi`) for a **fresh** Dapr instalation, you can use the following command: +To increase the storage size (in this example- `16Gi`) for a **fresh** Dapr installation, you can use the following command: {{< tabs "Dapr CLI" "Helm" >}} @@ -69,6 +69,14 @@ helm upgrade --install dapr dapr/dapr \ {{% /codetab %}} {{< /tabs >}} +{{% alert title="Note" color="primary" %}} +For storage providers that do NOT support dynamic volume expansion: If Dapr has ever been installed on the cluster before, the Scheduler's Persistent Volume Claims must be manually uninstalled in order for new ones with increased storage size to be created. +```bash +kubectl delete pvc -n dapr-system dapr-scheduler-data-dir-dapr-scheduler-server-0 dapr-scheduler-data-dir-dapr-scheduler-server-1 dapr-scheduler-data-dir-dapr-scheduler-server-2 +``` +Persistent Volume Claims are not deleted automatically with an [uninstall]({{< ref dapr-uninstall.md >}}). This is a deliberate safety measure to prevent accidental data loss. +{{% /alert %}} + #### Increase existing Scheduler Storage Size {{% alert title="Warning" color="warning" %}} diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md index fa64b4386d1..89a0c03a4f9 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md @@ -93,7 +93,7 @@ For a new Dapr deployment, HA mode can be set with both: - The [Dapr CLI]({{< ref "kubernetes-deploy.md#install-in-highly-available-mode" >}}), and - [Helm charts]({{< ref "kubernetes-deploy.md#add-and-install-dapr-helm-chart" >}}) -For an existing Dapr deployment, [you can enable HA mode in a few extra steps]({{< ref "#enabling-high-availability-in-an-existing-dapr-deployment" >}}). +For an existing Dapr deployment, [you can enable HA mode in a few extra steps]({{< ref "#enable-high-availability-in-an-existing-dapr-deployment" >}}). ### Individual service HA Helm configuration @@ -159,7 +159,7 @@ spec: ## Deploy Dapr with Helm -[Visit the full guide on deploying Dapr with Helm]({{< ref "kubernetes-deploy.md#install-with-helm-advanced" >}}). +[Visit the full guide on deploying Dapr with Helm]({{< ref "kubernetes-deploy.md#install-with-helm" >}}). ### Parameters file @@ -353,4 +353,4 @@ Watch this video for a deep dive into the best practices for running Dapr in pro ## Related links - [Deploy Dapr on Kubernetes]({{< ref kubernetes-deploy.md >}}) -- [Upgrade Dapr on Kubernetes]({{< ref kubernetes-upgrade.md >}}) \ No newline at end of file +- [Upgrade Dapr on Kubernetes]({{< ref kubernetes-upgrade.md >}}) diff --git a/daprdocs/content/en/operations/hosting/self-hosted/self-hosted-with-docker.md b/daprdocs/content/en/operations/hosting/self-hosted/self-hosted-with-docker.md index 700acc7767e..7aa42196f71 100644 --- a/daprdocs/content/en/operations/hosting/self-hosted/self-hosted-with-docker.md +++ b/daprdocs/content/en/operations/hosting/self-hosted/self-hosted-with-docker.md @@ -123,6 +123,7 @@ services: "--app-id", "nodeapp", "--app-port", "3000", "--placement-host-address", "placement:50006", # Dapr's placement service can be reach via the docker DNS entry + "--scheduler-host-address", "scheduler:50007", # Dapr's scheduler service can be reach via the docker DNS entry "--resources-path", "./components" ] volumes: @@ -134,22 +135,19 @@ services: ... # Deploy other daprized services and components (i.e. Redis) placement: - image: "daprio/dapr" + image: "daprio/placement" command: ["./placement", "--port", "50006"] ports: - "50006:50006" scheduler: - image: "daprio/dapr" - command: ["./scheduler", "--port", "50007"] + image: "daprio/scheduler" + command: ["./scheduler", "--port", "50007", "--etcd-data-dir", "/data"] ports: - "50007:50007" - # WARNING - This is a tmpfs volume, your state will not be persisted across restarts + user: root volumes: - - type: tmpfs - target: /data - tmpfs: - size: "64m" + - "./dapr-etcd-data/:/data" networks: hello-dapr: null diff --git a/daprdocs/content/en/operations/observability/logging/_index.md b/daprdocs/content/en/operations/observability/logging/_index.md index 444f4cc9c97..96998b55a5e 100644 --- a/daprdocs/content/en/operations/observability/logging/_index.md +++ b/daprdocs/content/en/operations/observability/logging/_index.md @@ -3,6 +3,6 @@ type: docs title: "Logging" linkTitle: "Logging" weight: 400 -description: "How to setup loggings for Dapr sidecar, and your application" +description: "How to setup logging for Dapr sidecar, and your application" --- diff --git a/daprdocs/content/en/operations/observability/logging/logs.md b/daprdocs/content/en/operations/observability/logging/logs.md index 5d0d9492a5f..a3b18c6cd24 100644 --- a/daprdocs/content/en/operations/observability/logging/logs.md +++ b/daprdocs/content/en/operations/observability/logging/logs.md @@ -127,7 +127,7 @@ If you are using the Azure Kubernetes Service, you can use [Azure Monitor for co ## References -- [How-to: Set up Fleuntd, Elastic search, and Kibana]({{< ref fluentd.md >}}) +- [How-to: Set up Fluentd, Elastic search, and Kibana]({{< ref fluentd.md >}}) - [How-to: Set up Azure Monitor in Azure Kubernetes Service]({{< ref azure-monitor.md >}}) - [Configure and view Dapr Logs]({{< ref "logs-troubleshooting.md" >}}) - [Configure and view Dapr API Logs]({{< ref "api-logs-troubleshooting.md" >}}) diff --git a/daprdocs/content/en/operations/observability/tracing/otel-collector/open-telemetry-collector-appinsights.md b/daprdocs/content/en/operations/observability/tracing/otel-collector/open-telemetry-collector-appinsights.md index c851ec8a495..008cfdbbb37 100644 --- a/daprdocs/content/en/operations/observability/tracing/otel-collector/open-telemetry-collector-appinsights.md +++ b/daprdocs/content/en/operations/observability/tracing/otel-collector/open-telemetry-collector-appinsights.md @@ -6,42 +6,42 @@ weight: 1000 description: "How to push trace events to Azure Application Insights, using the OpenTelemetry Collector." --- -Dapr integrates with [OpenTelemetry (OTEL) Collector](https://github.com/open-telemetry/opentelemetry-collector) using the Zipkin API. This guide walks through an example using Dapr to push trace events to Azure Application Insights, using the OpenTelemetry Collector. +Dapr integrates with [OpenTelemetry (OTEL) Collector](https://github.com/open-telemetry/opentelemetry-collector) using the OpenTelemetry protocol (OTLP). This guide walks through an example using Dapr to push traces to Azure Application Insights, using the OpenTelemetry Collector. ## Prerequisites - [Install Dapr on Kubernetes]({{< ref kubernetes >}}) -- [Set up an App Insights resource](https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource) and make note of your App Insights instrumentation key. +- [Create an Application Insights resource](https://learn.microsoft.com/azure/azure-monitor/app/create-workspace-resource) and make note of your Application Insights connection string. ## Set up OTEL Collector to push to your App Insights instance -To push events to your App Insights instance, install the OTEL Collector to your Kubernetes cluster. +To push traces to your Application Insights instance, install the OpenTelemetry Collector on your Kubernetes cluster. -1. Check out the [`open-telemetry-collector-appinsights.yaml`](/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml) file. +1. Download and inspect the [`open-telemetry-collector-appinsights.yaml`](/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml) file. -1. Replace the `` placeholder with your App Insights instrumentation key. +1. Replace the `` placeholder with your App Insights connection string. -1. Apply the configuration with: +1. Deploy the OpenTelemetry Collector into the same namespace where your Dapr-enabled applications are running: - ```sh + ```sh kubectl apply -f open-telemetry-collector-appinsights.yaml ``` -## Set up Dapr to send trace to OTEL Collector +## Set up Dapr to send traces to the OpenTelemetry Collector -Set up a Dapr configuration file to turn on tracing and deploy a tracing exporter component that uses the OpenTelemetry Collector. +Create a Dapr configuration file to enable tracing and send traces to the OpenTelemetry Collector via [OTLP](https://opentelemetry.io/docs/specs/otel/protocol/). -1. Use this [`collector-config.yaml`](/docs/open-telemetry-collector/collector-config.yaml) file to create your own configuration. +1. Download and inspect the [`collector-config-otel.yaml`](/docs/open-telemetry-collector/collector-config-otel.yaml). Update the `namespace` and `otel.endpointAddress` values to align with the namespace where your Dapr-enabled applications and OpenTelemetry Collector are deployed. -1. Apply the configuration with: +1. Apply the configuration with: ```sh - kubectl apply -f collector-config.yaml + kubectl apply -f collector-config-otel.yaml ``` ## Deploy your app with tracing -Apply the `appconfig` configuration by adding a `dapr.io/config` annotation to the container that you want to participate in the distributed tracing, as shown in the following example: +Apply the `tracing` configuration by adding a `dapr.io/config` annotation to the Dapr applications that you want to include in distributed tracing, as shown in the following example: ```yaml apiVersion: apps/v1 @@ -57,18 +57,18 @@ spec: dapr.io/enabled: "true" dapr.io/app-id: "MyApp" dapr.io/app-port: "8080" - dapr.io/config: "appconfig" + dapr.io/config: "tracing" ``` {{% alert title="Note" color="primary" %}} -If you are using one of the Dapr tutorials, such as [distributed calculator](https://github.com/dapr/quickstarts/tree/master/tutorials/distributed-calculator), the `appconfig` configuration is already configured, so no additional settings are needed. +If you are using one of the Dapr tutorials, such as [distributed calculator](https://github.com/dapr/quickstarts/tree/master/tutorials/distributed-calculator), you will need to update the `appconfig` configuration to `tracing`. {{% /alert %}} You can register multiple tracing exporters at the same time, and the tracing logs are forwarded to all registered exporters. That's it! There's no need to include any SDKs or instrument your application code. Dapr automatically handles the distributed tracing for you. -## View traces +## View traces Deploy and run some applications. After a few minutes, you should see tracing logs appearing in your App Insights resource. You can also use the **Application Map** to examine the topology of your services, as shown below: diff --git a/daprdocs/content/en/operations/security/mtls.md b/daprdocs/content/en/operations/security/mtls.md index b471783c031..2bd7ec2c386 100644 --- a/daprdocs/content/en/operations/security/mtls.md +++ b/daprdocs/content/en/operations/security/mtls.md @@ -334,12 +334,12 @@ Example: dapr status -k NAME NAMESPACE HEALTHY STATUS REPLICAS VERSION AGE CREATED - dapr-operator dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.26 - dapr-placement-server dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.27 + dapr-operator dapr-system True Running 1 1.15.1 4m 2025-02-19 17:36.26 + dapr-placement-server dapr-system True Running 1 1.15.1 4m 2025-02-19 17:36.27 dapr-dashboard dapr-system True Running 1 0.15.0 4m 2025-02-19 17:36.27 - dapr-sentry dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.26 - dapr-scheduler-server dapr-system True Running 3 1.15.0 4m 2025-02-19 17:36.27 - dapr-sidecar-injector dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.26 + dapr-sentry dapr-system True Running 1 1.15.1 4m 2025-02-19 17:36.26 + dapr-scheduler-server dapr-system True Running 3 1.15.1 4m 2025-02-19 17:36.27 + dapr-sidecar-injector dapr-system True Running 1 1.15.1 4m 2025-02-19 17:36.26 ⚠ Dapr root certificate of your Kubernetes cluster expires in 2 days. Expiry date: Mon, 04 Apr 2025 15:01:03 UTC. Please see docs.dapr.io for certificate renewal instructions to avoid service interruptions. ``` diff --git a/daprdocs/content/en/operations/support/support-release-policy.md b/daprdocs/content/en/operations/support/support-release-policy.md index cb8705451e5..ab0a3adf1f2 100644 --- a/daprdocs/content/en/operations/support/support-release-policy.md +++ b/daprdocs/content/en/operations/support/support-release-policy.md @@ -45,7 +45,12 @@ The table below shows the versions of Dapr releases that have been tested togeth | Release date | Runtime | CLI | SDKs | Dashboard | Status | Release notes | |--------------------|:--------:|:--------|---------|---------|---------|------------| -| February 27th 2025 | 1.15.0
| 1.15.0 | Java 1.14.0
Go 1.12.0
PHP 1.2.0
Python 1.15.0
.NET 1.15.0
JS 3.5.0
Rust 0.16 | 0.15.0 | Supported (current) | [v1.15.0 release notes](https://github.com/dapr/dapr/releases/tag/v1.15.0) | +| May 5th 2025 | 1.15.5
| 1.15.0 | Java 1.14.1
Go 1.12.0
PHP 1.2.0
Python 1.15.0
.NET 1.15.4
JS 3.5.2
Rust 0.16.1 | 0.15.0 | Supported (current) | [v1.15.5 release notes](https://github.com/dapr/dapr/releases/tag/v1.15.5) | +| April 4th 2025 | 1.15.4
| 1.15.0 | Java 1.14.0
Go 1.12.0
PHP 1.2.0
Python 1.15.0
.NET 1.15.4
JS 3.5.2
Rust 0.16.1 | 0.15.0 | Supported (current) | [v1.15.4 release notes](https://github.com/dapr/dapr/releases/tag/v1.15.4) | +| March 5rd 2025 | 1.15.3
| 1.15.0 | Java 1.14.0
Go 1.12.0
PHP 1.2.0
Python 1.15.0
.NET 1.15.4
JS 3.5.2
Rust 0.16.1 | 0.15.0 | Supported (current) | [v1.15.3 release notes](https://github.com/dapr/dapr/releases/tag/v1.15.3) | +| March 3rd 2025 | 1.15.2
| 1.15.0 | Java 1.14.0
Go 1.12.0
PHP 1.2.0
Python 1.15.0
.NET 1.15.0
JS 3.5.0
Rust 0.16 | 0.15.0 | Supported (current) | [v1.15.2 release notes](https://github.com/dapr/dapr/releases/tag/v1.15.2) | +| February 28th 2025 | 1.15.1
| 1.15.0 | Java 1.14.0
Go 1.12.0
PHP 1.2.0
Python 1.15.0
.NET 1.15.0
JS 3.5.0
Rust 0.16 | 0.15.0 | Supported (current) | [v1.15.1 release notes](https://github.com/dapr/dapr/releases/tag/v1.15.1) | +| February 27th 2025 | 1.15.0
| 1.15.0 | Java 1.14.0
Go 1.12.0
PHP 1.2.0
Python 1.15.0
.NET 1.15.0
JS 3.5.0
Rust 0.16 | 0.15.0 | Supported | [v1.15.0 release notes](https://github.com/dapr/dapr/releases/tag/v1.15.0) | | September 16th 2024 | 1.14.4
| 1.14.1 | Java 1.12.0
Go 1.11.0
PHP 1.2.0
Python 1.14.0
.NET 1.14.0
JS 3.3.1 | 0.15.0 | Supported | [v1.14.4 release notes](https://github.com/dapr/dapr/releases/tag/v1.14.4) | | September 13th 2024 | 1.14.3
| 1.14.1 | Java 1.12.0
Go 1.11.0
PHP 1.2.0
Python 1.14.0
.NET 1.14.0
JS 3.3.1 | 0.15.0 | ⚠️ Recalled | [v1.14.3 release notes](https://github.com/dapr/dapr/releases/tag/v1.14.3) | | September 6th 2024 | 1.14.2
| 1.14.1 | Java 1.12.0
Go 1.11.0
PHP 1.2.0
Python 1.14.0
.NET 1.14.0
JS 3.3.1 | 0.15.0 | Supported | [v1.14.2 release notes](https://github.com/dapr/dapr/releases/tag/v1.14.2) | @@ -56,11 +61,11 @@ The table below shows the versions of Dapr releases that have been tested togeth | April 3rd 2024 | 1.13.2
| 1.13.0 | Java 1.11.0
Go 1.10.0
PHP 1.2.0
Python 1.13.0
.NET 1.13.0
JS 3.3.0 | 0.14.0 | Supported | [v1.13.2 release notes](https://github.com/dapr/dapr/releases/tag/v1.13.2) | | March 26th 2024 | 1.13.1
| 1.13.0 | Java 1.11.0
Go 1.10.0
PHP 1.2.0
Python 1.13.0
.NET 1.13.0
JS 3.3.0 | 0.14.0 | Supported | [v1.13.1 release notes](https://github.com/dapr/dapr/releases/tag/v1.13.1) | | March 6th 2024 | 1.13.0
| 1.13.0 | Java 1.11.0
Go 1.10.0
PHP 1.2.0
Python 1.13.0
.NET 1.13.0
JS 3.3.0 | 0.14.0 | Supported | [v1.13.0 release notes](https://github.com/dapr/dapr/releases/tag/v1.13.0) | -| January 17th 2024 | 1.12.4
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Supported | [v1.12.4 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.4) | -| January 2nd 2024 | 1.12.3
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Supported | [v1.12.3 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.3) | -| November 18th 2023 | 1.12.2
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Supported | [v1.12.2 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.2) | -| November 16th 2023 | 1.12.1
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Supported | [v1.12.1 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.1) | -| October 11th 2023 | 1.12.0
| 1.12.0 | Java 1.10.0
Go 1.9.0
PHP 1.1.0
Python 1.11.0
.NET 1.12.0
JS 3.1.2 | 0.14.0 | Supported | [v1.12.0 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.0) | +| January 17th 2024 | 1.12.4
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Unsupported | [v1.12.4 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.4) | +| January 2nd 2024 | 1.12.3
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Unsupported | [v1.12.3 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.3) | +| November 18th 2023 | 1.12.2
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Unsupported | [v1.12.2 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.2) | +| November 16th 2023 | 1.12.1
| 1.12.0 | Java 1.10.0
Go 1.9.1
PHP 1.2.0
Python 1.12.0
.NET 1.12.0
JS 3.2.0 | 0.14.0 | Unsupported | [v1.12.1 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.1) | +| October 11th 2023 | 1.12.0
| 1.12.0 | Java 1.10.0
Go 1.9.0
PHP 1.1.0
Python 1.11.0
.NET 1.12.0
JS 3.1.2 | 0.14.0 | Unsupported | [v1.12.0 release notes](https://github.com/dapr/dapr/releases/tag/v1.12.0) | | November 18th 2023 | 1.11.6
| 1.11.0 | Java 1.9.0
Go 1.8.0
PHP 1.1.0
Python 1.10.0
.NET 1.11.0
JS 3.1.0 | 0.13.0 | Unsupported | [v1.11.6 release notes](https://github.com/dapr/dapr/releases/tag/v1.11.6) | | November 3rd 2023 | 1.11.5
| 1.11.0 | Java 1.9.0
Go 1.8.0
PHP 1.1.0
Python 1.10.0
.NET 1.11.0
JS 3.1.0 | 0.13.0 | Unsupported | [v1.11.5 release notes](https://github.com/dapr/dapr/releases/tag/v1.11.5) | | October 5th 2023 | 1.11.4
| 1.11.0 | Java 1.9.0
Go 1.8.0
PHP 1.1.0
Python 1.10.0
.NET 1.11.0
JS 3.1.0 | 0.13.0 | Unsupported | [v1.11.4 release notes](https://github.com/dapr/dapr/releases/tag/v1.11.4) | diff --git a/daprdocs/content/en/operations/troubleshooting/common_issues.md b/daprdocs/content/en/operations/troubleshooting/common_issues.md index 40281dd2fee..8d6294f6b4d 100644 --- a/daprdocs/content/en/operations/troubleshooting/common_issues.md +++ b/daprdocs/content/en/operations/troubleshooting/common_issues.md @@ -291,3 +291,21 @@ kubectl config get-users ``` You may learn more about webhooks [here](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/). + +## Ports not available during `dapr init` +You might encounter the following error on Windows after attempting to execute `dapr init`: + +> PS C:\Users\You> dapr init +Making the jump to hyperspace... +Container images will be pulled from Docker Hub +Installing runtime version 1.14.4 +Downloading binaries and setting up components... +docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:52379 -> 0.0.0.0:0: listen tcp4 0.0.0.0:52379: bind: An attempt was made to access a socket in a way forbidden by its access permissions. + +To resolve this error, open a command prompt in an elevated terminal and run: + +```bash +nat stop winnat +dapr init +net start winnat +``` \ No newline at end of file diff --git a/daprdocs/content/en/reference/api/conversation_api.md b/daprdocs/content/en/reference/api/conversation_api.md index 44fa52d286a..415bd4faa7e 100644 --- a/daprdocs/content/en/reference/api/conversation_api.md +++ b/daprdocs/content/en/reference/api/conversation_api.md @@ -32,7 +32,7 @@ POST http://localhost:/v1.0-alpha1/conversation//converse | --------- | ----------- | | `inputs` | Inputs for the conversation. Multiple inputs at one time are supported. Required | | `cacheTTL` | A time-to-live value for a prompt cache to expire. Uses Golang duration format. Optional | -| `scrubPII` | A boolean value to enable obfuscation of sensitive information returning from the LLM. Optional | +| `scrubPII` | A boolean value to enable obfuscation of sensitive information returning from the LLM. Set this value if all PII (across contents) in the request needs to be scrubbed. Optional | | `temperature` | A float value to control the temperature of the model. Used to optimize for consistency and creativity. Optional | | `metadata` | [Metadata](#metadata) passed to conversation components. Optional | @@ -42,7 +42,7 @@ POST http://localhost:/v1.0-alpha1/conversation//converse | --------- | ----------- | | `content` | The message content to send to the LLM. Required | | `role` | The role for the LLM to assume. Possible values: 'user', 'tool', 'assistant' | -| `scrubPII` | A boolean value to enable obfuscation of sensitive information present in the content field. Optional | +| `scrubPII` | A boolean value to enable obfuscation of sensitive information present in the content field. Set this value if PII for this specific content needs to be scrubbed exclusively. Optional | ### Request content example @@ -89,4 +89,4 @@ RESPONSE = { ## Next steps - [Conversation API overview]({{< ref conversation-overview.md >}}) -- [Supported conversation components]({{< ref supported-conversation >}}) \ No newline at end of file +- [Supported conversation components]({{< ref supported-conversation >}}) diff --git a/daprdocs/content/en/reference/api/jobs_api.md b/daprdocs/content/en/reference/api/jobs_api.md index bb635e3c759..316974e9471 100644 --- a/daprdocs/content/en/reference/api/jobs_api.md +++ b/daprdocs/content/en/reference/api/jobs_api.md @@ -20,7 +20,7 @@ With the jobs API, you can schedule jobs and tasks in the future. Schedule a job with a name. Jobs are scheduled based on the clock of the server where the Scheduler service is running. The timestamp is not converted to UTC. You can provide the timezone with the timestamp in RFC3339 format to specify which timezone you'd like the job to adhere to. If no timezone is provided, the server's local time is used. ``` -POST http://localhost:3500/v1.0-alpha1/jobs/ +POST http://localhost:/v1.0-alpha1/jobs/ ``` ### URL parameters @@ -100,7 +100,7 @@ $ curl -X POST \ Get a job from its name. ``` -GET http://localhost:3500/v1.0-alpha1/jobs/ +GET http://localhost:/v1.0-alpha1/jobs/ ``` ### URL parameters @@ -138,7 +138,7 @@ $ curl -X GET http://localhost:3500/v1.0-alpha1/jobs/jobforjabba -H "Content-Typ Delete a named job. ``` -DELETE http://localhost:3500/v1.0-alpha1/jobs/ +DELETE http://localhost:/v1.0-alpha1/jobs/ ``` ### URL parameters diff --git a/daprdocs/content/en/reference/api/workflow_api.md b/daprdocs/content/en/reference/api/workflow_api.md index 5a3ff3dd712..3d667d8421d 100644 --- a/daprdocs/content/en/reference/api/workflow_api.md +++ b/daprdocs/content/en/reference/api/workflow_api.md @@ -13,7 +13,7 @@ Dapr provides users with the ability to interact with workflows through its buil Start a workflow instance with the given name and optionally, an instance ID. ``` -POST http://localhost:3500/v1.0/workflows///start[?instanceID=] +POST http://localhost:/v1.0/workflows///start[?instanceID=] ``` Note that workflow instance IDs can only contain alphanumeric characters, underscores, and dashes. @@ -53,7 +53,7 @@ The API call will provide a response similar to this: Terminate a running workflow instance with the given name and instance ID. ``` -POST http://localhost:3500/v1.0/workflows///terminate +POST http://localhost:/v1.0/workflows///terminate ``` {{% alert title="Note" color="primary" %}} @@ -87,7 +87,7 @@ This API does not return any content. For workflow components that support subscribing to external events, such as the Dapr Workflow engine, you can use the following "raise event" API to deliver a named event to a specific workflow instance. ``` -POST http://localhost:3500/v1.0/workflows///raiseEvent/ +POST http://localhost:/v1.0/workflows///raiseEvent/ ``` {{% alert title="Note" color="primary" %}} @@ -120,7 +120,7 @@ None. Pause a running workflow instance. ``` -POST http://localhost:3500/v1.0/workflows///pause +POST http://localhost:/v1.0/workflows///pause ``` ### URL parameters @@ -147,7 +147,7 @@ None. Resume a paused workflow instance. ``` -POST http://localhost:3500/v1.0/workflows///resume +POST http://localhost:/v1.0/workflows///resume ``` ### URL parameters @@ -174,7 +174,7 @@ None. Purge the workflow state from your state store with the workflow's instance ID. ``` -POST http://localhost:3500/v1.0/workflows///purge +POST http://localhost:/v1.0/workflows///purge ``` {{% alert title="Note" color="primary" %}} @@ -205,7 +205,7 @@ None. Get information about a given workflow instance. ``` -GET http://localhost:3500/v1.0/workflows// +GET http://localhost:/v1.0/workflows// ``` ### URL parameters diff --git a/daprdocs/content/en/reference/arguments-annotations-overview.md b/daprdocs/content/en/reference/arguments-annotations-overview.md index 72d50b01c94..a8976efd500 100644 --- a/daprdocs/content/en/reference/arguments-annotations-overview.md +++ b/daprdocs/content/en/reference/arguments-annotations-overview.md @@ -24,7 +24,7 @@ This table is meant to help users understand the equivalent options for running | `--dapr-http-max-request-size` | `--dapr-http-max-request-size` | | `dapr.io/http-max-request-size` | **Deprecated** in favor of `--max-body-size`. Inreasing the request max body size to handle large file uploads using http and grpc protocols. Default is `4` MB | | `--max-body-size` | not supported | | `dapr.io/max-body-size` | Inreasing the request max body size to handle large file uploads using http and grpc protocols. Set the value using size units (e.g., `16Mi` for 16MB). The default is `4Mi` | | `--dapr-http-read-buffer-size` | `--dapr-http-read-buffer-size` | | `dapr.io/http-read-buffer-size` | **Deprecated** in favor of `--read-buffer-size`. Increasing max size of http header read buffer in KB to to support larger header values, for example `16` to support headers up to 16KB . Default is `16` for 16KB | -| `--read-buffer-size` | not supported | | `dapr.io/read-buffer-size` | Increasing max size of http header read buffer in KB to to support larger header values. Set the value using size units, for example `32Ki` will support headers up to 32KB . Default is `4` for 4KB | +| `--read-buffer-size` | not supported | | `dapr.io/read-buffer-size` | Increasing max size of http header read buffer in KB to to support larger header values. Set the value using size units, for example `32Ki` will support headers up to 32KB . Default is `4Ki` for 4KB | | not supported | `--image` | | `dapr.io/sidecar-image` | Dapr sidecar image. Default is daprio/daprd:latest. The Dapr sidecar uses this image instead of the latest default image. Use this when building your own custom image of Dapr and or [using an alternative stable Dapr image]({{< ref "support-release-policy.md#build-variations" >}}) | | `--internal-grpc-port` | not supported | | `dapr.io/internal-grpc-port` | Sets the internal Dapr gRPC port (default `50002`); all cluster services must use the same port for communication | | `--enable-metrics` | not supported | | configuration spec | Enable [prometheus metric]({{< ref prometheus >}}) (default true) | diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/cron.md b/daprdocs/content/en/reference/components-reference/supported-bindings/cron.md index 6a046f781b0..72daed2dc5e 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/cron.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/cron.md @@ -50,7 +50,7 @@ The Dapr cron binding supports following formats: For example: * `30 * * * * *` - every 30 seconds -* `0 15 * * * *` - every 15 minutes +* `0 */15 * * * *` - every 15 minutes * `0 30 3-6,20-23 * * *` - every hour on the half hour in the range 3-6am, 8-11pm * `CRON_TZ=America/New_York 0 30 04 * * *` - every day at 4:30am New York time diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md b/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md index f2d14d320b3..4aff149d319 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md @@ -58,19 +58,24 @@ The above example uses secrets as plain strings. It is recommended to use a secr | Field | Required | Binding support | Details | Example | |--------------------|:--------:|------------|-----|---------| | `bucket` | Y | Output | The bucket name | `"mybucket"` | -| `type` | Y | Output | Tge GCP credentials type | `"service_account"` | -| `project_id` | Y | Output | GCP project id| `projectId` -| `private_key_id` | Y | Output | GCP private key id | `"privateKeyId"` -| `private_key` | Y | Output | GCP credentials private key. Replace with x509 cert | `12345-12345` -| `client_email` | Y | Output | GCP client email | `"client@email.com"` -| `client_id` | Y | Output | GCP client id | `0123456789-0123456789` -| `auth_uri` | Y | Output | Google account OAuth endpoint | `https://accounts.google.com/o/oauth2/auth` -| `token_uri` | Y | Output | Google account token uri | `https://oauth2.googleapis.com/token` -| `auth_provider_x509_cert_url` | Y | Output | GCP credentials cert url | `https://www.googleapis.com/oauth2/v1/certs` -| `client_x509_cert_url` | Y | Output | GCP credentials project x509 cert url | `https://www.googleapis.com/robot/v1/metadata/x509/.iam.gserviceaccount.com` +| `project_id` | Y | Output | GCP project ID | `projectId` | +| `type` | N | Output | The GCP credentials type | `"service_account"` | +| `private_key_id` | N | Output | If using explicit credentials, this field should contain the `private_key_id` field from the service account json document | `"privateKeyId"` | +| `private_key` | N | Output | If using explicit credentials, this field should contain the `private_key` field from the service account json. Replace with x509 cert | `12345-12345` | +| `client_email` | N | Output | If using explicit credentials, this field should contain the `client_email` field from the service account json | `"client@email.com"` | +| `client_id` | N | Output | If using explicit credentials, this field should contain the `client_id` field from the service account json | `0123456789-0123456789` | +| `auth_uri` | N | Output | If using explicit credentials, this field should contain the `auth_uri` field from the service account json | `https://accounts.google.com/o/oauth2/auth` | +| `token_uri` | N | Output | If using explicit credentials, this field should contain the `token_uri` field from the service account json | `https://oauth2.googleapis.com/token`| +| `auth_provider_x509_cert_url` | N | Output | If using explicit credentials, this field should contain the `auth_provider_x509_cert_url` field from the service account json | `https://www.googleapis.com/oauth2/v1/certs`| +| `client_x509_cert_url` | N | Output | If using explicit credentials, this field should contain the `client_x509_cert_url` field from the service account json | `https://www.googleapis.com/robot/v1/metadata/x509/.iam.gserviceaccount.com`| | `decodeBase64` | N | Output | Configuration to decode base64 file content before saving to bucket storage. (In case of saving a file with binary content). `true` is the only allowed positive value. Other positive variations like `"True", "1"` are not acceptable. Defaults to `false` | `true`, `false` | | `encodeBase64` | N | Output | Configuration to encode base64 file content before return the content. (In case of opening a file with binary content). `true` is the only allowed positive value. Other positive variations like `"True", "1"` are not acceptable. Defaults to `false` | `true`, `false` | +## GCP Credentials + +Since the GCP Storage Bucket component uses the GCP Go Client Libraries, by default it authenticates using **Application Default Credentials**. This is explained further in the [Authenticate to GCP Cloud services using client libraries](https://cloud.google.com/docs/authentication/client-libraries) guide. +Also, see how to [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc). + ## Binding support This component supports **output binding** with the following operations: diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md b/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md index d91818a1d8f..0f78f118bc5 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md @@ -170,15 +170,16 @@ To perform a create operation, invoke the AWS S3 binding with a `POST` method an "operation": "create", "data": "YOUR_CONTENT", "metadata": { - "storageClass": "STANDARD_IA" + "storageClass": "STANDARD_IA", + "tags": "project=sashimi,year=2024", } } ``` -For example you can provide a storage class while using the `create` operation with a Linux curl command +For example you can provide a storage class or tags while using the `create` operation with a Linux curl command ```bash -curl -d '{ "operation": "create", "data": "YOUR_BASE_64_CONTENT", "metadata": { "storageClass": "STANDARD_IA" } }' / +curl -d '{ "operation": "create", "data": "YOUR_BASE_64_CONTENT", "metadata": { "storageClass": "STANDARD_IA", "project=sashimi,year=2024" } }' / http://localhost:/v1.0/bindings/ ``` diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/local-echo.md b/daprdocs/content/en/reference/components-reference/supported-conversation/local-echo.md new file mode 100644 index 00000000000..e2a2770a3e8 --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/local-echo.md @@ -0,0 +1,28 @@ +--- +type: docs +title: "Local Testing" +linkTitle: "Echo" +description: Detailed information on the echo conversation component used for local testing +--- + +## Component format + +A Dapr `conversation.yaml` component file has the following structure: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: echo +spec: + type: conversation.echo + version: v1 +``` + +{{% alert title="Information" color="warning" %}} +This component is only meant for local validation and testing of a Conversation component implementation. It does not actually send the data to any LLM but rather echos the input back directly. +{{% /alert %}} + +## Related links + +- [Conversation API overview]({{< ref conversation-overview.md >}}) diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/openai.md b/daprdocs/content/en/reference/components-reference/supported-conversation/openai.md index 7148685b1bb..ce8dc94123c 100644 --- a/daprdocs/content/en/reference/components-reference/supported-conversation/openai.md +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/openai.md @@ -21,6 +21,8 @@ spec: value: mykey - name: model value: gpt-4-turbo + - name: endpoint + value: 'https://api.openai.com/v1' - name: cacheTTL value: 10m ``` @@ -35,6 +37,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr |--------------------|:--------:|---------|---------| | `key` | Y | API key for OpenAI. | `mykey` | | `model` | N | The OpenAI LLM to use. Defaults to `gpt-4-turbo`. | `gpt-4-turbo` | +| `endpoint` | N | Custom API endpoint URL for OpenAI API-compatible services. If not specified, the default OpenAI API endpoint will be used. | `https://api.openai.com/v1` | | `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` | ## Related links diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-gcp-pubsub.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-gcp-pubsub.md index 088126b1c39..849f118633a 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-gcp-pubsub.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-gcp-pubsub.md @@ -76,7 +76,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr | Field | Required | Details | Example | |--------------------|:--------:|---------|---------| -| projectId | Y | GCP project id| `myproject-123` +| projectId | Y | GCP project ID | `myproject-123` | endpoint | N | GCP endpoint for the component to use. Only used for local development (for example) with [GCP Pub/Sub Emulator](https://cloud.google.com/pubsub/docs/emulator). The `endpoint` is unnecessary when running against the GCP production API. | `"http://localhost:8085"` | `consumerID` | N | The Consumer ID organizes one or more consumers into a group. Consumers with the same consumer ID work as one virtual consumer; for example, a message is processed only once by one of the consumers in the group. If the `consumerID` is not provided, the Dapr runtime set it to the Dapr application ID (`appID`) value. The `consumerID`, along with the `topic` provided as part of the request, are used to build the Pub/Sub subscription ID | Can be set to string value (such as `"channel1"`) or string format value (such as `"{podName}"`, etc.). [See all of template tags you can use in your component metadata.]({{< ref "component-schema.md#templated-metadata-values" >}}) | identityProjectId | N | If the GCP pubsub project is different from the identity project, specify the identity project using this attribute | `"myproject-123"` diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md index 387920e7a50..7ea8295630b 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md @@ -69,6 +69,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr | failover | N | Property to enabled failover configuration. Needs sentinalMasterName to be set. Defaults to `"false"` | `"true"`, `"false"` | sentinelMasterName | N | The sentinel master name. See [Redis Sentinel Documentation](https://redis.io/docs/manual/sentinel/) | `""`, `"127.0.0.1:6379"` | maxLenApprox | N | Maximum number of items inside a stream.The old entries are automatically evicted when the specified length is reached, so that the stream is left at a constant size. Defaults to unlimited. | `"10000"` +| streamTTL | N | TTL duration for stream entries. Entries older than this duration will be evicted. This is an approximate value, as it's implemented using Redis stream's `MINID` trimming with the '~' modifier. The actual retention may include slightly more entries than strictly defined by the TTL, as Redis optimizes the trimming operation for efficiency by potentially keeping some additional entries. | `"30d"` ## Create a Redis instance diff --git a/daprdocs/content/en/reference/components-reference/supported-secret-stores/gcp-secret-manager.md b/daprdocs/content/en/reference/components-reference/supported-secret-stores/gcp-secret-manager.md index 24a1a155bfe..4557e436f76 100644 --- a/daprdocs/content/en/reference/components-reference/supported-secret-stores/gcp-secret-manager.md +++ b/daprdocs/content/en/reference/components-reference/supported-secret-stores/gcp-secret-manager.md @@ -50,16 +50,22 @@ The above example uses secrets as plain strings. It is recommended to use a loca | Field | Required | Details | Example | |--------------------|:--------:|--------------------------------|---------------------| -| type | Y | The type of the account. | `"service_account"` | -| project_id | Y | The project ID associated with this component. | `"project_id"` | -| private_key_id | N | The private key ID | `"privatekey"` | -| client_email | Y | The client email address | `"client@example.com"` | -| client_id | N | The ID of the client | `"11111111"` | -| auth_uri | N | The authentication URI | `"https://accounts.google.com/o/oauth2/auth"` | -| token_uri | N | The authentication token URI | `"https://oauth2.googleapis.com/token"` | -| auth_provider_x509_cert_url | N | The certificate URL for the auth provider | `"https://www.googleapis.com/oauth2/v1/certs"` | -| client_x509_cert_url | N | The certificate URL for the client | `"https://www.googleapis.com/robot/v1/metadata/x509/.iam.gserviceaccount.com"`| -| private_key | Y | The private key for authentication | `"privateKey"` | +| `project_id` | Y | The project ID associated with this component. | `"project_id"` | +| `type` | N | The type of the account. | `"service_account"` | +| `private_key_id` | N | If using explicit credentials, this field should contain the `private_key_id` field from the service account json document | `"privateKeyId"`| +| `private_key` | N | If using explicit credentials, this field should contain the `private_key` field from the service account json. Replace with x509 cert | `12345-12345`| +| `client_email` | N | If using explicit credentials, this field should contain the `client_email` field from the service account json | `"client@email.com"`| +| `client_id` | N | If using explicit credentials, this field should contain the `client_id` field from the service account json | `0123456789-0123456789`| +| `auth_uri` | N | If using explicit credentials, this field should contain the `auth_uri` field from the service account json | `https://accounts.google.com/o/oauth2/auth`| +| `token_uri` | N | If using explicit credentials, this field should contain the `token_uri` field from the service account json | `https://oauth2.googleapis.com/token`| +| `auth_provider_x509_cert_url` | N | If using explicit credentials, this field should contain the `auth_provider_x509_cert_url` field from the service account json | `https://www.googleapis.com/oauth2/v1/certs`| +| `client_x509_cert_url` | N | If using explicit credentials, this field should contain the `client_x509_cert_url` field from the service account json | `https://www.googleapis.com/robot/v1/metadata/x509/.iam.gserviceaccount.com`| + + +## GCP Credentials + +Since the GCP Secret Manager component uses the GCP Go Client Libraries, by default it authenticates using **Application Default Credentials**. This is explained further in the [Authenticate to GCP Cloud services using client libraries](https://cloud.google.com/docs/authentication/client-libraries) guide. +Also, see how to [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc). ## Optional per-request metadata properties diff --git a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-cassandra.md b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-cassandra.md index b5aff291d51..b16520cb869 100644 --- a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-cassandra.md +++ b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-cassandra.md @@ -88,6 +88,10 @@ For example, if installing using the example above, the Cassandra DNS would be: {{< /tabs >}} +## Apache Ignite + +[Apache Ignite](https://ignite.apache.org/)'s integration with Cassandra as a caching layer is not supported by this component. + ## Related links - [Basic schema for a Dapr component]({{< ref component-schema >}}) - Read [this guide]({{< ref "howto-get-save-state.md#step-2-save-and-retrieve-a-single-state" >}}) for instructions on configuring state store components diff --git a/daprdocs/content/en/reference/resource-specs/component-schema.md b/daprdocs/content/en/reference/resource-specs/component-schema.md index 875744c2868..180eccae99a 100644 --- a/daprdocs/content/en/reference/resource-specs/component-schema.md +++ b/daprdocs/content/en/reference/resource-specs/component-schema.md @@ -8,7 +8,7 @@ description: "The basic spec for a Dapr component" Dapr defines and registers components using a [resource specifications](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/). All components are defined as a resource and can be applied to any hosting environment where Dapr is running, not just Kubernetes. -Typically, components are restricted to a particular [namepsace]({{< ref isolation-concept.md >}}) and restricted access through scopes to any particular set of applications. The namespace is either explicit on the component manifest itself, or set by the API server, which derives the namespace through context with applying to Kubernetes. +Typically, components are restricted to a particular [namespace]({{< ref isolation-concept.md >}}) and restricted access through scopes to any particular set of applications. The namespace is either explicit on the component manifest itself, or set by the API server, which derives the namespace through context with applying to Kubernetes. {{% alert title="Note" color="primary" %}} The exception to this rule is in self-hosted mode, where daprd ingests component resources when the namespace field is omitted. However, the security profile is mute, as daprd has access to the manifest anyway, unlike in Kubernetes. diff --git a/daprdocs/content/en/reference/resource-specs/subscription-schema.md b/daprdocs/content/en/reference/resource-specs/subscription-schema.md index c047fd40f87..e46fb49e88c 100644 --- a/daprdocs/content/en/reference/resource-specs/subscription-schema.md +++ b/daprdocs/content/en/reference/resource-specs/subscription-schema.md @@ -9,12 +9,12 @@ description: "The basic spec for a Dapr subscription" The `Subscription` Dapr resource allows you to subscribe declaratively to a topic using an external component YAML file. {{% alert title="Note" color="primary" %}} -Any subscription can be restricted to a particular [namepsace]({{< ref isolation-concept.md >}}) and restricted access through scopes to any particular set of applications. +Any subscription can be restricted to a particular [namespace]({{< ref isolation-concept.md >}}) and restricted access through scopes to any particular set of applications. {{% /alert %}} This guide demonstrates two subscription API versions: -- `v2alpha` (default spec) +- `v2alpha1` (default spec) - `v1alpha1` (deprecated) ## `v2alpha1` format @@ -89,4 +89,4 @@ scopes: - [Learn more about the declarative subscription method]({{< ref "subscription-methods.md#declarative-subscriptions" >}}) - [Learn more about dead letter topics]({{< ref pubsub-deadletter.md >}}) - [Learn more about routing messages]({{< ref "howto-route-messages.md#declarative-subscription" >}}) -- [Learn more about bulk subscribing]({{< ref pubsub-bulk.md >}}) \ No newline at end of file +- [Learn more about bulk subscribing]({{< ref pubsub-bulk.md >}}) diff --git a/daprdocs/data/components/conversation/generic.yaml b/daprdocs/data/components/conversation/generic.yaml index b8961c86829..48eab18af22 100644 --- a/daprdocs/data/components/conversation/generic.yaml +++ b/daprdocs/data/components/conversation/generic.yaml @@ -23,3 +23,8 @@ state: Alpha version: v1 since: "1.15" +- component: Local echo + link: local-echo + state: Stable + version: v1 + since: "1.15" diff --git a/daprdocs/layouts/partials/head.html b/daprdocs/layouts/partials/head.html deleted file mode 100644 index 92fac408193..00000000000 --- a/daprdocs/layouts/partials/head.html +++ /dev/null @@ -1,45 +0,0 @@ - - -{{ hugo.Generator }} -{{ range .AlternativeOutputFormats -}} - -{{ end -}} - -{{ $outputFormat := partial "outputformat.html" . -}} -{{ if and hugo.IsProduction (ne $outputFormat "print") -}} - -{{ else -}} - -{{ end -}} - -{{ partialCached "favicons.html" . }} - - {{- if .IsHome -}} - {{ .Site.Title -}} - {{ else -}} - {{ with .Title }}{{ . }} | {{ end -}} - {{ .Site.Title -}} - {{ end -}} - -{{ $desc := .Page.Description | default (.Page.Content | safeHTML | truncate 150) -}} - -{{ template "_internal/opengraph.html" . -}} -{{ template "_internal/schema.html" . -}} -{{ template "_internal/twitter_cards.html" . -}} -{{ partialCached "head-css.html" . "asdf" -}} - -{{ if .Site.Params.offlineSearch -}} - -{{ end -}} - -{{ if .Site.Params.prism_syntax_highlighting -}} - -{{ end -}} - -{{ partial "hooks/head-end.html" . -}} diff --git a/daprdocs/layouts/shortcodes/dapr-latest-version.html b/daprdocs/layouts/shortcodes/dapr-latest-version.html index ee56053a0fd..a085fd0e6f5 100644 --- a/daprdocs/layouts/shortcodes/dapr-latest-version.html +++ b/daprdocs/layouts/shortcodes/dapr-latest-version.html @@ -1 +1 @@ -{{- if .Get "short" }}1.15{{ else if .Get "long" }}1.15.0{{ else if .Get "cli" }}1.15.0{{ else }}1.15.0{{ end -}} +{{- if .Get "short" }}1.15{{ else if .Get "long" }}1.15.5{{ else if .Get "cli" }}1.15.1{{ else }}1.15.1{{ end -}} diff --git a/daprdocs/static/docs/open-telemetry-collector/collector-config.yaml b/daprdocs/static/docs/open-telemetry-collector/collector-config.yaml index 970477b62ea..e7154aa520e 100644 --- a/daprdocs/static/docs/open-telemetry-collector/collector-config.yaml +++ b/daprdocs/static/docs/open-telemetry-collector/collector-config.yaml @@ -2,7 +2,7 @@ apiVersion: dapr.io/v1alpha1 kind: Configuration metadata: name: appconfig - namespace: default + namespace: default # Your app namespace spec: tracing: samplingRate: "1" diff --git a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml index 3b26889539d..9e08ddbdfc2 100644 --- a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml +++ b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml @@ -8,10 +8,13 @@ metadata: data: otel-collector-config: | receivers: - zipkin: - endpoint: 0.0.0.0:9411 + otlp: + protocols: + grpc: + endpoint: ${env:MY_POD_IP}:4317 extensions: health_check: + endpoint: :13133 pprof: endpoint: :1888 zpages: @@ -20,8 +23,7 @@ data: debug: verbosity: basic azuremonitor: - endpoint: "https://dc.services.visualstudio.com/v2/track" - instrumentation_key: "" + connection_string: "" # maxbatchsize is the maximum number of items that can be # queued before calling to the configured endpoint maxbatchsize: 100 @@ -32,7 +34,7 @@ data: extensions: [pprof, zpages, health_check] pipelines: traces: - receivers: [zipkin] + receivers: [otlp] exporters: [azuremonitor,debug] --- apiVersion: v1 @@ -44,10 +46,10 @@ metadata: component: otel-collector spec: ports: - - name: zipkin # Default endpoint for Zipkin receiver. - port: 9411 + - name: otel # Default endpoint for OTEL receiver. + port: 4317 protocol: TCP - targetPort: 9411 + targetPort: 4317 selector: component: otel-collector --- @@ -71,7 +73,7 @@ spec: spec: containers: - name: otel-collector - image: otel/opentelemetry-collector-contrib:0.101.0 + image: otel/opentelemetry-collector-contrib:0.127.0 command: - "/otelcol-contrib" - "--config=/conf/otel-collector-config.yaml" @@ -83,7 +85,13 @@ spec: cpu: 200m memory: 400Mi ports: - - containerPort: 9411 # Default endpoint for Zipkin receiver. + - containerPort: 4317 # Default endpoint for OTEL receiver. + env: + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP volumeMounts: - name: otel-collector-config-vol mountPath: /conf diff --git a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-generic.yaml b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-generic.yaml index 1e0f3b8ee6f..1a89c2aeb5c 100644 --- a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-generic.yaml +++ b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-generic.yaml @@ -75,7 +75,7 @@ spec: spec: containers: - name: otel-collector - image: otel/opentelemetry-collector-contrib-dev:latest + image: otel/opentelemetry-collector-contrib:0.127.0 command: - "/otelcontribcol" - "--config=/conf/otel-collector-config.yaml" diff --git a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml index dac90954277..ed10b6c39bd 100644 --- a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml +++ b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml @@ -78,7 +78,7 @@ spec: spec: containers: - name: otel-collector - image: otel/opentelemetry-collector-contrib-dev:latest + image: otel/opentelemetry-collector-contrib:0.127.0 command: - "/otelcontribcol" - "--config=/conf/otel-collector-config.yaml" diff --git a/daprdocs/static/presentations/dapr-slidedeck.pptx.zip b/daprdocs/static/presentations/dapr-slidedeck.pptx.zip index 81690292685..77e22558db7 100644 Binary files a/daprdocs/static/presentations/dapr-slidedeck.pptx.zip and b/daprdocs/static/presentations/dapr-slidedeck.pptx.zip differ diff --git a/sdkdocs/python b/sdkdocs/python index fc4980daaa4..e7c85cea29e 160000 --- a/sdkdocs/python +++ b/sdkdocs/python @@ -1 +1 @@ -Subproject commit fc4980daaa4802bfb2590f133c332b934b196205 +Subproject commit e7c85cea29e64581f86a7b127d22e618a972bbdb