Skip to main content

H-08 GitOps

Brick H of the Enterprise AI Platform. Technology: Argo CD (ApplicationSets per environment, sync waves, drift detection). French version: ../../fr/bricks/H-08-gitops.md.

Role and responsibilities​

  • Deploy the platform and tenant manifests from Git, detect drift, roll back by Git revert.

Position and interactions​

  • Execution path: workflow (pull based deployment).
  • Agents, models, tools manifests can be applied by Argo CD hooks calling POST /v1/manifests/apply.

Open source and developed parts​

  • Open source reused: Argo CD.
  • Developed in the platform: Repository layout, ApplicationSets, sync waves (migrations before control plane).

Data model​

Control Plane tables (schema eai): eai.audit_events.

Every tenant table has tenant_id uuid NOT NULL and a row level security policy on current_setting('app.tenant_id', true)::uuid. ClickHouse usage_events is the analytics replica of eai.usage_events (ReplacingMergeTree keyed by event_id).

Contract: contracts/v1/agent-manifest.schema.json (schema_version 1.0). Usage is always reported with contracts/v1/usage-event.schema.json, audit with contracts/v1/audit-event.schema.json.

API endpoints​

MethodPath
POST/v1/manifests/apply
GET/readyz

POST /v1/manifests/apply​

Request:

{
"kind": "Model",
"name": "llama-70b-local",
"version": "1.0.0",
"spec": {
"provider": "vllm"
}
}

Response:

{
"kind": "Model",
"name": "llama-70b-local",
"version": "1.0.0",
"status": "applied"
}

GET /readyz​

Response:

{
"status": "ready",
"checks": {
"postgres": "ok",
"redis": "ok",
"clickhouse": "ok"
}
}

SDK examples​

Python​

import yaml
from enterprise_ai import EnterpriseAI

client = EnterpriseAI(base_url="<control-plane-url>", api_key="eai_live_xxx", tenant="acme", locale="en")
client.manifests.apply(yaml.safe_load(open("model.yaml")))
client.system.readyz()

TypeScript​

import { EnterpriseAI } from "@enterprise-ai/sdk";

const client = new EnterpriseAI({ baseUrl: "<control-plane-url>", apiKey: process.env.EAI_API_KEY, tenant: "acme", locale: "en" });
await client.manifests.apply({ path: "model.yaml" });
await client.meta.ready();

Java​

EnterpriseAIClient client = EnterpriseAIClient.builder()
.baseUrl("<control-plane-url>")
.apiKey(System.getenv("EAI_API_KEY"))
.tenant("acme")
.locale(Locale.ENGLISH)
.build();
client.manifests().apply(Map.of("path", "model.yaml"));
client.meta().ready();

Go​

client, err := eai.NewClient(eai.WithBaseURL("<control-plane-url>"), eai.WithAPIKey(os.Getenv("EAI_API_KEY")), eai.WithTenant("acme"), eai.WithLocale("en"))
if err != nil { log.Fatal(err) }
ctx := context.Background()
_, err = client.Manifests.Apply(ctx, map[string]any{"path": "model.yaml"})
_, err = client.Meta.Ready(ctx, nil)

Configuration​

No EAI_* variable: configured through Helm values and the tool's own configuration.

Helm values keys (deploy/helm/enterprise-ai/values.yaml): controlPlane.migration.

Security​

  • Argo CD SSO, project RBAC, only signed images admitted (H-10/H-13).
  • Tenant resolved from the credential, never from the body; PostgreSQL row level security on every tenant table.
  • Every mutation and policy decision writes a hash chained audit event (G-11).
  • Errors use the standard envelope with message_i18n en and fr.

Observability​

  • Sync status and drift alerts.
  • W3C traceparent propagated, X-Request-Id returned, spans carry eai.tenant_id, eai.project, eai.agent_id, eai.run_id.

FinOps units​

  • Environment lifecycle (preview environments TTL) limits idle cost.

Failure modes and resilience​

  • Failed sync -> automatic rollback to the last healthy revision.

Standalone adoption​

Clients with Flux can consume the same Helm chart.

Acceptance tests​

  1. Manual kubectl change is reverted by Argo CD self heal.

Implementation roadmap