Skip to content

Deployment ​

Three Docker Compose setups live in infra/, plus Kubernetes manifests for production.

Quick start ​

infra/docker-compose.yaml starts published images with no configuration and exposes only the workbench on port 4242.

bash
docker compose -f infra/docker-compose.yaml up -d

Override MDEO_IMAGE_PREFIX to pull from another registry owner and MDEO_IMAGE_TAG to pin a release.

Development ​

infra/docker-compose-dev.yaml builds every image from the current checkout and additionally exposes the internal service and database ports.

bash
docker compose -f infra/docker-compose-dev.yaml up --build

It also starts three optimizer-execution nodes wired together as peers, so distributed search can be exercised locally.

Production ​

infra/docker-compose-prod.yaml runs published images and keeps configuration external.

bash
cp infra/.env.example infra/.env
# edit infra/.env
docker compose --env-file infra/.env -f infra/docker-compose-prod.yaml up -d

Images follow the naming scheme ${MDEO_IMAGE_PREFIX}/mdeo-<service>:${MDEO_IMAGE_TAG}.

Settings that matter ​

VariableWhy it matters
ADMIN_USERNAME, ADMIN_PASSWORDThe bootstrap administrator. Change both.
DATABASE_*, *_DB_USER, *_DB_PASSWORDEach domain has its own database; give each its own credentials.
JWT_PRIVATE_KEY, JWT_PUBLIC_KEY, JWT_ISSUERSigning material for the tokens services use to call the backend.
JWT_EXECUTION_EXPIRATION_SECONDSMust outlive your longest optimisation run, or the node cannot report its final state.
CORS_ALLOWED_HOSTSThe hosts allowed to reach the API.
COOKIE_SECURE, COOKIE_SAMESITELeave at the secure defaults behind TLS.
PLUGIN_BASE_URL, INTERNAL_PLUGIN_BASE_URLHow plugin URLs are resolved for the browser and for the backend respectively.
DEFAULT_PLUGIN_URLSComma-separated plugin URLs registered at startup.
EXECUTION_TIMEOUT_MSUpper bound on a single execution.
FILE_DATA_COMPUTATION_TIMEOUT_SECONDSHow long the backend waits for a plugin to compute file data. Default 300.
FILE_DATA_COMPUTATION_BINDING_SECONDSHow long a running computation, and the token the plugin computes with, stays valid. Defaults to the computation timeout.
PLUGIN_REQUEST_TIMEOUT_SECONDSHow long a one-shot request to a plugin may take. Default 300.
EXECUTION_START_TIMEOUT_SECONDS, EXECUTION_READ_TIMEOUT_SECONDSHow long starting an execution, and reading, cancelling or deleting one, may take. Defaults 300 and 60.
PLUGIN_MANIFEST_CHECK_SECONDSHow often every plugin is asked whether its manifest changed. Default 60; 0 checks only on the plugins' answers.
PLUGIN_MANIFEST_REFRESH_COOLDOWN_SECONDSHow long the backend waits before fetching a changed manifest of the same plugin again after an attempt. Default 60.
PLUGIN_MANIFEST_TIMEOUT_SECONDS, SERVICE_CONNECT_TIMEOUT_SECONDSHow long fetching a plugin manifest, and opening any connection to a service, may take. Defaults 30 and 10. The execution services read SERVICE_CONNECT_TIMEOUT_SECONDS too, for the plugin sessions their scripts call external functions over.
FILE_DATA_BATCH_CONCURRENCYHow many entries of one file data batch are looked up at the same time. Default 16; keep it below DATABASE_MAX_POOL_SIZE.

The full list is in infra/.env.example.

Kubernetes ​

Manifests are under infra/k8s/. They provision the backend, the plugin services, the execution services and their secrets, and are the way to scale out: optimizer-execution is designed to run as several replicas that discover each other through a peer list, each contributing worker threads to a single run.

Scaling notes ​

  • Optimiser nodes are the component to add when runs are too slow. The resources block of a config file caps how much of the available capacity a single run may take (threads, nodes, threadsPerNode).
  • Plugin services keep no durable state. In memory they hold a pool of Langium instances, the contribution sets they were sent by hash, and open sessions. A restart costs one 409 round trip per contribution set and drops open sessions, which reconnect. MAX_LANGIUM_INSTANCES trades memory for the ability to serve concurrent requests with different plugin sets.
  • Databases are already split per domain, so a heavy optimisation run does not contend with workbench traffic.

After an upgrade ​

Plugin manifests reference versioned static assets, and a stale manifest makes plugin loading fail in the workbench. The backend keeps them current by itself: every answer of a plugin service carries a fingerprint of its manifest, and the backend also asks every plugin for it once a minute (PLUGIN_MANIFEST_CHECK_SECONDS). When a redeployed service reports a different fingerprint, the backend fetches its manifest again in the background — at most a minute after the deploy.

WARNING

Plugin services built on an older @mdeo/service-common, which send no fingerprint, still need a manual refresh (Settings → Plugins) after an upgrade.

WARNING

Tokens carry one scope per capability since this release, and error responses share one shape. Upgrade the backend, the workbench and every plugin and execution service together, including plugin services a project builds itself on @mdeo/service-common or the Kotlin plugin service module. A service built before this release still accepts the tokens the backend issues, but it reports errors in the old shape: the backend passes its HTTP failures on without their message, and cannot read the errors an older execution service sends over its WebSocket at all, so those requests fail as Unavailable. Sessions and external functions need the new version on both sides.

Released under the terms of the repository licence.