wiki:SEMAINE-2.0-Distributed

Running SEMAINE-2.0 as a distributed system

SEMAINE-2.0 is fundamentally distributed. All communication runs via the Message-oriented Middleware ActiveMQ. This allows users to run the SEMAINE system in a distributed fashion, across different computers and optionally across different operating systems, thus matching CPU and memory requirements of the components with available compute power.

The SEMAINE-2.0-windows package comes with a number of configuration examples to show how to easily achieve a distributed system. It is assumed that low-level issues of setting up a network and identifying the IP address of a given machine are solved -- there is abundant information on these issues available on the internet.

In essence, seting up the distributed system amounts to the following tasks:

  • determine the IP address of the machine that should run ActiveMQ;
  • adapting the configuration variable CMS_URL on all machines to point to the right ActiveMQ instance;
  • starting the right components on each machine.

The key idea here is to create a custom start script for each machine, starting from SEMAINE-2.0\start.bat. All machines can use the common stop.bat.

In SEMAINE-2.0\config-examples, example start scripts are provided for the following scenarios.

Scenario 1: Two windows machines

In this scenario we assume two machines:

Machine 1 is a Windows machine. It should run ActiveMQ, the java components, and the Greta components. Its IP address is 192.168.1.1

Machine 2 is also a Windows machine. It should run Opensmile and the Video analysis components.

Make sure the respective components are available in the respective machines.

  • copy start-machine1.bat into the SEMAINE-2.0 folder on machine 1.
  • copy start-machine2.bat into the SEMAINE-2.0 folder on machine 2.
  • Now, first run start-machine1 on machine 1, then start-machine2 on machine 2.

start-machine1.bat:

:: Which ActiveMQ to connect to:
set CMS_URL=tcp://192.168.1.1:61616

:: Locations of installed software:
:: %~dp0 is expanded pathname of the current script
set SEMAINEDIR=%~dp0%
set ACTIVEMQDIR="%SEMAINEDIR%apache-activemq-5.3.0"
set JAVADIR="%SEMAINEDIR%java"
set GRETADIR="%SEMAINEDIR%Greta"

:: ACTIVEMQ: start and wait for it to be started
if exist %ACTIVEMQDIR% (
  echo.Trying to start ActiveMQ from %ACTIVEMQDIR%...
  set SUNJMX=-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
  start "activemq" /MIN /D %ACTIVEMQDIR%\bin activemq-admin.bat start
  :loop
  %GRETADIR%\utils\WAIT.exe 1
  for /f "delims=" %%a in ('netstat -an ^| findstr "61616"') do @set ACTIVEMQ_READY=%%a 
  if "%ACTIVEMQ_READY%"=="" (
    echo.Waiting for ActiveMQ...
    goto loop
  ) else (
    echo.ActiveMQ seems to be ready.
  )
)

:: Java components
if exist %JAVADIR% (
  echo.Starting Java components
  start "speech2face" /MIN /D "%SEMAINEDIR%" bin\semaine-speech2face.bat
)

:: GRETA components
if exist %GRETADIR% (
  echo.Starting Greta components
  start /MIN /D %GRETADIR% Active_ActionSelection.exe
  start /MIN /D %GRETADIR% Active_BehaviorPlanner.exe
  start /MIN /D %GRETADIR% Active_BehaviorRealizer.exe
  start /MIN /D %GRETADIR% Active_ListenerIntentPlanner.exe
  start /D %GRETADIR% Active_Player.exe
)

start-machine2.bat:

:: Which ActiveMQ to connect to:
set CMS_URL=tcp://192.168.1.1:61616

:: Locations of installed software:
:: %~dp0 is expanded pathname of the current script
set SEMAINEDIR=%~dp0%
set OPENSMILEDIR="%SEMAINEDIR%Opensmile"
set IMPERIALDIR="C:\Program Files\HCI^2 group, Imperial College London\Semaine Video Components"


:: Start audio components if installed
if exist %OPENSMILEDIR%\SEMAINExtract.exe (
  echo.Starting Opensmile audio input components
  start /MIN /D %OPENSMILEDIR% SEMAINExtract.exe -C opensmileSemaine.conf
)

:: Start video components if installed
if exist %IMPERIALDIR%\VideoFeatureExtractorConsole.exe (
  echo.Starting video input components
  start /MIN /D %IMPERIALDIR% VideoFeatureExtractorConsole.exe
)

Scenario 2: One Linux/Mac and two Windows machines

In this scenario we assume three machines:

Machine 1 is a Linux or Mac OS X machine. It should run ActiveMQ, Opensmile, and the Java components. Its IP address is 192.168.1.10.

Machine 2 is a Windows machine runing the Greta components.

Machine 3 is a Windows machine. It should run the Video analysis components.

Make sure the respective components are available in the respective machines.

  • copy start-machine1.sh into the SEMAINE-2.0 folder on machine 1.
  • copy start-machine2.bat into the SEMAINE-2.0 folder on machine 2.
  • copy start-machine3.bat into the SEMAINE-2.0 folder on machine 3.
  • Now, first run start-machine1 on machine 1, then start-machine2 on machine 2 and start-machine3 on machine 3.

start-machine1.sh:

#!/bin/sh
# This assumes that activemq is on the PATH; adapt call to activemq if necessary.

SEMAINEDIR=`dirname "$0"`
SEMAINEDIR=`(cd $SEMAINEDIR ; pwd)`

# Which ActiveMQ to connect to:
export CMS_URL=tcp://192.168.1.10:61616

activemq &

$SEMAINEDIR/bin/semaine-speech2face.sh &

$SEMAINEDIR/bin/run_components/start_component_tum.opensmile &

start-machine2.bat:

:: Which ActiveMQ to connect to:
set CMS_URL=tcp://192.168.1.10:61616

:: Locations of installed software:
:: %~dp0 is expanded pathname of the current script
set SEMAINEDIR=%~dp0%
set GRETADIR="%SEMAINEDIR%Greta"

:: GRETA components
if exist %GRETADIR% (
  echo.Starting Greta components
  start /MIN /D %GRETADIR% Active_ActionSelection.exe
  start /MIN /D %GRETADIR% Active_BehaviorPlanner.exe
  start /MIN /D %GRETADIR% Active_BehaviorRealizer.exe
  start /MIN /D %GRETADIR% Active_ListenerIntentPlanner.exe
  start /D %GRETADIR% Active_Player.exe
)

start-machine3.bat:

:: Which ActiveMQ to connect to:
set CMS_URL=tcp://l92.168.1.10:61616

:: Locations of installed software:
:: %~dp0 is expanded pathname of the current script
set IMPERIALDIR="C:\Program Files\HCI^2 group, Imperial College London\Semaine Video Components"

:: Start video components if installed
if exist %IMPERIALDIR%\VideoFeatureExtractorConsole.exe (
  echo.Starting video input components
  start /MIN /D %IMPERIALDIR% VideoFeatureExtractorConsole.exe
)
Last modified 8 years ago Last modified on 12/22/09 08:19:57