-
Notifications
You must be signed in to change notification settings - Fork 2k
Components auto-registration #5062
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
Conversation
Pinging @pkedy for review and thoughts as the main author of the current registration mechanism |
8e60ebb
to
23565db
Compare
Codecov Report
@@ Coverage Diff @@
## master #5062 +/- ##
==========================================
+ Coverage 65.37% 65.45% +0.07%
==========================================
Files 113 113
Lines 12740 12723 -17
==========================================
- Hits 8329 8328 -1
+ Misses 3820 3811 -9
+ Partials 591 584 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I have a thought that could we use a method like a template to generate files in |
It’s an option for the future. It does raise questions about what the supportability story would be in that case. Note that some components have slightly different files, especially bindings (they can have both input and output) and middlewares. for now, this PR is optimized to allow the people who absolutely need to build their own Dapr with a custom selection of components to do that more easily. Especially if you want to remove a lot of components, doing it without this PR makes it very likely to have a lot of merge conflicts over time. |
In this way the dependences still exist in |
The merge conflicts would be in the For the |
LGTM. Pending validation passing. |
/ok-to-test |
1 similar comment
/ok-to-test |
Something's up with the change. I'll investigate and the E2E test failures tomorrow morning. |
End-to-end tests failed on windows. Please check the build logs |
End-to-end tests failed on linux. Please check the build logs |
End-to-end tests failed on linux. Please check the build logs |
End-to-end tests failed on windows. Please check the build logs |
@artursouza fixed the issue that was causing tests to fail. |
/ok-to-test |
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
ce16e2b
to
c61fd83
Compare
/ok-to-test |
Congrats! All end-to-end tests have passed on linux. Thanks for your contribution! |
Congrats! All end-to-end tests have passed on windows. Thanks for your contribution! |
Congrats! All end-to-end tests have passed on linux. Thanks for your contribution! |
End-to-end tests failed on windows. Please check the build logs |
@yaron2 @artursouza @pkedy any update on this? I heard from @mcandeia that this will help his work on pluggable components too |
* master: (134 commits) Record metric for service updates (dapr#5114) chore: remove duplicate word in comments (dapr#5099) Run e2e tests in previous version of K8s on AKS to see if it's breaking Windows tests (dapr#5104) add {namespace} option to set consumerID Add tracing passthrough for bindings (dapr#5049) Improve component init error logs and metrics (dapr#4975) Improvements to E2E test apps (dapr#5042) Fix component name for aws dynamodb (dapr#5095) Fix perf tests not building (dapr#5096) Fix missing components in Metadata API result. (dapr#5052) Fixed log message (dapr#5088) Disable IPFS binding for now (dapr#5092) optimize/concurrency: pubsub concurrency map writes in runtime unit test. (dapr#5086) Configuration API response to use dictionaries - based on PR dapr#4695 (dapr#5083) correct compile error correct checking for actors with same id fix type error in print fix typo add log when actor start time and end time is not expected Components auto-registration (dapr#5062) ... Signed-off-by: zhangchao <zchao9100@gmail.com> # Conflicts: # go.mod # pkg/grpc/api.go # pkg/grpc/api_test.go # pkg/http/api.go # pkg/runtime/runtime.go
Due to dapr/dapr#5062 Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Due to dapr/dapr#5062 Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Due to dapr/dapr#5062 Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Due to dapr/dapr#5062 Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
This PR changes the way that the component registry works internally.
Before, each component had to have an import in the
cmd/daprd/main.go
file and then be added to the relevant registry in that file. With over 100 components, that started to become complex to track too.Now, each component is automatically registered when a file is placed in
cmd/daprd/components
, with each component getting its own file. For example, this is thestate_in-memory.go
file:This PR is needed to simplify (greatly) the life of users who are building Dapr with a custom set of components, either adding new ones or stripping down components. The biggest advantage is a significant reduction in merge conflicts when managing a custom set of components.
PS: A companion PR will be needed in components-contrib. Once that's merged, I will remove the temporary replacement in the go.mod dapr/components-contrib#1997
PPS: Also fixes #4860