Skip to content

Developer Quickstart

Florent Monjalet edited this page Sep 3, 2019 · 22 revisions

Using Phobos

The basic installation process and usage is described by README.md.

Compiling

These instructions describe how to compile Phobos on CentOS 7.

Dependencies

An always up-to-date dependency list can be retrieved from the Phobos specfile.

Build dependencies:

  • postgresql94-devel (from EPEL or any version compatible with Postgres 9.4)
  • glib2-devel >= 2.28
  • python-devel
  • jansson-devel >= 2.5
  • libini_config-devel
  • openssl-devel
  • libattr-devel
  • sg3_utils-devel

Runtime (and test) dependencies:

  • postgresql94-server (from EPEL or any version compatible with Postgres 9.4), although Postgres does not have to run on the same node as phobos.
  • postgresql94-contrib
  • postgresql94-libs
  • glib2 >= 2.28
  • jansson
  • libini_config
  • openssl
  • libattr
  • python
  • python-argparse
  • python-yaml
  • clustershell
  • python-psycopg2

Compilation

$ ./autogen.sh
$ ./configure
$ make

Testing

Setting up the database

By default, Phobos tests expect to have a PostgreSQL database configured with a database named phobos, a user named phobos with phobos as a password. This configuration can be manually done or automatically done by invoking the following line (after the project has been successfully compiled):

$ sudo -u postgres ./scripts/phobos_db_local setup_db -p phobos

Depending on your umask, you may have to make some files readable and executable for the postgres user first:

chmod a+rx ./scripts/phobos_db{,_local}

Note : For production use, manual experimentation or the integration test script acceptance.sh, the database name, user and password can be set to arbitrary values (either manually or via phobos_db_local, see ./scripts/phobos_db_local setup_db -h). In this case, you can export the following environment variable:

$ export PHOBOS_DSS_connect_string="dbname='<your db name>' user='<your user>' password='<your password>' > host=<postgresql instance hostname>"

However, tests as they are written necessitate the hardcoded credentials (except for acceptance.sh).

Running the test suite

$ make check

Setting up a Virtual Tape Library (VTL)

To test all the tape, LTFS and SCSI related code, Phobos needs to have access to a tape library. By default, it will look for the /dev/changer device to gain access to a tape library (can be changed in configuration).

Having a real tape library to test Phobos is not very handy, this is why we tend to use a VTL (Virtual Tape Library), emulating a real tape library. As Phobos uses LTFS, the VTL needs to support physical partitioning of tapes, this is why we use Quadstorvtl instead of the opensource mhvtl.

The project was tested with QuadstorVTL 3.0.36, the RPM can be downloaded here https://www.quadstor.com/vtl-extended-edition-downloads.html.

Once QuadstorVTL is installed, setting it up with the appropriate drives and tapes for the Phobos test suite can be performed with the ci/setup_quadstor.sh.

The test suite is then ran as usual, but this time all tape related tests (test_scsi.sh, and a subpart of test_store_retry.sh and acceptance.sh) will be executed:

$ make check

CI scripts

Most of the setup described in this page is summed up by the ci/run-ci.sh script.

Clone this wiki locally