ultravioletrs / cocos

Cocos AI - Confidential Computing System for AI
https://ultraviolet.rs/cocos.html
Apache License 2.0
23 stars 9 forks source link

Feature: Restructure Configuration for Manager and Agent Services #209

Open SammyOina opened 1 month ago

SammyOina commented 1 month ago

Is your feature request related to a problem? Please describe.

Background

We currently have two configuration structures for our manager and agent services. Both services share the same gRPC server and client library code, but attested TLS should only be usable for the agent service.

Current Configuration Structures

Client Config

type Config struct {
    ClientCert   string        `env:"CLIENT_CERT"     envDefault:""`
    ClientKey    string        `env:"CLIENT_KEY"      envDefault:""`
    ServerCAFile string        `env:"SERVER_CA_CERTS" envDefault:""`
    URL          string        `env:"URL"             envDefault:"localhost:7001"`
    Timeout      time.Duration `env:"TIMEOUT"         envDefault:"60s"`
    AttestedTLS  bool          `env:"ATTESTED_TLS"    envDefault:"false"`
    Manifest     string        `env:"MANIFEST"        envDefault:""`
}

Server Config

type Config struct {
    Host         string `env:"HOST"               envDefault:""`
    Port         string `env:"PORT"               envDefault:""`
    CertFile     string `env:"SERVER_CERT"        envDefault:""`
    KeyFile      string `env:"SERVER_KEY"         envDefault:""`
    ServerCAFile string `env:"SERVER_CA_CERTS"    envDefault:""`
    ClientCAFile string `env:"CLIENT_CA_CERTS"    envDefault:""`
    AttestedTLS  bool   `env:"ATTESTED_TLS"       envDefault:"false"`
}

Proposed Changes

  1. Create a base configuration structure for common fields.
  2. Create separate structures for manager-specific and agent-specific configurations.
  3. Embed the base configuration in both manager and agent configurations.
  4. Move TLS-related fields to the agent configuration only.

Benefits

Tasks

Indicate the importance of this feature to you.

Must-have

Anything else?

No response