control-plane

module
v0.0.0-...-3384764 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0

README

control-plane

Monorepo for the DCM control plane monolith.

Layout

cmd/control-plane/              # monolith entrypoint
internal/app/                   # wiring, config, shared DB bootstrap
internal/catalog/               # catalog manager
internal/placement/             # placement manager
internal/policy/                # policy manager (CRUD + OPA engine)
internal/sp/                    # service provider manager
api/                            # OpenAPI specs per domain
pkg/                            # generated HTTP clients
test/subsystem/                 # per-domain subsystem tests
deploy/                         # platform compose, helm chart, postgres init

See the control plane monolith enhancement.

Development

Build and unit tests:

make build
make test
make lint
make check-catalog-aep

Run the monolith (pick one):

Command Where it runs Database Other deps
make run host SQLite at /tmp/control-plane.db NATS disabled
make run-dev host Postgres (DB_* defaults) Postgres + NATS running locally
make compose-up containers Postgres in compose also starts NATS, Keycloak, control-plane, and dcm-ui
make run              # SQLite, no containers
make compose-up       # platform stack in containers
make compose-down     # stop stack and remove volumes

Compose uses POSTGRES_USER and POSTGRES_PASSWORD (defaults in compose are for local dev only). Override via environment or a .env file; see deploy/.env.example.

Policy evaluation and placement provisioning run in-process in the monolith (EvaluationService, PlacementService via local clients). There is no public HTTP route for policies:evaluateRequest or /resources. Use make test-policy and make test-placement for unit coverage.

Per-domain subsystem tests still run separately; catalog compose may set PLACEMENT_MANAGER_URL to reach WireMock placement stubs (test-only; not a production API on the monolith).

