Skip to content
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

created name resolution local component #1340

Closed
wants to merge 54 commits into from

Conversation

jigargandhi
Copy link
Member

@jigargandhi jigargandhi commented Nov 26, 2021

Description

Created a local name resolution component that does parsing of command line arguments to daprd/daprd.exe to identify different dapr instances.

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: dapr/dapr#3256

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 / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]

@jigargandhi jigargandhi marked this pull request as ready for review November 29, 2021 12:27
@jigargandhi jigargandhi requested review from a team as code owners November 29, 2021 12:27
@yaron2 yaron2 mentioned this pull request Nov 29, 2021
3 tasks
Copy link
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

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

This change looks good to me. @jigargandhi would you mind to run go mod tidy for both pubsub.kafka certification test and pubsub.rabbitmq certification test?

@jigargandhi
Copy link
Member Author

@beiwei30 ran go mod tidy and fixed issues

beiwei30
beiwei30 previously approved these changes Dec 2, 2021
Copy link
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

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

LGTM.

daixiang0
daixiang0 previously approved these changes Dec 3, 2021
}

func (resolver *resolver) ResolveID(req nameresolution.ResolveRequest) (string, error) {
processes, err := ps.Processes()
Copy link
Member

Choose a reason for hiding this comment

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

Can this be cached? This seem to be a super expensive operation per Invoke() call. Doing it for a cache miss is kind of OK but once cached, we should be able to reuse. Also, invalidating the cache is super important. Maybe we change this logic to be running in the background updating a lookup table and then the ResolveID() method just does a lookup.

Copy link
Member Author

Choose a reason for hiding this comment

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

The value can be cached and we can run a go routine which invalidates the cache every 30 seconds.
We will then need to store process id also in cache, and validate that the process id is actually for dapr process only (it may be that the process id is reassigned)
If the process id does not match then it will start the cache invalidation process again.
Also, the cache invalidation process will also run only once 30 seconds.

Copy link
Member

Choose a reason for hiding this comment

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

Correct. We need to keep track of the PIDs too.

@Taction
Copy link
Member

Taction commented Jan 8, 2022

@jigargandhi Thanks for this PR! Would you please fix DCO issue? You can refer to here about how to fix it.

@jigargandhi
Copy link
Member Author

@Taction Sure, I will be adding one more commit as per a review comment from @artursouza , will sign off that commit.

@beiwei30
Copy link
Member

@jigargandhi Jigar, at the same time, pls. fix go mod tidy check failure.

rainfd and others added 25 commits January 21, 2022 18:48
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* cosmosdb output binding certification tests

Signed-off-by: GitHub <noreply@github.com>

* linter touchup

Signed-off-by: GitHub <noreply@github.com>

* Rename some remnants from copy paste

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* not modifying policy if disableEntity is set

Signed-off-by: Amit Mor <amit.mor@hotmail.com>

* not modifying policy if disableEntity is set

Signed-off-by: Amit Mor <amit.mor@hotmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* feature/pubsub: add delay queue params for pulsar

* feature/pubsub: add delay queue params for pulsar

* feature/pubsub: add delay queue params for pulsar

* hotfix: upgrade dgrijalva/jwt-go

* hotfix: upgrade dgrijalva/jwt-go

Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* add S3ForcePathStyle support for s3 binding

Signed-off-by: rainfd <rainfd@live.cn>

* add S3ForcePathStyle unit test

Signed-off-by: rainfd <rainfd@live.cn>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
…able names" - Introduce `fmt.Sprintf` where applicable (dapr#1388)

* - Introduce `fmt.Sprintf` where applicable
- Add conformance test for cassandra component.

Signed-off-by: mbimbij <joseph.mbimbi@gmail.com>

* Start cassandra via docker-compose for its conformance test

Signed-off-by: mbimbij <joseph.mbimbi@gmail.com>

* Apply `go fmt` on `tests/conformance/common.go` as part of PR correction

Signed-off-by: mbimbij <joseph.mbimbi@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* remove duplicated err handle

Signed-off-by: Taction <zchao9100@gmail.com>

* fix test go mod tidy

Signed-off-by: Taction <zchao9100@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* parent dbb18e4
author Scott Hussey <sthussey@gmail.com> 1632277042 -0500
committer Scott Hussey <sthussey@gmail.com> 1639111222 -0600

Support Oauth2 authentication for Kafka

- Utilize the SASL OAUTHBEARER mechanism to support
  the Oauth2 client_credentials flow for Kafka
  authentication

- Deprecate `authRequired` field and introduce `authType`
  to support varied authentication mechanisms

- Add a metadata upgrade mechanism to support backwards
  compatability

- Recommend broker specific scopes to guard against a
  compromised broker replaying a token

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* kafka test - use volumes instead of root

CI test fails due to losing data written to container
root

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* Clean up volumes

- When bringing down the docker-compose context, cleanup
  volumes

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* Clean up stale comment

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* Resume config defaults

- Return some Kafka config to default values to lower config
  footprint and stabilize flaky CI runs

Signed-off-by: Scott Hussey <sthussey@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* pub/sub rocketmq:upgrade with client v2

Signed-off-by: zach <zachchou016@gmail.com>

* pubsub/rocketmq:remove cache and add start with setup

Signed-off-by: zach <zachchou016@gmail.com>

* pubsub/rocketmq:fix variable golint

Signed-off-by: zach <zachchou016@gmail.com>

* pubsub/rocketmq:change license and fix goimports

Signed-off-by: zach <zachchou016@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Issue reference: dapr/docs#2039

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* Implement State Store for OCI ObjectStorage service

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* add go.mod and go.sum with dependencies on OCI SDK

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Removed dependency in unit test on OCI account

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Adding extensive unit test (coverage) using mock-OCI client

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Correcting linting issues and review requests

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* Kafka PubSub: Setting metadata as message headers.

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* running go mod tidy on certification tests

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* MQTT Certification Test

Signed-off-by: shivam <shivamkm07@gmail.com>

* Using paho.mqtt.golang fork with AutoAck fix

Signed-off-by: shivam <shivamkm07@gmail.com>

* Adding MQTT component in certification.yml

Signed-off-by: shivam <shivamkm07@gmail.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* binding kafka: check if topics are not empty before reading

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

* binding kafka: log warning instead of returning error

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
* conformance tests

Signed-off-by: Amit Mor <amit.mor@hotmail.com>

* latest localstack. snssqs to conformance list

Signed-off-by: Amit Mor <amit.mor@hotmail.com>

Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
…eue (dapr#1418)

Signed-off-by: 1046102779 <seachen@tencent.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>
@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

Merging #1340 (26e5911) into master (09fb60c) will decrease coverage by 0.03%.
The diff coverage is 22.53%.

❗ Current head 26e5911 differs from pull request most recent head d44a4dc. Consider uploading reports for the commit d44a4dc to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1340      +/-   ##
==========================================
- Coverage   35.02%   34.98%   -0.04%     
==========================================
  Files         148      151       +3     
  Lines       12825    13059     +234     
==========================================
+ Hits         4492     4569      +77     
- Misses       7853     8004     +151     
- Partials      480      486       +6     
Impacted Files Coverage Δ
authentication/azure/auth_amqp.go 0.00% <0.00%> (ø)
bindings/aws/kinesis/kinesis.go 2.61% <0.00%> (ø)
bindings/aws/s3/s3.go 15.06% <0.00%> (-0.11%) ⬇️
bindings/azure/eventgrid/eventgrid.go 3.84% <0.00%> (ø)
bindings/mqtt/mqtt.go 25.00% <0.00%> (-1.42%) ⬇️
configuration/redis/redis.go 37.22% <0.00%> (-1.12%) ⬇️
pubsub/aws/snssqs/policy.go 0.00% <0.00%> (ø)
pubsub/gcp/pubsub/pubsub.go 24.60% <0.00%> (+0.38%) ⬆️
pubsub/kafka/sarama_log_bridge.go 0.00% <0.00%> (ø)
pubsub/kafka/sasl_oauthbearer.go 0.00% <0.00%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4918900...d44a4dc. Read the comment docs.

@jigargandhi
Copy link
Member Author

please review this #1455 PR, closing this as messed up sign-off

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.

[Proposal] Provide alternative service resolution mechanism besides mdns