Some notes on how JCodeSys is setup in pshare

by Rob Andre

JCodeSys is a combination of shared libraries which were built from TRANSP static libraries and java and jython code which makes calls into the shared libraries. The JCodeSys files are in ${TRANSPROOT}/jcodesys. The jcodesys directory contains README_INSTALL and README_DEVELOPER files as documentation for working with this code. I describe here how it relates specifically to pshare.

pshare's .login file loads in /p/beast/java/load_share.csh which sets up ant and jython environment variables. Environment variables specifically related to TRANSP are loaded from ${JCODESYSDIR}/pshare_jcodesysrc.csh. This is pretty much identical to ${JCODESYSDIR}/example_jcodesysrc.csh except it will not be overridden by a cvs update (for security).


Personal Environment

It is helpful to have several environment variables defined which are unique to yourself as pshare.

  ELVIS_SERVER - required for testing, point this to the host running your elvis server
  TRIAGE_DEVELOPER - give this your user name (e.g. randre) and it will be used in the triage gui
I set these up automatically when I log into pshare from my bash user account using the bash function,
sshpstar()     { 
                 ssh $* -t csh -c '"source .cshrc ; source .login ; bash --rcfile /u/randre/.bashrc_pstar"'
                }
which references a special .bashrc_pstar file. I also set a distinct DBGDIR for debugging TRANSP code. However the build and debugging of the java code will be done in $JCODESYSDIR/build which is unique to pshare. There is a way to control this with properties but I haven't tried it.
Properties

Properties, contained in property files or set on the command line to java, act like environment variables to java code. Properties are particularly important in ant, the java code build program. In ant, properties are immutable. So ant properties can be fixed by setting them before they are defaulted. Most of the defaults are set in $JCODESYSDIR/bxml/project_properties.xml. However the properties in $JCODESYSDIR/master.properties are loaded first. The master.properties file is currently used to set the options for testing and deployment. In particular, this is where the reference to /p/beast/java is made.


Testing

To test the code,

  upjcode test
The results of the tests can be found in $JCODESYSDIR/build/index.html. They currently take about 5 minutes to run and you will need to have ELVIS_SERVER defined and pointing to an elvis server for some of the tests to succeed. See README_DEVELOPER for more info on testing.
Deployment

The code is automatically deployed as part of a pshare_update. This means a directory is created in /p/beast/java/jcodesysYYYMmmDD with a link at /p/beast/java/jcodesys. The code can also be deployed manually with,

  upjcode deploy
Ideally the tests should be run before deployement.

If you have just changed some java code you can deploy on top of the current deployment with

  upjcode deploy-over-java
This takes about a minute to run. If you have just changed some TRANSP library code which will affect the shared libraries then
  upshare -bua
  upjcode deploy-over-share

pshr****

The pshr**** accounts use the java jars and shared libraries in the deployment directory (/p/beast/java/jcodesys). Any changes which are needed to the code should be made to the pshare account and then deployed, as described above, to the deployment directory.