Skip to content

Commit 55d7dc2

Browse files
Merge pull request #1176 from alicejgibbons/release-1.15
Re-merge 1.15 release branch into master
2 parents 43a98a1 + a70f256 commit 55d7dc2

File tree

26 files changed

+599
-24
lines changed

26 files changed

+599
-24
lines changed

.github/env/global.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
DAPR_CLI_VERSION: 1.15.0
2-
DAPR_RUNTIME_VERSION: 1.15.0
2+
DAPR_RUNTIME_VERSION: 1.15.2
33
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v${DAPR_CLI_VERSION}/install/
44
DAPR_DEFAULT_IMAGE_REGISTRY: ghcr
55

conversation/csharp/http/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this quickstart, you'll send an input to a mock Large Language Model (LLM) using Dapr's Conversation API. This API is responsible for providing one consistent API entry point to talk to underlying LLM providers.
44

5-
Visit [this](https://v1-15.docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
66

77
> **Note:** This example leverages HTTP `requests` only. If you are looking for the example using the Dapr Client SDK (recommended) [click here](../sdk/).
88
@@ -14,7 +14,7 @@ This quickstart includes one app:
1414

1515
This section shows how to run the application using the [multi-app run template file](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) and Dapr CLI with `dapr run -f .`.
1616

17-
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Integrate with popular LLM models by using one of the other [supported conversation components](https://v1-15.docs.dapr.io/reference/components-reference/supported-conversation/).
17+
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Integrate with popular LLM models by using one of the other [supported conversation components](https://docs.dapr.io/reference/components-reference/supported-conversation/).
1818

1919
Open a new terminal window and run the multi app run template:
2020

conversation/csharp/sdk/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this quickstart, you'll send an input to a mock Large Language Model (LLM) using Dapr's Conversation API. This API is responsible for providing one consistent API entry point to talk to underlying LLM providers.
44

5-
Visit [this](https://v1-15.docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
66

77
> **Note:** This example leverages the Dapr SDK. If you are looking for the example using the HTTP API [click here](../http/).
88
@@ -14,7 +14,7 @@ This quickstart includes one app:
1414

1515
This section shows how to run the application using the [multi-app run template file](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) and Dapr CLI with `dapr run -f .`.
1616

17-
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Integrate with popular LLM models by using one of the other [supported conversation components](https://v1-15.docs.dapr.io/reference/components-reference/supported-conversation/).
17+
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Integrate with popular LLM models by using one of the other [supported conversation components](https://docs.dapr.io/reference/components-reference/supported-conversation/).
1818

1919
Open a new terminal window and run the multi app run template:
2020

conversation/go/http/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this quickstart, you'll send an input to a mock Large Language Model (LLM) using Dapr's Conversation API. This API is responsible for providing one consistent API entry point to talk to underlying LLM providers.
44

5-
Visit [this](https://v1-15.docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
66

77
> **Note:** This example leverages HTTP `requests` only. If you are looking for the example using the Dapr Client SDK (recommended) [click here](../sdk/).
88
@@ -14,7 +14,7 @@ This quickstart includes one app:
1414

1515
This section shows how to run the application using the [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`.
1616

17-
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://v1-15.docs.dapr.io/reference/components-reference/supported-conversation/).
17+
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://docs.dapr.io/reference/components-reference/supported-conversation/).
1818

1919
Open a new terminal window and run the multi app run template:
2020

conversation/go/sdk/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this quickstart, you'll send an input to a mock Large Language Model (LLM) using Dapr's Conversation API. This API is responsible for providing one consistent API entry point to talk to underlying LLM providers.
44

5-
Visit [this](https://v1-15.docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
66

77
> **Note:** This example leverages the Dapr SDK. If you are looking for the example using the HTTP API [click here](../http/).
88
@@ -14,7 +14,7 @@ This quickstart includes one app:
1414

1515
This section shows how to run the application using the [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`.
1616

17-
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://v1-15.docs.dapr.io/reference/components-reference/supported-conversation/).
17+
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://docs.dapr.io/reference/components-reference/supported-conversation/).
1818

1919
Open a new terminal window and run the multi app run template:
2020

conversation/javascript/http/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this quickstart, you'll send an input to a mock Large Language Model (LLM) using Dapr's Conversation API. This API is responsible for providing one consistent API entry point to talk to underlying LLM providers.
44

5-
Visit [this](https://v1-15.docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
66

77
> **Note:** This example leverages HTTP `requests` only.
88
@@ -14,7 +14,7 @@ This quickstart includes one app:
1414

1515
This section shows how to run the application using the [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`.
1616

17-
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://v1-15.docs.dapr.io/reference/components-reference/supported-conversation/).
17+
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://docs.dapr.io/reference/components-reference/supported-conversation/).
1818

1919
1. Install dependencies:
2020

conversation/python/http/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this quickstart, you'll send an input to a mock Large Language Model (LLM) using Dapr's Conversation API. This API is responsible for providing one consistent API entry point to talk to underlying LLM providers.
44

5-
Visit [this](https://v1-15.docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
66

77
> **Note:** This example leverages HTTP `requests` only.
88
@@ -14,7 +14,7 @@ This quickstart includes one app:
1414

1515
This section shows how to run the application using the [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`.
1616

17-
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://v1-15.docs.dapr.io/reference/components-reference/supported-conversation/).
17+
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://docs.dapr.io/reference/components-reference/supported-conversation/).
1818

1919
1. Install dependencies:
2020

conversation/python/sdk/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this quickstart, you'll send an input to a mock Large Language Model (LLM) using Dapr's Conversation API. This API is responsible for providing one consistent API entry point to talk to underlying LLM providers.
44

5-
Visit [this](https://v1-15.docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/conversation/conversation-overview/) link for more information about Dapr and the Conversation API.
66

77
This quickstart includes one app:
88

@@ -12,7 +12,7 @@ This quickstart includes one app:
1212

1313
This section shows how to run the application using the [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`.
1414

15-
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://v1-15.docs.dapr.io/reference/components-reference/supported-conversation/).
15+
This example uses the default LLM Component provided by Dapr which simply echoes the input provided, for testing purposes. Here are other [supported Conversation components](https://docs.dapr.io/reference/components-reference/supported-conversation/).
1616

1717
1. Install dependencies:
1818

jobs/csharp/http/README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ expected_stdout_lines:
5757
expected_stderr_lines:
5858
output_match_mode: substring
5959
match_order: none
60-
background: false
60+
background: true
6161
sleep: 60
6262
timeout_seconds: 120
6363
-->
@@ -95,6 +95,18 @@ After 20 seconds, the terminal output should present the `C-3PO` job being proce
9595

9696
<!-- END_STEP -->
9797

98+
3. Stop and clean up application processes.
99+
100+
<!-- STEP
101+
name: Stop multi-app run
102+
-->
103+
104+
```bash
105+
dapr stop -f .
106+
```
107+
108+
<!-- END_STEP -->
109+
98110
## Run apps individually
99111

100112
### Schedule Jobs

jobs/csharp/http/job-scheduler/Program.cs

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
var daprHost = Environment.GetEnvironmentVariable("DAPR_HOST") ?? "http://localhost";
2121
var jobServiceDaprHttpPort = "6280";
22-
2322
var httpClient = new HttpClient();
2423

2524
await Task.Delay(5000); // Wait for job-service to start
@@ -65,7 +64,6 @@ async Task ScheduleJob(string jobName, object jobBody)
6564
async Task GetJobDetails(string jobName)
6665
{
6766
var reqURL = $"{daprHost}:{jobServiceDaprHttpPort}/v1.0-alpha1/jobs/{jobName}";
68-
6967
var response = await httpClient.GetAsync(reqURL);
7068

7169
if (!response.IsSuccessStatusCode)

jobs/csharp/sdk/README.md

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Dapr Jobs API (SDK)
2+
3+
In this quickstart, you'll schedule, get, and delete a job using Dapr's Job API. This API is responsible for scheduling and running jobs at a specific time or interval.
4+
5+
Visit [this](https://docs.dapr.io/developing-applications/building-blocks/jobs/) link for more information about Dapr and the Jobs API.
6+
7+
> **Note:** This example leverages the Dotnet SDK. If you are looking for the example using only HTTP requests, [click here](../http/).
8+
9+
This quickstart includes two apps:
10+
11+
- Jobs Scheduler, responsible for scheduling, retrieving and deleting jobs.
12+
- Jobs Service, responsible for handling the triggered jobs.
13+
14+
## Run all apps with multi-app run template file
15+
16+
This section shows how to run both applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications and will `schedule`, `run`, `get`, and `delete` jobs within a single process.
17+
18+
1. Build the apps:
19+
20+
<!-- STEP
21+
name: Build dependencies for job-service
22+
sleep: 1
23+
-->
24+
25+
```bash
26+
cd ./job-service
27+
dotnet build
28+
```
29+
30+
<!-- END_STEP -->
31+
32+
<!-- STEP
33+
name: Build dependencies for job-scheduler
34+
sleep: 1
35+
-->
36+
37+
```bash
38+
cd ./job-scheduler
39+
dotnet build
40+
```
41+
42+
<!-- END_STEP -->
43+
44+
2. Run the multi app run template:
45+
46+
<!-- STEP
47+
name: Run multi app run template
48+
expected_stdout_lines:
49+
- '== APP - job-service-sdk == Job Scheduled: R2-D2'
50+
- '== APP - job-service-sdk == Job Scheduled: C-3PO'
51+
- '== APP - job-service-sdk == Starting droid: R2-D2'
52+
- '== APP - job-service-sdk == Executing maintenance job: Oil Change'
53+
- '== APP - job-service-sdk == Starting droid: C-3PO'
54+
- '== APP - job-service-sdk == Executing maintenance job: Limb Calibration'
55+
expected_stderr_lines:
56+
output_match_mode: substring
57+
match_order: none
58+
background: true
59+
sleep: 60
60+
timeout_seconds: 120
61+
-->
62+
63+
```bash
64+
dapr run -f .
65+
```
66+
67+
The terminal console output should look similar to this, where:
68+
69+
- The `R2-D2` job is being scheduled.
70+
- The `R2-D2` job is being retrieved.
71+
- The `C-3PO` job is being scheduled.
72+
- The `C-3PO` job is being retrieved.
73+
- The `R2-D2` job is being executed after 15 seconds.
74+
- The `C-3PO` job is being executed after 20 seconds.
75+
76+
```text
77+
== APP - job-scheduler-sdk == Scheduling job...
78+
== APP - job-service-sdk == Job Scheduled: R2-D2
79+
== APP - job-scheduler-sdk == Job scheduled: {"name":"R2-D2","job":"Oil Change","dueTime":15}
80+
== APP - job-scheduler-sdk == Getting job: R2-D2
81+
== APP - job-service-sdk == Getting job...
82+
== APP - job-scheduler-sdk == Job details: {"schedule":"@every 15s","repeatCount":1,"dueTime":null,"ttl":null,"payload":"ChtkYXByLmlvL3NjaGVkdWxlL2pvYnBheWxvYWQSJXsiZHJvaWQiOiJSMi1EMiIsInRhc2siOiJPaWwgQ2hhbmdlIn0="}
83+
== APP - job-scheduler-sdk == Scheduling job...
84+
== APP - job-service-sdk == Job Scheduled: C-3PO
85+
== APP - job-scheduler-sdk == Job scheduled: {"name":"C-3PO","job":"Limb Calibration","dueTime":20}
86+
== APP - job-scheduler-sdk == Getting job: C-3PO
87+
== APP - job-service-sdk == Getting job...
88+
== APP - job-scheduler-sdk == Job details: {"schedule":"@every 20s","repeatCount":1,"dueTime":null,"ttl":null,"payload":"ChtkYXByLmlvL3NjaGVkdWxlL2pvYnBheWxvYWQSK3siZHJvaWQiOiJDLTNQTyIsInRhc2siOiJMaW1iIENhbGlicmF0aW9uIn0="}
89+
== APP - job-service-sdk == Handling job...
90+
== APP - job-service-sdk == Starting droid: R2-D2
91+
== APP - job-service-sdk == Executing maintenance job: Oil Change
92+
```
93+
94+
After 20 seconds, the terminal output should present the `C-3PO` job being processed:
95+
96+
```text
97+
== APP - job-service-sdk == Handling job...
98+
== APP - job-service-sdk == Starting droid: C-3PO
99+
== APP - job-service-sdk == Executing maintenance job: Limb Calibration
100+
```
101+
102+
<!-- END_STEP -->
103+
104+
3. Stop and clean up application processes.
105+
106+
<!-- STEP
107+
name: Stop multi-app run
108+
-->
109+
110+
```bash
111+
dapr stop -f .
112+
```
113+
114+
<!-- END_STEP -->
115+
116+
## Run apps individually
117+
118+
### Schedule Jobs
119+
120+
1. Open a terminal and run the `job-service` app. Build the dependencies if you haven't already.
121+
122+
```bash
123+
cd ./job-service
124+
dotnet build
125+
```
126+
127+
```bash
128+
dapr run --app-id job-service-sdk --app-port 6200 --dapr-http-port 6280 -- dotnet run
129+
```
130+
131+
2. In a new terminal window, schedule the `R2-D2` Job using the Jobs API.
132+
133+
```bash
134+
curl -X POST \
135+
http://localhost:6200/scheduleJob \
136+
-H "Content-Type: application/json" \
137+
-d '{
138+
"name": "R2-D2",
139+
"job": "Oil Change",
140+
"dueTime": 2
141+
}'
142+
```
143+
144+
In the `job-service` terminal window, the output should be:
145+
146+
```text
147+
== APP - job-app == Received job request...
148+
== APP - job-app == Starting droid: R2-D2
149+
== APP - job-app == Executing maintenance job: Oil Change
150+
```
151+
152+
3. On the same terminal window, schedule the `C-3PO` Job using the Jobs API.
153+
154+
```bash
155+
curl -X POST \
156+
http://localhost:6200/scheduleJob \
157+
-H "Content-Type: application/json" \
158+
-d '{
159+
"name": "C-3PO",
160+
"job": "Limb Calibration",
161+
"dueTime": 30
162+
}'
163+
```
164+
165+
### Get a scheduled job
166+
167+
1. On the same terminal window, run the command below to get the recently scheduled `C-3PO` job.
168+
169+
```bash
170+
curl -X GET http://localhost:6200/getJob/C-3PO -H "Content-Type: application/json"
171+
```
172+
173+
You should see the following:
174+
175+
```text
176+
{"name":"c-3po", "dueTime":"30s", "data":{"@type":"type.googleapis.com/google.protobuf.Value", "value":{"Value":"C-3PO:Limb Calibration"}}}
177+
```
178+
179+
### Delete a scheduled job
180+
181+
1. On the same terminal window, run the command below to deleted the recently scheduled `C-3PO` job.
182+
183+
```bash
184+
curl -X DELETE http://localhost:6200/deleteJob/C-3PO -H "Content-Type: application/json"
185+
```
186+
187+
2. Run the command below to attempt to retrieve the deleted job:
188+
189+
```bash
190+
curl -X GET http://localhost:6200/getJob/C-3PO -H "Content-Type: application/json"
191+
```
192+
193+
In the `job-service` terminal window, the output should be similar to the following:
194+
195+
```text
196+
ERRO[0157] Error getting job C-3PO due to: rpc error: code = NotFound desc = job not found: C-3PO instance=local scope=dapr.api type=log ver=1.15.0
197+
```

jobs/csharp/sdk/dapr.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 1
2+
apps:
3+
- appDirPath: ./job-service/
4+
appID: job-service-sdk
5+
appPort: 6200
6+
daprHTTPPort: 6280
7+
command: ["dotnet", "run"]
8+
appLogDestination: console
9+
daprdLogDestination: console
10+
- appDirPath: ./job-scheduler/
11+
appID: job-scheduler-sdk
12+
appPort: 6300
13+
daprHTTPPort: 6380
14+
command: ["dotnet", "run"]
15+
appLogDestination: console
16+
daprdLogDestination: console

0 commit comments

Comments
 (0)