Skip to content

Installation Instructions

Dan Leehr edited this page Jan 9, 2015 · 9 revisions

This contains instructions for installing on Ubuntu Linux. This has been tested on iPlant Atmosphere but should work on any cloud provider that supports Ubuntu.

Installation and first-time setup

  1. Login over ssh

  2. Install packages

     sudo apt-get install git postgresql libpq-dev ruby bundler
    
  3. Clone traitdb repo

     git clone https://github.com/NESCent/TraitDB.git
    
  4. Install dependencies

     cd TraitDB
     bundle install
    
  5. Create a postgres user

     sudo -u postgres createuser -d traitdb_prod -P # will prompt for a password, make one up
    
  6. Obtain a Google App ID and app secret from Google Developer Console.

  1. Configure database and Google OAuth credentials

     export TRAITDB_PG_PROD_USER="traitdb_prod"
     export TRAITDB_PG_PROD_PASS="<your password here>"
     export TRAITDB_PG_PROD_HOST="127.0.0.1"
     export TRAITDB_PG_PROD_PORT="5432"
     export TRAITDB_GOOGLE_APP_ID="xxxxx.apps.googleusercontent.com"
     export TRAITDB_GOOGLE_APP_SECRET="xXxXxXXX"
    
  2. Install the database

     RAILS_ENV=production rake db:setup
    
  3. Compile assets

     RAILS_ENV=production rake assets:precompile
    
  4. Start the webapp

    RAILS_ENV=production rails server -d
    
  5. Create an admin user

  • Visit http://your-server:3000 in your web browser

  • Click Sign In

  • Authenticate with a Google Account

  • In the ssh console, upgrade this user to an admin

    RAILS_ENV=production rake traitdb:upgrade_admin[<[email protected]>]
    Upgrading [email protected]
    
  1. Start a worker

    mkdir tmp
    RAILS_ENV=production script/delayed_job start
    
  2. See README for further instructions on creating projects and uploading YAML configs

Future startup instructions

  1. Login over ssh

  2. Configure database and Google OAuth credentials (Consider putting these in a file and sourcing it on login)

     export TRAITDB_PG_PROD_USER="traitdb_prod"
     export TRAITDB_PG_PROD_PASS="<your password here>"
     export TRAITDB_PG_PROD_HOST="127.0.0.1"
     export TRAITDB_PG_PROD_PORT="5432"
     export TRAITDB_GOOGLE_APP_ID="xxxxx.apps.googleusercontent.com"
     export TRAITDB_GOOGLE_APP_SECRET="xXxXxXXX"
    
  3. Start a worker (Consider installing in init.d or upstart)

     RAILS_ENV=production script/delayed_job start
    
  4. Start the webapp (Consider installing in init.d or upstart)

     RAILS_ENV=production rails server -d
    
Clone this wiki locally