NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Software > MnCKnowledge > DevelopingMC
   Changes | Index | Contents | Search | Statistics | Go

Developing M&C Software



Intro

For a developer unfamiliar with the M&C software, what are the methods and best practices involved with this code tree. Here is a brief explanation of how to setup one's sandbox, run unit tests, and run with the simulator. This is not a tutorial on more basic concepts, like using CVS.

Setting up your sandbox

Development should take place in the developer's /home/sandboxes/developer area. The process for checking out, and building the M&C source code can be adapted from the steps included in CreatingNewMCVersion. Here is that adaptation, but reader be warned, the below will probably not be kept up to date as well as the former link!

Unit Tests

Unit Tests are run from the source directories.

Running the unit tests for the M&C modules requires some preparation. This is due to the fact that some of the unit tests need a) a configuration file, or b) to run against a daemon. For this reason, the unit tests need to run against a simulation. Because of the dependencies of some unit tests on M&C simulator components, the developer should pay special attention to whether or not the simulator is in use by checking the simulator calendar prior to running unit tests. If it is in use, results of the unit tests may not be consistent or reliable. Thus in the below instructions (from the comments in the gbt_unit_test script), the /home/sim/gbt.bash and sparrow.bash files are sourced:

  1. Define YGOR_ROOT, e.g., export YGOR_ROOT=/home/sandboxes/developer/mc/ygor
  2. Define GB_ROOT, e.g., export YGOR_ROOT=/home/sandboxes/developer/mc/gb
  3. source $YGOR_ROOT/ygor.bash
  4. source /home/sim/gbt.bash
  5. Select a sparrow, e.g., source /home/sparrow/integration/sparrow.bash

Then run the tests:

Installation and Using the Simulator

Before a developer can run the code they are developing in the simulator, they must install it.

Installation

The key to understanding the installation is that everything is installed except the config files. As an example, if one inspects the /home/gbt directory, one can see that most directories are symbolic links, except for the etc directory (home of etc/config):

[pmargani@nereid /home/gbt]$ ls -lrt
drwxrwxr-x  8 monctrl  monctrl  4096 May  8  2006 etc
lrwxrwxrwx  1 monctrl  monctrl    25 Mar 28 13:28 tcl -> /home/gbtversions/7.2/tcl
lrwxrwxrwx  1 monctrl  monctrl    25 Mar 28 13:28 lib -> /home/gbtversions/7.2/lib
lrwxrwxrwx  1 monctrl  monctrl    27 Mar 28 13:28 glish -> /home/gbtversions/7.2/glish
lrwxrwxrwx  1 monctrl  monctrl    26 Mar 28 13:28 exec -> /home/gbtversions/7.2/exec
lrwxrwxrwx  1 monctrl  monctrl    25 Mar 28 13:28 bin -> /home/gbtversions/7.2/bin
lrwxrwxrwx  1 monctrl  monctrl    26 Mar 28 13:28 apps -> /home/gbtversions/7.2/apps
lrwxrwxrwx  1 monctrl  monctrl    17 Jul 18 11:23 sparrow -> /home/sparrow/7.2
...

This is partially due to the fact that the configuration files in etc/config are not entirely under developer's control - they are being continually editied by astronomers and engineers. Consequently, they aren't under CVS control either. The revision control for these files is adhoc.

For the simulator, the configuration files in /home/sim/etc/config have all been tailored to meet the needs of the M&C simulation (i.e., don't connect to the real telescope).

Consequently, for installing the developer's sandbox, one method is to simply install in one's own test installation in /home/simversions. This will help the developer when switching the simulator to their installation.

Here are the simple instructions for installing, again adapted from CreatingNewMCVersion.

Running against the simulator

A full explanation, along with rules for running the simulator, are provided at RunningTheSimulator.

It is recommended that you read the full explanation, but here's the basic idea:

To switch simulation versions, one can follow the same steps spelled out in SwitchingMCVersions, except all references to /home/gbt should be replaced with /home/sim. In addition, the RunningTheSimulator wiki points out that one can configure which sparrow to run in the simulator manually as well.

Another confusing issue that isn't mentioned explicitly, is that the Antenna simulator is sometimes used for tests along with the production system. This happens for instance, on maintenance days. Thus the simulation calendar is important.

This section could use some more work I think.

-- PaulMarganian - 19 Jul 2007

Topic DevelopingMC . { Edit | Attach | Ref-By | Printable | Diffs | r1.9 | > | r1.8 | > | r1.7 | More }
Revision r1.9 - 27 Jul 2007 - 15:31 GMT - RonGrider
Parents: MnCKnowledge
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.