YAML Configuration Reference

Field reference for mlknife-compose.yaml and profile files.

Purpose

This page is a reference. Use it to look up field names, expected shapes, and common examples. For guided learning, start with Configuration Guide, Multi-Profile, or Workspaces.

File Names

File Meaning Selected By
mlknife-compose.yaml Default compose configuration No profile flag
mlknife-compose.prod.yaml Named profile that inherits from default --profile prod
mlknife-compose.batch-training.yaml Pipeline or environment variant --profile batch-training

Root Schema

mlknife-compose.yaml
name: image-classifier
author: ml-team
backend: aws

parameters: {}
services: {}
modules: {}
Field Type Required Description
namestringRequiredLogical stack name.
authorstringRequiredOwner or team responsible for the stack.
backendstringOptionalProvider backend, such as aws or gcp. Defaults to aws when omitted.
workspacestringOptionalDeployment workspace. CLI --workspace takes precedence.
rolestringOptionalProvider execution role or equivalent deployment identity.
parent_profilestringProfile onlyParent profile to inherit from. Defaults to default.
parametersobjectOptionalReusable values referenced by services and modules.
servicesobjectOptionalProvider-managed infrastructure services.
modulesobjectOptionalPipeline modules or workflow steps.
executorsobjectOptionalReusable execution templates for modules.
module_defaultsobjectOptionalDefaults applied to modules.
disabled_serviceslistOptionalService names excluded from the resolved stack.
disabled_moduleslistOptionalModule names excluded from the resolved stack.

Parameters

Use parameters for values reused across services and modules. References have two resolution phases: deploy-time references are resolved while ModelKnife builds the stack, and run-time references are resolved when an orchestrated pipeline run starts.

parameters:
  environment: dev
  data_path: s3://example-${parameters.environment}/images
  run_output_path: s3://example-${parameters.environment}/runs/${runtime.run_id}
  audit_prefix: ${runtime.workspace}/${runtime.pipeline_name}/${runtime.started_at}
ReferencePhaseMeaning
${parameters.environment}Deploy timeReference another parameter.
${env.ENVIRONMENT}Deploy timeReference an environment variable or value loaded from .env.
${services.name.outputs.key}Deploy timeReference outputs produced by a deployed service.
${runtime.run_id}Run timeShared id for the current pipeline run.
${runtime.started_at}Run timeTimestamp for when the current pipeline run started.
${runtime.pipeline_name}Run timeLogical pipeline name for the current run.
${runtime.workspace}Run timeWorkspace selected for the current run.
${runtime.provider}Run timeProvider backend for the current run.

Resolution Phases

${parameters.*}, ${env.*}, and ${services.*} are deploy-time references. ${runtime.*} values are run-time references: they are intentionally preserved during compose-file resolution and filled by the orchestration layer when a pipeline run starts. All modules in the same run receive the same runtime context.

Run Overrides

Use run overrides when you want one pipeline execution to use different parameters without editing or redeploying the compose file. Overrides are passed to the same deployed pipeline for that execution only. Scheduled runs still use the parameters defined in YAML.

mk p run --param start_date=2026-06-01
mk p run --param input_path=s3://bucket/input
mk p run --module-param prepare_training_data.limit=1000
CLI OptionScopeBehavior
--param key=valuePipeline runOverrides a pipeline parameter, then updates module job parameters that reference it.
--module-param module.key=valueOne moduleOverrides or adds a job parameter for the named module only.

Override Order

ModelKnife starts from the compose file, applies --param to the pipeline parameter set, resolves module job parameters that reference those pipeline parameters, then applies --module-param to the named module. --module-param is the most specific override.

Services

Services describe managed infrastructure. The common shape is provider-neutral where possible, with provider-specific fields under provider.<name>.

services:
  artifacts_bucket:
    type: object_storage_bucket
    configuration:
      bucket_name: image-classifier-${parameters.environment}-artifacts
      versioning: true
    provider:
      aws:
        force_destroy: false
FieldTypeDescription
typestringService kind, such as object_storage_bucket or function.
repositorystringSource repository path when the service needs code.
configurationobjectProvider-neutral service configuration.
providerobjectProvider-specific overrides, keyed by provider name.
depends_onlistService dependencies.
tagsobjectUser metadata. ModelKnife also adds managed metadata such as workspace where supported.

Modules

Modules describe pipeline steps and their dependencies.

modules:
  prepare_training_data:
    type: etl
    repository: ../src
    entry_point: jobs/prepare_training_data.py
    depends_on: []
    job_parameters:
      input_path: ${parameters.data_path}/raw
      output_path: ${parameters.run_output_path}/prepared
FieldTypeDescription
typestringModule kind.
repositorystringSource code path.
entry_pointstringScript, function, or executable entry point.
executorreference/objectExecution environment or reference to an executor.
depends_onlistModule dependency names.
job_parametersobjectRuntime parameters passed to the module.

Profiles

A profile file inherits from the default compose file, then overrides matching fields.

mlknife-compose.prod.yaml
parent_profile: default

parameters:
  environment: prod

services:
  artifacts_bucket:
    configuration:
      versioning: true

Clearing Inherited Sections

Use modules: {} or services: {} when a profile should intentionally clear inherited modules or services.

Workspace Interaction

Workspace is not a YAML field. It is selected by CLI flag and passed into ModelKnife-managed deployment isolation.

mk s deploy --workspace prod --profile prod