LON-CAPA Packaging and Filesystem Management
Functional Model Description (Scott Harrison, April 2000)
- Synopsis
- Summary of Data Store Objects (e.g. CVS, RPM, LCIC)
- Summary of Processes (e.g. making a CD image, upgrading a system, altering package composition)
- Summary of Actor Objects (e.g. cron jobs, programmers, head packaging
developer)
- Functional Model Diagram
- Description of the Functional Model Diagram
- Data Store Objects
- Processes
- Actor Objects
- Frequently Asked Questions
1. Synopsis
Up to this point, dozens of scripts have been written
to automate various elements of the LON-CAPA installation, upgrade, and software development process. A number of significant issues
relate to this effort. Security on the system is largely a matter of limiting
unnecessary network services, monitoring the filesystem of LON-CAPA
servers to make full account for the presence of every file on the system,
and securely communicating potential problems to system administrators of a given
LON-CAPA server machine.
This document is the functional model description which describes the computations
and their expected results necessary to manage packaging and filesystem management
for LON-CAPA both now and in the future in a manner that is synchronous
with software development, installations, and upgrades. Promulgation of coding
changes, version control, and maintaining a handle on security and network optimization
issues (such as introducing SAMBA and NetaTalk into the network architecture) have
been some of the reasons for introducing a more strongly defined characterization
of all of these processes involved with LON-CAPA software packaging and file system
management.
2. Summary of Data Store Objects
- CVS
Concurrent Versions System. A central file repository is set up for LON-CAPA software development.
- RPM
Red Hat Package Manager. A system to manage software applications (packages). This system tracks package
interdependencies, configuration files, and file alterations. The RPM packaging system can (and probably should) reside on a different
computer than the central file repository computer. The RPM packaging system should probably be on a computer
accessible to the
- LCIC
LON-CAPA Integrity Check. A script-based system which analyzes a computer to determine the RPM composition
(missing or contrastingly extraneous RPMs), extraneous files which do not belong to any RPM, and RPM file
alterations.
3. Summary of Processes
- Non-automated processes
- implements change
Programmer creates a successful change to the LON-CAPA software. To carry out this step, the programmer
must enter in bug-free code to the CVS file repository. The programmer must also inform the packaging developer
as to where and how the files need to be placed and configured on LON-CAPA computer systems.
- alter package composition
The packaging developer may choose to add/remove different sets of entire RPM packages from LON-CAPA computer
systems. The packaging developer may also choose to modify the file composition and dependency details of individual
RPM packages. There are over 700 potential RedHat packages to select from on RedHat 6.1 disks. Selecting an appropriate
mix of RPMs can GREATLY improve security on LON-CAPA systems (by, for instance, removing unnecessary services) and is
considered the general start- and end- point of LON-CAPA security.
- change process programs
The various automated processes are to be written and modified by the packaging developer. These processes should
reside on the packaging development system (RPM packaging system) as well the CVS file repository.
- upgrade
The packaging developer chooses when to upgrade the packaging system so that the packaging system upgrade passes
along to other computers in the software development cluster.
- Automated processes
- LON_CAPA_update_RPM_build_tree
Retrieves files out of the central software development CVS file repository. Builds any customized packages associated
with the LON-CAPA system.
- LON_CAPA_make_CD_image
Compiles a RedHat installation/upgrade CD image based on the current LON-CAPA RPM packaging descriptions.
- LON_CAPA_post_CD_image
Make CD image available for other LON-CAPA development/run-time systems to upgrade from.
- LON_CAPA_upgrade_sys
Check to see if a general LON-CAPA RedHat system upgrade should be performed based on the version available from the packaging
system. Also, monitor current status of system with LCIC (perhaps a "corrupt" system should be re-upgraded/re-installed). If upgrade
should be performed, then perform a network install/upgrade while preserving all LON-CAPA configuration files.
4. Summary of Actor Objects
- Head Packaging Developer
Responsible for maintaining and writing scripts which automate the packaging and monitoring of distributed LON-CAPA systems. Also
responsible for altering overall package composition of LON-CAPA systems.
- Programmer
Responsible for introducing software improvements to the LON-CAPA system itself. Submits software additions and modifications to
the central CVS file repository.
- Cron
Cron jobs issue scheduled commands to facilitate the independent distributed processing of the various scripts associated with
LON-CAPA Packaging and Filesystem Management.
5. Functional Model Diagram
6. Description of the Functional Model Diagram
I will now describe a semi-chronological viewpoint of how all the different processes take place
so as to better understand both the specifics of the functional model, as well as the pertinent
dynamical and object-oriented characteristics of the algorithm.
Every week on Thursday at 3 in the morning, a cron job associated with the RPM packaging system on
the main packaging computer updates the build tree of all LON-CAPA source RPMs based on files in the central
CVS file repository. It does this by initiating the process LON_CAPA_update_RPM_build_tree. This process
requests and receives files from the central CVS file repository, and updates all the source RPM file trees. RPM packages
are then "bundled" by issuing build commands to the "Red Hat Package Manager" (rpm -b ...).
The LON_CAPA_update_RPM_build_tree process calls the LON_CAPA_make_CD_image process which writes a
CD image into a single file on the main packaging system. This is followed by the process LON_CAPA_post_CD_image
which mounts and posts the CD image file onto a web accessible location.
The LON_CAPA_upgrade_sys process is launched by a cron job specific to every individual
computer present in the software development cluster. Each individual computer checks the main packaging computer to see
if a system upgrade is needed. System upgrade information is passed to the LCIC on each specific computer (LON-CAPA
Integrity Checker) so that integrity checking is done as a function of the most recent system upgrade.
Finally, on Sunday at 3 in the morning, a cron job associated with each computer launches the LCIC integrity checker
system which resyncs itself based on the RPMs and files present on the system as well as information pertaining to
the expected status of the system (in terms of upgrade, RPM composition, etc). The results of the LCIC integrity checker
"re-syncing" are posted under a password controlled directory.
7. Frequently Asked Questions
- What does LON-CAPA stand for?
The LearningOnline Network with a Computer-Assisted Personalized Approach
- What is the general structure of the CVS repository?
These are the current directories:
loncom - server configuration and application files associated with LON-CAPA library and access servers
lonline - lecture online
CAPA - files associated with CAPA (homework processing, grading, homework generating, exam and quiz administration)
doc - documentation
modules - custom built software modules meant for use with the LON-CAPA project
rat - the "RAT"; resource assembly tool
packaging - files (including this one) specific to packaging and filesystem management of LON-CAPA
- How does a programmer set himself up to use CVS?
you will need to have the CVSROOT enviroment variable set to
:pserver:yourname@zaphod.lite.msu.edu:/home/cvs
To do this if you are using csh or tcsh put in your .login:
setenv CVSROOT :pserver:yourname@zaphod.lite.msu.edu:/home/cvs
For bash put this in .bash_profile
export CVSROOT=:pserver:yourname@zaphod.lite.msu.edu:/home/cvs
You can add the "cvs login" command to your .login/.bash_profile if you wish to make this simple.
And you can add "cvs logout" to your .logout/.bash_logout so you rember to logout.
To use CVS, you must first login (cvs login) and enter in your zaphod password.
To leave CVS, you must logout (cvs logout).
- How does a programmer retrieve files from the CVS repository for the first time?
cvs checkout [resourcename]
[resourcename] is one of the directories above (loncom, rat, doc, and so on)
- How does a programmer update his files from the CVS repository?
(In other words, CVS server ----to----your---->> client computer.)
cvs update -d [resourcename]
[resourcename] is one of the directories above (loncom, rat, doc, and so on)
- How does a programmer send his changes to the central CVS repository?
(In other words, client computer ----to----our---->> CVS server.)
cvs commit [resourcename]
[resourcename] is one of the directories above (loncom, rat, doc, and so on)
- How does a programmer add or remove files from the central CVS repository?
Note: this is different from "updating" or "committing" changes. This is not the alteration
of existing files. This is the ADDITION or REMOVAL of files.
Within "the" directory, use these two commands to add a file:
cvs add [filename]; cvs commit
Within "the" directory, use these two commands to remove a file:
cvs remove [filename]; cvs commit
- How does a programmer add or remove directories from the central CVS repository?
Within the upper directory, use these two commands to add a directory:
cvs add [directoryname]; cvs commit
Within "the" directory, use these two commands to remove a directory:
cvs remove [directoryname]; cvs commit
There is a slight catch that you cannot directly "add" a new major directory like
loncom, lonline, rat, doc, and so on. You must first "cvs add" it as a subdirectory, then
move that subdirectory to the top directory structure and "cvs commit".
Better yet, you can cvs import your new directory into the top level area of the CVS repository.
- How does a programmer "inform" the packaging developer of changes to LON-CAPA system file composition?
By talking to the packaging developer in person.
By making well-formatted changes to the packaging/file_map.txt file in the CVS repository. See below
for more information on how to format the packaging/file_map.txt file.
- What does "run any process" mean in the functional model?
Most processes are meant to run automatically and are invoked by cron jobs on various machines.
It may be the case that, for instance, the processes need to be manually invoked so as to prepare
a specific CD release.
- Where are the automated processes located?
In the directory /usr/local/bin.
By typing ls /usr/local/bin/LON_CAPA_*, you can view all the automated LON-CAPA processes associated with the computer systems.
- Where are the cron jobs located? What are their names and how reliable are they?
On every LON-CAPA computer there is a file /etc/cron.d/LON_CAPA_filesystem which launches standard cron jobs.
On the LON-CAPA main packaging computer there is a file /etc/cron.d/LON_CAPA_packager which launches cron jobs specific to the
main packaging computer.
On LON-CAPA software development computers, there is a file /etc/cron.d/LON_CAPA_upgrader which upgrades all computers in the
LON-CAPA software development cluster.
- Can automated processes be run manually? On the packaging computer? On other LON-CAPA computers?
Yes. To correctly manually run an automated process, look to see how the process is invoked in the /etc/cron.d directory.
- What are the specifics associated with the RPM packaging system on the main packaging computer?
The RPM packaging system on the main packaging computer introduces the following differences to the main packaging computer compared to
other computers in the software development cluster:
- Presence of RPM build tree
- Presence of CD image
- More automated processes present on system (LON_CAPA_update_RPM_build_tree, LON_CAPA_make_CD_image, LON_CAPA_post_CD_image)
- What are the specifics associated with the process LON_CAPA_update_RPM_build_tree?
This process checkouts LON-CAPA directories and files. This process reads from the packaging/file_map.txt.
This process reads RPM .spec template files to set up the two LON-CAPA RPMs (LON-CAPA-base and LON-CAPA-auxiliary).
These updated RPMs are placed into a pool of RPMs from which to generate the customized RedHat installation/upgrade CD.
A 'comps' file is generated to customize the grouping of packages on the CD image. The CD image is written and made accessible
on the web.
- What are the specifics associated with the writing and web posting of the LON-CAPA system CD image on the main packaging computer?
There are a number of shell commands which need to be launched. (Details coming soon in this document.)
- What are the specifics associated with the process LON_CAPA_make_CD_image?
There are a number of shell commands which need to be launched. (Details coming soon in this document.)
- How are upgrades performed on the packaging computer? Is there any way to upgrade/install LON-CAPA on a new machine?
Upgrades are performed only based on package composition. New machines can be upgraded via network install or CD install. (More details coming soon.)
- What are the specifics associated with the process LON_CAPA_post_CD_image?
There are a number of shell commands which need to be launched. (Details coming soon in this document.)
- What are the specifics associated with the process LON_CAPA_upgrade_sys?
LON_CAPA_upgrade_sys does an automated network upgrade of any out-of-date packages based on the main packaging computer.
LON_CAPA_upgrade_sys initializes and invokes the LCIC (integrity checker) based on current upgrade information.
- What output from the LCIC (integrity checker) warrants taking corrective action?
Currently, the output from the LCIC consists of two files, TOTAL_FILE.txt and SUMMARY_FILE.txt. There are no immediate plans for
automating any form of response to this output. This does provide information as to whether critical system binaries or configuration
files are being tampered with. Perhaps the SUMMARY_FILE.txt should be e-mailed weekly to a system administrator at the responsible
institution.
- What is the correct format for the packaging/file_map.txt file?
Every line refers to a file or directory to install/upgrade on a LON-CAPA system. There are six fields to each line which are tab-separated.
[computer-type]
[file location on CVS repository]
[ultimate location on LON-CAPA system]
[package name]
[configuration settings that need to be saved?]
[description of file and what it does]
- What controls version naming in terms of system upgrades?
This information is present in packaging/version.txt. This file consists of three tab-separated fields (version number, release number, and version
name). The release number is automatically incremented each week as a function of LON_CAPA_post_CD_image. The version number and release numbers are used
to label the LON-CAPA-base and LON-CAPA-auxiliary RPMs as well as the customized RedHat CD release.