-
Notifications
You must be signed in to change notification settings - Fork 582
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
feat: Add peerbroker proxy for agent connections #349
Conversation
Agents will connect using this proxy. Eventually we'll intercept some of these messages for validation, but that's not necessary right now.
Codecov Report
@@ Coverage Diff @@
## main #349 +/- ##
==========================================
+ Coverage 67.80% 67.85% +0.04%
==========================================
Files 147 146 -1
Lines 7905 7886 -19
Branches 72 72
==========================================
- Hits 5360 5351 -9
+ Misses 2002 1990 -12
- Partials 543 545 +2
Continue to review full report at Codecov.
|
peerbroker/proxy.go
Outdated
// PubSub is used to geodistribute in a simple way. All message payloads | ||
// are small in size <=8KB, and we don't require delivery guarantees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this context, very helpful for me!
The "don't require delivery guarantees" part I was unsure about - is it because the agent is giving information like stats that come periodically and will get renewed? Just worried about losing things like shell commands from the customer -> proxy -> agent or losing output from agent -> proxy -> customer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I improved the comment here to explain what data flows through.
I added the ASCII chart too, which should help to explain this kinda confusing code.
// └─────────────────────┘ │<agent-id> channel: │ │from payloads to create new │ | ||
// │ │ │NegotiateConnection() streams│ | ||
// │<stream-id><payload>│ │or write to existing ones. │ | ||
// └────────────────────┘ └─────────────────────────────┘ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love me some inline diagrams like this! 🖼️
Agents will connect using this proxy. Eventually we'll intercept
some of these messages for validation, but that's not necessary right now.