Closed mfcollins3 closed 3 weeks ago
@dotnet-policy-service agree
Did you test this PR?
@davidfowl Yes, I did. Are you just asking for verification, or did you see a problem?
I didn't see any unit tests for PlacementHostAddress
, so I gathered it was difficult to test that and didn't add a unit test for SchedulerHostAddress
either. But when I built the Aspire NuGet packages locally and updated my app host project to use them, Dapr gave the errors that I expected without them and was able to connect with the properties included:
builder.AddExecutable("authorization-service", "../../../target/debug/authorization-service",
"../services/authorization")
.WithDaprSidecar(new DaprSidecarOptions
{
AppId = "authorization-service",
AppPort = 8000,
PlacementHostAddress = "placement:50006",
SchedulerHostAddress = "scheduler:50007"
})
.WithHttpEndpoint(8000, isProxied: false);
Here's the Dapr sidecar logs where you can see it's picking up the value of SchedulerHostAddress
correctly:
2024-10-28T22:26:17 WARNING: no application command found.
2024-10-28T22:26:17 ℹ️ Starting Dapr with id authorization-service. HTTP Port: 33981. gRPC Port: 43485
2024-10-28T22:26:17 time="2024-10-29T05:26:17.165934885Z" level=info msg="Starting Dapr Runtime -- version 1.14.4 -- commit 583960dc90120616124b60ad2b7820fc0b3edf44" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.165949218Z" level=info msg="Log level set to: info" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17
Flag --components-path has been deprecated, use --resources-path
2024-10-28T22:26:17
Flag --dapr-http-max-request-size has been deprecated, use '--max-body-size 4Mi'
2024-10-28T22:26:17
Flag --dapr-http-read-buffer-size has been deprecated, use '--read-buffer-size 4Ki'
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166066968Z" level=warning msg="mTLS is disabled. Skipping certificate request and tls validation" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.security type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166271426Z" level=info msg="metric spec: {0x4000d5edd9 <nil> <nil> []}" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.diagnostics type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166291843Z" level=info msg="Using default latency distribution buckets: [1 2 3 4 5 6 8 10 13 16 20 25 30 40 50 65 80 100 130 160 200 250 300 400 500 650 800 1000 2000 5000 10000 20000 50000 100000]" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.diagnostics type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16635551Z" level=warning msg="The default value for 'spec.metric.http.increasedCardinality' will change to 'false' in Dapr 1.15 or later" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.diagnostics type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166463968Z" level=info msg="Initializing connection to Scheduler in the background" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166635093Z" level=info msg="Scheduler client initialized for address: scheduler:50007" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.scheduler.clients type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166642885Z" level=info msg="Scheduler client connections created" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166665093Z" level=info msg="standalone mode configured" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166679593Z" level=info msg="app id: authorization-service" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166747385Z" level=info msg="Dapr trace sampler initialized: ParentBased{root:AlwaysOnSampler,remoteParentSampled:AlwaysOnSampler,remoteParentNotSampled:AlwaysOffSampler,localParentSampled:AlwaysOnSampler,localParentNotSampled:AlwaysOffSampler}" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166791676Z" level=info msg="metrics server started on :33603/" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166936593Z" level=info msg="local service entry announced: authorization-service -> 172.19.0.3:41867" app_id=authorization-service component="nr (mdns/v1)" instance=970387f29dad scope=dapr.contrib type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166951093Z" level=info msg="Initialized name resolution to mdns" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.166977301Z" level=info msg="Loading components…" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16699701Z" level=info msg="Waiting for all outstanding components to be processed…" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167001051Z" level=info msg="All outstanding components processed" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167007635Z" level=info msg="Loading endpoints…" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167018385Z" level=info msg="Waiting for all outstanding http endpoints to be processed…" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167021385Z" level=info msg="All outstanding http endpoints processed" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167024593Z" level=info msg="Loading Declarative Subscriptions…" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167056468Z" level=info msg="gRPC server listening on TCP address: :43485" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.grpc.api type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167066676Z" level=info msg="Enabled gRPC tracing middleware" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.grpc.api type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16706926Z" level=info msg="Enabled gRPC metrics middleware" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.grpc.api type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167100926Z" level=info msg="Registering workflow engine for gRPC endpoint: [::]:43485" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.grpc.api type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167114093Z" level=info msg="API gRPC server is running on port 43485" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16712526Z" level=warning msg="The default value for 'spec.metric.http.increasedCardinality' will change to 'false' in Dapr 1.15 or later" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.http type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167147843Z" level=info msg="Enabled max body size HTTP middleware with size 4194304 bytes" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.http type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167154093Z" level=info msg="Enabled tracing HTTP middleware" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.http type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16715651Z" level=info msg="Enabled metrics HTTP middleware" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.http type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16728551Z" level=info msg="HTTP server listening on TCP address: :33981" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.http type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167303218Z" level=info msg="HTTP server is running on port 33981" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167306343Z" level=info msg="The request body size parameter is: 4194304 bytes" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167314135Z" level=info msg="gRPC server listening on TCP address: :41867" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.grpc.internal type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167321218Z" level=info msg="Enabled gRPC tracing middleware" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.grpc.internal type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167323135Z" level=info msg="Enabled gRPC metrics middleware" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.grpc.internal type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167332051Z" level=info msg="Internal gRPC server is running on :41867" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167350385Z" level=info msg="application protocol: http. waiting on port 8000. This will block until the app is listening on that port." app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.167588968Z" level=info msg="application discovered on port 8000" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.168974676Z" level=info msg="Application configuration loaded" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.168995593Z" level=info msg="actors: state store is not configured - this is okay for clients but services with hosted actors will fail to initialize!" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.169017968Z" level=info msg="Configuring actors placement provider 'placement'. Configuration: 'placement:placement:50006'" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.actor type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16903301Z" level=info msg="Configuring actor reminders provider 'default'. Configuration: ''" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.actor type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.16905726Z" level=info msg="Actor runtime started. Idle timeout: 1h0m0s" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.actor type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.169082801Z" level=info msg="Configuring workflow engine with actors backend" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.169093468Z" level=info msg="Registering component for dapr workflow engine..." app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.169100176Z" level=info msg="Initializing Dapr workflow component" app_id=authorization-service component="dapr (workflow.dapr/v1)" instance=970387f29dad scope=dapr.contrib type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.169113093Z" level=info msg="Workflow engine initialized." app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.169120551Z" level=info msg="dapr initialized. Status: Running. Init Elapsed 2ms" app_id=authorization-service instance=970387f29dad scope=dapr.runtime type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.172707926Z" level=info msg="Scheduler stream connected" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.scheduler type=log ver=1.14.4
2024-10-28T22:26:17 time="2024-10-29T05:26:17.703653052Z" level=info msg="Placement tables updated, version: 0" app_id=authorization-service instance=970387f29dad scope=dapr.runtime.actors.placement type=log ver=1.14.4
2024-10-28T22:26:18 ✅ You're up and running! Dapr logs will appear here.
2024-10-28T22:26:18
@davidfowl Yes, I did. Are you just asking for verification, or did you see a problem?
We don't have test automation setup which makes it difficult to take any changes to the dapr integration currently. The substitute so far has been the playground example and manual verification.
cc @philliphoff
We don't have test automation setup which makes it difficult to take any changes to the dapr integration currently.
Understood. Is there anything else that I can do to move this forward? Unfortunately, this flag is going to be important for Dapr integration for anyone using Aspire with Dapr 1.14.x and not running with the basic setup (the scheduler service was introduced in the 1.14.0 release). Without it, the Dapr sidecar will continually throw errors.
It might be a good idea to future-proof the Dapr integration to expose a generic AdditionalArguments
string property so that as Dapr adds more options in the future, DaprSidecarOptions
can support them without requiring additional immediate changes. I can add that to my PR or make a separate PR if anyone likes that idea.
It might be a good idea to future-proof the Dapr integration to expose a generic AdditionalArguments string property so that as Dapr adds more options in the future, DaprSidecarOptions can support them without requiring additional immediate changes. I can add that to my PR or make a separate PR if anyone likes that idea.
@mfcollins3 That's a good idea, though I'd make that a separate PR.
Description
I enhanced DaprSidecarOptions by adding the SchedulerHostAddress property. This will allow the developer to specify the host address of the Dapr scheduler service if not running on localhost (for example, if developing using Docker Compose, the scheduler service will be running on a different host).
I enhanced the DaprDistributedApplicationLifecycleHook to pass the --scheduler-host-address parameter to the Dapr sidecar if the DaprSidecarOptions.SchedulerHostAddress property is specified.
Fixes #6477
Checklist
<remarks />
and<code />
elements on your triple slash comments?Does the change require an update in our Aspire docs?
Microsoft Reviewers: Open in CodeFlow