|
| 1 | +# Application Simulator Configuration Specification |
| 2 | + |
| 3 | +The following document outlines the technical specification for the configuration |
| 4 | +files used by different components of [cisco-open/app-simulator](https://github.com/cisco-open/app-simulator). |
| 5 | + |
| 6 | +## Components |
| 7 | + |
| 8 | +There are two groups of components: |
| 9 | + |
| 10 | +- **generators** are convenience functions that translate an application simulator |
| 11 | + configuration file for multiple containers into the format recognized by popular |
| 12 | + container orchestration engines, like Kubernetes or docker compose. An application |
| 13 | + simulator configuration file is for the most part independent of the orchestration engine, such that |
| 14 | + it is possible to reuse a configuration with different orchestration engines. |
| 15 | +- **containers** are the building blocks of application simulator. They encapsulate |
| 16 | + **services**, **databases** and **loaders** which can be combined to represent a |
| 17 | + complex microservice architecture. Containers share some of their configuration, |
| 18 | + but they also have some domain-specific settings. |
| 19 | + |
| 20 | +Component configurations MAY contain elements that are specific to one orchestration engine. |
| 21 | +They are grouped in under a key that identified the engine, i.e. `k8s` for Kubernetes and |
| 22 | +`dockerCompose` for docker compose. |
| 23 | + |
| 24 | +## Generator configuration |
| 25 | + |
| 26 | +The configuration file that can be read by a generator is called "application simulator configuration file" (or short "app sim config"), since it |
| 27 | +represents the top-level structure of a simulated microservice application. |
| 28 | + |
| 29 | +A generator MUST support reading an app sim config in YAML format. A generator MAY support other formats like JSON, TOML, etc. |
| 30 | + |
| 31 | +The top level element of an app sim config file MUST be [mapping](https://yaml.org/spec/1.2.2/#mapping) and MAY contain |
| 32 | +sections represented by the following keys: |
| 33 | + |
| 34 | +- **global**: the value node MUST either be empty, or a mapping that contains configurations that are either relevant for the generation process or applied to all **containers**. |
| 35 | +- **services**: the value node MUST either be empty, or a mapping of **services** by their name. |
| 36 | +- **databases**: the value node MUST either be empty, or a mapping of **databases** be their name. |
| 37 | +- **loaders**: the value node MUST either be empty, or a mapping of **loaders** by their name. |
| 38 | + |
| 39 | +The structure of the mappings for the different **container** components (**services**, **databases**, **loaders**) are described |
| 40 | +below in the chatper [Container configuration](#container-configuration). |
| 41 | + |
| 42 | +The **global** configuration MAY have the following child nodes: |
| 43 | + |
| 44 | +- **imageNamePrefix**: |
| 45 | +- **imageNameSuffix**: |
| 46 | +- **serviceDefaultPort**: |
| 47 | + |
| 48 | +## Container configuration |
| 49 | + |
| 50 | +### Common configuration |
| 51 | + |
| 52 | +All **container** configurations share the following settings: |
| 53 | + |
| 54 | +- **type** (required) |
| 55 | +- **name** |
| 56 | +- **port** |
| 57 | +- **aliases** |
| 58 | +- **enabled** |
| 59 | + |
| 60 | +### Service configuration |
| 61 | + |
| 62 | +- **endpoints** |
| 63 | + |
| 64 | +### Call sequence configuration |
| 65 | + |
| 66 | +- **call** |
| 67 | +- **probability** |
| 68 | +- **schedule** |
| 69 | + |
| 70 | +Available **commands** for **call**: |
| 71 | + |
| 72 | +- **sleep** |
| 73 | +- **slow** |
| 74 | +- **cache** |
| 75 | +- **error** |
| 76 | +- **log** |
| 77 | + |
| 78 | +### Database configuration |
| 79 | + |
| 80 | +- **databases** |
| 81 | + |
| 82 | +### Loader configuration |
| 83 | + |
| 84 | +- **wait** |
| 85 | +- **sleep** |
| 86 | +- **urls** |
0 commit comments