Skip to content

Developer VM Setup

conorom edited this page Apr 27, 2016 · 23 revisions

Overview

It's possible to use a Vagrant based VM to run a full Hydra development environment for the heliotrope repository. You can build a vanilla VM and install all of the required decencies yourself, or you can start with the box that DCE maintains for Hydra Camp which has the following dependencies and tools pre-installed:

  • git
  • rvm
  • Redis
  • FITS
  • FFMpeg
  • ImageMagick In development mode, heliotrope uses solr_wrapper and fcrepo_wrapper to install and run Solr and Fedora, so these don't need to be pre-installed.

Setup

  1. Install Vagrant & VirtualBox following the instructions on their websites.
  2. Open a terminal window and clone the project repo
    git clone https://github.com/curationexperts/heliotrope.git
  3. Change directory to the project directory
    cd heliotrope
  4. Configure Vagrant memory and cpu allocation: the provided Vagrantfile allocates 1024MB and 1 CPU to the VM, if you system has sufficient resources, edit the Vagrantfile to allocate 2048MB or 4096MB memory and 2 CPUs for better performance.
  5. Start Vagrant (creates machine, provisions its packages and gems, performs initial Fedora setup - see bootstrap.sh) vagrant up
  6. Connect to your VM vagrant ssh
  7. Create an initial admin user bundle exec rake admin
    then follow the prompts to add the first user
  8. Start your services (open a separate vagrant shell for each) a. Solr: bundle exec solr_wrapper b. Fedora: bundle exec fcrepo_wrapper c. Rails server: bundle exec rails s -b 0.0.0.0 then visit the application at http://localhost:3000

NOTES

SHARED DIRECTORY Within your VM, the host project directory (./heliotrope) is shared at /vagrant in the guest VM - you can edit files using a GUI text editor or IDE on your host system.

the rails server 0.0.0.0 binding is required for the VM port forwarding to work

TODO Examine failures of the command that starts all three servers bundle exec rake hydra:server

Edit fcrepo_wrapper_dev.yml to set the data directory to an unshared location (TODO: add detail) SOLR & FEDORA