Installing the Trio System

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. However, the current release only contains slower Python implementation. If you are interested in performance experiments, please contact us!

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

  • Python Programming Language (version 2.4 or higher)
    • The Python interpreter is used to execute both trioplus and TrioExplorer.
  • PostgreSQL (version 8.2 or higher)
    • The underlying relational DBMS.
    • A graph visualization tool to render schema graphs in TrioExplorer.

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

Installation Instructions

Installing Peripheral Packages

  1. Python (version 2.4 or higher)
    • Most Linux distributions and Mac OS X Leopard have Python installed.
    • Please note that Trio is not tested with Python 3.0.
    • For Linux, install Python using a software package manager (e.g., apt-get or yum).
    • For Mac OS X, installer is available at http://www.python.org/download/.
    • For Windows, installer is available at http://www.python.org/download/.
      • Don’t install version 2.6 because Easy Install doesn’t have a windows installer for Python 2.6 yet.
    • Make sure Python’s bin directory (e.g., C:\Python25;C:\Python25\Scripts) is in your PATH environment (by running python -V).
  2. PostgreSQL (version 8.2 or higher)
    • For Linux, install PostgreSQL using a software package manager (e.g., apt-get or yum).
    • For Mac OS X, installers are available at http://www.postgresql.org/download/macosx.
    • For Windows, pgInstaller is available at http://www.postgresql.org/ftp/binary/v8.2.11/win32/.
      • Don’t install version 8.3 because triospi.dll for PostgreSQL 8.3 is not provided.
    • Make sure PostgreSQL’s bin directory (e.g., C:\Program Files\PostgreSQL\8.2\bin) is in your PATH environment (by running postgres -V and pg_config).
      • In some distributions, pg_config is in the development package. We recommend installing pg_config because it will detect the correct location of triospi.so or triospi.dll.
    • Make sure plpgsql support is enabled.
    • If you are going to running PostgreSQL using an account other than postgres, you need to create a database with the account name (e.g., run createdb trio). Please refer to The PostgreSQL User Account and Creating a Database Cluster.
  3. Graphviz
    • For Linux, install Graphviz using a software package manager (e.g., apt-get or yum).
    • For Mac OS X and Windows, executable packages are available at http://www.graphviz.org/Download.php.
    • Make sure Graphviz’s bin directory (e.g., C:\Program Files\Graphviz 2.21\bin) is in your PATH environment (by running d t -V).

Installing Trio

Depending on the environment, you might need root privileges to complete these steps.

  1. Install Easy Install. Please see http://pypi.python.org/pypi/setuptools for instructions.
  2. For Windows only, install PyGreSQL win32 package at http://www.pygresql.org/readme.html#download-pygresql-here (Installing PyGreSQL with Easy Install requires the Microsoft Visual C++).
  3. Run easy_install -U -f http://infolab.stanford.edu/trio/code/ Trio TrioExplorer to install Trio packages and all required libraries.
  4. Run triospi_install to get the SPI module working.
    • This step will fail if you don’t have pg_config. You can manually do this step by copying site-packages/Trio-1.1-py2.5.egg/trio/spi/{linux2|darwin|win32}/pg-{8.2|8.3}/triospi.{so|dll} into PostgreSQL’s lib directory (e.g., /usr/lib/pgsql or C:\Program Files\PostgreSQL\8.2\lib). site-packages is usually in /usr/lib/python2.5 or C:\Python25\Lib.

Running the Trio System

TrioExplorer

Preparing TrioExplorer for its first use requires generating trioexplorer.ini. Please run paster make-config TrioExplorer trioexplorer.ini inside a directory of your choice (e.g., C:\Trio or ~/Trio). While running TrioExplorer, some temporary files will be generated as well in the directory.

  1. Make sure PostgreSQL is working.
  2. Running TrioExplorer
    • Run paster serve trioexplorer.ini
    • For Linux and Mac OS X, daemon mode is available: run paster serve --daemon trioexplorer.ini and paster serve --stop-daemon to start and stop TrioExplorer. Please run paster serve -h for more options.
    • If you are prompted for a DBA login to PostgreSQL, please provide one created along with your PostgreSQL installation (e.g., postgres).
  3. TrioExplorer should now be reachable from your browser, e.g., using http://127.0.0.1:8080/ or http://localhost:8080/.

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 trioplus -u foo -d bar -p.

  1. Create your new PostgreSQL user role and database instance using the following PostgreSQL executables:
    • Run createuser [-U postgres] -S -D -R -P foo
    • Run createdb [-U postgres] -O foo 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:
    • Run triosetupdb [-U postgres] bar foo
  3. Connect to your new Trio database using the command line client:
    • Run trioplus -u foo -d bar -p
 
trio/install.txt · Last modified: 2009/01/23 14:28 by hyunjung
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki