Difference between revisions of "Remote Experiment Controller"

From wwwelab
Jump to navigation Jump to search
Line 22: Line 22:
 
* Docker (20.10+)
 
* Docker (20.10+)
 
* docker-compose (1.25.4+)
 
* docker-compose (1.25.4+)
+
 
 
= Preparation steps =
 
= Preparation steps =
  
Line 52: Line 52:
 
= Build =
 
= Build =
  
Follow the next steps to build and run at target environments.
+
Configure the following properties based on your environment:
  
'''build_pendulum.properties:'''
+
'''build_pendulum.properties''':
  
* '''lab.list''': Name of the laboratories to build, comma (,) delimited.
 
 
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.
 
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed
+
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)
 
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)
 
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)
 
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)
 
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)
Line 64: Line 63:
 
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)
 
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)
  
== Local ==
+
'''docker-compose-pendulum.yml''':
 
 
This option only serves testing purposes (install locally a clean environment), Pendulum Hardware Server is not used at this step.
 
 
 
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias="REC" -Dbuild.environment=local
 
 
 
Be aware that a virtual experiment is started by this step, not the pendulum!
 
 
 
  
== Production ==
+
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)
   
 
  
Build the project:
+
Package
 +
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias="REC" -Dbuild.environment=pendulum -Dpack.docker.images
  
     $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias="REC" -Dbuild.environment=pendulum
+
Copy to destination servers:
 +
     $ scp deployment/images/target/*.tar multicast-server-name:/tmp/
 +
    $ scp deployment/compose/target/docker-compose-{pendulum,template}.yml multicast-server-name:/tmp/
 +
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/
  
 
= Install =
 
= Install =
  
 +
== ReC, Webswing and Multicast Controller ==
 +
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab
 +
    $ sudo usermod -a -G docker elab
 +
    $ sudo -u elab docker load --input /tmp/webswing.tar
 +
    $ sudo -u elab docker load --input /tmp/multicast.tar
 +
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar
 +
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar
 +
    $ sudo -u elab cp /tmp/docker-compose-{pendulum,template}.yml /home/elab/
 +
    $ sudo -u elab docker-compose -f /home/elab/docker-compose-template.yml -f /home/elab/docker-compose-pendulum.yml up -d
  
 +
== Hardware Server ==
 +
    # Replace wpexperiment with your experiment name
 +
    $ export experiment=wpexperiment
 +
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab
 +
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}
 +
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}
 +
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start
  
 
Steps to build and deploy ReC at target environments:
 
Steps to build and deploy ReC at target environments:

Revision as of 12:22, 13 April 2021

Pre-requisites

Build environment

  • Maven 3.6.3
  • OpenJDK 11 (11.0.8+)
  • Docker (20.10+)
  • docker-compose (1.25.4+)

Multicast Controller and rec.client

  • Docker (20.10+)
  • docker-compose (1.25.4+)

Hardware Server

  • OpenJDK 11 (11.0.8+)

rec.web (recommended only for testing locally)

  • Docker (20.10+)
  • docker-compose (1.25.4+)

Preparation steps

First checkout the project from github:

   $ git clone https://github.com/linkareti/rec-project.git

(FIXME) Then we need to switch to jdk11-migration branch:

   $ git checkout jdk11-migration

To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum

experiments/create_pendulum_experiment.sh

   Mandatory arguments:
   * 1st argument: Name of the experiment (e.g. worldpendulum)
   * 2nd argument: ID of the experiment (e.g. ELAB_WORLD_PENDULUM)
   * 3rd argument: Pendulum location (e.g. Faro)
   Optional arguments:
   * 4th argument: URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)
   * 5th argument: Pendulum serial device location (default: /dev/ttyS0)

Sample script execution to create pendulum:

   $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0

Build

Configure the following properties based on your environment:

build_pendulum.properties:

  • pendulum.experiment.list: Name of the experiment(s) to build, comma (,) delimited.
  • pendulum.multicast.controller.host: Hostname where Multicast controller is going to be installed (default: elab-multicast)
  • pendulum.multicast.controller.port: Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)
  • pendulum.rec.multicastcontroller.jmxremote.port: Listen JMX port used to recieve connections from rec.web (default: 25001)
  • install.dir: Base directory where Multicast Controller is going to be installed (default: /home/elab)
  • deployment.subdir: Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)

docker-compose-pendulum.yml:

Package

   $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias="REC" -Dbuild.environment=pendulum -Dpack.docker.images

Copy to destination servers:

   $ scp deployment/images/target/*.tar multicast-server-name:/tmp/
   $ scp deployment/compose/target/docker-compose-{pendulum,template}.yml multicast-server-name:/tmp/
   $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/

Install

ReC, Webswing and Multicast Controller

   $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab
   $ sudo usermod -a -G docker elab
   $ sudo -u elab docker load --input /tmp/webswing.tar
   $ sudo -u elab docker load --input /tmp/multicast.tar
   $ sudo -u elab docker load --input /tmp/webswing-admin.tar
   $ sudo -u elab docker load --input /tmp/reverse-proxy.tar
   $ sudo -u elab cp /tmp/docker-compose-{pendulum,template}.yml /home/elab/
   $ sudo -u elab docker-compose -f /home/elab/docker-compose-template.yml -f /home/elab/docker-compose-pendulum.yml up -d

Hardware Server

   # Replace wpexperiment with your experiment name
   $ export experiment=wpexperiment
   $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab
   $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}
   $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}
   $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start

Steps to build and deploy ReC at target environments:

  1. TODO Steps

Steps to connect to IST environment:

  1. TODO Steps