Skip to content

feat: Allow configuring the scheduler host on init #1520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2025

Conversation

acroca
Copy link
Contributor

@acroca acroca commented Jul 9, 2025

Description

Added a new flag for dapr init where the user can specify the scheduler host.

This allows running dapr apps pointing to a remote scheduler, as long as the configured scheduler host address is reachable from the dapr app.

To test this feature, I have a container with dind and dapr, where I executed:

dapr init --scheduler-override-broadcast-host-port dind-service

Then from another container with access to the docker instance from dind, I'm running a service with:

 dapr run --app-id=test \
                --metrics-port=9091 \
                --scheduler-host-address=dind-service:50006 \
                --placement-host-address=dind-service:50005 \
                --dapr-grpc-port 50001 \
                --app-port 50070 \
                --app-protocol grpc \
                --log-level debug \
                go run .

With this change, I see the following logs:

INFO[0000] Connected and received scheduler hosts addresses: [dind-service:50006]  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.watchhosts type=log ver=1.15.6
DEBU[0000] Attempting to connect to Scheduler at address: dind-service:50006  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.clients type=log ver=1.15.6
INFO[0000] Scheduler client initialized for address: dind-service:50006  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.clients type=log ver=1.15.6
...
INFO[0002] Scheduler stream connected for [JOB_TARGET_TYPE_ACTOR_REMINDER]  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.cluster type=log ver=1.15.6

Without this change, it failed:

INFO[0000] Connected and received scheduler hosts addresses: [localhost:50006]  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.watchhosts type=log ver=1.15.6
DEBU[0000] Attempting to connect to Scheduler at address: localhost:50006  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.clients type=log ver=1.15.6
INFO[0000] Scheduler client initialized for address: localhost:50006  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.clients type=log ver=1.15.6
...
ERRO[0002] Failed to watch scheduler jobs, retrying: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp [::1]:50006: connect: connection refused"  app_id=test instance=7eb14174350b scope=dapr.runtime.scheduler.cluster type=log ver=1.15.6

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1518

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@acroca acroca requested review from a team as code owners July 9, 2025 12:24
@acroca acroca changed the title feat: Allow configuring the scheduler advertised address on init feat: Allow configuring the scheduler host on init Jul 9, 2025
JoshVanL
JoshVanL previously approved these changes Jul 9, 2025
Copy link
Contributor

@JoshVanL JoshVanL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also backport this to release-1.15 and create a patch release.

Signed-off-by: Albert Callarisa <[email protected]>
@acroca acroca force-pushed the set-scheduler-binding-address-on-init branch from 5263b25 to 847ed81 Compare July 10, 2025 05:45
@acroca acroca requested a review from JoshVanL July 10, 2025 05:47
@acroca acroca force-pushed the set-scheduler-binding-address-on-init branch 3 times, most recently from 72d8a7c to d4731e5 Compare July 10, 2025 07:18
@acroca
Copy link
Contributor Author

acroca commented Jul 10, 2025

Patch PR here: #1521

@JoshVanL
Copy link
Contributor

@acroca tests are failing

@msfussell
Copy link
Member

@acroca - Please raise a PR for Dapr docs.

@acroca
Copy link
Contributor Author

acroca commented Jul 14, 2025

@acroca - Please raise a PR for Dapr docs.

@msfussell Thanks for reminding updating the docs :) dapr/docs#4721

@yaron2 yaron2 merged commit edb70cf into dapr:master Jul 15, 2025
57 of 64 checks passed
@acroca acroca deleted the set-scheduler-binding-address-on-init branch July 15, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DAPR 1.15 not working in standalone mode when called from a VM
5 participants