Differences between revisions 4 and 5
Revision 4 as of 2007-08-07 18:04:10
Size: 10136
Comment:
Revision 5 as of 2007-09-24 15:25:06
Size: 10677
Comment:
Deletions are marked like this. Additions are marked like this.
Line 296: Line 296:


== Update the fm_ist_cus_copy database at MPE with the current content of the operation database at FN ==

{{{
cd ~/exportCus
mkdir CALU
rm CALU/*
rm cus.defs

cus -export cus.defs
cd CALU
cus -listcaltables | & gawk 'length() == 0 {next}; found > 0 {print $1}; /A list of calibration tables for this registry:/ {found=1}' | xargs -i cus -downloadcal "{}" "{}"
cd ..
ccm -listconfig=active | gawk '{print $5}' | xargs -i zip -rv "{}".zip cus.defs CALU
ccm -listmib=db ; ccm -listmodel=active ; ccm -listconfig=active
}}}


<!> /!\ All the procedures below are defined for the pacs account on the host hpacsegse unless stated different. <!> /!\


TableOfContents(2)

Standard Procedures

A new MIB (combination) is available and ready to be used

The MIB to be ingested can be specified in two different ways, either by the CVS MibTags or by the database MibLabels.

ccm -loadmib PACS_MIB_TAG EGSE_MIB_TAG CDMSSIM_MIB_TAG

or

ccm -loadmib=MIB_LABEL

The MIB loading does not affect any ongoing operation. It can be executed at any time.

To get listings of MibLabels of already loaded MIBs or available CVS MibTags follow this [#MibListing link].

A new (modifiable) instrumentModel shall be created using new MIB definition

The MIB must be already ingested into the database using the above procedure.

Before going to more detail here is the way to go on in almost all cases. Usually the last used CUS definitions will be copied to the next (modifiable) instrumentModel. In that case use the

ccm -listconfig=active

command to get the current missionConfigurationLabel. In the command

ccm -createmodel -usemib=MIB_LABEL -usecus=cvs=CvsTagName -cvscomment=comment

replace MIB_LABEL with the new Miblabel and CvsTagName with the missionConfigurationLabel returned by the previous command.

Gratulation, you created a new (modifiable) instrumentModel.

In case you want to select a different source for your CUS definitions for the new (modifiable) instrumentModel two command options are available.

  • Using an existing version from the CUS CVS repository specified by a CVS tag name which is formed like a MissionConfigurationLabel.

This is the way to select CUS definitions belonging to a specific missionConfiguration.

  •  ccm -createmodel -usemib=MIB_LABEL -usecus=cvs=CvsTagName -cvscomment=comment
    Please see [#missionConfListing this section] to get a list of available missionConfigurations.
  • Using the current CUS definitions from an existing (modifiable) instrumentModel in the database specified by an InstrumentModelLabel name.

     ccm -createmodel -usemib=MIB_LABEL -usecus=im=InstrumentModelLabel -cvscomment=comment
    Please see [#instModelListing this section] to get a list of available instrumentModels.

In case there is already an instrumentModel using the same MibLabel you must use the  -force  switch of the ccm command to get a new version.

A dialog window will pop-up to enter a CVS comment if none was entered at the command line.

Each of these options will create an instrumentModel, load it with the specified MIB, load the requested CUS definitions (also updating the CVS repository) and create the first missionConfiguration for this new instrumentModel. Finally the property file will be updated with the new instrumentModel and missionConfiguration and the CcsHandler will be restarted.

<!> Note: The CUS editor "cusgui" must be restarted to view (and edit) the new modifiable instrumentModel.

Editing CUS definitions

There are two ways to create or modify CUS definitions like observing modes, building blocks, procedures, calibration tables.

  • The more intuitive way is to use the CUS GUI application
    cusgui
  • Another way is to import text files holding the new/updated CUS definitions.
    cus -f -m "your comment" -import yourFileNames

Publish CUS modifications for the current instrumentModel

Whenever you want to make the CUS modification edited with the CUS editor available for commanding you must commit your changes to the database to update the instrumentModel and you must use the following command to create a new missionConfiguration and make it available.

ccm -updatecus -cvscomment=comment

A dialog window will pop-up to enter a CVS comment if none was entered at the command line.

Creating a new set of TCL templates files for the CCS

  • Case 1: No change in the call of the observing modes, no new CCS templates files, no deleted CCS template files, no change in the observing mode parameters: Then the script file describing the CCS template files must not be changed just take the previous one.
  • Case 2: Otherwise the previous script file needs some editing.

All script files shall following the naming convention ~/CCStemplates/template-YYYY-MM-DD-HH:MM.script to make it easy to detect the most recent one.

Copy the previous script file to a temporary file named tempScript. In case 2) open the tempScript file with a text editor of your choice to make the necessary changes it.

#
# case 1
#
cp ~/CCStemplates/template-YYYY-MM-DD-HH:MM.script ~/CCStemplates/tempScript
#
# case 2
#
cp ~/CCStemplates/template-YYYY-MM-DD-HH:MM.script ~/CCStemplates/tempScript
xemacs ~/CCStemplates/tempScript

The script file consists of single records holding ccshandler commands to create the template TCL scripts.

  • ccshandler -template [-file=fileName] obsMode paramList [-file=fileName]

Command options:

  • -template: mandatory option to activate template generator mode
  • -file: specifies the file name to store the resulting TCL procedure template. If the -file option is missing the template will be printed to standard output.
  • obsMode: name of the observing mode to be called
  • paramList: parameters for the observing mode. A parameter specification consists of the parameter name followed by an equal sign (=) followed by the parameter value followed by a semicolon (;). More than one parameter specifications must be concatenated without white space in between.

Please note that the "obsMode" must be followed by a "paramList". If there are no observation parameters specify an empty list by setting a single semicolon.

To create the templates use the following procedure

cd ~/CCStemplates

set timeStamp=`date "+%F-%H:%M"`
mkdir templates-$timeStamp
cd templates-$timeStamp
mv ../tempScript ../template-${timeStamp}.script
source ../template-${timeStamp}.script |& tee ../templateGeneration-${timeStamp}.log
cd ..
#
# checks
#
# no Exceptions shall be raised
#
grep Exception templateGeneration-${timeStamp}.log
#
# a template file size of 0 indicates a failure, those files will be removed
#
find templates-$timeStamp -size 0
find templates-$timeStamp -size 0 | xargs rm -v
#
# ZIP creation
#
cd templates-$timeStamp
zip -v ~/CCStemplates/PACS_CCS_templates-${timeStamp}.zip *
echo "The CCS (valid) template files are stored in the file"
echo ~/CCStemplates/PACS_CCS_templates-${timeStamp}.zip

Please check the output for any listed Exceptions or files with a size of 0 bytes. Empty template files will be removed before the ZIP file is created.

The script echoes the name of the ZIP file holding all template files for delivery.

Monitoring CcsHandler and TmIngestion

To monitor and control both TmIngestion and CcsHandler convinience procedures exist.

CcsHandler start       # starting CcsHandler, it will run in the background
CcsHandler stop        # stopping CcsHandler
CcsHandler status      # showing the output of "ps -lf" of CcsHandler (if it runs)
CcsHandler log         # showing the tail of the CcsHandler log file and continue to monitor it

TmIngestion start       # starting TmIngestion, it will run in the background
TmIngestion stop        # stopping TmIngestion
TmIngestion status      # showing the output of "ps -lf" of TmIngestion (if it runs)
TmIngestion log         # showing the tail of the TmIngestion log file and continue to monitor it

List of MIBs

Anchor(MibListing)

The command

ccm -listmib=database

shows all MIBs already loaded into the database.

The command

ccm -listmibs=cvs
}}
shows all MIB tag names available in the Leuven CVS repository.

The command
{{{
ccm -listmib

will give you both listings.

List of (modifiable) instrumentModels

Anchor(instModelListing)

The command

ccm -listmodel=active

shows the active (modifiable) instrumentModel as set by a property. Starting a CUS editor will work with this instrumentModel.

The command

ccm -listmodel=database

shows all available (modifiable) instrumentModels known by the database.

The command

ccm -listmodel

will give you both listings.

List of missionConfigurations ( = CVS tag names)

Anchor(missionConfListing)

The command

ccm -listconfig=active

shows the active missionConfiguration as set by a property. The running CCsHandler is working with this missionConfiguration.

The command

ccm -listconfig=database

shows all available missionConfigurations known by the database.

The command

ccm -listconfig

will give you both listings.

Recovery Procedures

Initial loading of the empty database

Make sure the database is empty by issuing following commands using the <!> dbsa account

echo yes | db_admin -c pacs_fm_ist_fn1@hpacsegse
echo yes | db_admin -u pacs_fm_ist_fn1@hpacsegse
db_admin -i pacs_fm_ist_fn1@hpacsegse

Switch again to the <!> pacs account.

Load the MIB again.

ccm -loadmib PACS_MIB_N_8_16 EGSE_MIB_0_20 CDMSSIM_MIB_0_4

Initialize both the database and the CVS repository with an initial set of CUS definitions

initCVSrepositoryAndDB ~/procedures/FM_ILT_MC_V4-3_PR8-15_E0-20_C0-4.tar.gz 
> 1
> Initial loading of the CUS definitions using the missionConfiguration FM_ILT_MC_V4-3_PR8-15_E0-20_C0-4.tar.gz of the pacs_fm_ilt_3@pacs5 database

cd /home/pacs/CCStemplates mkdir templates cd templates source ../CUS_Shell_Scripts_FM_IST_20070803.script |& tee ../templateGeneration.log cd .. # checks grep Exception templateGeneration.log ls templates | wc -l ; wc -l CUS_Shell_Scripts_FM_IST_20070803.script find templates/ -size 0 find templates/ -size 0 | xargs rm -v

== Update the fm_ist_cus_copy database at MPE with the current content of the operation database at FN ==

cd ~/exportCus
mkdir CALU
rm CALU/*
rm cus.defs

cus -export cus.defs
cd CALU
cus -listcaltables | & gawk 'length() == 0 {next}; found > 0 {print $1}; /A list of calibration tables for this registry:/ {found=1}' | xargs -i cus -downloadcal "{}" "{}"
cd ..
ccm -listconfig=active | gawk '{print $5}' | xargs -i zip -rv "{}".zip cus.defs CALU
ccm -listmib=db ; ccm -listmodel=active ; ccm -listconfig=active

Herschel: PACS/FM_IST_Procedures/CcmCus (last edited 2009-07-15 14:32:37 by localhost)