Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge recent change (observability) from master -> release-1.14 #1079

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
27ae4c9
Updating Readme to favor kubectl based deploy vs. multi app run for t…
paulyuk Jul 22, 2024
2415ab5
Aligning test with dapr init --dev which installs redis, so quickstar…
paulyuk Jul 23, 2024
8497225
Disabling conflicting GH action workflow steps
paulyuk Jul 23, 2024
7905162
forcing ghcr.io as image registry for kubernetes init
paulyuk Jul 23, 2024
2878707
Patching CLI with fix for Redis in --dev mode
paulyuk Jul 24, 2024
9ab1fd3
Merge branch 'hello-k8s-single-run' of github.com:paulyuk/quickstarts…
paulyuk Jul 24, 2024
c724918
Updating readme with exact redis version
paulyuk Jul 24, 2024
b2fb2e1
Restoring original Dapr CLI install command (sans ghcr flag)
paulyuk Jul 24, 2024
c9e0515
jobs api
rochabr Jul 24, 2024
9d2aec4
removing unused http port
rochabr Jul 24, 2024
b6f110f
global env dapr version
rochabr Jul 24, 2024
2377cb6
Update jobs/go/http/README.md
rochabr Jul 24, 2024
069f1f4
Update validate.yaml
yaron2 Jul 25, 2024
2564cfc
Update validate.yaml
yaron2 Jul 25, 2024
6c8005e
Update validate.yaml
yaron2 Jul 25, 2024
471930f
go-sdk reference updgrade
rochabr Jul 25, 2024
2601a5d
increasing sleep time
rochabr Jul 25, 2024
d64d200
Merge branch 'dapr:master' into jobs-api
rochabr Jul 25, 2024
20dafba
removing sleeps and increasing timeout
rochabr Jul 25, 2024
a6f8709
simplifying steps
rochabr Jul 25, 2024
b1c40e0
changing ports
rochabr Jul 25, 2024
be70bef
Merge pull request #1064 from rochabr/jobs-api
paulyuk Jul 25, 2024
323853b
chore: rename workflow, bump kubernetes versions and print redis logs
mikeee Jul 25, 2024
ff7603a
ci: remove debug/log step
mikeee Jul 25, 2024
231fb83
fix: define resiliency policy
mikeee Jul 25, 2024
afdd5ea
fix: update expected validation output
mikeee Jul 25, 2024
515af4a
Update validate.yaml
yaron2 Jul 25, 2024
9ba2bcd
Disabling Jobs SDK quickstart test until @rochabr fixes #1071
paulyuk Jul 25, 2024
fbd8716
Merge pull request #1072 from paulyuk/hotfix/jobs-sdk-test
paulyuk Jul 25, 2024
4d9be49
fix: add sleep/background arguments to the observability tutorial
mikeee Jul 25, 2024
1589133
Updating all Dapr.* SDKs to 1-14.*-* version
paulyuk Jul 25, 2024
68dc3d3
Merge pull request #1069 from mikeee/validate-tutorials
paulyuk Jul 25, 2024
c6c5614
Javascript SDK changes for 1.14 release ("@dapr/dapr": "^3.3.1")
paulyuk Jul 26, 2024
f59cb35
Python SDK updates to dapr>=1.14.0a,<1.15.0
paulyuk Jul 26, 2024
41c471e
Merge branch 'release-1.14' of github.com:dapr/quickstarts into hello…
paulyuk Jul 26, 2024
12eb0a9
Updating readme with better timeouts and redis (if exists) test
paulyuk Jul 26, 2024
64e85b5
Merge pull request #1057 from paulyuk/hello-k8s-single-run
paulyuk Jul 26, 2024
c376acc
Merge pull request #1073 from paulyuk/release-1.14-sdk-updates
paulyuk Jul 26, 2024
1eb7ba5
Merge branch 'master' of github.com:dapr/quickstarts into release-1.14
paulyuk Jul 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/env/global.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DAPR_CLI_VERSION: 1.13.0
DAPR_RUNTIME_VERSION: 1.13.5
DAPR_CLI_VERSION: 1.14.0-rc.7
DAPR_RUNTIME_VERSION: 1.14.0-rc.5
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v${DAPR_CLI_VERSION}/install/
DAPR_DEFAULT_IMAGE_REGISTRY: ghcr
MACOS_PYTHON_VERSION: 3.10
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
env:
GOVER: 1.17
KUBERNETES_VERSION: v1.21.1
KIND_VERSION: v0.12.0
KIND_IMAGE_SHA: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
GOVER: 1.22
KUBERNETES_VERSION: v1.29.4
KIND_VERSION: v0.23.0
KIND_IMAGE_SHA: sha256:3abb816a5b1061fb15c6e9e60856ec40d56b7b52bcea5f5f1350bc6e2320b6f8
strategy:
matrix:
os: [ubuntu-latest]
Expand Down Expand Up @@ -132,11 +132,10 @@ jobs:
dapr --version
- name: Install Dapr - Kubernetes
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install redis bitnami/redis --version 17.14.5
dapr init -k --dev --runtime-version=${{ env.DAPR_RUNTIME_VERSION }} --wait || kubectl get pods --all-namespaces
kubectl get nodes -o wide
kubectl describe pod dapr-dev-redis-master-0
helm list
for pod in `dapr status -k | awk '/dapr/ {print $1}'`; do kubectl describe pod -l app=$pod -n dapr-system ; kubectl logs -l app=$pod -n dapr-system; done
- name: Install utilities dependencies
run: |
Expand All @@ -148,48 +147,48 @@ jobs:
pushd tutorials/hello-world
make validate
popd
- name: Validate hello-kubernetes multi app run
if: matrix.os == 'ubuntu-latest'
run: |
pushd tutorials/hello-kubernetes
make validate_multi_app_run
popd
# - name: Validate hello-kubernetes multi app run
# if: matrix.os == 'ubuntu-latest'
# run: |
# pushd tutorials/hello-kubernetes
# make validate_multi_app_run
# popd
- name: Validate hello-kubernetes normal run
if: matrix.os == 'ubuntu-latest'
run: |
pushd tutorials/hello-kubernetes
make validate_normal_run
popd
- name: Validate distributed-calculator
if: matrix.os == 'ubuntu-latest'
run: |
pushd tutorials/distributed-calculator
make validate
popd
- name: Validate pub-sub
if: matrix.os == 'ubuntu-latest'
run: |
pushd tutorials/pub-sub
make validate
popd
- name: Validate bindings
if: matrix.os == 'ubuntu-latest'
run: |
pushd tutorials/bindings
make validate
popd
- name: Validate secretstore
if: matrix.os == 'ubuntu-latest'
run: |
pushd tutorials/secretstore
make validate
popd
- name: Validate observability
if: matrix.os == 'ubuntu-latest'
run: |
pushd tutorials/observability
make validate
popd
# - name: Validate distributed-calculator
# if: matrix.os == 'ubuntu-latest'
# run: |
# pushd tutorials/distributed-calculator
# make validate
# popd
# - name: Validate pub-sub
# if: matrix.os == 'ubuntu-latest'
# run: |
# pushd tutorials/pub-sub
# make validate
# popd
# - name: Validate bindings
# if: matrix.os == 'ubuntu-latest'
# run: |
# pushd tutorials/bindings
# make validate
# popd
# - name: Validate secretstore
# if: matrix.os == 'ubuntu-latest'
# run: |
# pushd tutorials/secretstore
# make validate
# popd
# - name: Validate observability
# if: matrix.os == 'ubuntu-latest'
# run: |
# pushd tutorials/observability
# make validate
# popd
- name: Linkcheck README.md
run: |
make validate
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Pick a building block API (for example, PubSub, state management, etc) and rapid
| [Cryptography](./cryptography) | Perform cryptographic operations without exposing keys to your application |
| [Resiliency](./resiliency) | Define and apply fault-tolerant policies (retries/back-offs, timeouts and circuit breakers) to your Dapr API requests |
| [Workflow](./workflows) | Dapr Workflow enables you to create long running, fault-tolerant, stateful applications |
| [Jobs](./jobs) | Dapr Jobs enable you to manage and schedule tasks |

