Skip to main content

Construction Kit Library Management

OctoMesh provides built-in tools for managing Construction Kit (CK) model libraries across tenants. This includes browsing available libraries from catalogs, checking compatibility, resolving dependencies, and importing libraries with full dependency resolution.

Catalog Sources

CK model libraries are distributed through catalogs. OctoMesh supports multiple catalog sources:

CatalogDescriptionDefault
EmbeddedResourceSystem models embedded in the service binariesAlways active
PublicGitHubPublic GitHub repository with released CK librariesEnabled
PrivateGitHubPrivate GitHub repository for development/pre-release librariesDisabled in production
LocalFileSystemLocal file system for development useDisabled in production

Catalog sources can be configured per environment via Helm values or environment variables.

System-Managed Models

Models whose name is System or starts with System. (e.g., System.Identity, System.Communication) are managed by the OctoMesh services themselves. These models:

  • Are imported automatically during tenant creation and service startup
  • Cannot be updated by users through the Library Management UI or CLI
  • Are shown with a "Service-Managed" badge in the Library Overview
  • Are excluded from the "Fix All" batch operation

Version Compatibility

When evaluating whether a CK library can be imported into a tenant, OctoMesh checks transitive compatibility against installed system model versions:

  • The check walks the full dependency chain recursively
  • For each dependency on a system-managed model, the major version must match the installed version
  • Example: If System-2.0.7 is installed, a library requiring System-3.0.0 (different major) is incompatible
  • A library requiring System-2.0.3 is compatible (same major, installed version is higher)

Incompatible libraries are flagged in both the UI and CLI and cannot be imported.

Dependency Resolution

When importing a CK library, OctoMesh automatically resolves its full dependency tree:

  1. Fetch the target model from the catalog
  2. Walk its Dependencies list (exact version references)
  3. For each dependency, recursively resolve sub-dependencies
  4. Deduplicate by model name, keeping the highest required version
  5. Exclude system-managed models (they are managed by services)
  6. Order topologically (dependencies before dependents)

The result is a flat, ordered list of models to import. Each model is imported sequentially via Hangfire background jobs, ensuring that dependencies are available before dependents are imported.

Import Pipeline

The import flow uses the existing asynchronous job pipeline:

Authorization

CK library management operations are protected by the Data Model Management authorization policy:

OperationRequired Scope
Browse catalogs (list, search)octo_api.read_only or octo_api
View library statusocto_api.read_only or octo_api
Resolve dependenciesocto_api.read_only or octo_api
Import models / Refresh cachesocto_api.data_model_management or octo_api

The DataModelManagement role is included in the default TenantOwners group.

REST API Endpoints

System Scope

MethodEndpointDescription
GETsystem/v1/ckmodelcatalogList all models from all catalogs
GETsystem/v1/ckmodelcatalog/search?q={term}Search models
GETsystem/v1/ckmodelcatalog/catalogsList catalog sources
GETsystem/v1/ckmodelcatalog/{catalogName}List models from specific catalog
POSTsystem/v1/ckmodelcatalog/refreshRefresh all catalog caches

Tenant Scope

MethodEndpointDescription
GET{tenantId}/v1/models/LibraryStatusMerged view: installed + catalog
POST{tenantId}/v1/models/ResolveDependenciesBatchResolve dependency trees
POST{tenantId}/v1/models/ImportFromCatalogBatchBatch import with jobs
POST{tenantId}/v1/models/CheckUpgradePre-flight migration check
POST{tenantId}/v1/models/ImportFromCatalogSingle model import