cram
CVS
.eco
.iocTop
where the releases are located.iocTop/packageName
, create the current
softlink and point it to the release that is currently being used in production.
drwxrwxr-x 9 iocegr lcls MatlabSupport-R3-0-0-0
drwxrwxr-x 9 softegr lcls MatlabSupport-R3-1-0-0
drwxrwxr-x 10 softegr lcls MatlabSupport-R3-2-0-0
lrwxrwxrwx 1 softegr lcls current -> MatlabSupport-R3-2-0-0
[softegr@lcls-builder MatlabSupport]$
iocCommon
, for each IOC belonging to the software package, create a iocSpecificRelease
softlink and point it to the current
softlink defined above.
You must use relative paths for these softlinks.
lrwxrwxrwx st.cmd -> startup.cmd
-rwxrwxr-x startup.cmd
lrwxrwxrwx iocSpecificRelease -> ../../iocTop/MatlabSupport/current
[softegr@lcls-builder sioc-sys0-ml00]$
bin
softlink to the iocTop area (many softIOC's used this approach) if you previously had one.
It does not hurt to have the bin
softlink but it is confusing and it makes it very hard to debug cram
failures.
The recommended way to refer to collateral in iocTop
is to use the iocSpecificRelease
link.
startup.cmd
to use the iocSpecificRelease
softlink.
You will need to change the hashbang
portion of the startup script by replacing #!bin/linux-x86
with #!iocSpecificRelease/bin/linux-x86
[softegr@lcls-builder sioc-sys0-ml00]$ cat startup.cmd
#!iocSpecificRelease/bin/linux-x86/matlabSupport
#==============================================================
#
# Abs: EPICS Soft IOC Startup Script for sioc-sys0-ml00
in addition to location from where iocBoot/st.cmd
is loaded where bin/../../iocBoot/
is replaced with iocSpecificRelease/iocBoot
. Note this listing has some portions alterted to make it fit.
# Go to IOC top directory and execute IOC startup script
cd <iocCommon>/sioc-sys0-ml00/iocSpecificRelease/iocBoot/sioc-sys0-ml00
< st.cmd
# Execute soft_post_st.cmd script
< /usr/local/lcls/epics/iocCommon/All/Prod/soft_post_st.cmd
screeniocs
to use the iocSpecificRelease
softlink instead of the bin
link.
For example, change .../sioc-sys0-ml00/bin/linux-x86/matlabSupport
to .../sioc-sys0-ml00/iocSpecificRelease/bin/linux-x86/matlabSupport
.
Note this listing has some portions alterted to make it fit.
[softegr@lcls-builder Prod]$ grep -e "^sioc-sys0-ml00" ${IOC_SCREEN}/screeniocs
sioc-sys0-ml00 <iocCommon>/sioc-sys0-ml00/iocSpecificRelease/bin/linux-x86/...
[softegr@lcls-builder Prod]$
screeniocs
, you'll need to log into the machine hosting the softIoc and restart the softIoc using the /etc/init.d
scripts.
You need to do this only during migration; this is because merely exiting from iocSh
in iocConsole
does not start a new screen session.
You can also accomplish the same using iocConsole your_ioc -cleanup
cram
.cram
eco
and cd
into it.
[mshankar@lcls-dev2 test]$ eco
Enter name of module/package to checkout: MatlabSupport
Enter name of tag or [RETURN] to use HEAD>
Using MAIN_TRUNK. The name of the directory will be 'MAIN TRUNK'.
...
[mshankar@lcls-dev2 test]$ cd MatlabSupport/MAIN_TRUNK
[mshankar@lcls-dev2 MAIN_TRUNK]$
cram describe
.
This creates a .cram
folder with the package information in packageinfo
.
This allows you to skip the name and type command line parameters when using cram
.
[mshankar@lcls-dev2 MAIN_TRUNK]$ cram describe
configure/CONFIG
for static builds with:
SHARED_LIBRARIES=NO
STATIC_BUILD=YES
USR_SYS_LIBS += pcre
to your application's Makefile.
This will include libpcre.a
from the system libraries.
PROD_LIBS
using PROD_LIBS += asyn
and remove it from your <APP_libs> in your application's Makefile.
motor
module, you may need to include the motor
and asyn
module's as part of PROD_LIBS
and remove it from your <APP_libs> in your application's Makefile.
calc
module, you may need to include the sscan
module in your configure/RELEASE
SSCAN_MODULE_VERSION=sscan-R2-8-1_1-0
SSCAN=$(EPICS_MODULES)/sscan/$(SSCAN_MODULE_VERSION)
and in your app's Makefile
softLlrf_LIBS += sscan
ldd
is a very useful tool. If you do an ldd bin/linux-x86/your_app
, you should only see .so
's from /usr/lib
or /lib
. If you see .so
's from other folders, you need to include the .a
's or you need to ship the .so
's using LIB_INSTALLS
..so
files from the environment), please bear in mind that it is likely that the .so
's may not be physically present on the production side(s).
Consider bundling these as part of your software package using the LIB_INSTALLS
variables of the EPICS build system.
Every dependency that needs to exist on the production side(s) is an entity that the system's team needs to maintain.
Please do make sure that they are aware of it and that there is a facility agnostic way to determine the location of these assets.
envPaths
will be fixed by the upgrade
script.
However, there will not be any modules on the production side of the fence.
So, any templates that are being loaded from the module folder need to be included in the application.
The EPICS build system already has support for adding a wide variety of file types to your software package and also allows for custom types.
In general, adding a file to your application consists of adding the file using something suitable like DB_INSTALLS
.
For example, to add autosave's save_restoreStatus.db
to your application, add the following line to your applications <app>/Db/Makefile
DB_INSTALLS += $(AUTOSAVE)/db/save_restoreStatus.db
and change your
st.cmd
to point to
dbLoadRecords("db/save_restoreStatus.db", "P=SIOC_$(AREA)-$(IOC_SUFF):")
instead of dbLoadRecords("$(AUTOSAVE)/db/save_restoreStatus.db", "P=SIOC_$(AREA)-$(IOC_SUFF):")
areaDetector.cfg
if you have one. Some areaDetector.cfg
have a cd $(AREA_DETECTOR)/ADApp/Db
as the first line. You may want to comment this out as we are not loading templates from the db
area.cram
has some ability to detect external resources using cram lint
.
You typically run cram lint
in a cycle with make clean
and make
.
An IOC make
generates the st.cmd
and envPaths
for all the ioc's in the software package.
cram lint
parses the st.cmd
for all the ioc's in the software package and points out
< $(AREA_DETECTOR)/include.cmd
cd
's to external folders like cd $(AREA_DETECTOR)/ADApp/Db
dbLoadRecords
; for example, dbLoadRecords("$(IOCADMIN)/db/iocAdminSoft.db", "IOC=SIOC:$(AREA):$(IOC_SUFF)")
dbLoadRecords
; these could be elements that were not added to the app's Makefile using DB_INSTALLS
cram lint
, run make clean
followed by make
and then run cram lint
.
You should see some thing like this
[mshankar@lcls-dev2 ProfileMonitorAD-R1-0-2]$ cram lint
Linting IOC iocBoot/sioc-b34-pm02
Linting IOC iocBoot/sioc-li20-pm20
iocBoot/sioc-b34-pm02/st.cmd:125 Missing file db/iocAdminSoft.db in ${TOP}; perhaps you...
iocBoot/sioc-b34-pm02/st.cmd:147 Add DB_INSTALLS += $(AREA_DETECTOR)/ADApp/Db/ADBase.te...
Fix these errors as appropriate and then run make clean
followed by make
followed by cram lint
.
msi
from EPICS base and not anywhere else.
That is, change references to msi
with IOC Makefiles and point it to ${EPICS_BASE_RELEASE}/bin/${EPICS_HOST_ARCH}/msi
.
make
and confirm that you are able to build your IOC app with these changes.
[mshankar@lcls-dev2 MAIN_TRUNK]$ cvs add .cram
[mshankar@lcls-dev2 MAIN_TRUNK]$ cvs add .cram/packageinfo
[mshankar@lcls-dev2 MAIN_TRUNK]$ cvs commit
cram
to deploy your IOC package.cram
eco
and cd
into it.
[mshankar@lcls-dev2 test]$ eco
Enter name of module/package to checkout: MatlabSupport
Enter name of tag or [RETURN] to use HEAD>MatlabSupport-R3-2-0-0
Using MatlabSupport-R3-2-0-0. The name of the directory will be ...
...
[mshankar@lcls-dev2 test]$ cd MatlabSupport/MatlabSupport-R3-2-0-0/
[mshankar@lcls-dev2 MatlabSupport-R3-2-0-0]$
current
and the iocSpecificRelease
softlinks) has been set up correctly, you should be able to run cram ls
from within your tagged release folder.
This should get a list of the current releases for your software package.
[mshankar@lcls-dev2 MatlabSupport-R3-2-0-0]$ cram ls
Current versions on facility: LCLS
Current master release => MatlabSupport-R3-2-0-0
IOC: sioc-sys0-ml00 => MatlabSupport-R3-2-0-0
...
make
.
If your IOC software package has been currently set up, the make
should complete successfully.
cram push
to all facilities.
[mshankar@lcls-dev2 MatlabSupport-R3-2-0-0]$ cram push
Pushed release MatlabSupport-R3-2-0-0 to LCLS
...
If you are doing this for the first time, make sure that the new version of the software package made it to the iocTop
across all facilities.cram upgrade
. You will need to specify the facility and the IOC and the release.
...MatlabSupport-R3-2-0-0]$ cram upgrade -f TestFac -i sioc-sys6-ml00 MatlabSupport-R3-2-0-0
...MatlabSupport-R3-2-0-0]
cram ls
again.-i
argument. For example, cram upgrade -f TestFac -i sioc-sys6-ml00,sioc-sys6-ml01 MatlabSupport-R3-2-0-0
-i ALL
. For example, cram upgrade -f TestFac -i ALL MatlabSupport-R3-2-0-0
-f ALL
. For example, cram upgrade -f ALL -i ALL MatlabSupport-R3-2-0-0
cram
uses the same approach used by HLA applications. Therefore, the preparation for HLA applications is straightforward.CVS
.eco
.${PHYSICS_TOP}
that points to the release within the release
folder.
[mshankar@lcls-dev2 ~]$ cd $PHYSICS_TOP
[mshankar@lcls-dev2 physics]$ ls -ltrd archiveviewer
lrwxr-xr-x 1 mshankar root 43 Nov 4 10:41 archiveviewer -> release/ArchiveViewer-R1-2-11/
${PHYSICS_TOP}/release
of each facility, create a packageName
folder (if it does not exist) and move the existing releases for the software package to the packageName
folder.
[mshankar@lcls-dev2 ~]$ cd ${PHYSICS_TOP}/release
[mshankar@lcls-dev2 release]$ mkdir archiveviewer
[mshankar@lcls-dev2 release]$ mv ArchiveViewer* archiveviewer
${PHYSICS_TOP}
to point to the current production release within the new release/packageName
folder.
Note this link will be broken because of the mv
in the previous step.
[mshankar@lcls-dev2 ~]$ cd $PHYSICS_TOP
[mshankar@lcls-dev2 physics]$ rm archiveviewer
rm: remove symbolic link `archiveviewer'? y
[mshankar@lcls-dev2 physics]$ ln -s release/archiveviewer/ArchiveViewer-R1-2-11 archiveviewer
[mshankar@lcls-dev2 physics]$ ls -ltra
cram
.cram
uses the same approach used by HLA applications. As long as you can build your application using ant
, you should be good to go.
However, there are a couple of steps.
Do these steps and commit into CVS before tagging your release.
eco
and cd
into it.
[mshankar@lcls-dev2 test]$ eco
Enter name of module/package to checkout: archiveviewer
Enter name of tag or [RETURN] to use HEAD>
Using MAIN_TRUNK. The name of the directory will be 'MAIN TRUNK'.
...
[mshankar@lcls-dev2 test]$ cd archiveviewer/MAIN_TRUNK/
[mshankar@lcls-dev2 MAIN_TRUNK]$
cram describe
.
This creates a .cram
folder with the package information in packageinfo
.
This allows you to skip the name and type command line parameters when using cram
.
[mshankar@lcls-dev2 MAIN_TRUNK]$ cram describe
ant
and make sure the application builds correctly.[mshankar@lcls-dev2 MAIN_TRUNK]$ cvs add .cram
[mshankar@lcls-dev2 MAIN_TRUNK]$ cvs add .cram/packageinfo
[mshankar@lcls-dev2 MAIN_TRUNK]$ cvs commit
jars
that are outside the package and include those jars
within the package.
This is not strictly necessary but will minimize migration headaches.
cram
eco
and cd
into it.
[mshankar@lcls-dev2 test]$ eco
Enter name of module/package to checkout: archiveviewer
Enter name of tag or [RETURN] to use HEAD>ArchiveViewer-R1-2-11
Using ArchiveViewer-R1-2-11. The name of the directory will be ...
...
[mshankar@lcls-dev2 test]$ cd archiveviewer/ArchiveViewer-R1-2-11/
[mshankar@lcls-dev2 ArchiveViewer-R1-2-11]$
cram ls
from within your tagged release folder.
This should get a list of the current releases for your software package.
[mshankar@lcls-dev2 ArchiveViewer-R1-2-11]$ cram ls
Current version on facility: LCLS => ArchiveViewer-R1-2-11
Current version on facility: FACET => ArchiveViewer-R1-2-11
Current version on facility: TestFac => ArchiveViewer-R1-2-11
Current version on facility: Dev => ArchiveViewer-R1-2-11
[mshankar@lcls-dev2 ArchiveViewer-R1-2-11]$
ant
.
If your HLA software package has been currently set up, the ant
should complete successfully.
cram push
to all facilities.
[mshankar@lcls-dev2 ArchiveViewer-R1-2-11]$ cram push
Pushed release ArchiveViewer-R1-2-11 to LCLS
...
If you are doing this for the first time, make sure that the new version of the software package made it to the ${PHYSICS_TOP}/release
across all facilities.cram upgrade
. You will need to specify the facility and the IOC and the release.
...ArchiveViewer-R1-2-11]$ cram upgrade -f LCLS ArchiveViewer-R1-2-11
...ArchiveViewer-R1-2-11]
cram ls
again.-f
argument. For example, cram upgrade -f TestFac,LCLS ArchiveViewer-R1-2-11
-f ALL
. For example, cram upgrade -f ALL ArchiveViewer-R1-2-11