You are here: Foswiki>Service Web>GenericRDA3ServerUsage (15 Feb 2017, VitaliyRapp)Edit Attach

Important note:

This is a copy of the page from the CERN - Wiki, adjusted to be useful at GSI.

Introduction

The cmw-tools project provides an implementation of a running generic Rda2 and Rda3 test server without FESA layer.

These generic servers, can be reused for setting up and performing integration and performance tests or any other desired scenario.

Management capabilities

The generic RDA servers incorporate some management and accounting capabilities.

These allow the user to:
  1. Issue commands to the server (reset server, delete device, generate device unique identifier, etc.)
  2. Request information from the server (statistical data, property acquired context or request context, etc.)
To be able to benefit from them, the user should use a combination of reserved:
  • Device names
  • Properties names
  • Feld names
All the capabilities along with a description of what they do an how to invoke them can be found in the attached table:

Checkout and compilation

Please follow the these steps to properly check out an build cmw-tools (java version) and cmw-tools-cpp (C++ version). This instruction is adopted to GSI.

Java

1. Check out from SVN

From the CERN - SVN repository " https://svn.cern.ch/reps/acc-co " checkout the cmw-tools project. This project can be found under: https://svn.cern.ch/reps/acc-co/trunk/cmw/cmw-tools

Additional a copy this project (converted to maven incl. correct pom.xml file) can be found at GSI repositiory: https://www-acc.gsi.de/svn/cscosv/cmw/cmw-tools

2. Convert to maven an build the project (Not needed if you have checked out from GSI repository)

Convert the project to maven

Add (edit) the pom.xml file. An example can be found in the attachment.

C++

1. Check out from SVN

From the SVN repository " https://svn.cern.ch/reps/acc-co " checkout the cmw-tools-cpp project.

This project can be found under: https://svn.cern.ch/reps/acc-co/trunk/cmw/cmw-tools-cpp

Aditional a copy this project can be found at GSI repositiory: https://www-acc.gsi.de/svn/cscosv/cmw/cmw-tools-cpp

2. Build the project

To build the C++ version of cmw-tools you have two options:

Build the project in a purely "Eclipse way" :
    1. Convert the project into a C++ project
      Right click on the directory folder and choose the options "New->Convert to a C/C++ Project (Adds C/C++ Nature)" :

    2. Convert into a "Makefile project" with "Linux GCC" toolchaing
    3. Create the proper compilation targets

      On the "MakeTarget" view, right click on cmw-tools-cpp and select the option "New". Add following targets:
      clean CPU=x86_64 PARENT_MAKEFILE=opt/cern/buildsystem/cmw/2.0.1/Make.gsi CMW_MAKEFILE_VERSION=2.0.1
      compile -j4 CPU=x86_64 PARENT_MAKEFILE=/opt/cern/buildsystem/cmw/2.0.1/Make.gsi CMW_MAKEFILE_VERSION=2.0.1 ZMQ_VERSION=4.0.4
      demo CPU=x86_64 PARENT_MAKEFILE=/opt/cern/buildsystem/cmw/2.0.1/Make.gsi CMW_MAKEFILE_VERSION=2.0.1 ZMQ_VERSION=4.0.4
    4. Execute the Makefile compilation targets in following order: clean, compile, demo
Build the project from the command line:
  1. On your command line shell, go to the directory where the cmw-tools-cpp is located
  2. Execute > make clean CPU=x86_64 PARENT_MAKEFILE=opt/cern/buildsystem/cmw/2.0.1/Make.gsi CMW_MAKEFILE_VERSION=2.0.1
  3. Execute > make compile -j4 CPU=x86_64 PARENT_MAKEFILE=/opt/cern/buildsystem/cmw/2.0.1/Make.gsi CMW_MAKEFILE_VERSION=2.0.1 ZMQ_VERSION=4.0.4
  4. Execute > make demo CPU=x86_64 PARENT_MAKEFILE=/opt/cern/buildsystem/cmw/2.0.1/Make.gsi CMW_MAKEFILE_VERSION=2.0.1 ZMQ_VERSION=4.0.4

Launching the servers

On this document we will show how to run the demonstration program with both a C++ and Java testbed servers.

Depending on the needs of the user, it might not be necessary for him to have both but only one server running. In that case, the necessary modifications to run tests against only one server are self-evident and do not require special instructions on our side.

Rda3DataServer.java

Prior to launch your server locally you need to setup some parameters.
  • JVM (Java Virtual Machine) parameters, should look like following:
-Dcmw.directory.client.serverList=fcmw00a.acc.gsi.de:5021
-Dcmw.nameresolution=direct
-Dlog4j.configuration=log4j.properties
This parameters are valid, if you start the server in the GSI environment. Othervise you need to provide the host/port where your DirectryServer is started.
NOTE: The RDA server will be accessible using the server name, which can be provided using the agrument below. However, if you want a communication using the device name you will need to configure your DirectoryServer accrodingly.
  • Rda3DataServer programm arguments should look like follwing:
-server YourServerName

Once these parameters have properly been set, the user can finally launch a local Rda3 server by right clicking on the Rda3DataServer.java class and clicking once more on menu option "Run as Java Application".

On your Eclipse IDE console you should be able to see some logging messages. Among them there should be a message informing that the server has started along with information regarding the server.

The output should look similar to this one:

image01-ConsoleOutput.png

Rda3DataServer.cpp

Similar to the building process, when it comes to launch the C++ version of the server, the user gets presented with two options:

1. Launch the project in a purely "Eclipse way"
  • Under the cmw-tools-cpp project directory, go to the binaries directory and "Right click on Run as Local C++ Application".
  • Simmilar to the java verison wtih VM arguemtns the C++ Rda3DataServer needs to be configured using the environmental variables. Therefore you need to provide following values:
    • CMW_DIRECTORY_CLIENT_SERVERLIST = fcmw00a.acc.gsi.de:5021
    • CMW_DIRECTORY_CLIENT_CONNECT_TIMEOUT = 30000

      This parameters are valid, if you start the server in the GSI environment. Othervise you need to provide the host/port where your DirectryServer is started.

      NOTE: The RDA server will be accessible using the server name, which can be provided using the agrument below. However, if you want a communication using the device name you will need to configure your DirectoryServer accrodingly.

  • Rda3DataServer launch arguments are same as in java:
-server YourServerName

2. Launch the project from the command line.
  • Starting at the cmw-tools-cpp directory go to "demo/bin/x86_64"
$ cd demo/bin/L866/
  • Create a directory service environment variable with the proper value
$ export CMW_DIRECTORY_CLIENT_SERVERLIST=fcmw00a.acc.gsi.de:5021
  • Launch the server
$ ./Rda3DataServer -server LocalServerName_CPP -log ../../../src/demo/resources/log.cfg
  • The server will start to produce output information that will be prompted on the console.
Topic revision: r5 - 15 Feb 2017, VitaliyRapp
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback