LCLS How-To Release Software

LCLS Code Management

LCLS PLC Development Getting Started

LCLS How-To Boot an EPICS IOC

EPICS Directory Tree

Description

CVS Repository

Reference Directory

EPICS IOC Applcations

epics/ioc

/afs/slac/g/lcls/epics/<version>/iocTop

EPICS Site

epics/site/src

/afs/slac/g/lcls/epics/<version>/modules

EPICS Base

epics/base

/afs/slac/g/lcls/epics/<version>/base

EPICS Extensions

epics/extensions

/afs/slac/g/lcls/epics/<version>/extensions

EPICS IOC Boot

epics/iocCommon

/afs/slac/g/lcls/epics/<version>/iocCommon

EPICS CPU Boot

epics/cpuCommon

/afs/slac/g/lcls/epics/<version>/cpuCommon

Tools Directory Tree

Description

CVS Repository

Reference Directory

EDM Configuration Files

tools/edm/config

/afs/slac/g/lcls/tools/edm/config

EDM Displays

tools/edm/display

/afs/slac/g/lcls/tools/edm/display

EDM Scripts

tools/edm/scripts

/afs/slac/g/lcls/tools/edm/script

Alarm Handler Configuration Files

tools/alh

afs/slac/g/lcls/tools/alh/config

Channel Watcher Configuration Files

tools/ChannelWatcher

afs/slac/g/lcls/tools/ChannelWatcher/config

PLC Applications

plc

/afs/slac/g/lcls/plc

Firmware 

firmware

/afs/slac/g/lcls/firmware

Note: PLC applications are generated on windows machines. See subsystem controls engineer for details

It is important to note that releasing software to the Development System during the 2007 run will affect the production system displays, standalone process restarts, and IOC's upon boot.

For plc's follow Step 1-4 only.

Step 1: General Instructions

  1. Log into your SLAC Unix account on the host lcls-dev2
  2. Setup your CVS environment variables for the LCLS environment.
  3. All EPICS IOC Application should include the site modules iocAdmin, which provides ioc statisticts. Those applications that require restore capabilities should include the module autosave or restore, which uses ChannelWatcher. To add these modules, please note that the configure/RELEASE file will need to be modified. # US

Step 2: Modifying existing software in CVS:
Note: if a cross compiler does not exist for your source, for example plc ladder logic and firmware, skip item 4 below.

  1. Change directory to your local sandbox
  2. Use eco to checkout software from cvs, or do it manually  cvs co -d <directory> <module name>  
  3. modify software
  4. if applicable, build your application to verify that the build is successfully.
  5. test your changes in development
  6. if ready, commit your changes to CVS, making sure to edit the RELEASE_NOTES describing the changes made
  7. Tag your release. 
  8. Use cram push your application to production

Step 3: Importing new software into CVS:

  1. Change directory to the TOP of your new application
  2. Make sure you have a RELEASE_NOTES and README file at the top of your application
  3. Modify you configure/RELEASE file for production use
  4. Import your software into CVS. The cvs import syntax is

cvs import -m "Initial import of ..." epics/base <vendor_tag> <release_tag>
cvs import -m "Initial import of ..." epics/site/src/<package> <vendor_tag> <release_tag>
cvs import -m "Initial import of ..." epics/ioc/<subsystem> <vendor_tag> <release_tag>

EPICS IOC Example)
cvs import -m "Initial import of...." epics/ioc/Vacuum Vacuum Vacuum-R1-0-0
PLC Example)
cvs import -m "Initial import of...." plc/Water/ioc-in20-wa01 ioc-in20-wa01 ioc-in20-wa01-R1-0-0

Step 4: Commit your changes to CVS and Tag

  1. Change directory to the directory where your changes were made locally.
  2. Commit all changed files to cvs: cvs commit -m "comment" <filename>
  3. Move to the top level directory of your application you wish to tag. For PLC applications this will be the nodename directory.
  4. Tag software: cvs tag <modulename>-RX-Y-Z

EPICS IOC Applicaiton Example: cvs tag Vacuum-R1-0-1
PLC Example: cvs tag ioc-in20-wa01-R1-0-0

