Skip to content

feat: Add orchestration server — REST/WebSocket gateway and C++ agent gRPC client#32

Merged
FW-Nagorko merged 26 commits into
develfrom
feat/grpc-communication
Jun 12, 2026
Merged

feat: Add orchestration server — REST/WebSocket gateway and C++ agent gRPC client#32
FW-Nagorko merged 26 commits into
develfrom
feat/grpc-communication

Conversation

@kox13

@kox13 kox13 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #7

This pull request implements the communication layer between the dashboard
and C++ agents. A Go server acts as a gateway — exposing REST and WebSocket
endpoints to the dashboard, while communicating with agents over gRPC.
The C++ agent gains a gRPC client stub to connect to the server and stream
metrics in response to received messages.

gRPC agent gateway (Go server)

  • Added a GET /api/agents REST endpoint that lists all connected agents and their status
  • Added a POST /api/agents/{id}/stream REST endpoint that dispatches a streaming task to a specific agent over a gRPC stream.
  • Added a /ws?agent_id={id} WebSocket endpoint that forwards incoming metric frames from the agent to the connected dashboard clients. WebSocket connections are per-agent — the dashboard subscribes to a specific agent's stream.
  • Implemented a gRPC server that receives metric streams from agents and routes them to the appropriate active WebSocket connection. Metric streaming starts on task dispatch, not on connection.

gRPC client (C++ agent)

  • Added a gRPC client implementation in the agent that connects to the server on startup and opens a bidirectional stream.
  • On receiving a task from the server, the agent begins collecting and streaming metrics back through the open gRPC stream.
  • Proto definitions were extended to cover task dispatch and metric stream message types shared between Go and C++.

These changes introduce a complete request/response + streaming pipeline between the dashboard and agents, laying the foundation for real-time metric observability.

kox13 added 22 commits February 3, 2026 21:04
…ithub actions ci, modified pre-commit script to check server code formatting
…move PrintCurrentAffinity to utils, move UUID saving and loading to Client, remove UUID creation from the agent
…ints; default CMake preset is now Debug build type
@kox13 kox13 self-assigned this Jun 9, 2026
@kox13 kox13 added this to volta Jun 9, 2026
@kox13 kox13 added the enhancement New feature or request label Jun 9, 2026
@patryk-przybysz patryk-przybysz changed the base branch from main to devel June 10, 2026 02:02
Comment thread sources/agent/src/client/stream_metrics_reactor.cc Outdated

@FW-Nagorko FW-Nagorko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major issue regarding the missing BatchAck call to buffer, other than that the agent side looks good.

Comment thread sources/agent/src/client/stream_metrics_reactor.cc Outdated
Comment thread sources/agent/src/client/stream_metrics_reactor.cc Outdated
kox13 added 2 commits June 12, 2026 19:54
…s AckSnapshot on the buffer to release already sent metrics
…sn't mark overriden functions as virtual functions when called from constructor
@kox13 kox13 requested a review from FW-Nagorko June 12, 2026 18:13

@FW-Nagorko FW-Nagorko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All critical bugs seem resolved, the agent - server communication works properly in a test environment.

Comment thread sources/agent/src/main.cc Outdated
@FW-Nagorko FW-Nagorko merged commit de62f57 into devel Jun 12, 2026
2 checks passed
@FW-Nagorko FW-Nagorko deleted the feat/grpc-communication branch June 12, 2026 21:11
@github-project-automation github-project-automation Bot moved this to Done in volta Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Agent] Implement transport layer (scaffolding, gRPC client)

2 participants