From 09f7f1b3b85b0afac3e9654d3e4d7b525c738ebc Mon Sep 17 00:00:00 2001 From: erlingrj Date: Tue, 15 Apr 2025 18:45:19 +0200 Subject: [PATCH 1/2] Update docs to reflect compiling a RTI for each federation. --- docs/reference/security.mdx | 9 --- .../distributed-execution.mdx | 69 ++++--------------- 2 files changed, 12 insertions(+), 66 deletions(-) diff --git a/docs/reference/security.mdx b/docs/reference/security.mdx index 508e27cab..c58afe05d 100644 --- a/docs/reference/security.mdx +++ b/docs/reference/security.mdx @@ -29,15 +29,6 @@ target C { }; ``` -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: - -```bash -mkdir build && cd build -cmake -DAUTH=ON ../ -make -sudo make install -``` - If you would like to go back to non-AUTH mode, you would have to remove all contents of the `build` folder. \ No newline at end of file diff --git a/docs/writing-reactors/distributed-execution.mdx b/docs/writing-reactors/distributed-execution.mdx index 0c8acb99d..31687cd6a 100644 --- a/docs/writing-reactors/distributed-execution.mdx +++ b/docs/writing-reactors/distributed-execution.mdx @@ -24,21 +24,6 @@ In addition to the federates, there is a program called the **RTI**, for **runti It is possible to encapsulate federates in Docker containers for deployment. See [containerized execution](../reference/docker-support.mdx). -## Installation of the RTI - -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: - -```shell -git clone https://github.com/lf-lang/reactor-c.git -cd reactor-c/core/federated/RTI/ -mkdir build && cd build -cmake ../ -make -sudo make install -``` - -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). - ## Minimal Example 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, - + ``` bin/Federated - bin/Federated_s - bin/Federated_d - ``` - - - - - ``` - bin/Federated - src-gen/Federated/s/Federated_s.py - src-gen/Federated/d/Federated_d.py + fed-gen/Federated/bin/federated__s + fed-gen/Federated/bin/federated__d + fed-gen/Federated/bin/RTI ``` @@ -86,26 +63,16 @@ When you run the code generator on `src/Federated.lf` containing the above code, 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. -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`. +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`. 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: - - - ```sh - RTI -n 2 - bin/Federated_s - bin/Federated_d - ``` - - - - + ```sh - RTI -n 2 - python3 src-gen/Federated/s/Federated_s.py - python3 src-gen/Federated/d/Federated_d.py + fed-gen/Federated/bin/RTI -n 2 + fed-gen/Federated/bin/federated__s + fed-gen/Federated/bin/federated__d ``` @@ -149,22 +116,12 @@ Upon running the program, you will see information printed about the starting an 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, - + ```sh RTI -n 2 -i myFederation - bin/Federated_s -i myFederation - bin/Federated_d -i myFederation - ``` - - - - - - ```sh - RTI -n 2 -i myFederation - python3 src-gen/Federated/s/Federated_s.py -i myFederation - python3 src-gen/Federated/d/Federated_d.py -i myFederation + fed-gen/Federated/bin/federated__s -i myFederation + fed-gen/Federated/bin/federated__d -i myFederation ``` @@ -318,8 +275,6 @@ Enable means to always start the service at startup, whereas start means to just 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. -Second, the RTI must be installed on the remote machine. See [instructions for installation the RTI](#installation-of-the-rti). - ## Specifying RTI Hosts You can specify a domain name on which the RTI should run as follows: From 7d4ccf0d02356d5704d4b288440a35432c154acb Mon Sep 17 00:00:00 2001 From: erlingrj Date: Wed, 16 Apr 2025 07:50:33 +0200 Subject: [PATCH 2/2] Address code-review --- docs/writing-reactors/distributed-execution.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing-reactors/distributed-execution.mdx b/docs/writing-reactors/distributed-execution.mdx index 31687cd6a..06f44d973 100644 --- a/docs/writing-reactors/distributed-execution.mdx +++ b/docs/writing-reactors/distributed-execution.mdx @@ -119,7 +119,7 @@ You may have several federations running on the same machine(s) or even several ```sh - RTI -n 2 -i myFederation + fed-gen/Federated/bin/RTI -n 2 -i myFederation fed-gen/Federated/bin/federated__s -i myFederation fed-gen/Federated/bin/federated__d -i myFederation ```