Skip to main content

Environment YAML reference

This reference describes the EnvironmentDefinition document accepted by POST /environments/ and PUT /environments/{environmentId}/. JSON and YAML carry the same structure. It is for authors who need a reproducible infrastructure inventory; use the environment guide for the Desktop workflow and the runtime guides for provider-specific setup.

Before you write a definition

  • Use stable, unique IDs. The environment ID is the identity used by PUT; send a complete definition when replacing an existing environment. The version ID is the identity referenced by scopes.
  • Create the environment before an execution scope. A scope refers to the version ID, and its network topology is a separate document.
  • Declare performance values deliberately. Omitting a numeric value decodes it as 0 (except computeSpeedup, which the database defaults to 1); that is rarely a useful planning model.
  • Keep credentials out of the file. credentialRef and credentialReference name a credential already stored in AkôFlow; they are not the secret itself.

The smallest useful simulation definition is versioned in examples/simulation/environment.yaml. It is a better starting point than an empty document because it includes a runtime, schedulable resources, and their bindings.

Document shape

environment: {}
version: {}
runtimes: []
resources: []
resourceRuntimeBindings: []
resourceRelations: []
storages: []
activityResourceProfiles: []
connections: []
connectionChecks: []
connectorBindings: []

environment and version are required for a persisted definition. The remaining collections may be empty at creation time, but a plan needs at least one schedulable resource, an enabled binding, and a runtime compatible with the selected execution mode.

Identity and version fields

PathRequiredTypeAccepted values / defaultNotes
environment.idYesstringunique IDPrimary environment ID.
environment.nameYesstringnon-empty in a useful definitionDisplay name; unique names are not required.
environment.descriptionNostring""Free text.
environment.statusNostringdefineddefined, connecting, connected, discovering, ready, degraded, or unreachable. Set it from observed connection state rather than treating it as a runtime selector.
environment.createdAtNotimestampdatabase creation timeReturned by reads; do not author it.
version.idYesstringunique IDThe immutable ID referenced by scopes.
version.environmentIdYesstringenvironment.idKeep it equal to the enclosing environment ID. The create path persists the enclosing ID.
version.versionYesintegersequence chosen by authorMust be unique for an environment.
version.statusYesstringdraft, published, retiredUse published for an inventory intended for a scope.
version.networkModelYesstringauthor-defined labelA descriptive model label such as static-links; topology links themselves live in the execution-scope document.
version.interferenceModelYesstringauthor-defined labelRecord the model assumption, for example none.
version.costModelYesstringauthor-defined labelRecord the cost interpretation, for example per-second.
version.configurationHashYesstringauthor-provided stable hash/labelUsed to identify the inventory configuration.
version.createdAt, version.publishedAtNotimestampserver-managed / optionalRead-only evidence fields.

Runtimes

Each entry in runtimes defines how a version can execute or simulate work. configuration is a runtime-specific object; see the relevant SimGrid, Kubernetes, or SLURM/HPC guide before adding its keys.

PathRequiredTypeValues / defaultNotes
runtimes[].idYesstringunique IDReferenced by resource and storage bindings.
runtimes[].environmentVersionIdYesstringversion.idKeep equal to the enclosing version ID; create persists the enclosing version.
runtimes[].nameYesstringunique per versionUser-facing runtime name.
runtimes[].driverYesenumslurm, kubernetes, ssh, local, serverless, simgrid, cloudThe database validates this list.
runtimes[].modeYesenumexecution, simulationThe database validates this list. A SimGrid runtime uses simulation; a remote runtime normally uses execution.
runtimes[].roleNostring""Informational role, such as simulation.
runtimes[].configurationNoobject{}Driver-specific settings.
runtimes[].capabilitiesRecommendedobjectall booleans default to false when omittedDeclare only capabilities the runtime actually provides.

capabilities accepts these boolean keys: batch, interactive, container, serverless, gpu, mpi, sharedStorage, dataStaging, cancellation, logStreaming, and simulation.

Resources and resource bindings

Resources are the candidates a plan can place activities on. A resource is usable only when it belongs to the selected version, is schedulable: true, and has an enabled binding to a compatible runtime.

PathRequiredTypeValues / defaultNotes
resources[].idYesstringunique IDReferenced by bindings, relations, profiles, assignments, and topology links.
resources[].environmentVersionIdYesstringversion.idKeep equal to the enclosing version ID; create persists the enclosing version.
resources[].typeYesenumSee resource types belowClassifies the resource.
resources[].nameYesstringDisplay name.
resources[].providerIdYesstringunique per versionProvider-facing or modeled identifier.
resources[].executionTargetNoenumbatchbatch, direct, or provisioned. The create path normalizes an omitted value to batch.
resources[].parentResourceIdNostringomittedParent resource ID, when the hierarchy is meaningful.
resources[].tier, region, zone, architectureNostring""Placement descriptors.
resources[].cpuCoresRecommendedinteger0Number of modeled cores. Set the actual parallel capacity.
resources[].cpuCapacityRecommendednumber0Schedulable CPU capacity. Keep it coherent with cpuCores for a one-unit-per-core model.
resources[].memoryBytes, storageBytesRecommendedinteger0Capacity in bytes.
resources[].computeSpeedupRecommendednumber1Relative compute multiplier. The database defaults an omitted value to 1; set it explicitly in portable YAML.
resources[].pricePerSecondRecommendednumber0Cost rate used by planning/simulation.
resources[].bootOverheadSeconds, containerOverheadSecondsNonumber0Modeled setup delays in seconds.
resources[].schedulableRecommendedbooleandatabase default trueSet explicitly. false retains inventory visibility without making a placement target.
resources[].metadataNoobject{}Provider- or experiment-specific metadata.