Legacy cmd/*-manager binaries were removed. Use make build / make run.

Container image

Build locally:

make image-build

CI pushes to quay.io/dcm-project/control-plane on merges to main and release/v* branches (and on version tags). See Releasing in shared-workflows for tag behavior and version conventions.

Platform deploy

Full-stack Compose and Helm packaging live under deploy/:

  • Compose: control-plane, postgres, nats, keycloak, dcm-ui, and optional service providers
  • Helm: Kubernetes/OpenShift chart at deploy/helm/dcm (optional auth via auth.enabled)

See deploy/RUN.md for local stack usage, authentication, and service provider profiles. See deploy/helm/dcm/README.md for cluster installs.

Authentication is disabled by default (AUTH_DISABLED=true). The CLI forwards bearer tokens (dcm login or DCM_TOKEN); service providers do not yet forward authentication headers, so enabling auth can break SP communication with the control plane.

Port Service Notes
:8080 control-plane API Direct access; validates JWT bearer tokens when auth enabled
:8180 Keycloak Identity provider (OIDC issuer)
:7007 dcm-ui Web UI
Image versions

Service repos push images to quay.io/dcm-project/<service> with the following tags:

Tag format Example When created
main main Every push to main
<short-sha> a6882f7 Every push to main or release/v* branch, and v* git tag pushes
v<semver>-rc.N v0.0.1-rc.2 Retag script (promotes a release branch SHA to an RC tag)
v<semver> v0.0.1 When a v* git tag is pushed (final release)

Browse available tags at https://quay.io/repository/dcm-project/<service>?tab=tags.

Pin versions in .env (see deploy/.env.example):

CONTROL_PLANE_VERSION=v0.0.1

Omitting the variable defaults to main.

Directories

Path Synopsis
api
agent/v1alpha1
Package agent provides primitives to interact with the openapi HTTP API.
Package agent provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1
Package v1alpha1 provides primitives to interact with the openapi HTTP API.
Package v1alpha1 provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes
Package servicetypes provides primitives to interact with the openapi HTTP API.
Package servicetypes provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes/cluster
Package cluster provides primitives to interact with the openapi HTTP API.
Package cluster provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes/container
Package container provides primitives to interact with the openapi HTTP API.
Package container provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes/database
Package database provides primitives to interact with the openapi HTTP API.
Package database provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes/network
Package network provides primitives to interact with the openapi HTTP API.
Package network provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes/storage
Package storage provides primitives to interact with the openapi HTTP API.
Package storage provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes/three_tier_app_demo
Package three_tier_app_demo provides primitives to interact with the openapi HTTP API.
Package three_tier_app_demo provides primitives to interact with the openapi HTTP API.
catalog/v1alpha1/servicetypes/vm
Package vm provides primitives to interact with the openapi HTTP API.
Package vm provides primitives to interact with the openapi HTTP API.
policy/v1alpha1
Package v1alpha1 provides primitives to interact with the openapi HTTP API.
Package v1alpha1 provides primitives to interact with the openapi HTTP API.
sp/v1alpha1/resource_manager
Package resource_manager provides primitives to interact with the openapi HTTP API.
Package resource_manager provides primitives to interact with the openapi HTTP API.
cmd
control-plane command
internal
agent/api/server
Package server provides primitives to interact with the openapi HTTP API.
Package server provides primitives to interact with the openapi HTTP API.
agent/handlers/v1alpha1
Package v1alpha1 implements HTTP handlers for the Agent API.
Package v1alpha1 implements HTTP handlers for the Agent API.
agent/healthcheck
Package healthcheck monitors agent heartbeats and marks agents unavailable.
Package healthcheck monitors agent heartbeats and marks agents unavailable.
agent/service
Package service implements agent business logic.
Package service implements agent business logic.
agent/store/agent
Package agent provides the GORM-based store for Agent entities.
Package agent provides the GORM-based store for Agent entities.
agent/store/model
Package model defines the Agent domain model for GORM persistence.
Package model defines the Agent domain model for GORM persistence.
app
Package app wires the control-plane monolith.
Package app wires the control-plane monolith.
auth
Package auth provides HTTP authentication middleware and actor resolution.
Package auth provides HTTP authentication middleware and actor resolution.
auth/service
Package service implements actor resolution and JIT provisioning.
Package service implements actor resolution and JIT provisioning.
auth/store
Package store defines the actor store interface and GORM implementation.
Package store defines the actor store interface and GORM implementation.
auth/store/model
Package model defines the actor and identity persistence types.
Package model defines the actor and identity persistence types.
catalog/api/server
Package server provides primitives to interact with the openapi HTTP API.
Package server provides primitives to interact with the openapi HTTP API.
catalog/config
Package config provides application configuration loaded from environment variables.
Package config provides application configuration loaded from environment variables.
catalog/handlers/v1alpha1
Package v1alpha1 implements the v1alpha1 API request handlers.
Package v1alpha1 implements the v1alpha1 API request handlers.
catalog/logging
Package logging provides HTTP logging middleware using slog.
Package logging provides HTTP logging middleware using slog.
catalog/placement
Package placement provides a client for the Placement Manager service.
Package placement provides a client for the Placement Manager service.
catalog/service
Package service implements the business logic for catalog management.
Package service implements the business logic for catalog management.
catalog/store
Package store provides database access for catalog resources.
Package store provides database access for catalog resources.
catalog/store/model
Package model defines the database models for catalog resources.
Package model defines the database models for catalog resources.
catalog/testutil
Package testutil provides helpers shared by catalog tests.
Package testutil provides helpers shared by catalog tests.
placement/agent
Package agent provides types and an adapter boundary for listing ready agents, mirroring the policy and sprm adapter packages.
Package agent provides types and an adapter boundary for listing ready agents, mirroring the policy and sprm adapter packages.
placement/config
Package config handles loading and validating service configuration.
Package config handles loading and validating service configuration.
placement/httputil
Package httputil provides HTTP utility functions including retry logic.
Package httputil provides HTTP utility functions including retry logic.
placement/logging
Package logging provides structured logging initialization for the application.
Package logging provides structured logging initialization for the application.
placement/policy
Package policy provides types and an adapter boundary for policy evaluation.
Package policy provides types and an adapter boundary for policy evaluation.
placement/service
Package service implements the core business logic for resource placement.
Package service implements the core business logic for resource placement.
placement/sprm
Package sprm provides types and an adapter boundary for SP resource instances.
Package sprm provides types and an adapter boundary for SP resource instances.
placement/store
Package store provides data persistence operations for resources.
Package store provides data persistence operations for resources.
placement/store/model
Package model defines the database models for resource storage.
Package model defines the database models for resource storage.
placement/types
Package types holds domain models for placement resources.
Package types holds domain models for placement resources.
policy/api/server
Package server provides primitives to interact with the openapi HTTP API.
Package server provides primitives to interact with the openapi HTTP API.
policy/config
Package config provides application configuration loaded from environment variables.
Package config provides application configuration loaded from environment variables.
policy/handlers/v1alpha1
Package v1alpha1 handles v1alpha1 API requests for policy CRUD operations.
Package v1alpha1 handles v1alpha1 API requests for policy CRUD operations.
policy/logging
Package logging provides structured logging initialization for the application.
Package logging provides structured logging initialization for the application.
policy/opa
Package opa provides an embedded OPA engine for policy compilation and evaluation.
Package opa provides an embedded OPA engine for policy compilation and evaluation.
policy/service
Package service implements the business logic for policy operations.
Package service implements the business logic for policy operations.
policy/store
Package store provides database initialization and storage interfaces for policies.
Package store provides database initialization and storage interfaces for policies.
policy/store/model
Package model defines the database models for the store layer.
Package model defines the database models for the store layer.
sp/api/resource_manager
Package resource_manager provides primitives to interact with the openapi HTTP API.
Package resource_manager provides primitives to interact with the openapi HTTP API.
sp/cleanup
Package cleanup implements stale instance cleanup scheduling.
Package cleanup implements stale instance cleanup scheduling.
sp/config
Package config handles loading and validating service configuration.
Package config handles loading and validating service configuration.
sp/consumer
Package consumer subscribes to NATS JetStream status events.
Package consumer subscribes to NATS JetStream status events.
sp/handlers/resource_manager
Package resource_manager implements HTTP handlers for the Resource Manager API.
Package resource_manager implements HTTP handlers for the Resource Manager API.
sp/logging
Package logging provides structured logging initialization for the application.
Package logging provides structured logging initialization for the application.
sp/messaging
Package messaging provides CloudEvent types and a JetStream publisher for agent communication.
Package messaging provides CloudEvent types and a JetStream publisher for agent communication.
sp/pending
Package pending sweeps timed-out pending and queued service instances.
Package pending sweeps timed-out pending and queued service instances.
sp/service
Package service provides shared types and helpers for business logic layers.
Package service provides shared types and helpers for business logic layers.
sp/service/resource_manager
Package resource_manager implements service type instance management.
Package resource_manager implements service type instance management.
sp/store
Package store provides database access interfaces and implementations.
Package store provides database access interfaces and implementations.
sp/store/model
Package model defines database models for the service provider store.
Package model defines database models for the service provider store.
sp/store/resource_manager
Package store provides database access for service type instance operations.
Package store provides database access for service type instance operations.
sp/testutil
Package testutil provides helpers shared by tests in this module.
Package testutil provides helpers shared by tests in this module.
pkg
agent/client
Package client provides primitives to interact with the openapi HTTP API.
Package client provides primitives to interact with the openapi HTTP API.
catalog/client
Package client provides primitives to interact with the openapi HTTP API.
Package client provides primitives to interact with the openapi HTTP API.
policy/client
Package client provides primitives to interact with the openapi HTTP API.
Package client provides primitives to interact with the openapi HTTP API.
sp/client/resource_manager
Package resource_manager provides primitives to interact with the openapi HTTP API.
Package resource_manager provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL