"sgl-router/src/vscode:/vscode.git/clone" did not exist on "21b884606676ac30e3dc0d52ee38e2e5409445ca"
orchestration.rst 7.17 KB
Newer Older
Antoine Kaufmann's avatar
Antoine Kaufmann committed
1
..
Antoine Kaufmann's avatar
Antoine Kaufmann committed
2
  Copyright 2022 Max Planck Institute for Software Systems, and
Antoine Kaufmann's avatar
Antoine Kaufmann committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  National University of Singapore
..
  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:
..
  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.
..
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

24
25
.. _sec-orchestration:

26
###################################
Antoine Kaufmann's avatar
Antoine Kaufmann committed
27
SimBricks Orchestration
28
29
###################################

30
31
32
33
34
35
36
Our orchestration framework replaces hand-crafted scripts for setting up and
running experiments. Instead, they are described in a declarative fashion. The
orchestration framework then takes care of the details managing launching the
respective component simulators, setting up the SimBricks communication channels
between them, and monitoring their execution. All output is collected in a JSON
file, which allows post-processing afterwards. 

Antoine Kaufmann's avatar
Antoine Kaufmann committed
37
38
39
40
******************************
Concepts
******************************

41
42
43
To declare experiments, we use multiple important concepts and terminology,
which we now introduce.

Antoine Kaufmann's avatar
Antoine Kaufmann committed
44
45
46
Experiments
===========

47
48
49
50
51
52
53
54
55
An *experiment* defines which component simulators to run, how they are
connected, and which workload is executed. To define an experiment, instantiate
the class :class:`~simbricks.orchestration.experiments.Experiment` in your own
Python module, which has member functions to further define the component
simulators to run. SimBricks comes with many pre-defined experiments, which can serve as starting guides and are located in the repository under ``experiments/pyexps``.

.. autoclass:: simbricks.orchestration.experiments.Experiment
  :members: add_host, add_pcidev, add_nic, add_network

Antoine Kaufmann's avatar
Antoine Kaufmann committed
56
57
58
Runs
====

59
60
61
62
63
64
65
66
67
68
69
Experiments can be executed multiple times, for example, to gain statistical
insights when including a random or non-deterministic component. We call each
execution one *run* of the experiment. Each run produces its own output JSON
file. The file name includes the number of the run.

The number of runs can be specified when invoking the orchestration framework,
see :ref:`sec-command-line`. When using simulator checkpointing, we use one run
to boot the simulator and take the checkpoint, and a second one to execute the
actual experiment. This is the reason for two output JSON files being produced.
For more information, see :ref:`sec-checkpointing`.

Antoine Kaufmann's avatar
Antoine Kaufmann committed
70
71
72
Component Simulators
====================

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
SimBricks provides multiple already implemented component simulators, which
can be used in experiments. This selection includes host, NIC, network, and PCI
device simulators. Each simulator is implemented in a class deriving from
:class:`~simbricks.orchestration.simulators.Simulator`, which provides the
necessary commands and arguments for its execution and for specifying the
SimBricks communication channel to connect to. We also offer more specialized
base classes for the different component types, which implement common member
functions, for example, add connected NICs or network component simulators to a
host component simulator. Every already implemented component simulator can be
found in the module. :mod:`simbricks.orchestration.simulators`.

.. automodule:: simbricks.orchestration.simulators

  .. autoclass:: simbricks.orchestration.simulators.Simulator
    :members: resreq_cores, resreq_mem, prep_cmds, run_cmd, dependencies

  .. autoclass:: simbricks.orchestration.simulators.HostSim
    :members: add_pcidev, add_nic, add_netdirect

  .. autoclass:: simbricks.orchestration.simulators.NICSim
    :members: set_network

  .. autoclass:: simbricks.orchestration.simulators.NetSim
    :members: connect_network

  .. autoclass:: simbricks.orchestration.simulators.PCIDevSim


.. _sec-node_configuration:

