Skip to content

Commit 73c49cc

Browse files
svrnmnoMoreCLI
andauthored
add initial specification document (#74)
Co-authored-by: Alexander Stoklasa <[email protected]>
1 parent 534c297 commit 73c49cc

File tree

3 files changed

+88
-7
lines changed

3 files changed

+88
-7
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ learn using it with the step by step tutorial:
5858

5959
## Configuration specification
6060

61-
Application simulator is driven by configuration files that allow you to
62-
describe a microservice architecture and then run it with your preferred
63-
container orchestration. The configuration file follows a
64-
[specification](./docs/specification.md)
61+
Application simulator is driven by configuration files that allow you to describe a microservice architecture and
62+
then run it with your preferred container orchestration. The configuration file follows a [specification](./docs/specification/README.md).
6563

6664
## Contribute
6765

docs/specification.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/specification/README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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

Comments
 (0)