Skip to content

Commit 4678a26

Browse files
authored
Merge branch 'dapr:v1.15' into patch-1
2 parents 510dc69 + 6280034 commit 4678a26

File tree

86 files changed

+1344
-893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1344
-893
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"ghcr.io/devcontainers/features/hugo:1": {
1212
"extended": true,
13-
"version": "latest"
13+
"version": "0.100.2"
1414
},
1515
"ghcr.io/devcontainers/features/node:1": {
1616
"nodeGypDependencies": true,

.github/workflows/stale-pr-monitor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
stale-pr-message: 'Stale PR, paging all reviewers'
1919
stale-pr-label: 'stale'
2020
exempt-pr-labels: 'question,"help wanted",do-not-merge,waiting-on-code-pr'
21-
days-before-stale: 30
21+
days-before-stale: 90

LICENSE

Lines changed: 203 additions & 394 deletions
Large diffs are not rendered by default.

daprdocs/content/en/concepts/dapr-services/placement.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ updatedAt | timestamp | Timestamp of the actor registered/updated.
9393
}
9494
```
9595

96+
## Disabling the Placement service
97+
98+
99+
The Placement service can be disabled with the following setting:
100+
101+
102+
```
103+
global.actors.enabled=false
104+
```
105+
106+
The Placement service is not deployed with this setting in Kubernetes mode. This not only disables actor deployment, but also disables workflows, given that workflows use actors. This setting only applies in Kubernetes mode, however initializing Dapr with `--slim` excludes the Placement service from being deployed in self-hosted mode.
107+
108+
109+
For more information on running Dapr on Kubernetes, visit the [Kubernetes hosting page](https://docs.dapr.io/operations/hosting/kubernetes/).
110+
111+
96112
## Related links
97113

98-
[Learn more about the Placement API.]({{< ref placement_api.md >}})
114+
[Learn more about the Placement API.]({{< ref placement_api.md >}})

daprdocs/content/en/contributing/presentations.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ weight: 20
66
description: How to give a presentation on Dapr and examples
77
---
88

9-
We welcome community members giving presentations on Dapr and spreading the word about all the awesome Dapr features! We offer a template PowerPoint file to get started.
9+
We encourage community members to give presentations on Dapr. To get you started quickly, we offer two PowerPoint files:
1010

11-
{{< button text="Download the Dapr Presentation Deck" link="/presentations/dapr-slidedeck.pptx.zip" >}}
11+
- *dapr-slidedeck.pptx*, this is a 150+ page slide deck and contains; an overview of Dapr, all of its building block APIs, cross-cutting concerns, hosting options, and assets to create your own architecture diagrams.
12+
- *dapr-workflow.pptx*, this is a dedicated slide deck about Dapr workflow and contains; durable execution concept, workflow authoring, workflow patterns, workflow management, and challenges & tips.
13+
14+
There is a downloadable zip file contains both slide decks.
15+
16+
{{< button text="Download the Dapr Presentation Decks" link="/presentations/dapr-slidedecks.zip" >}}
1217

1318
{{% alert color="primary" %}}
1419
If you're using the PowerPoint template with MacOS, please install the Space Grotesk font to ensure the text is rendered properly:
@@ -19,19 +24,16 @@ brew install --cask font-space-grotesk
1924

2025
## Giving a Dapr presentation
2126

22-
- Begin by downloading the [Dapr Presentation Deck](/presentations/dapr-slidedeck.pptx.zip). This contains slides and diagrams needed to give a Dapr presentation.
27+
- Begin by downloading the [Dapr Presentation Decks](/presentations/dapr-slidedecks.zip). These contain slides, diagrams, and graphical assets needed to give a Dapr presentation.
2328
- Next, review the docs to make sure you understand the [concepts]({{< ref concepts >}}).
24-
- Use the Dapr [quickstarts](https://github.com/dapr/quickstarts) repo and [samples](https://github.com/dapr/samples) repo to show demos of how to use Dapr.
29+
- Use the Dapr [quickstarts](https://github.com/dapr/quickstarts) repo to show demos of how to use Dapr.
30+
- Once you've done a Dapr presentation, claim the *Dapr Presenter* badge by adding your presentation to [this table](https://github.com/dapr/community/tree/master/presentations) in the Dapr Community repository.
31+
32+
## Dapr presentations from the community
2533

26-
## Previous Dapr presentations
34+
If you need some inspiration, watch these Dapr presentations by the community via this [Dapr YouTube playlist](https://youtube.com/playlist?list=PLcip_LgkYwztNWGLdO6yROA3zKl-uUu7h&si=dLMS2CPPyMsfl-QQ):
2735

28-
| Presentation | Recording | Deck |
29-
|--------------|-----------|------|
30-
| Running Event-Driven Pub/Sub Microservices In Kubernetes With Dapr | [Link](https://youtu.be/-4sHUvfk2Eg) | N/A
31-
| Ignite 2019: Mark Russinovich Presents the Future of Cloud Native Applications | [Link](https://www.youtube.com/watch?v=LAUDVk8PaCY) | [Link](/presentations/2019IgniteCloudNativeApps.pdf)
32-
| Azure Community Live: Build microservice applications using DAPR with Mark Fussell | [Link](https://www.youtube.com/watch?v=CgqI7nen-Ng) | N/A
33-
| Ready 2020: Mark Russinovich Presents Cloud Native Applications | [Link](https://youtu.be/eJCu6a-x9uo?t=1614) | [Link](/presentations/2020ReadyCloudNativeApps.pdf)
34-
| Ignite 2021: Mark Russinovich Presents Dapr v1.0 Release | [Link](https://youtu.be/69PrhWQorEM?t=3789) | N/A
36+
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?si=0atWXnp3ikvuqao7&amp;list=PLcip_LgkYwztNWGLdO6yROA3zKl-uUu7h" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
3537

3638
## Additional resources
3739

daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,40 +110,30 @@ The code examples below leverage Dapr SDKs to invoke the output bindings endpoin
110110

111111
{{% codetab %}}
112112

113+
Here's an example of using a console app with top-level statements in .NET 6+:
114+
113115
```csharp
114-
//dependencies
115-
using System;
116-
using System.Collections.Generic;
117-
using System.Net.Http;
118-
using System.Net.Http.Headers;
116+
using System.Text;
119117
using System.Threading.Tasks;
120118
using Dapr.Client;
121-
using Microsoft.AspNetCore.Mvc;
122-
using System.Threading;
123119
124-
//code
125-
namespace EventService
120+
var builder = WebApplication.CreateBuilder(args);
121+
builder.Services.AddDaprClient();
122+
var app = builder.Build();
123+
124+
const string BINDING_NAME = "checkout";
125+
const string BINDING_OPERATION = "create";
126+
127+
var random = new Random();
128+
using var daprClient = app.Services.GetRequiredService<DaprClient>();
129+
130+
while (true)
126131
{
127-
class Program
128-
{
129-
static async Task Main(string[] args)
130-
{
131-
string BINDING_NAME = "checkout";
132-
string BINDING_OPERATION = "create";
133-
while(true)
134-
{
135-
System.Threading.Thread.Sleep(5000);
136-
Random random = new Random();
137-
int orderId = random.Next(1,1000);
138-
using var client = new DaprClientBuilder().Build();
139-
//Using Dapr SDK to invoke output binding
140-
await client.InvokeBindingAsync(BINDING_NAME, BINDING_OPERATION, orderId);
141-
Console.WriteLine("Sending message: " + orderId);
142-
}
143-
}
144-
}
132+
await Task.Delay(TimeSpan.FromSeconds(5));
133+
var orderId = random.Next(1, 1000);
134+
await client.InvokeBindingAsync(BINDING_NAME, BINDING_OPERATION, orderId);
135+
Console.WriteLine($"Sending message: {orderId}");
145136
}
146-
147137
```
148138

149139
{{% /codetab %}}

daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,34 +113,41 @@ Configure your application to receive incoming events. If you're using HTTP, you
113113
- Listen on a `POST` endpoint with the name of the binding, as specified in `metadata.name` in the `binding.yaml` file.
114114
- Verify your application allows Dapr to make an `OPTIONS` request for this endpoint.
115115

116-
Below are code examples that leverage Dapr SDKs to demonstrate an output binding.
116+
Below are code examples that leverage Dapr SDKs to demonstrate an input binding.
117117

118118
{{< tabs ".NET" Java Python Go JavaScript>}}
119119

120120
{{% codetab %}}
121121

122+
The following example demonstrates how to configure an input binding using ASP.NET Core controllers.
123+
122124
```csharp
123-
//dependencies
124125
using System.Collections.Generic;
125126
using System.Threading.Tasks;
126127
using System;
127128
using Microsoft.AspNetCore.Mvc;
128129
129-
//code
130-
namespace CheckoutService.controller
130+
namespace CheckoutService.controller;
131+
132+
[ApiController]
133+
public sealed class CheckoutServiceController : ControllerBase
131134
{
132-
[ApiController]
133-
public class CheckoutServiceController : Controller
135+
[HttpPost("/checkout")]
136+
public ActionResult<string> getCheckout([FromBody] int orderId)
134137
{
135-
[HttpPost("/checkout")]
136-
public ActionResult<string> getCheckout([FromBody] int orderId)
137-
{
138-
Console.WriteLine("Received Message: " + orderId);
139-
return "CID" + orderId;
140-
}
138+
Console.WriteLine($"Received Message: {orderId}");
139+
return $"CID{orderId}";
141140
}
142141
}
142+
```
143143

144+
The following example demonstrates how to configure the same input binding using a minimal API approach:
145+
```csharp
146+
app.MapPost("checkout", ([FromBody] int orderId) =>
147+
{
148+
Console.WriteLine($"Received Message: {orderId}");
149+
return $"CID{orderId}"
150+
});
144151
```
145152

146153
{{% /codetab %}}

daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md

Lines changed: 45 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,21 @@ The following example shows how to get a saved configuration item using the Dapr
7676
{{% codetab %}}
7777
7878
```csharp
79-
//dependencies
8079
using System;
8180
using System.Collections.Generic;
8281
using System.Threading.Tasks;
8382
using Dapr.Client;
8483

