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

go/grpc: sentry nodes #2475

Merged
merged 6 commits into from
Jan 22, 2020
Merged

go/grpc: sentry nodes #2475

merged 6 commits into from
Jan 22, 2020

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Dec 16, 2019

Closes: #1829

TODO:

  • some more TODO in comments (some extracting/generalizing to be done)

@codecov
Copy link

codecov bot commented Dec 16, 2019

Codecov Report

Merging #2475 into master will decrease coverage by 0.42%.
The diff coverage is 47.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2475      +/-   ##
==========================================
- Coverage   63.74%   63.32%   -0.43%     
==========================================
  Files         346      354       +8     
  Lines       32672    33433     +761     
==========================================
+ Hits        20828    21170     +342     
- Misses       9265     9633     +368     
- Partials     2579     2630      +51
Impacted Files Coverage Δ
go/keymanager/api/api.go 68.96% <ø> (ø) ⬆️
go/common/grpc/policy/api/api.go 0% <0%> (ø)
go/oasis-test-runner/oasis/sentry.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/keymanager.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/args.go 0% <0%> (ø) ⬆️
go/storage/client/init.go 78.43% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/fixture.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/storage.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/oasis.go 0% <0%> (ø) ⬆️
go/worker/common/committee/accessctl.go 100% <100%> (ø) ⬆️
... and 64 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 2e6f3ef...5ae2341. Read the comment docs.

@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch 13 times, most recently from 23366e4 to a13e086 Compare December 19, 2019 13:59
@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch 5 times, most recently from 4b7ee1a to 2ee99c4 Compare January 7, 2020 14:57
@ptrus ptrus requested a review from kostko January 7, 2020 14:59
@ptrus ptrus added c:breaking/consensus Category: breaking consensus changes c:common Category: common libraries c:registry Category: entity/node/runtime registry service golang labels Jan 7, 2020
@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch from 216437b to 573a41e Compare January 8, 2020 10:35
Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

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

Nice work! I added some more comments.

case p, ok := <-pCh:
if !ok {
g.logger.Error("WatchPolicies stream failure")
// TODO: Panic? Retry?
Copy link
Member

Choose a reason for hiding this comment

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

When can this happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

i think connection errors with the upstream (for whatever reason) would make this fail

@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch 2 times, most recently from 0cd571c to 4db97ee Compare January 9, 2020 09:31
@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch 5 times, most recently from 077a285 to 22154ba Compare January 16, 2020 13:55
@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch 4 times, most recently from 080d80f to 6b251ae Compare January 21, 2020 10:01
@ptrus ptrus requested a review from kostko January 21, 2020 10:03

// Handler returns a grpc StreamHandler than can be used
// to proxy requests to provided client.
// XXX: potentially the connection should be established in this package,
Copy link
Member

Choose a reason for hiding this comment

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

Plan to file issues around these?

Copy link
Member Author

@ptrus ptrus Jan 22, 2020

Choose a reason for hiding this comment

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

yeah i'll file a single issue about proxy benchmarks and potential improvements, since i feel like for most of these some benchmarks should be first done (e.g. compare perf of accessing a storage node directly or via a sentry)

@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch 3 times, most recently from f3fb821 to 33bec30 Compare January 22, 2020 11:18
@ptrus ptrus requested a review from kostko January 22, 2020 12:18
Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

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

Some minor nits, otherwise this looks good now!

func (args *argBuilder) workerRegistrySentryAddresses(addrs []string) *argBuilder {
func (args *argBuilder) disableRegistrationWorker() *argBuilder {
args.vec = append(args.vec, []string{
"--" + registration.CfgRegistrationWorkerEnabled + "=false",
Copy link
Member

Choose a reason for hiding this comment

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

Is this a new flag? It is not mentioned in the changelog fragment. Also, is this required because of #1930 (e.g., it could be handled automatically)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh forgot to add it to the changelog fragment. So it's not technically needed actually, i just wanted to disable the registration worker on sentry nodes as it's not needed (in case it's enabled the registrations are failing anyway, so no actual difference). So i'm fine with removing the flag and postponing this to the #1930 - i don't see a reason it couldn't be done automatically (maybe by checking node roles?).

Copy link
Member Author

Choose a reason for hiding this comment

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

i removed it for now as it's not technically needed, and it can be properly fixed with #1930

@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch from 33bec30 to 69561fe Compare January 22, 2020 16:05
ptrus added 5 commits January 22, 2020 19:26
Actually with gRPC sentries, the sentry worker flags are now also used out
of registration worker so having those flags in common worker makes more sense.
Not sure how i managed to miss that when doing the renaming in previous
PR.
@ptrus ptrus force-pushed the ptrus/feature/grpc-sentry-support branch from 69561fe to 1eea851 Compare January 22, 2020 18:27
@ptrus
Copy link
Member Author

ptrus commented Jan 22, 2020

thanks for all the reviews on the huge PR @kostko :-)

@ptrus ptrus merged commit 7a2bb53 into master Jan 22, 2020
@ptrus ptrus deleted the ptrus/feature/grpc-sentry-support branch January 22, 2020 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:breaking/consensus Category: breaking consensus changes c:common Category: common libraries c:registry Category: entity/node/runtime registry service golang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support access control policy filtering on GRPC Proxies
2 participants