### Tutorials

Expand Down
2 changes: 1 addition & 1 deletion actors/csharp/sdk/client/SmartDevice.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.13.*-*" />
<PackageReference Include="Dapr.Actors" Version="1.14.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.13.*-*" />
<PackageReference Include="Dapr.Actors" Version="1.14.*-*" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions actors/csharp/sdk/service/SmartDevice.Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.13.*-*" />
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.13.*-*" />
<PackageReference Include="Dapr.Actors" Version="1.14.*-*" />
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.14.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion bindings/csharp/sdk/batch/batch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.13.*-*" />
<PackageReference Include="Dapr.AspNetCore" Version="1.14.*-*" />
</ItemGroup>

</Project>
14 changes: 7 additions & 7 deletions bindings/javascript/sdk/batch/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/javascript/sdk/batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@dapr/dapr": "^3.3.0",
"@dapr/dapr": "^3.3.1",
"axios": "^0.25.0"
}
}
2 changes: 1 addition & 1 deletion bindings/python/sdk/batch/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dapr>=1.13.0a,<1.14.0
dapr>=1.14.0a,<1.15.0
Flask
typing-extensions
2 changes: 1 addition & 1 deletion configuration/csharp/sdk/order-processor/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.13.*-*" />
<PackageReference Include="Dapr.AspNetCore" Version="1.14.*-*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dapr>=1.13.0a,<1.14.0
dapr>=1.14.0a,<1.15.0
typing-extensions
152 changes: 152 additions & 0 deletions jobs/go/http/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Dapr Jobs

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.

