Browse Source

Support the components-path via dapr extension (#556)

jkotalik/fixAzureFunctions
Mohammad Taghavi 6 years ago
committed by GitHub
parent
commit
2bfe16fef4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      samples/dapr/orders/orders.csproj
  2. 2
      samples/dapr/products/products.csproj
  3. 2
      samples/dapr/store/store.csproj
  4. 13
      samples/dapr/tye.yaml
  5. 6
      src/Microsoft.Tye.Extensions/Dapr/DaprExtension.cs

2
samples/dapr/orders/orders.csproj

@ -5,7 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.6.0-preview01" /> <PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
samples/dapr/products/products.csproj

@ -5,7 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.6.0-preview01" /> <PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
samples/dapr/store/store.csproj

@ -5,7 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.6.0-preview01" /> <PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
</ItemGroup> </ItemGroup>
</Project> </Project>

13
samples/dapr/tye.yaml

@ -16,7 +16,9 @@ extensions:
# a file on disk when running locally at `./components/myconfig.yaml` # a file on disk when running locally at `./components/myconfig.yaml`
# #
# config: myconfig # config: myconfig
# components-path configures the components path of the dapr sidecard
components-path: "./components/"
services: services:
- name: orders - name: orders
project: orders/orders.csproj project: orders/orders.csproj
@ -32,4 +34,11 @@ services:
- name: redis - name: redis
image: redis image: redis
bindings: 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
src/Microsoft.Tye.Extensions/Dapr/DaprExtension.cs

@ -31,7 +31,7 @@ namespace Microsoft.Tye.Extensions.Dapr
} }
// See https://github.com/dotnet/tye/issues/260 // See https://github.com/dotnet/tye/issues/260
// //
// Currently the pub-sub pattern does not work when you have multiple replicas. Each // 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 // 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. // pub-sub this means that you'll won't get some messages.
@ -71,6 +71,10 @@ namespace Microsoft.Tye.Extensions.Dapr
proxy.Args += $" -log-level {logLevel}"; 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. // Add dapr proxy as a service available to everyone.
proxy.Dependencies.UnionWith(context.Application.Services.Select(s => s.Name)); proxy.Dependencies.UnionWith(context.Application.Services.Select(s => s.Name));

Loading…
Cancel
Save