[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Packaging VistA - GT.M directories



On Wed, Jul 11, 2012 at 5:53 PM, Bhaskar, K.S <ks.bhaskar@fisglobal.com> wrote:
Although GT.M is very flexible when it comes to configuration - it is all managed with environment variables - configuring directories one way vs. another can make it easier or harder to manage configurations.  Two points worth noting are:

  1. The GT.M compiler produces .o object code modules from .m source code modules.  Each object code module is specific to a GT.M version (or release - we use the terms interchangeably).  So, the same source code modules can produce different object modules.  Furthermore, GT.M produces different object modules for use in M mode (each character is one byte) and UTF-8 mode (each character is one or more bytes encoded in UTF-8).  Also, while database files can have formats that are compatible across GT.M versions, a database file is can be open only by processes of one GT.M version at one time.
  2. Users expect to have multiple GT.M versions installed and in use on a computer.  For example, one use case is rolling upgrades of GT.M releases.

While GT.M's environment variables accommodate just about any directory structure, for sanity, I recommend a GT.M working directory for each application environment.  Within that working directory is a subdirectory for routines (independent of GT.M release), and a subdirectory for each GT.M release to be used.  For example (the gtm script that comes with GT.M creates this structure by default):

$ tree -dL 1 myApp/
myApp/
├── r
├── V5.4-002B_x86_64
├── V5.5-000_x86
└── V5.5-000_x86_64

4 directories
$

As my laptop is 64-bits, I have separate subdirectories for 32- and 64-bit flavors of the same GT.M release, V5.5-000, so that I can run one or the other.  Routines source modules go in the r subdirectory.

The structure of each release specific directory is:

$ tree -d myApp/V5.5-000_x86
myApp/V5.5-000_x86
├── g
├── o
│   └── utf8
└── r

4 directories
$

The g subdirectory is where database related files go ("g" is "globals" in M parlance).  Object modules compiled in M mode go in the o subdirectory, and object modules compiled in UTF8 mode go in the o/utf8 subdirectory.  There is also an r subdirectory in the release specific subdirectory for routines that depend on a GT.M version.  (Since we try very hard to avoid regressions, the use case is where a routine is enhanced to take advantage of new functionality in a release.

In 32- and 64-bit releases of GT.M, object modules can be simple .o files in the o and o/utf8 subdirectories.  As 64-bit releases of GT.M support placing object modules in shared libraries created with ld (makes memory usage more efficient when there are thousands of processes executing the same routine), you can also create .so files and place them within the o and o/utf8 subdirectories on 64-bit platforms.

Sometimes, when packaging VistA, I have also used p subdirectories to parallel r subdirectories, at the myApp level as well as at the release specific level.  The idea is that routines generated when patching would go in the p subdirectories.

Regards
-- Bhaskar

-- 

 


Bhaskar,

Thanks for this very detail guidance.

Our first rough cut at the directory structure
for the VistA Debian package has been:


/var/lib/vista/
/var/lib/vista/r
/var/lib/vista/o
/var/lib/vista/g
/var/lib/vista/j
/var/lib/vista/logs
/var/lib/vista/inetd
/var/lib/vista/profile


The directories "j" and "logs" were added during the Code Convergence
conference call last Thursday, to accommodate for Journaling and Logs.

The inetd directory hosts two files with configuration for CPRS / xinetd.

The profile directory host an example profile file, that a user could copy
to set up the environment with the proper environment variables pointing
to the VistA instance.

If I'm following correctly, it seems that we should have in this path the
version name/number of the fis-gtm that was used to create the instance.

Maybe something like:

/var/lib/vista/V5.5-000_x86_64
/var/lib/vista/V5.5-000_x86_64/r
/var/lib/vista/V5.5-000_x86_64/o

/var/lib/vista/V5.5-000_x86_64/g
/var/lib/vista/V5.5-000_x86_64/j
/var/lib/vista/V5.5-000_x86_64/logs
/var/lib/vista/V5.5-000_x86_64/inetd
/var/lib/vista/V5.5-000_x86_64/profile


Would this make sense ?



Also, since you touched on utf8...

Currently we are enabling utf8 in the fis-gtm package by default.

Would that conflict with what VistA is expecting to find ?



      Thanks


            Luis



Reply to: