osrf / mbzirc

Simulator for the MBZIRC Maritime Grand Challenge
Apache License 2.0
72 stars 47 forks source link

Add stall option to cloudsim_bridge docker entrypoint #192

Closed AlejoAsd closed 2 years ago

AlejoAsd commented 2 years ago

When launching Cloudsim bridges and field computers (FCs) on networks without multicast, it is necessary to configure the cyclonedds.xml file with peer information so that bridges and FCs can discover each other and exchange information.

The cyclonedds.xml configuration file requires a <Peer> entry with the IP of the peer on both containers looking to communicate using unicast. Each container contains the IP address of the other container it wants to connect to.

When launching in the cloud, IPs are not fixed, and they are not available until the container starts running, which is problematic due to the inherent cycle in the peer configuration. It is not possible to configure a container before launching, and it is not possible to launch a container before it is configured.

An optional env var MBZIRC_STALL_START_PATH was introduced that contains a path to a file, which when set, allows the container to run but stalls it from calling the launchfile until the file path exists. This allows for the configuration of the cyclonedds.xml file and any other additional configs before the bridge starts.