NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Software > SoftwareDocs > BosDocs
   Changes | Index | Contents | Search | Statistics | Go

Business Office System Documentation



Project

Please refer to the BusinessOfficeSystem project page for non-software specific information on the Business Office System (BOS).

Design

During the initial design phase of the BOS project an analysis of requirements was done to give us a stepping stone for our choice of design pattern (implementation technology), classes, and database schema. The results were the completion of the diagram below.

BosRequirements.jpg

Shared Design Patterns

Throughout the BOS, common patterns were used for the relationships between models, controllers, templates, widgets, etc. Much of what was done can also be seen in the TurboGears book and documentation. Here is an attempt to elucidate these patterns through an example of the dreded 'foobar' object.

User Management Design

Part of the Business Office System (BOS), called the User Management module (or BOS-UM), has been created to manage information (i.e. mailing addresses, phone numbers, employee offices, etc.) for NRAO employees, users, and affiliate organizations. Users of the BOS are members of the NRAO business offices, other NRAO employees, and external customers. These users are split up into two user groups, administrators and users. The administrators are limited to a few NRAO employees in the business offices, Computing divisions and the Green Bank Software Development division. Members of the administrator group have complete access the BOS user management module, while members of the users group can only access their own information.

Database Schema

The database schema is based upon the current NRAO-wide Users Database. It contains all of the information contained in the original NRAO-wide Users Database as well as additional information which will expand the potential uses of the database. Through collaboration with the e2e division, we have been able to fit the requirements for the BOS into a new proposed NRAO-wide Users Database design, shown below. This design allows for multiple mailing addresses, phone numbers, and email addresses to reference a single record in the person and organization tables. We chose the name of the organization table (rather than the current term, institution) to encompass companies, primary schools, elementary schools, and high schools in addition to universities. The userAuthentication table serves as a place holder for user accounts, which are technology dependent.

The tables in the proposed schema above cover most of the functionality required for the BOS-UM, however a few additional tables are needed. These tables, shown below, contain information on the location of NRAO employees and are also used in the BOS Reservation Management module.

DB_Design-UM.jpg

Database Overlap with Other Systems

The intent of an NRAO-wide User Database is to create a central repository which will contain contact information for NRAO facility users. In reality, the NRAO deals with many more people than just users of our telescopes. For example, the NRAO-wide Users Database will be used by the BOS to store contact information for all types of visitors to our facilities - not just observers who will use our telescopes. Other software products will also make use of the NRAO-wide Users Database. The Dynamic Scheduling Software is such a product. For each GBT observer, the DSS will need to keep track of prioritized phone lists that are only validate for a specified date range. For details on how Dynamic Scheduling makes use of the NRAO-wide Users Database, take a look at the DSSSoftwareSuite.

Models

Models_UM_UML.jpg

Controllers

Controllers_UM_UML.jpg

Reservations Management Design

Database Design

DB_Design_RM.jpg

Models

Models_RM_UML.jpg

Controllers

Controllers_RM_UML.jpg

Transactions Management Design

Database Migration

Development Environment

Other things to cover.

Deployment

The live BOS server runs on the Green Bank web server gollum. Since gollum is exposed to the outside world, security is very tight on this machine. It does not connect to any NFS mounts, although the BOS installation directories are accessible from other computers via /home/bos.nrao.edu/active. You must use the linux user bos to write to this directory. Due to the security restrictions on gollum, a local python installation must be used to run the BOS server (/home/bos.nrao.edu/active/smeagol). Source /home/bos.nrao.edu/active/smeagol/BosPython.bash or BosPython.csh to use smeagol.

Installing a new release

