Made some dapr improvements based on feedback#1133
Conversation
- Default appid to the resource name - Name the dapr side car resource name-dapr - Look for the side car annotation on all resources.
| } | ||
|
|
||
| var resource = new ExecutableResource(appId, fileName, workingDirectory, daprCommandLine.Arguments.ToArray()); | ||
| var daprSideCar = new ExecutableResource($"{resource.Name}-dapr", fileName, appHostDirectory, daprCommandLine.Arguments.ToArray()); |
There was a problem hiding this comment.
I wonder if it'd make sense to add an option to allow setting the resource name in case {resource}-dapr isn't desired.
| } | ||
|
|
||
| var resource = new ExecutableResource(appId, fileName, workingDirectory, daprCommandLine.Arguments.ToArray()); | ||
| var daprSideCar = new ExecutableResource($"{resource.Name}-dapr", fileName, appHostDirectory, daprCommandLine.Arguments.ToArray()); |
There was a problem hiding this comment.
Originally the sidecar was run in the project directory to mimic how the sidecars would be started when using Dapr run files (in order for the sidecar's (optional) Command property, which was often dotnet run to make sense). The user can still specify a command in the sidecar options, though it's probably of little use when using Aspire's orchestration.
It's probably ok to generally use the app host directory, since we've made all the important paths relative to it anyway, but it will be a point of inconsistency between Dapr (by itself) and Dapr (in Aspire). For non-project resources (like executables), the app host directory is probably the only real option. I suppose we could add a WorkingDirectory sidecar option if/when customers have a need.
There was a problem hiding this comment.
I think we can make it work for projects and executables, but containers don’t have natural working directory. What does looking based on this directory ?
philliphoff
left a comment
There was a problem hiding this comment.
Agree that it makes sense to use the Aspire name for the "parent" resource as the default Dapr application ID.
- Default appid to the resource name - Name the dapr side car resource name-dapr - Look for the side car annotation on all resources.
Fixes #1091
Fixes #926