Antoine Kaufmann's avatar
Antoine Kaufmann committed
103
104
105
Node Configuration
==================

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
The configuration and workload to run on individual host simulators or, more
generally, nodes that should run in the experiment, are defined using the
classes :class:`~simbricks.orchestration.nodeconfig.NodeConfig` and
:class:`~simbricks.orchestration.nodeconfig.AppConfig`, respectively.

:class:`~simbricks.orchestration.nodeconfig.NodeConfig` defines, for example,
the networking configuration like IP address and subnet mask, how much system
memory the node has, and which disk image to run. The latter can be used, for
example, to run a specific version of the Linux kernel on a node. You can find
more information on this in the :ref:`next section <sec-howto-custom_image>`.
:class:`~simbricks.orchestration.nodeconfig.NodeConfig` contains an attribute
for a :class:`~simbricks.orchestration.nodeconfig.AppConfig`.

.. automodule:: simbricks.orchestration.nodeconfig

  .. autoclass:: simbricks.orchestration.nodeconfig.NodeConfig
    :members: ip, prefix, mtu, cores, memory, disk_image, app, run_cmds, cleanup_cmds, config_files 


.. _sec-app_configuration:

Antoine Kaufmann's avatar
Antoine Kaufmann committed
127
128
129
Application Configuration
-------------------------

130
131
132
133
134
135
136
137
138
139
140
141
The class :class:`~simbricks.orchestration.nodeconfig.AppConfig` offers member
functions to define the concrete commands to run on the node. It also provides a
member function
:meth:`~simbricks.orchestration.nodeconfig.AppConfig.config_files` to specify
additional files to be made available on the host, which are specified as key
value pairs, where the key represents the filename inside the simulated guest
system and the value is an IO handle to the file on the host running the
simulators.

  .. autoclass:: simbricks.orchestration.nodeconfig.AppConfig
    :members: run_cmds, config_files

Antoine Kaufmann's avatar
Antoine Kaufmann committed
142
143
144
145
146

******************************
Running Experiments
******************************

147
148
149

.. _sec-command-line:

Antoine Kaufmann's avatar
Antoine Kaufmann committed
150
151
152
Command Line
====================

Hejing Li's avatar
Hejing Li committed
153
.. code-block:: bash
Antoine Kaufmann's avatar
Antoine Kaufmann committed
154
155

   usage: simbricks-run [-h] [--filter PATTERN [PATTERN ...]] [--pickled] [--runs N]
Hejing Li's avatar
Hejing Li committed
156
157
158
159
               [--firstrun N] [--force] [--verbose] [--pcap] [--repo DIR]
               [--workdir DIR] [--outdir DIR] [--cpdir DIR] [--parallel]
               [--cores N] [--mem N] [--slurm] [--slurmdir DIR]
               EXP [EXP ...]
160

Hejing Li's avatar
Hejing Li committed
161
Positional arguments
Antoine Kaufmann's avatar
Antoine Kaufmann committed
162
--------------------
163

Antoine Kaufmann's avatar
Antoine Kaufmann committed
164
   *  ``EXP``
165

Hejing Li's avatar
Hejing Li committed
166
      An experiment file to run.
167

Hejing Li's avatar
Hejing Li committed
168
Optional arguments
Antoine Kaufmann's avatar
Antoine Kaufmann committed
169
------------------
170

Hejing Li's avatar
Hejing Li committed
171
   *  `` -h, --help``
172

Hejing Li's avatar
Hejing Li committed
173
174
175
176
      show this help message and exit.
   
   * `` --filter PATTERN [PATTERN ...] ``
      Pattern to match experiment names against
177

Antoine Kaufmann's avatar
Antoine Kaufmann committed
178
179
180
Environment
-----------

181
182

******************************
Antoine Kaufmann's avatar
Antoine Kaufmann committed
183
Images
184
185
186
187
******************************


******************************
Antoine Kaufmann's avatar
Antoine Kaufmann committed
188
Distributed Simulations
189
190
191
192
******************************


******************************
Antoine Kaufmann's avatar
Antoine Kaufmann committed
193
Slurm
194
******************************