Skip to content

Commit 0fc9b06

Browse files
authored
Merge pull request #309 from lf-lang/compile-rti-for-each-federation
Update docs to reflect compiling a RTI for each federation.
2 parents d1f93df + 7d4ccf0 commit 0fc9b06

File tree

2 files changed

+13
-67
lines changed

2 files changed

+13
-67
lines changed

docs/reference/security.mdx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ target C {
2929
};
3030
```
3131

32-
The RTI build must include CMake options to enable simple HMAC-based authentication of federates. Add `-DAUTH=ON` option to the CMake command as shown below:
33-
34-
```bash
35-
mkdir build && cd build
36-
cmake -DAUTH=ON ../
37-
make
38-
sudo make install
39-
```
40-
4132
If you would like to go back to non-AUTH mode, you would have to remove all contents of the `build` folder.
4233

4334
</ShowOnly>

docs/writing-reactors/distributed-execution.mdx

Lines changed: 13 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ In addition to the federates, there is a program called the **RTI**, for **runti
2424
It is possible to encapsulate federates in Docker containers for deployment.
2525
See [containerized execution](../reference/docker-support.mdx).
2626

27-
## Installation of the RTI
28-
29-
Federated execution requires installation of a separate stand-alone program called the Runtime Infrastructure or **RTI**. At the current time, the only way to install this is from source files:
30-
31-
```shell
32-
git clone https://github.com/lf-lang/reactor-c.git
33-
cd reactor-c/core/federated/RTI/
34-
mkdir build && cd build
35-
cmake ../
36-
make
37-
sudo make install
38-
```
39-
40-
The above will create a program called `RTI` and install it at `/usr/local/bin/RTI`. Once this program is available in your path, you can compile and execute federated Lingua Franca programs using [VS Code or the command-line tools](/docs/installation). For more details, see the [README file](https://github.com/lf-lang/reactor-c/blob/main/core/federated/RTI/README.md).
41-
4227
## Minimal Example
4328

4429
A minimal federated execution is specified by using the `federated` keyword instead of `main` for the main federate. An example is given below:
@@ -55,21 +40,13 @@ When you run the code generator on `src/Federated.lf` containing the above code,
5540

5641

5742
<ShowIfs>
58-
<ShowIf c>
59-
60-
```
61-
bin/Federated
62-
bin/Federated_s
63-
bin/Federated_d
64-
```
65-
66-
</ShowIf>
67-
<ShowIf py>
43+
<ShowIf c py>
6844

6945
```
7046
bin/Federated
71-
src-gen/Federated/s/Federated_s.py
72-
src-gen/Federated/d/Federated_d.py
47+
fed-gen/Federated/bin/federated__s
48+
fed-gen/Federated/bin/federated__d
49+
fed-gen/Federated/bin/RTI
7350
```
7451

7552
</ShowIf>
@@ -86,26 +63,16 @@ When you run the code generator on `src/Federated.lf` containing the above code,
8663

8764
The root name, `Federated`, is the name of the .lf file from which these are generated (and the name of the main reactor, which is required to match if it is specified). The suffixes "\_s" and "\_d" come from the names of the top-level instances. There will always be one federate for each top-level reactor instance.
8865

89-
To run the program, you can simply run `bin/Federated`, which is a `bash` script that launches the RTI and two other programs, `Federated_s` and `Federated_d`.
66+
To run the program, you can simply run `bin/Federated`, which is a `bash` script that launches the RTI and two other programs, `federated__s` and `federated__d`.
9067
Alternatively, you can manually execute the RTI followed by the two federate programs by starting them on the command line. It is best to use three separate terminal windows (so that outputs from the three programs do not get jumbled together) to execute the following commands:
9168

9269
<ShowIfs>
93-
<ShowIf c>
70+
<ShowIf c py>
9471

9572
```sh
96-
RTI -n 2
97-
bin/Federated_s
98-
bin/Federated_d
99-
```
100-
101-
</ShowIf>
102-
103-
<ShowIf py>
104-
105-
```sh
106-
RTI -n 2
107-
python3 src-gen/Federated/s/Federated_s.py
108-
python3 src-gen/Federated/d/Federated_d.py
73+
fed-gen/Federated/bin/RTI -n 2
74+
fed-gen/Federated/bin/federated__s
75+
fed-gen/Federated/bin/federated__d
10976
```
11077

11178
</ShowIf>
@@ -149,22 +116,12 @@ Upon running the program, you will see information printed about the starting an
149116

150117
You may have several federations running on the same machine(s) or even several instances of the same federation. In this case, it is necessary to distinguish between the federations. To accomplish this, you can pass a `-i` or `--id` parameter to the RTI and its federates with an identifier that is unique to the particular federation. For example,
151118
<ShowIfs>
152-
<ShowIf c>
119+
<ShowIf c py>
153120

154121
```sh
155-
RTI -n 2 -i myFederation
156-
bin/Federated_s -i myFederation
157-
bin/Federated_d -i myFederation
158-
```
159-
160-
</ShowIf>
161-
162-
<ShowIf py>
163-
164-
```sh
165-
RTI -n 2 -i myFederation
166-
python3 src-gen/Federated/s/Federated_s.py -i myFederation
167-
python3 src-gen/Federated/d/Federated_d.py -i myFederation
122+
fed-gen/Federated/bin/RTI -n 2 -i myFederation
123+
fed-gen/Federated/bin/federated__s -i myFederation
124+
fed-gen/Federated/bin/federated__d -i myFederation
168125
```
169126

170127
</ShowIf>
@@ -318,8 +275,6 @@ Enable means to always start the service at startup, whereas start means to just
318275

319276
It will also be much more convenient if the launcher does not have to enter passwords to gain access to the remote machine. This can be accomplished by installing your public key (typically found in `~/.ssh/id_rsa.pub`) in `~/.ssh/authorized_keys` on the remote host.
320277

321-
Second, the RTI must be installed on the remote machine. See [instructions for installation the RTI](#installation-of-the-rti).
322-
323278
## Specifying RTI Hosts
324279

325280
You can specify a domain name on which the RTI should run as follows:

0 commit comments

Comments
 (0)