This is the main repository for the Observation Management Project (OMP), containing Perl components. It includes:
Database access and query modules.
Web interface.
"MSB" and "Sp" (science program) SOAP services.
JCMT translator.
JCMT archiving (enterdata) software.
Filter script for the "flex" email service.
Various programs and other scripts.
The OMP configuration system is accessed by the OMP::Config module. It uses the following files:
- cfg/omp.cfg
-
Main configuration file.
- cfg/omp-dev.cfg
-
"Development" configuration file, used in place of the main configuration if the file cfg/.omp-test exists.
This file includes the omp-dev.css stylesheet (with red layout elements) and sets the theme color to red in order to make the web interface of a development version easy to identify.
It also specifies an
arc-database-prefixof "dev" in order to select the development version of the archive databases. - cfg/jcmt.cfg, cfg/ukirt.cfg
-
Telescope-specific configuration.
- ompsite.cfg, ompsite-dev.cfg
-
Site configuration files, as selected by the
siteconfigparameter in the main (or development) configuration file. Typically located outside this repository. Includes the database settings, including the selection of either theompordevompdatabase for the OMP tables.
In addition, the CGI scripts use the following files to prepare their environment settings:
- cgi/omp-cgi-init.pl
-
For the web interface CGI scripts.
- server/omp-srv-init.pl
-
For the SOAP services.
This repository includes a number of test (.t) scripts in the t directory. To run these, prepare a Makefile by running Makefile.PL with whichever installation of Perl you wish to use for the tests. Then apply its test rule:
perl Makefile.PL
make testNote that the first test, 1_compile.t, attempts to load each OMP module individually in a fresh Perl environment. Since this can be quite time-consuming, this test scan be skipped by setting the environment variable SKIP_COMPILE_TEST.
The t-db directory contains a number of test scripts which interact with the (development version of the) database. Please see the README file in that directory for more information.
The t-tr directory contains various MSBs and reference translations to OCS config. XML. Please see the Makefile in that directory for more information.
Running a test copy of the OMP web interface via a server installed in a location other than the default will require some adjustments to the configuration.
In the [default] section, set the cookie-domain to the name you will use to access the server (noting that 127.0.0.1 is not the same as localhost here) and disable the requirement for cookies to be passed by HTTPS.
cookie-domain=127.0.0.1
cookie-secure=0If your web server is incapable of performing proper HTTP redirects from CGI scripts (such as the server mentioned below), select www-meta-refresh instead:
www-meta-refresh=1Then set the www-templ directory to the templates directory of this repository:
www-templ=REPOSITORY/templFinally configure the installation paths in the [web-install] section of the configuration. You will need to set public and private to wherever you want the public and private web services to be installed, omplib to the library directory of this repository and initpath to the location where the CGI "init" files will be installed, typically inside the cgi-bin directory of the public installation.
public = INSTALL/omp
private = INSTALL/omp-private
omplib = REPOSITORY/lib
initpath = INSTALL/omp/cgi-binThe documentation for these settings can be viewed with:
perldoc admin/installcgi.plFinally you can check where each file would be installed with the following command:
admin/installcgi.pl --images --dry-runIf everything looks correct then this command can be repeated without the --dry-run option to perform the installation.
Finally you will need to run a web server capable of executing CGI scripts. One possible example is the http.server module included with Python. It can be run via a script such as the following from your install directory:
#!/bin/bash
cd omp
python3 -m http.server --cgi 8010If you wish to serve both the public and private interfaces, it is possible to do this using two servers on different port numbers via a script such as:
#!/bin/bash
set -m
cd omp
python3 -m http.server --cgi 8010 &
PIDPUB=$!
cd ../omp-private
python3 -m http.server --cgi 8020 &
PIDPRIV=$!
trap "kill $PIDPUB; kill $PIDPRIV" SIGINT
wait