Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
Support the components-path via dapr extension (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtaghavi2005 authored Jul 15, 2020
1 parent b2b91fa commit 2bfe16f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion samples/dapr/orders/orders.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.6.0-preview01" />
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/dapr/products/products.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.6.0-preview01" />
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/dapr/store/store.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.6.0-preview01" />
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
</ItemGroup>

</Project>
13 changes: 11 additions & 2 deletions samples/dapr/tye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ extensions:
# a file on disk when running locally at `./components/myconfig.yaml`
#
# config: myconfig


# components-path configures the components path of the dapr sidecard
components-path: "./components/"
services:
- name: orders
project: orders/orders.csproj
Expand All @@ -32,4 +34,11 @@ services:
- name: redis
image: redis
bindings:
- port: 6379
- port: 6379
# To ensure that your are running a dapr placement container with the right binding port.
# (50005 as HostPort)
- name: placement
image: daprio/dapr
args: ./placement
bindings:
- port: 50005
6 changes: 5 additions & 1 deletion src/Microsoft.Tye.Extensions/Dapr/DaprExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public override Task ProcessAsync(ExtensionContext context, ExtensionConfigurati
}

// See https://github.com/dotnet/tye/issues/260
//
//
// Currently the pub-sub pattern does not work when you have multiple replicas. Each
// daprd instance expects that it has a single application to talk to. So if you're using
// pub-sub this means that you'll won't get some messages.
Expand Down Expand Up @@ -71,6 +71,10 @@ public override Task ProcessAsync(ExtensionContext context, ExtensionConfigurati
proxy.Args += $" -log-level {logLevel}";
}

if (config.Data.TryGetValue("components-path", out obj) && obj?.ToString() is string componentsPath)
{
proxy.Args += $" -components-path {componentsPath}";
}
// Add dapr proxy as a service available to everyone.
proxy.Dependencies.UnionWith(context.Application.Services.Select(s => s.Name));

Expand Down

0 comments on commit 2bfe16f

Please sign in to comment.