Step 5: CVS Tag your changes

For ioc common startup: cd /afs/slac/g/lcls/epics/iocCommon/<subsystem>/<nodename>
For ioc application: cd /nfs/slac/g/lcls/epics/iocTop/<subsystem>
For modules: cd /afs/slac/g/lcls/epics/modules/<module>
For epics base: cd /afs/slac/g/lcls/epics/base/base-<version>

  1. cvs co -P -d <tagged version> -r <tagged version> <module name>
  2. cd <tagged version>
  3. gmake
  4. Send an email to controls-software-release regarding your tagged software release. If other applications need your changes, describe how to include your new version and the features of this new release.

Step 6: ChannelWatcher

  1. Update configuration files for your ioc if necessary.
  2. Create or modify the Master.XX file for your subsystem.
  3. Restart your ChannelWatcher monitoring process. For more information click here.

Step 7: Follow instructions on[How-To Boot an EPICS ioc|LCLS How-To Boot an EPICS IOC]

  1. Test your new release on the development system.
  2. If booting form the LCLSCA subnet proceed to Step 9. Otherwise, request permission from mcc ops to reboot your ioc. Once permission has been granted, send an email to controls-software-release regarding your ioc boot. This email message is forwarded to the Operations E-log. Boot your ioc and test. Send email to controls-software-release when your test has finished, providing the results of your test. If you have to backout your release, go to Step 8, Otherwise, your done!

Step 8: Backout out a Release

  1. Ask ops permission to back out you release
  2. Send a message to the MCC E-log
  3. From lcls-dev2, use CRAM to backout your release. Note: From lcls-dev2, type cram --revert  or cram --upgrade for help
  4. Reboot your ioc from the production network panel.

Step 9: Preliminary checkout in Production 
Check for duplicate PV usng  dupePVs.bash

Examples:
1) get usage
dupePVs.bash -h

2) check all iocs found in $IOC
dupePVs.bash

3) check all eioc's
dupePVs.bash eioc

4) check all iocs with mg in the name
dupePVs.bash mg

5) check all soft magnet IOCs
dupePVs.bash sioc-.*-mg01

Step 10: Exporting Software to Production System

When your EPICS IOC Application is ready for release to production, which means that you have completed the following;

  1. committed your changes to CVS
  2. tagged you release
  3. built and tested on the development system (lcls-dev2)

You are ready to export your software to production.

For EPICS IOC Applications:

  1. If your application is CRAMmed from lcls-dev2:
    1. cd to TOP of your Application
    2. cram push
  2. Otherwise,
    1. ssh to the production machine shared account, may  need to hope to lcls-prod02 first
    2. cd $EPICS_IOC_TOP/<Application>
    3. Use eco to checkout your application
    4. cd to the TOP of your release
    5. build your application by typeing "make"
    6. cd $EPICS_IOCS/<nodename>
    7. For hard iocs
      1.  cp -p startup.cmd startup.cmd_bckup
      2.   edit startup.cmd file and point to the new tagged release
    8. For soft iocs
      1.  mv bin bin_bckup
      2.   ln -s ../../iocTop/<subsystem>/<tagged-version>/bin/<OS> bin
         
    9. Enter a log in the operations elog book by sending email to controls-software-release
    10. Reboot ioc from network panel, after mcc has granted permission.

Matlab Programs Released to Production:

Step 11: Export ChannelWatcher Config Files
(see the example below)

  • ssh iocegr@lcls-builder or ssh physics@lcls-srv01
  • export CVSROOT=:ext:luchini@lcls-prod02:/afs/slac/g/lcls/cvs
  • cd $TOOLS/ChannelWatcher/config
  • cvs update <filename>
  • ssh laci@lcls-daemon1
  • cd /etc/init.d
  • ./st.cw<Subsystem> restart ex) st.cwMG for Magnets
  • logout
  • Note: if you have the Message Logger up (from lclshome) note the number of pv's that failed to connect to ChannelWatcher.
  • Enter a message in the operation elog book by sending email to controls-software-release.
  • No labels