Skip to content

Developer VM Setup

Mark Bussey edited this page Apr 14, 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. Start Vagrant
    vagrant up
  5. Connect to your VM
    vagrant ssh
  6. Install MySQL client libraries (missing from the Hydra-Camp VM)
    sudo apt-get install -y libmysqlclient-dev
  7. Within your VM (at a prompt like vagrant@hydra-devbox:~$) change directory to the shared working directory
    cd /vagrant
  8. Run the one-time application setup script
    bin/setup
  9. Create an initial admin user
    bundle exec rake admin
    then follow the prompts to add the first user
  10. Test your configuration by running your development server
    bundle exec rake hydra:server
    then visit the application at http://localhost:3000
  11. Edit fcrepo_wrapper_dev.yml to set the data directory to an unshared location (TODO: add detail)
  12. Start your services (open a separate vagrant shell for each & cd to the /vagrant project directory) a. Solr: bundle exec solr_wrapper --config config/solr_wrapper_dev.yml b. Fedora: bundle exec fcrepo_wrapper --config config/fcrepo_wrapper_dev.yml c. Rails server: bundle exec rails s -b 0.0.0.0 NOTE: the binding is required for the VM port forwarding to work

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.

SOLR & FEDORA