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. “Recommended” fields improve the inventory but are not required by the create handler.

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 unused environment. Replacement can fail once a scope, plan, or other record references its inventory. 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. The API decodes omitted numeric values as 0, including computeSpeedup, and saves them explicitly. Set a positive speedup and realistic capacity for schedulable resources.
  • Keep secrets out of the file. Connection credential references identify saved credentials. Transfer and storage references have provider-specific behavior; see the AWS/S3 limits before using them.

The smallest useful simulation definition is versioned in akoflow-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: []

environment and version are required for a persisted definition. The remaining collections may be empty at creation time. Planning needs a schedulable resource in the selected scope; executing the plan also needs an enabled binding to a runtime compatible with the run mode.

The create handler returns the submitted document. It may still show omitted nested parent IDs as empty strings. Read GET /environments/{environmentId}/ to see the IDs actually saved with the environment and version.

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.statusNostringdefinedDocumented states are defined, connecting, connected, discovering, ready, degraded, and unreachable. The create path does not validate this string; use an observed 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.environmentIdNostringsaved as environment.idThe repository uses the enclosing environment ID when it saves the version.
version.versionYesintegersequence chosen by authorMust be unique for an environment.
version.statusRecommendedstring"" if omittedDocumented states are draft, published, and retired; the create path does not validate this string. Use published for inventory intended for planning.
version.networkModelNostring"" if omittedOptional model label such as static-links. Topology links live in a separate network-topology document.
version.interferenceModelNostring"" if omittedRecord the model assumption when one is known, for example none.
version.costModelNostring"" if omittedRecord the cost interpretation when one is known, for example per-second.
version.configurationHashRecommendedstring"" if omittedSupply a stable label or hash to identify the inventory configuration; the create path does not compute it.
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[].environmentVersionIdNostringsaved as version.idThe repository uses the enclosing version ID when it saves each runtime.
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[].configurationNoobjectomittedDriver-specific settings; supply an object when the driver needs one.
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​

Planning considers resources in the selected scope marked schedulable: true; for non-batch targets it also checks the workflow's CPU and memory requirements. It does not filter them by runtime binding. Before execution, ensure each assigned resource has an enabled binding to a runtime compatible with the run mode; the supervisor rejects the request otherwise.

PathRequiredTypeValues / defaultNotes
resources[].idYesstringunique IDReferenced by bindings, relations, profiles, assignments, and topology links.
resources[].environmentVersionIdNostringsaved as version.idThe repository uses the enclosing version ID when it saves each resource.
resources[].typeRecommendedstring"" if omittedUse a known resource type below to classify the resource. The create path does not validate this field against that list.
resources[].nameYesstring—Display 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[].computeSpeedupRecommendednumber0 when omitted from API inputRelative compute multiplier. Set a positive value, commonly 1 for the baseline resource.
resources[].pricePerSecondRecommendednumber0Cost rate used by planning/simulation.
resources[].bootOverheadSeconds, containerOverheadSecondsNonumber0Modeled setup delays in seconds.
resources[].schedulableRecommendedbooleanfalse when omitted from API inputSet true for a placement target. false retains inventory visibility without making a placement target.
resources[].metadataNoobjectomittedProvider- or experiment-specific metadata.

Known 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. A stored type does not by itself make the resource runnable.

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

resourceRuntimeBindings[].resourceId and runtimeId must identify saved entries. Use entries from the same environment version: the database checks that both IDs exist, but does not check that their versions match. Set enabled: true for a usable binding; an omitted value decodes as false through the API. Omit configuration when the binding needs no settings.

resourceRelations is optional. When used, each relation needs sourceResourceId, targetResourceId, and type; the repository saves the enclosing version.id as its environmentVersionId. 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, typeYes for a usable connectionstringKnown types: ssh, kubernetes, cloud, local, agentname is unique within the environment. The create path does not validate type against this list.
connections[].environmentIdNostringsaved as environment.idThe repository uses the enclosing environment ID when it saves each connection.
connections[].endpoint, username, credentialRefNostring""Reference stored credentials; never put tokens or private keys here.
connections[].configurationNoobjectomittedConnection-type-specific settings.
connections[].createdAtNotimestampserver-managedRead-only evidence field.

Do not author connectorBindings or connectionChecks in this definition. The Go type includes both fields, but POST and PUT do not save them. GET includes recent connection checks recorded by separate health operations; it does not return a saved connector-binding list from this file. Configure storage or transfer use through the supported runtime and storage paths; see the AWS/S3 guide for the current S3 credential limits. Validate a connection again after import instead of copying a historical check.

Storage​

storages records storage that an environment may use; it does not create a bucket, NFS export, PVC, or filesystem. Each storage entry needs an id, name, and type; the repository saves the enclosing version.id as its environmentVersionId. Database-accepted type values are local, pvc, nfs, s3, lustre, gcs, s3-compatible, and ssh-filesystem. An accepted type does not prove that the running server can read its bytes; try the intended browse or transfer operation.

PathRequiredTypeDefaultNotes
storages[].endpointNostring""Mount, URL, bucket, or filesystem endpoint.
storages[].capacityBytesNointeger0Capacity in bytes; must not be negative.
storages[].shared, readOnlyNobooleanfalseAccess semantics.
storages[].credentialReferenceNostring""Recorded reference. The default S3 browser does not resolve it and sends unsigned requests.
storages[].configuration, metadataNoobjectomittedStorage-provider details.
storages[].configuration.browseRoots[]For browsingarray of objectsnoneApproved roots, each with a path. For local filesystem browsing, include the exact endpoint path.
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.

For a self-managed daemon browsing its own filesystem, set AKOFLOW_LOCAL_STORAGE_ROOT to an approved directory before starting it. Then register a local storage with the same absolute path as endpoint and in configuration.browseRoots:

storages:
- id: lab-files
environmentVersionId: lab-v1
name: Lab files
type: local
endpoint: /srv/akoflow-lab
configuration:
browseRoots:
- path: /srv/akoflow-lab

Use this excerpt inside a complete environment definition; the directory must exist and be accessible to the daemon. The environment repository persists configuration, so a top-level browseRoots field alone will not enable browsing. browseRoots, capabilities, health, indexPolicy, and indexStatus also appear as fields in API responses. A catalog's healthy flag means the driver is available; it is not a fresh probe of the storage path or a compute node.

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 a runtime compatible with the run modePlanning can still assign it, but execution rejects the request. Add an enabled resource-runtime binding before starting the run.
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 or replacement can fail to preserve existing references. Register the revised inventory as a new environment with new environment and version IDs; the current API has no endpoint to append a version to an existing environment.

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