Installing the Trio System

This document is obsolete. Please see install page instead.

Package Overview

The Trio system is implemented in the Python programming language and layered on top of the PostgreSQL open-source DBMS. The system comes shipped with two user interfaces: trioplus, a command-line interface (CLI), and TrioExplorer, a web-based GUI with user-friendly control features, help pages, and some sample applications and queries. Trio also includes a basic Application Programming Interface (API) similar to the Python DB-API specification, on which the user interfaces are built.

The complete Trio functionality is available through the Python implementation, including a TriQL grammar parser and a hierarchical rewriting architecture that creates standard SQL queries from TriQL, which are then executed over a relational encoding of our data structures. Only a few complex operations such as on-demand lineage traversal and confidence computation are implemented as stored procedures.

The core functionality such as data-intensive fetch operations and cursor management are implemented redundantly in Python and a precompiled C-code library extension using the PostgreSQL-specific Server Programing Interface (SPI) to achieve better performance under PostgreSQL when the SPI option in trio.cfg is enabled. If you are interested in porting Trio to another DBMS, please contact us!

In its default configuration, the Trio system requires the following software packages:

  • Python Programming Language (version 2.4 or higher)
    • The programming language in which Trio is implemented. The Python interpreter is used to execute both trioplus and TrioExplorer.
  • PostgreSQL (version 8.2)
    • The default underlying relational DBMS.
    • A graph visualization tool to render schema graphs in TrioExplorer.
    • The Python DB-API module for PostgreSQL.
    • The web server framework on which TrioExplorer is built.
    • A lex and yacc parsing module for Python.
    • Another parsing tool. Required by PyDot.
    • A Python interface to Graphviz.

Currently we are running the system successfully on Linux, Mac OS X, and Windows XP.

Installation Instructions

Since Trio is deployed on top of the above packages, we suggest to install them one by one in the order as given below with respect to some dependencies among the different packages. For convenience, most of the required Python modules (Pylons, PyGreSQL, etc.) can be installed via ''Easy Install'' for both the Linux and Windows platforms.

If you can’t use Easy Install for some reason (e.g., due to your firewall constraints), stop by the Python Cheese Shop, which is a comprehensive software repository for Python, where you should also be able to download the required Python packages and then install them manually. For Mac users, ''Darwinports'' is an alternative package manager. For Linux, any package manager should do just fine.

Installing Peripheral Packages

Install the packages in the following order:

  1. Python
    • Installer binaries are available for Windows, Mac, and most Linux distributions.
    • Install version 2.4 or higher.
  2. PostgreSQL
    • Installers are available as Windows binaries (MSI) and Linux RPM packages (supporting Red Hat, Fedora, etc.).
    • Install the binaries for PostgreSQL 8.2.
    • Make sure PostgreSQL’s language support for plpgsql is enabled (check so when asked by the installer).
      • You can post-install the plpgsql language support anytime and make it the default extension for newly created databases by adding it to PostgreSQL’s template database using ‘createlang -d template1 plpgsql’.
    • PostgreSQL’s source code is only required to recompile the SPI packages under Windows (not for Linux or MAC). Since precompiled SPI packages are provided by the Trio distribution for Linux, Windows, and MAC OS X, compiling PostgreSQL or our Trio SPI package should only be required for developers.
    • Make sure PostgreSQL’s bin directory is in your PATH environment (i.e., the libpq library for client connections can be found by Python).
  3. Graphviz
    • An installer executable is available for Windows here.
    • Source code and RPM package are also available here.
  4. PyGreSQL
    • Run ‘easy_install PyGreSQL’. (You might need to use the binaries below for windows.)
    • Or get the binaries and/or sources from here and either use the installer that comes shipped with the binaries or run ‘python setup.py install’ to install from the sources.
  5. Pylons
    • Be sure to install version 0.9.5 (not any of the later versions).
    • Run ‘easy_install Simplejson==1.7.1’.
    • Run ‘easy_install Beaker==0.7.3’.
    • Run ‘easy_install WebHelpers==0.3.2’.
    • Run ‘easy_install Pylons==0.9.5’.
    • Or get the source from here and follow the installation instructions.
  6. PLY
    • Be sure to install version 2.2 (not any of the later versions).
    • Run ‘easy_install Ply==2.2’.
    • Or get the source from here and follow the installation instructions.
  7. PyParsing
    • Run ‘easy_install PyParsing’.
    • Or get the source from here and run ‘python setup.py install’.
  8. PyDot
    • Run ‘easy_install PyDot’.
    • Or get the source from here and run ‘python setup.py install’.

Installing Trio

  1. If not yet done, download the Trio package consisting of source code and binaries here.
  2. Extract the tar archive into your favorite directory.
  3. Get the SPI module working:
    • For Windows:
      • Copy spi/triospi_win32.dll to PostgreSQL’s lib directory (e.g., C:\Program Files\PostgreSQL\8.1\lib) renamed as triospi.dll
    • For Linux(x86 32):
      • Copy spi/triospi_linux_x86_32.so to PostgreSQL’s lib directory renamed as triospi.so
    • For Mac OS X:
      • Copy spi/triospi_macosx.so to PostgreSQL’s lib directory renamed as triospi.so

Running the Trio System

TrioExplorer

  1. Make sure PostgreSQL is working.
  2. Running TrioExplorer
    • Linux, Mac:
      • If the paster binary is not already in your PATH environment, you might want to edit explorer/start_te_server.sh such that the shell variable PASTER points to the paster program, which is a tiny Web Server that comes with the Pylons package.
      • Run ‘./start_te_server.sh’
    • Windows:
      • If the paster executable is not already in your PATH environment, you might want to edit explorer/start_te_server.bat such that the variable PASTER points to the paster command that is installed with Pylons.
      • Run ‘start_te_server.bat’
  3. At the command line, you are now prompted for an admin user login to PostgreSQL, which should have been created along with your PostgreSQL installation (e.g., ‘postgres’), and which will be used by TrioEplorer to create new user roles and database instances.
  4. TrioExplorer should now be reachable from your browser, e.g., using http://localhost:8080/. We recommend using Internet Explorer, which seems to be a little faster than some others.
    • New users can now press ‘Create a new user’ and create their own Trio login and database instances, which are then managed by the PostgreSQL server.

trioplus

Preparing trioplus for its first use requires a new user role and database instance be installed manually (denoted in the following as ‘foo’ and ‘bar’), which should be different from the default PostgreSQL instance, and which requires logging in onto the PostgreSQL server with admin privileges (denoted in the following by the admin user name ‘postgres’).

If you already have created a user login and database instance under TrioExplorer, you may just skip this step and directly jump to the last bullet, i.e., run ‘python trioplus.py -u foo -d bar -p’.

  1. Create your new PostgreSQL user role and database instance using the following PostgreSQL executables:
    • Run ‘createuser foo’
    • Run ‘createdb bar’
    • Note that for each of the above commands you might need to explicitly login as a superuser, if your default PostgreSQL user name is not a trusted PostgreSQL user, e.g., using ‘createuser -U postgres foo’.
  2. Set up some Trio metadata and initialize the Trio schema information for this new user:
    • ‘cd setup’
    • Run ‘./setup.sh foo’ (’setup foo’ under Windows) or, respectively, run ‘./setup.sh bar foo’ (’setup bar foo’ under Windows) if you need to explicitly provide a PostgreSQL user name (similar as above).
  3. Connect to your new Trio database using the command line client:
    • Run ‘python trioplus.py -u foo -d bar -p’
 
trio/installation.txt · Last modified: 2009/01/24 07:56 by hyunjung
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki