summaryrefslogtreecommitdiff
path: root/site/docs/getting-started/1-first-experiment.md
blob: 9c84c43599ef4caad69d9527457fbb381825b2e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
---
description: Designing a simple experiment
---

# First Experiment
Now that you have downloaded OpenDC, we will start creating a simple experiment. 
In this experiment we will compare the performance of a small, and a big data center on the same workload.

<details>
<summary>Expand this</summary>

This is content
</details>

:::tip Answer
<details>
<summary>Expand for the Answer</summary>
</details>
:::

:::info Learning goal
During this tutorial, we will learn how to create and execute a simple experiment in OpenDC.
:::

## Designing a Data Center

The first requirement to run an experiment in OpenDC is a **topology**. 
A **topology** defines the hardware on which a **workload** is executed. 
Larger topologies will be capable of running more workloads, and will often quicker. 

A **topology** is defined using a JSON file. A **topology** contains one or more _clusters_.
_clusters_ are groups of _hosts_ on a specific location. Each cluster consists of one or more _hosts_. 
A _host_ is a machine on which one or more tasks can be executed. _hosts_ are composed of a _cpu_ and a _memory_ unit. 

### Simple Data Center
in this experiment, we are comparing two data centers. Below is an example of the small **topology** file:

```json
{
    "clusters":
    [
        {
            "name": "C01",
            "hosts" :
            [
                {
                    "name": "H01",
                    "cpu":
                    {
                        "coreCount": 12,
                        "coreSpeed": 3300
                    },
                    "memory": {
                        "memorySize": 140457600000
                    }
                }
            ]
        }
    ]
}
```

This **topology** consist of a single _cluster_, with a single _host_. 

:::tip
To use this **topology** in experiment copy the content to a new JSON file, or download it [here](documents/topologies/small.json "download")
:::

### Simple Data Center
in this experiment, we are comparing two data centers. Below is an example of the bigger **topology** file:

```json
{
    "clusters":
    [
        {
            "name": "C01",
            "hosts" :
            [
                {
                    "name": "H01",
                    "cpu":
                    {
                        "coreCount": 32,
                        "coreSpeed": 3200
                    },
                    "memory": {
                        "memorySize": 256000
                    }
                }
            ]
        },
        {
            "name": "C02",
            "hosts" :
            [
                {
                    "name": "H02",
                    "count": 6,
                    "cpu":
                    {
                        "coreCount": 8,
                        "coreSpeed": 2930
                    },
                    "memory": {
                        "memorySize": 64000
                    }
                }
            ]
        },
        {
            "name": "C03",
            "hosts" :
            [
                {
                    "name": "H03",
                    "count": 2,
                    "cpu":
                    {
                        "coreCount": 16,
                        "coreSpeed": 3200
                    },
                    "memory": {
                        "memorySize": 128000
                    }
                }
            ]
        }
    ]
}
```

Compared to the small topology, the big topology consist of three clusters, all consisting of a single host.

:::tip
To use this **topology** in experiment copy the content to a new JSON file, or download it [here](documents/topologies/big.json "download")
:::

:::info
For more in depth information about Topologies, see [Topology](../documentation/Input/Topology)
:::

## Workloads

Next to the topology, we need a workload to simulate on the data center. 
In OpenDC, workloads are defined as a bag of tasks. Each task is accompanied by one or more fragments. 
These fragments define the computational requirements of the task over time. 
For this experiment, we will use the bitbrains-small workload. This is a small workload of 50 tasks, 
spanning over a bit more than a month time. You can download the workload [here](documents/workloads/bitbrains-small.zip "download")

:::info
For more in depth information about Workloads, see [Workload](../documentation/Input/Workload)
:::

## Executing an experiment

To run an experiment, we need to create an **experiment** file. This is a JSON file, that defines what should be executed 
by OpenDC, and how. Below is an example of a simple **experiment** file:

```json
{
    "name": "simple",
    "topologies": [{
        "pathToFile": "topologies/small.json"
    },
    {
        "pathToFile": "topologies/big.json"
    }],
    "workloads": [{
        "pathToFile": "traces/bitbrains-small",
        "type": "ComputeWorkload"
    }]
}
```

In this **experiment**, three things are defined. First, is the `name`. This defines how the experiment is called 
in the output folder. Second, is the `topologies`. This defines where OpenDC can find the topology files.
Finally, the `workloads`. This defines which workload OpenDC should run. You can download the experiment file [here](documents/experiments/simple_experiment.json "download")

As you can see, `topologies` defines two topologies. In this case OpenDC will run two simulations, one with the small
topology, and one with the big topology. 

:::info
For more in depth information about Experiments, see [Experiment](../documentation/Input/Experiment)
:::

## Running OpenDC
At this point, we should have all components to run an experiment. To make sure every file can be used by OpenDC, 
please create an experiment folder such as the one shown below:
```
── {simulation-folder-name} 📁 🔧
    ├── topologies 📁 🔒
    │   └── small.json 📄 🔧
    │   └── big.json 📄 🔧
    ├── experiments 📁 🔒
    │   └── simple_experiment.json 📄 🔧
    ├── workloads 📁 🔒
    │   └── bitbrains-small 📁 🔒
    │       └── fragments.parquet 📄 🔧
    │       └── tasks.parquet 📄 🔧
    ├── OpenDCExperimentRunner 📁 🔒
    │   └── lib 📁 🔒
    │   └── bin 📁 🔒
    ├── output 📁 🔒
```

Executing the experiment can be done directly from the terminal. 
Execute the following code from the terminal in simulation-folder-name

```
$ ./OpenDCExperimentRunner/bin/OpenDCExperimentRunner.sh --experiment-path "experiments/simple_experiment.json"
```