This is being replaced by a new system based on Python and PostgreSQL. See OdysseyApplications3 for details.
This is a system for creating web and command-line database applications in a consistent framework. It consists of the following pieces:
By far the most important package is the odyssey-2
package, which is described in PackageDocumentationOdyssey2.
The system consists of a "server" JVM that runs persistently on one machine, with "client" JVMs that run persistently on behalf of individual users on the various web servers. Additionally, there are "local" JVMs that run persistently under the identities of the individual users but otherwise are like the "client" JVMs.
By "persistently" we mean that the JVMs are started by a request, but continue to exist after that request has completed, and are re-used by future requests. However, they may be configured to terminate after a period of inactivity and will automatically be re-started by a future request. If a machine goes down, terminating one or more JVMs, no special harm will be done; the JVMs will simply restart as soon as a request comes in after the machine comes back up.
The automatic termination is handled by an instance of class WatchdogThread and is configured by including an invocation of the watchdog
method in the setup
method of the application instance. This is done in content.local
, content.client
, and content.server
, per region. OdysseyJavaCode has information concerning where to find the source code. Whenever the watchdog wakes up, it checks the set of requests active on the instance. If there are no active requests on two successive checks, it initiates termination of the server. The actual termination should be reliable, but if a request gets “stuck” somehow, then the watchdog will never observe the request set to be empty.
The "client" JVMs connect to the webserver by a small CGI written in C. The "local" JVMs connect to the web server the same as "client" JVMs, and to the command line by a small program written in C. The "client" and "local" JVMs connect to the "server" JVM by socket connections that are established upon startup.
All communication with the database takes place via the “server” JVM. Upon startup, it opens a connection to the MySQL server. Details are at OdysseyDatabaseDetails.
These applications are standard Web applications such as might be implemented using a PHP CGI or something comparable.
These applications provide services that require access to the user's local system account. This is done by using websuid
to run the client JVM under the user's local system account, instead of webgate
. There is a "front page" that provides access to all of these applications (www.student.cs, www.cs
).
odyssey.student.cs.uwaterloo.ca
apache configuration is controlled on services08.student.cs
by /software/wwwapache-1.3_server/config/httpd.conf
odyssey.uwaterloo.ca
apache2 configuration is controlled in the core region by /software/odyssey-3_apache/config/sites-available/odyssey
At present no data storage is associated with these applications; they simply provide a Web interface to some Unix command-line activities.
The Odyssey system should not require much routine maintenance. It is designed to just keep working smoothly without specific attention being paid.
There are a couple of exceptions at present, which should be removed over time as improvements are made:
.resp
files hanging around in the connect
directory. Cleaning out all the .resp
files and zonk
ing processes owned by odyssey
once in a while is not a bad idea. I believe that a further improvement to the adapter to time out waiting for access to the JVM FIFO will reduce incidents of this to nearly nothing.
ST#56596 is for automating cleanup.
Building a new application is normally done entirely by creating new Java code to implement the application, and then editing the content.client
and content.server
classes to publish an instance of the application on a web server at a specific URL.
Here is a brief list of the typical steps:
uw
package, say uw.newapp
.
database.cs
, and create the data model in the database.
content.server
to create an instance of the database interface upon server startup.
content.client
to link in the web front-end to a specific location in the URL structure.