Accepted resource types are: cluster, node_pool, kubernetes_machine, hpc_partition, hpc_machine, cloud_vm, fog_device, local_machine, serverless_platform, serverless_function, batch_queue, kubernetes_namespace, and slurm_reservation.

resourceRuntimeBindings:
- resourceId: simulated-edge
runtimeId: simgrid
enabled: true
configuration: {}

resourceRuntimeBindings[].resourceId and runtimeId are required and must reference entries in the same definition. enabled defaults to true in the database, but set it explicitly. configuration is optional and defaults to {}.

resourceRelations is optional. When used, each relation needs sourceResourceId, targetResourceId, and type; environmentVersionId should equal version.id. The allowed relation types are contains, member_of, and accessible_via. A relation cannot point from a resource to itself.

Connections and transfer connectors

connections describes how AkôFlow reaches an environment. It is an environment-level collection, not a version-level collection.

PathRequiredTypeValues / defaultNotes
connections[].id, name, typeYesstring / enumssh, kubernetes, cloud, local, agentname is unique within the environment.
connections[].environmentIdYesstringenvironment.idKeep it equal to the enclosing environment; create persists the enclosing ID.
connections[].endpoint, username, credentialRefNostring""Reference stored credentials; never put tokens or private keys here.
connections[].configurationNoobject{}Connection-type-specific settings.
connections[].createdAtNotimestampserver-managedRead-only evidence field.

connectorBindings declares artifact-transfer capabilities. Its connector enum is rsync, scp, sftp, http, s3-compatible, or gcs. The fields id, environmentId, and connector identify the binding; endpoint, credentialRef, and configuration are optional. health is observation data and should be written by a check rather than authored as an assumption.

connectionChecks is also observed data. Do not copy a historical online result into a new environment file: validate the connection again after import.

Storage

storages records accessible storage; it does not create a bucket, NFS export, PVC, or filesystem. Each storage entry requires id, environmentVersionId, name, and type. Supported types are local, pvc, nfs, s3, lustre, gcs, s3-compatible, and ssh-filesystem.

PathRequiredTypeDefaultNotes
storages[].endpointNostring""Mount, URL, bucket, or filesystem endpoint.
storages[].capacityBytesNointeger0Capacity in bytes; must not be negative.
storages[].shared, readOnlyNobooleanfalseAccess semantics.
storages[].credentialReferenceNostring""Stored credential reference.
storages[].configuration, metadataNoobject{}Storage-provider details.
storages[].runtimeBindings[]NoarraynoneMakes storage available to a runtime.

A storage runtime binding requires runtimeId. Its containerPath defaults to /akoflow/data when omitted, and default, readOnly, hostPath, and configuration are optional. At most one storage can be default: true for a given environment version and runtime.

browseRoots, capabilities, health, indexPolicy, and indexStatus are inventory/evidence fields returned by the API. Let discovery and indexing populate them; do not rely on an authored health status as proof that storage is reachable.

Activity resource profiles

activityResourceProfiles is optional calibration data for scheduling. It links an activity type to a resource and accepts id, activityTypeId, resourceId, runtimeSeconds, runtimeStdDevSeconds, cpuUtilization, peakMemoryBytes, diskReadBytes, diskWriteBytes, energyJoules, source, sampleSize, modelVersion, and metadata. Durations are seconds; memory and disk values are bytes. The activity type and resource must already exist.

This profile is not a substitute for a workflow activity's simulation.durationSeconds or FLOPs profile. For a SimGrid workflow, declare its per-activity compute model in the workflow and use resource profiles only as additional measured calibration data.

Minimal complete example

environment:
id: lab-sim
name: Lab simulation
status: ready
version:
id: lab-sim-v1
environmentId: lab-sim
version: 1
status: published
networkModel: static-links
interferenceModel: none
costModel: per-second
configurationHash: lab-sim-v1
runtimes:
- environmentVersionId: lab-sim-v1
id: simgrid
name: SimGrid
driver: simgrid
mode: simulation
capabilities: {simulation: true}
resources:
- id: edge
environmentVersionId: lab-sim-v1
type: fog_device
name: Edge node
providerId: edge
cpuCores: 2
cpuCapacity: 2
memoryBytes: 2147483648
storageBytes: 21474836480
computeSpeedup: 1
pricePerSecond: 0
bootOverheadSeconds: 0
containerOverheadSeconds: 0
schedulable: true
resourceRuntimeBindings:
- resourceId: edge
runtimeId: simgrid
enabled: true

After creating it, retrieve GET /environments/lab-sim/ and confirm that the runtime, resource, and binding are present. Then create an execution scope and its network topology before generating a plan.

Compatibility and common failures

SituationResult and recovery
A runtime driver or mode is not in the documented enumSQLite rejects the definition. Use a supported driver/mode pair.
A duplicate environment.id, version number, provider ID, runtime name, connection name, or binding pair is suppliedThe create transaction fails. Choose a new identity or update the existing definition through PUT.
A resource is not bound to the selected runtimeIt is absent from compatible planning resources. Add an enabled resource-runtime binding.
A resource has zero capacity or an omitted compute modelPlanning may have no feasible placement or a meaningless estimate. Set resource capacities and workflow activity profiles explicitly.
Two default storages bind to one runtimeThe definition is rejected. Keep one default storage for each runtime/version pair.
A scope or plan already uses the environmentDeletion is blocked to preserve reproducibility. Create a new version instead of mutating historical infrastructure.

Related reference: workflow YAML, SimGrid modeling, storage, and execution scopes.