Skip to content

Commit

Permalink
Merge pull request #1092 from dapr/release-1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyuk authored Aug 15, 2024
2 parents f695e1b + f7c925d commit 06227fb
Show file tree
Hide file tree
Showing 143 changed files with 50,354 additions and 8,008 deletions.
10 changes: 5 additions & 5 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_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v${DAPR_CLI_VERSION}/install/
DAPR_DEFAULT_IMAGE_REGISTRY: ghcr
MACOS_PYTHON_VERSION: 3.10
DAPR_CLI_VERSION: 1.14.0
DAPR_RUNTIME_VERSION: 1.14.1
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v${DAPR_CLI_VERSION}/install/
DAPR_DEFAULT_IMAGE_REGISTRY: ghcr
MACOS_PYTHON_VERSION: 3.10
4 changes: 2 additions & 2 deletions .github/workflows/validate_go_quickstarts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ jobs:
for building_block in $building_blocks; do
for variant in "${variants[@]}"
do
if [ ! -d "$building_block/go/$variant" ];
if [ ! -d "$building_block/go/$variant" ];
then
echo "$building_block/go/$variant does not exist."
else
pushd $building_block/go/$variant
echo "Validating $building_block/go/$variant quickstart"
make validate
make validate
popd
fi
done
Expand Down
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ packages
**/__pycache__/
**/dist/
Debug/
**_example

# IDE generated files and directories
*.iml
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# These owners are the maintainers and approvers of this repo
* @maintainers-quickstarts @approvers-quickstarts
* @dapr/maintainers-quickstarts @dapr/approvers-quickstarts
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
2 changes: 1 addition & 1 deletion actors/csharp/sdk/interfaces/SmartDevice.Interfaces.csproj
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/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ timeout_seconds: 120

```bash
cd ../../db
docker-compose up
docker compose up
```

<!-- END_STEP -->
Expand Down
37 changes: 25 additions & 12 deletions bindings/csharp/http/batch/program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ You may obtain a copy of the License at
See the License for the specific language governing permissions and
limitations under the License.
*/
using System;
using System.IO;

using Microsoft.AspNetCore.Localization;
using System.Globalization;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Mvc;


//dapr run --app-id batch-http --app-port 7001 --resources-path ../../../components -- dotnet run

Expand All @@ -28,20 +27,32 @@ limitations under the License.
var daprUrl = $"{baseURL}:{daprPort}/v1.0/bindings/{sqlBindingName}";

var builder = WebApplication.CreateBuilder(args);

builder.Services.Configure<RequestLocalizationOptions>(options =>
{
var invariantCulture = CultureInfo.InvariantCulture;
options.DefaultRequestCulture = new RequestCulture(invariantCulture);
options.SupportedCultures = [invariantCulture];
});

var app = builder.Build();

if (app.Environment.IsDevelopment()) {app.UseDeveloperExceptionPage();}
if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); }

app.UseRequestLocalization();

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

// Triggered by Dapr input binding
app.MapPost("/" + cronBindingName, async () => {
app.MapPost("/" + cronBindingName, async () =>
{
Console.WriteLine("Processing batch..");
string jsonFile = File.ReadAllText("../../../orders.json");
var ordersArray = JsonSerializer.Deserialize<Orders>(jsonFile);
foreach(Order ord in ordersArray?.orders ?? new Order[] {}){
foreach (Order ord in ordersArray?.orders ?? new Order[] { })
{
var sqlText = $"insert into orders (orderid, customer, price) values ({ord.OrderId}, '{ord.Customer}', {ord.Price});";
var payload = new DaprPayload(sql: new DaprPostgresBindingMetadata(cmd: sqlText), operation: "exec");
var orderJson = JsonSerializer.Serialize<DaprPayload>(payload);
Expand All @@ -50,19 +61,21 @@ limitations under the License.
Console.WriteLine(sqlText);
// Insert order using Dapr output binding via HTTP Post
try {
try
{
var resp = await httpClient.PostAsync(daprUrl, content);
resp.EnsureSuccessStatusCode();
}
catch (HttpRequestException e) {
}
catch (HttpRequestException e)
{
Console.WriteLine(e.ToString());
throw e;
}
}
Console.WriteLine("Finished processing batch");
return Results.Ok();
});

Expand Down
2 changes: 1 addition & 1 deletion bindings/csharp/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ timeout_seconds: 120

```bash
cd ../../db
docker-compose up
docker compose up
```

<!-- END_STEP -->
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>
30 changes: 20 additions & 10 deletions bindings/csharp/sdk/batch/program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,45 @@ You may obtain a copy of the License at
See the License for the specific language governing permissions and
limitations under the License.
*/
using System;
using System.IO;
using System.Text;

using Microsoft.AspNetCore.Localization;
using System.Globalization;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Mvc;
using Dapr.Client;


// dapr run --app-id batch-sdk --app-port 7002 --resources-path ../../../components -- dotnet run

var cronBindingName = "cron";
var sqlBindingName = "sqldb";

var builder = WebApplication.CreateBuilder(args);

builder.Services.Configure<RequestLocalizationOptions>(options =>
{
var invariantCulture = CultureInfo.InvariantCulture;
options.DefaultRequestCulture = new RequestCulture(invariantCulture);
options.SupportedCultures = [invariantCulture];
});

var app = builder.Build();

if (app.Environment.IsDevelopment()) {app.UseDeveloperExceptionPage();}
if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); }

// Triggered by Dapr input binding
app.MapPost("/" + cronBindingName, async () => {
app.UseRequestLocalization();

// Triggered by Dapr input binding
app.MapPost("/" + cronBindingName, async () =>
{
Console.WriteLine("Processing batch..");
string jsonFile = File.ReadAllText("../../../orders.json");
var ordersArray = JsonSerializer.Deserialize<Orders>(jsonFile);
using var client = new DaprClientBuilder().Build();
foreach(Order ord in ordersArray?.orders ?? new Order[] {}){
foreach (Order ord in ordersArray?.orders ?? new Order[] { })
{
var sqlText = $"insert into orders (orderid, customer, price) values ({ord.OrderId}, '{ord.Customer}', {ord.Price});";
var command = new Dictionary<string,string>(){
var command = new Dictionary<string, string>(){
{"sql",
sqlText}
};
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ timeout_seconds: 120

```bash
cd ../../db
docker-compose up
docker compose up
```

<!-- END_STEP -->
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ timeout_seconds: 120

```bash
cd ../../db
docker-compose up
docker compose up
```

<!-- END_STEP -->
Expand Down
Binary file removed bindings/go/sdk/batch/dapr_output_binding
Binary file not shown.
Loading

0 comments on commit 06227fb

Please sign in to comment.