Visit [this](https://v1-14.docs.dapr.io/developing-applications/building-blocks/jobs/) link for more information about Dapr and the Jobs API.

> **Note:** This example leverages HTTP `requests` only. If you are looking for the example using the Dapr Client SDK (recommended) [click here](../sdk/).

This quickstart includes two apps:

- `job-scheduler.go`, responsible for scheduling, retrieving and deleting jobs.
- `job-service.go`, responsible for handling the triggered jobs.

## Run the app with the template file

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.

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

<!-- STEP
name: Run multi app run template
expected_stdout_lines:
- '== APP - job-service == Received job request...'
- '== APP - job-service == Executing maintenance job: Oil Change'
- '== APP - job-scheduler == Job Scheduled: C-3PO'
- '== APP - job-service == Received job request...'
- '== APP - job-service == Executing maintenance job: Limb Calibration'
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
sleep: 60
timeout_seconds: 120
-->

```bash
dapr run -f .
```

The terminal console output should look similar to this, where:

- The `R2-D2` job is being scheduled.
- The `R2-D2` job is being executed after 2 seconds.
- The `C-3PO` job is being scheduled.
- The `C-3PO` job is being retrieved.

```text
== APP - job-scheduler == Job Scheduled: R2-D2
== APP - job-service == Received job request...
== APP - job-service == Starting droid: R2-D2
== APP - job-service == Executing maintenance job: Oil Change
== APP - job-scheduler == Job Scheduled: C-3PO
== APP - job-scheduler == Job details: {"name":"C-3PO", "dueTime":"30s", "data":{"@type":"ttype.googleapis.com/google.protobuf.StringValue", "expression":"C-3PO:Limb Calibration"}}
```

After 30 seconds, the terminal output should present the `C-3PO` job being processed:

```text
== APP - job-service == Received job request...
== APP - job-service == Starting droid: C-3PO
== APP - job-service == Executing maintenance job: Limb Calibration
```

2. Stop and clean up application processes

```bash
dapr stop -f .
```

<!-- END_STEP -->

## Run the Jobs APIs individually

### Schedule Jobs

1. Open a terminal and run the `job-service` app:

```bash
dapr run --app-id job-service --app-port 6200 --dapr-http-port 6280 -- go run .
```

2. On a new terminal window, schedule the `R2-D2` Job using the Jobs API.

```bash
curl -X POST \
http://localhost:6280/v1.0-alpha1/jobs/R2D2 \
-H "Content-Type: application/json" \
-d '{
"data": {
"@type": "type.googleapis.com/google.protobuf.StringValue",
"value": "R2-D2:Oil Change"
},
"dueTime": "2s"
}'
```

Back at the `job-service` app terminal window, the output should be:

```text
== APP - job-app == Received job request...
== APP - job-app == Starting droid: R2-D2
== APP - job-app == Executing maintenance job: Oil Change
```

3. On the same terminal window, schedule the `C-3PO` Job using the Jobs API.

```bash
curl -X POST \
http://localhost:6280/v1.0-alpha1/jobs/c-3po \
-H "Content-Type: application/json" \
-d '{
"data": {
"@type": "type.googleapis.com/google.protobuf.StringValue",
"value": "C-3PO:Limb Calibration"
},
"dueTime": "30s"
}'
```

### Get a scheduled job

1. On the same terminal window, run the command below to get the recently scheduled `C-3PO` job.

```bash
curl -X GET http://localhost:6280/v1.0-alpha1/jobs/c-3po -H "Content-Type: application/json"
```

You should see the following:

```text
{"name":"C-3PO", "dueTime":"30s", "data":{"@type":"type.googleapis.com/google.protobuf.StringValue", "expression":"C-3PO:Limb Calibration"}}
```

### Delete a scheduled job

1. On the same terminal window, run the command below to deleted the recently scheduled `C-3PO` job.

```bash
curl -X DELETE http://localhost:6280/v1.0-alpha1/jobs/c-3po -H "Content-Type: application/json"
```

2. Run the command below to attempt to retrieve the deleted job:

```bash
curl -X GET http://localhost:6280/v1.0-alpha1/jobs/c-3po -H "Content-Type: application/json"
```

Back at the `job-service` app terminal window, the output should be:

```text
ERRO[0249] Error getting job c-3po due to: rpc error: code = Unknown desc = job not found: app||default||job-service||c-3po instance=diagrid.local scope=dapr.api type=log ver=1.14.0-rc.2
```
12 changes: 12 additions & 0 deletions jobs/go/http/dapr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 1
apps:
- appDirPath: ./job-service/
appID: job-service
appPort: 6200
daprHTTPPort: 6280
command: ["go", "run", "."]
- appDirPath: ./job-scheduler/
appID: job-scheduler
appPort: 6300
daprHTTPPort: 6380
command: ["go", "run", "."]
Loading
Loading