Distributed Minimalistic SRTC System

The provided Putting Everything Together for a Minimalistic SRTC System example can run as it is just on a single machine. This tutorial will explain how what changes are needed to run the example on multiple distributed machines. In particular running the example on two machines.

The example is based on the Putting Everything Together for a Minimalistic SRTC System example, and this tutorial concentrates only on the parts that need to be modified.

Prerequisites

  1. Two network connected machines with same ELT Development Environment installation.

  2. As Service Discovery/deployment is in this version of RTC toolkit based on the file system we need to share these information between the machines. The easiest way to do this is to share the INTROOT area using a distributed file system like NFS.

  3. In addition the DDS (multicast) communication between the machines has to be configured correctly

  4. ssh is installed and setup so that is possible to remotely execute commands without entering the password.

Setup

The example needs two machines to run:

Node

Description

Simple SRTC

Machine where supervisor, telemetry subscriber and data task run.

Simple HRTC Gateway

Machine where telemetry republishing and MUDPI source run.

The Example Components and deployment

The same components as in the Putting Everything Together for a Minimalistic SRTC System case are used:

On Simple HRTC gateway node run:

Executable

Instance (component) name

rtctkMudpiPublisher

rtctkTelRepub

tel_repub_1

On Simple SRTC node run:

Executable

Instance (component) name

rtctkExampleTelSub

tel_sub_1

rtctkExampleDataTask

data_task_1

rtctkRtcSupervisor

rtc_sup

Modifications

The baseline Putting Everything Together for a Minimalistic SRTC System code example for modification can be found in:

_examples/exampleEndToEnd

To run the system distributed over two nodes we need to change the configuration and the script used to run the example.

Configuration

Let’s assume that the two machines have the following IP addresses:

Node

IP

Simple SRTC

134.171.2.88

Simple HRTC Gateway

134.171.2.78

Depending on which machines particular component are run we need to set proper IP addresses for:

  • req_rep_endpoint

  • pub_sub_endpoint

in config/resource/config/rtctk/rtctkRefImpl/service_disc.yaml as follow:

common:

    ...

rtc_sup:
    req_rep_endpoint:
        type: RtcString
        value: zpb.rr://134.171.2.88:12081/
    pub_sub_endpoint:
        type: RtcString
        value: zpb.ps://134.171.2.88:12082/
tel_repub_1:
    req_rep_endpoint:
        type: RtcString
        value: zpb.rr://134.171.2.78:12083/
    pub_sub_endpoint:
        type: RtcString
        value: zpb.ps://134.171.2.78:12084/
tel_sub_1:
    req_rep_endpoint:
        type: RtcString
        value: zpb.rr://134.171.2.88:12085/
    pub_sub_endpoint:
        type: RtcString
        value: zpb.ps://134.171.2.88:12086/
data_task_1:
    req_rep_endpoint:
        type: RtcString
        value: zpb.rr://134.171.2.88:12087/
    pub_sub_endpoint:
        type: RtcString
        value: zpb.ps://134.171.2.88:12088/

Script

The script rtctkExampleEndToEnd.sh located in : scripts/src/rtctkRefImpl.sh which among other things starts the executables has to be be run on the Simple SRTC node, but before it is run some modifications are needed.

Parts where telemetry republisher is started/stopped using ssh to remotely execute/stop the processes.

function do_start () {
    ...
    ssh 134.171.2.78 rtctkTelRepub tel_repub_1 "$SVC_DISC_ENDPOINT" &> rtctkTelRepub.tel_repub_1.log &
    ...

function do_stop () {
    ...
    ssh 134.171.2.78 killall rtctkTelRepub
    ...

Parts where MUDPI publisher is started/stopped using ssh to remotely execute/stop the processes.

function do_start_data () {
    ...
    ssh 134.171.2.78 rtctkMudpiPublisher -d "$DELAY" -s 36928 localhost "$PORT" "$TOPIC" &> rtctkMudpiPublisher.log  &
   ...

function do_stop () {
    ...
    ssh 134.171.2.78 killall --quiet --wait -SIGTERM rtctkMudpiPublisher
    .....

Running the Example

After the modification and installation (waf install) the example should be run on machine Simple SRTC as Putting Everything Together for a Minimalistic SRTC System example. The output of telemetry republisher and MUDPI publisher can be retrieved from rtctkTelRepub.tel_repub_1.log and rtctkMudpiPublisher.log respectively.