85-
//code
86-
namespace ConfigurationApi
87-
{
88-
public class Program
89-
{
90-
private static readonly string CONFIG_STORE_NAME = "configstore";
91-
92-
public static async Task Main(string[] args)
93-
{
94-
using var client = new DaprClientBuilder().Build();
95-
var configuration = await client.GetConfiguration(CONFIG_STORE_NAME, new List<string>() { "orderId1", "orderId2" });
96-
Console.WriteLine($"Got key=\n{configuration[0].Key} -> {configuration[0].Value}\n{configuration[1].Key} -> {configuration[1].Value}");
97-
}
98-
}
99-
}
84+
const string CONFIG_STORE_NAME = "configstore";
85+
86+
var builder = WebApplication.CreateBuilder(args);
87+
builder.Services.AddDaprClient();
88+
var app = builder.Build();
89+
90+
using var client = app.Services.GetRequiredServices<DaprClient>();
91+
92+
var configuration = await client.GetConfiguration(CONFIG_STORE_NAME, [ "orderId1", "orderId2" ]);
93+
Console.WriteLine($"Got key=\n{configuration[0].Key} -> {configuration[0].Value}\n{configuration[1].Key} -> {configuration[1].Value}");
10094
```
10195

10296
{{% /codetab %}}
@@ -261,13 +255,19 @@ using System;
261255
using System.Collections.Generic;
262256
using System.Threading.Tasks;
263257
using Dapr.Client;
258+
using System.Text.Json;
264259

265260
const string DAPR_CONFIGURATION_STORE = "configstore";
266261
var CONFIGURATION_ITEMS = new List<string> { "orderId1", "orderId2" };
267-
var client = new DaprClientBuilder().Build();
262+
263+
var builder = WebApplication.CreateBuilder(args);
264+
builder.Services.AddDaprClient();
265+
var app = builder.Build();
266+
267+
var client = app.Services.GetRequiredService<DaprClient>();
268268

269269
// Subscribe for configuration changes
270-
SubscribeConfigurationResponse subscribe = await client.SubscribeConfiguration(DAPR_CONFIGURATION_STORE, CONFIGURATION_ITEMS);
270+
var subscribe = await client.SubscribeConfiguration(DAPR_CONFIGURATION_STORE, CONFIGURATION_ITEMS);
271271

272272
// Print configuration changes
273273
await foreach (var items in subscribe.Source)
@@ -279,7 +279,7 @@ await foreach (var items in subscribe.Source)
279279
subscriptionId = subscribe.Id;
280280
continue;
281281
}
282-
var cfg = System.Text.Json.JsonSerializer.Serialize(items);
282+
var cfg = JsonSerializer.Serialize(items);
283283
Console.WriteLine("Configuration update " + cfg);
284284
}
285285
```
@@ -303,40 +303,23 @@ using Dapr.Extensions.Configuration;
303303
using System.Collections.Generic;
304304
using System.Threading;
305305