Perform the following steps to install a new release.
  1. cd /home/bos/integration/bos Note: where integration is the version to be tagged
  2. Verify that there are no locally modified files in bos:
  3. Tag the bos version
  4. su bos
  5. cd /home/bos.nrao.edu/active/bos
  6. mkdir BOSRELEASE (BOSRELEASE = 1.0 in this case)
  7. cd BOSRELEASE
  8. First type $ export CVSROOT=/home/gbt2/repository
  9. For creating a new integration (using 'trunk'): $ cvs checkout -P bos
  10. For creating a new release (using a 'branch'): cvs checkout -P -r release_1_0_patches bos
  11. cd bos/BOS
  12. cp ../release/bos/BOS/prod.cfg .
  13. cp ../release/bos/BOS/accountReconciler.cfg .
  14. edit prod.cfg to specify the database connection by setting the sqlalchemy.dburi
  15. cd /home/bos.nrao.edu/active/bos
  16. rm release
  17. ln -s BOSRELEASE release
  18. Restart the bos server

Patching a release

  1. su bos
  2. cd /home/bos.nrao.edu/active/bos/release
  3. cp the files you've updated from your sandbox to their corresponding directories.
  4. cvs commit the files you've updated
  5. Restart the bos server
  6. Go test it at bos.nrao.edu!

Using Apache as the web server

There are several ways to deploy BOS behind an apache web server:

Each has advantages and drawbacks. mod_rewrite and mod_proxy both work by having Apache forward requests to the CherryPy server port. These two methods are easy to set up and apparently are fast enough for production purposes. Apache can be set up to handle all static requests (such as requests for file downloads, etc.) leaving CherryPy to handle only the dynamic content. The drawbacks to these two approaches are:

mod_python provides a more appealing way to deploy BOS because it is slightly faster than the other two methods, and Apache starts/re-starts the BOS process. The disadvantages are that Apache runs multiple processes (of BOS?), something that probably does not affect BOS but is good to know, and that it is harder to configure and get running right (Ramm, 2007, pg 363).

mod_python attempt

The BOS team chose the mod_python option, and indeed it has proven to be difficult to set up so far. The directions in the Ramm book are obsolete, so we chose to use the directions on the TurbogGears web site. We encounterded problems immediately, even with a simple, do-nothing TurboGears application. Further troubleshooting and web searches revealed that the problem was that Python and Apache are using two different versions of Expat. Apache is using 1.95.7 and python is using 1.95.8. This causes the mod_python session to terminate with a segmentation fault (sig 11). This is where things stand as of 06/05/07.

Our options at present are:

  1. Upgrade the system Expat on colossus to match the one used by the Python in /opt/services/python. This is unfortunately a much more involved upgrade than one would think, because the new version of Expat requires a newer version of the C library. This is a core library used by just about everything else, which means the entire system must be upgraded. I've offered to allow goauld to be upgraded (to RHE5) but Chris prefers that Wolfgang do these things and Wolfgang is out of the country for the next 3 weeks.
  2. "Downgrade" python to compile with the 1.95.7 version of Expat. This would require investigating how to reconfigure the build for the Python installation on colossus. This may be our best option if we wish to proceed with mod_python
  3. Use one of the other methods.

After going with option 2 we ran into other issues with loading anything in the static directory where all our JavaScript, CSS, and Images are located in the source tree. Also, the server seemed to be very slow for unknown reasons. Online research (TG Web site) indicated that mod_python was not the recommended way to go due to the performance issues that we seemed to be experiencing. At this time we decide to attempt option 3 with mod_proxy.

mod_proxy attempt

<VirtualHost *>
    AddDefaultCharset utf-8

    ServerAdmin you@yoursite.com
    ServerName www.yoursite.com
    ProxyPreserveHost On

    DocumentRoot /export/raid/www/nrao

    # this prevents the follow URL path from being proxied
#    ProxyPass /static !

    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
</VirtualHost>

How to start the test server on Colossus?

How to stop the test server on Colossus?

Archived Documents

Topic BosDocs . { Edit | Attach | Ref-By | Printable | Diffs | r1.20 | > | r1.19 | > | r1.18 | More }
Revision r1.20 - 01 Oct 2007 - 14:48 GMT - MikeMcCarty
Parents: WebHome > SoftwareDocs
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.