NOISSUE - Introduce computation runner, log forwarder, ingress, and egress proxy services.#559
Merged
drasko merged 24 commits intoultravioletrs:mainfrom Feb 9, 2026
Merged
Conversation
…s proxy services. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…new architecture and repository. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…mmit, add log-forwarder pre-start hook, and rename proxy binaries. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…e logging for service connections and message processing. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…t logging to slog, and adjust ingress/egress proxy build and install steps. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…se specific commit hashes Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…and add gRPC test utility Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…rom a new repository, change agent gRPC port to 7001, and add a gRPC test client. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…ingress proxy to port 7002, and update build hashes. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…component versions. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…ent versions across several packages. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…update component versions. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…d reduce agent logging verbosity. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…gRPC test Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #559 +/- ##
==========================================
+ Coverage 68.80% 69.98% +1.17%
==========================================
Files 77 85 +8
Lines 5594 6043 +449
==========================================
+ Hits 3849 4229 +380
- Misses 1402 1446 +44
- Partials 343 368 +25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
…oxy tests. Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Merged
jovan-djukic
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent Architecture Documentation
Overview
The Agent has been refactored from a monolithic service into a microservices architecture with specialized components for security, isolation, and maintainability. The Agent now acts as an orchestrator rather than executing computations directly.
Architecture Diagram
graph TB subgraph "External" CLI[CLI/User] Manager[Computation management service] end subgraph "CVM Boundary" subgraph "Ingress" IngressProxy[Ingress Proxy<br/>ATLS Termination] end subgraph "Core Services" Agent[Agent Service<br/>Orchestrator] AttSvc[Attestation Service<br/>Quote Provider] LogFwd[Log Forwarder<br/>Event Aggregator] Runner[Computation Runner<br/>Execution Engine] end subgraph "Egress" EgressProxy[Egress Proxy<br/>Traffic Filter] end end CLI -->|gRPC/ATLS| IngressProxy IngressProxy -->|gRPC/Plaintext| Agent Manager -->|gRPC| Agent Agent -->|Unix Socket| AttSvc Agent -->|Unix Socket| Runner Agent -->|Unix Socket| LogFwd Runner -->|Unix Socket| LogFwd Runner -->|HTTP/HTTPS| EgressProxy Agent -->|HTTP/HTTPS| EgressProxy EgressProxy -->|Filtered| Internet[Internet] style IngressProxy fill:#e1f5ff style EgressProxy fill:#ffe1e1 style Agent fill:#fff4e1 style Runner fill:#f0e1ffService Components
1. Ingress Proxy (New)
Purpose: Single entry point for external connections with ATLS termination.
Responsibilities:
Configuration: Receives AgentConfig from Manager per computation
Location:
cmd/ingress-proxy,pkg/ingressCommunication:
2. Agent Service (Refactored)
Purpose: Orchestrator and state machine for computation lifecycle.
Responsibilities:
Idle→ReceivingManifest→ReceivingAlgorithm→ReceivingData→Running→ConsumingResults→Complete)Configuration:
AGENT_ENABLE_ATLS=false(ATLS now handled by Ingress Proxy)localhost:7001(not exposed externally)Location:
cmd/agent,agent/service.goCommunication:
3. Computation Runner (New)
Purpose: Isolated execution environment for algorithms.
Responsibilities:
Configuration:
RUNNER_LOG_LEVELorAGENT_LOG_LEVELLocation:
cmd/computation-runner,agent/runner/serviceCommunication:
/run/cocos/runner.sock)4. Log Forwarder (New)
Purpose: Centralized logging and event aggregation.
Responsibilities:
Configuration:
LOG_FORWARDER_LOG_LEVELorAGENT_LOG_LEVELAGENT_CVM_GRPC_*for Manager connectionLocation:
cmd/log-forwarder,agent/log/serviceCommunication:
/run/cocos/log.sock)5. Attestation Service (Existing, now standalone)
Purpose: Provides attestation quotes for the CVM.
Responsibilities:
Configuration: Minimal, uses platform-specific attestation APIs
Location:
cmd/attestation-serviceCommunication:
/run/cocos/attestation.sock)6. Egress Proxy (New)
Purpose: Controls and monitors all outbound network traffic.
Responsibilities:
Configuration:
COCOS_PROXY_PORT=3128HTTP_PROXY/HTTPS_PROXYenvironment variablesLocation:
cmd/egress-proxy,pkg/egressCommunication:
Data Flow
Computation Lifecycle
sequenceDiagram participant M as Manager participant A as Agent participant IP as Ingress Proxy participant R as Runner participant L as Log Forwarder participant AS as Attestation Svc M->>A: ComputationRunReq (manifest + AgentConfig) A->>IP: Start(AgentConfig, Computation) Note over IP: Starts ATLS listener on port 7002 A->>A: Transition to ReceivingManifest CLI->>IP: Algo(algorithm, requirements) IP->>A: Forward (plaintext) A->>A: Validate hash, save to disk A->>A: Transition to ReceivingData CLI->>IP: Data(dataset) IP->>A: Forward A->>A: Validate hash, save to /datasets A->>A: Transition to Running A->>R: Run(algorithm, requirements, args) R->>L: SendLog("Starting execution") L->>M: Forward logs R->>R: Execute algorithm R->>L: SendLog("Execution complete") R->>A: RunResponse(results) A->>A: Zip results, transition to ConsumingResults CLI->>IP: Result() IP->>A: Forward A->>CLI: Stream results A->>A: Transition to Complete M->>A: StopComputation A->>IP: Stop() A->>R: Stop() Note over IP: Stops ATLS listenerAttestation Flow
sequenceDiagram participant CLI participant IP as Ingress Proxy participant A as Agent participant AS as Attestation Svc CLI->>IP: Attestation(nonce) IP->>A: Forward A->>AS: GetAttestation(nonce, type) AS->>AS: Generate SNP/vTPM quote AS->>A: Return quote A->>IP: Forward quote IP->>CLI: Stream attestationConfiguration Management
Manager → Agent Configuration Flow
Manager creates
/etc/cocos/environmentfile with:Systemd services load this file via
EnvironmentFile=/etc/cocos/environmentAll services respect
AGENT_LOG_LEVELfor consistent loggingPer-computation config sent via
ComputationRunReq.AgentConfig:Service Dependencies (Systemd)
Security Improvements
Attack Surface Reduction
Network Isolation
Privilege Separation
File System Layout
Key Design Decisions
Migration from Old Architecture
Before (Monolithic Agent)
After (Microservices)
Backward Compatibility
AgentConfigper-computation still supported