306-
namespace ConfigurationApi
307-
{
308-
public class Program
309-
{
310-
public static void Main(string[] args)
311-
{
312-
Console.WriteLine("Starting application.");
313-
CreateHostBuilder(args).Build().Run();
314-
Console.WriteLine("Closing application.");
315-
}
316-
317-
/// <summary>
318-
/// Creates WebHost Builder.
319-
/// </summary>
320-
/// <param name="args">Arguments.</param>
321-
/// <returns>Returns IHostbuilder.</returns>
322-
public static IHostBuilder CreateHostBuilder(string[] args)
323-
{
324-
var client = new DaprClientBuilder().Build();
325-
return Host.CreateDefaultBuilder(args)
326-
.ConfigureAppConfiguration(config =>
327-
{
328-
// Get the initial value and continue to watch it for changes.
329-
config.AddDaprConfigurationStore("configstore", new List<string>() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
330-
config.AddStreamingDaprConfigurationStore("configstore", new List<string>() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
331-
332-
})
333-
.ConfigureWebHostDefaults(webBuilder =>
334-
{
335-
webBuilder.UseStartup<Startup>();
336-
});
337-
}
338-
}
339-
}
306+
Console.WriteLine("Starting application.");
307+
var builder = WebApplication.CreateBuilder(args);
308+
309+
// Unlike most other situations, we build a `DaprClient` here using its factory because we cannot rely on `IConfiguration`
310+
// or other injected services to configure it because we haven't yet built the DI container.
311+
var client = new DaprClientBuilder().Build();
312+
313+
// In a real-world application, you'd also add the following line to register the `DaprClient` with the DI container so
314+
// it can be injected into other services. In this demonstration, it's not necessary as we're not injecting it anywhere.
315+
// builder.Services.AddDaprClient();
316+
317+
// Get the initial value and continue to watch it for changes
318+
builder.Configuration.AddDaprConfigurationStore("configstore", new List<string>() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
319+
builder.Configuration.AddStreamingDaprConfigurationStore("configstore", new List<string>() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
320+
321+
await builder.Build().RunAsync();
322+
Console.WriteLine("Closing application.");
340323
```
341324
342325
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
524507
{{< tabs ".NET" Java Python Go JavaScript "HTTP API (BASH)" "HTTP API (Powershell)">}}
525508
526509
{{% codetab %}}
510+
527511
```csharp
528512
using System;
529513
using System.Collections.Generic;
530514
using System.Threading.Tasks;
531515
using Dapr.Client;
532516
517+
var builder = WebApplication.CreateBuilder();
518+
builder.Services.AddDaprClient();
519+
var app = builder.Build();
520+
533521
const string DAPR_CONFIGURATION_STORE = "configstore";
534-
var client = new DaprClientBuilder().Build();
522+
const string SubscriptionId = "abc123"; //Replace with the subscription identifier to unsubscribe from
523+
var client = app.Services.GetRequiredService<DaprClient>();
535524
536-
// Unsubscribe to config updates and exit the app
537-
async Task unsubscribe(string subscriptionId)
538-
{
539-
try
540-
{
541-
await client.UnsubscribeConfiguration(DAPR_CONFIGURATION_STORE, subscriptionId);
542-
Console.WriteLine("App unsubscribed from config changes");
543-
Environment.Exit(0);
544-
}
545-
catch (Exception ex)
546-
{
547-
Console.WriteLine("Error unsubscribing from config updates: " + ex.Message);
548-
}
549-
}
525+
await client.UnsubscribeConfiguration(DAPR_CONFIGURATION_STORE, SubscriptionId);
526+
Console.WriteLine("App unsubscribed from config changes");
550527
```
551528
{{% /codetab %}}
552529

daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Prompt caching optimizes performance by storing and reusing prompts that are oft
3030

3131
### Personally identifiable information (PII) obfuscation
3232

33-
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.
33+
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.
3434

3535
The PII scrubber obfuscates the following user information:
3636
- Phone number

0 commit comments

Comments
 (0)