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

[feature] Distributed query infrastructure (global-query server) #109

Merged
merged 28 commits into from
May 3, 2023

Conversation

els0r
Copy link
Owner

@els0r els0r commented Apr 11, 2023

Time to let the cat out of the bag. This is the first working version with

  • distributed query capabilities
  • client/server logging
  • a unified query client for goProbe and global-query
  • massive code simplifcation and re-use across the entire query pipeline

It also moves the entire goProbe API into legacyapi, not serving it anymore. This is preparation for #58, which should then be a more concise PR than this beast.

Closes #43

@els0r els0r linked an issue Apr 11, 2023 that may be closed by this pull request
@els0r els0r changed the title 43 global query [feature] Distributed query infrastructure (global-query server) Apr 11, 2023
@els0r els0r requested a review from fako1024 April 11, 2023 20:42
Copy link
Collaborator

@fako1024 fako1024 left a comment

Choose a reason for hiding this comment

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

Obviously no guarantees to safety of the review (my head's spinning after going through this behemoth of a PR 💫 ).
Change requested because of the raw query issue (not sure if others are affected, too). I'll try to help investigate as much as I can.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this maybe go someplace else (e.g. addon or examples or similar)?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I like to keep it next to the binary, in case someone wants to run the tool directly inside the directory with go run main.go --config .....

But no strong opinion here.

cmd/global-query/cmd/root.go Show resolved Hide resolved
cmd/global-query/cmd/server.go Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this maybe go someplace else (e.g. addon or examples or similar)?

Copy link
Owner Author

Choose a reason for hiding this comment

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

We could. Then we should supply them for every binary though.

cmd/global-query/pkg/conf/conf.go Show resolved Hide resolved
pkg/api/goprobe/client/client.go Show resolved Hide resolved
pkg/api/middleware.go Show resolved Hide resolved
pkg/api/query.go Outdated Show resolved Hide resolved
pkg/results/result.go Show resolved Hide resolved
pkg/types/columns.go Show resolved Hide resolved
@els0r
Copy link
Owner Author

els0r commented Apr 12, 2023

Obviously no guarantees to safety of the review (my head's spinning after going through this behemoth of a PR 💫 ).

Change requested because of the raw query issue (not sure if others are affected, too). I'll try to help investigate as much as I can.

Thanks for the initial review and the suggestions.

I'll also prioritize looking at the raw queries. Unfortunately never ran them during testing 🙈.

@els0r els0r force-pushed the 43-global-query branch 2 times, most recently from 82c7a65 to e4f95f4 Compare April 13, 2023 03:45
Copy link
Owner Author

@els0r els0r left a comment

Choose a reason for hiding this comment

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

@fako1024 : I've violently broken the build by rebasing on develop. Now it's complaining about changes that come from slimcap. Could you help me with this? I don't want to fix something that ain't broken.

pkg/types/columns.go Show resolved Hide resolved
pkg/results/result.go Show resolved Hide resolved
pkg/results/result.go Show resolved Hide resolved
cmd/global-query/pkg/conf/conf.go Show resolved Hide resolved
// DO NOT uncomment before clarifying behavior with httpc library
//
// retry any request that isn't 2xx
// req = req.RetryBackOffErrFn(func(resp *http.Response, _ error) bool {
Copy link
Owner Author

Choose a reason for hiding this comment

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

No problem. I really appreciate the conciseness of the library. At least 10x better than all the boilerplate repetition to make http requests.

Your suggestion with the interval generators sounds really good and simple to use. Then you don't have to modify the RetryBackOff function signature and just provide some syntactic sugar on top. Nice!

@fako1024
Copy link
Collaborator

@fako1024 : I've violently broken the build by rebasing on develop. Now it's complaining about changes that come from slimcap. Could you help me with this? I don't want to fix something that ain't broken.

Sure thing, I got your back! I've reverted slimcap to the latest version without breaking API changes. I'll have to make some changes in goProbe before bumping it to the newest commit. Build is fine again: https://github.com/els0r/goProbe/actions/runs/4698522445/jobs/8330904665

@els0r
Copy link
Owner Author

els0r commented May 1, 2023

@fako1024 : given that the review feedback has been incorporated and the major blocker (time queries not working) has been resolved, may I have your blessings?

The ideas are storming into my head and I'd like to tick them off in more digestable chunks and in separate issues. The API restructure of goProbe, for example, is next.

Toodles and hi to the old man.

@els0r els0r requested a review from fako1024 May 1, 2023 02:23
@fako1024
Copy link
Collaborator

fako1024 commented May 1, 2023

@fako1024 : given that the review feedback has been incorporated and the major blocker (time queries not working) has been resolved, may I have your blessings?

The ideas are storming into my head and I'd like to tick them off in more digestable chunks and in separate issues. The API restructure of goProbe, for example, is next.

Toodles and hi to the old man.

Sure thing, let's go ahead. Thanks for following up on the feedback. Side note: I've recently released httpc, incorporating all the recent changes / fixes you triggered: https://github.com/fako1024/httpc/releases/tag/v1.0.14 - Feel free to bump the current version in go.mod to this one if you'd like.

@els0r
Copy link
Owner Author

els0r commented May 3, 2023

@fako1024 : given that the review feedback has been incorporated and the major blocker (time queries not working) has been resolved, may I have your blessings?

The ideas are storming into my head and I'd like to tick them off in more digestable chunks and in separate issues. The API restructure of goProbe, for example, is next.

Toodles and hi to the old man.

Sure thing, let's go ahead. Thanks for following up on the feedback. Side note: I've recently released httpc, incorporating all the recent changes / fixes you triggered: https://github.com/fako1024/httpc/releases/tag/v1.0.14 - Feel free to bump the current version in go.mod to this one if you'd like.

Many thanks. Will do another bump in go.mod of httpc when reworking the API and clients.

@els0r els0r merged commit 2898236 into develop May 3, 2023
@els0r els0r deleted the 43-global-query branch May 3, 2023 00:01
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.

global-query
2 participants