Skip to content

Developer VM Setup

Mark Bussey 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
    vagrant up
  6. Connect to your VM
    vagrant ssh
  7. Update package lists sudo apt-get update
  8. Upgrade existing packages sudo apt-get upgrade
  9. Install MySQL client libraries (missing from the Hydra-Camp VM)
    sudo apt-get install -y libmysqlclient-dev
  10. Within your VM (at a prompt like vagrant@hydra-devbox:~$) change directory to the shared working directory
    cd /vagrant
  11. Install missing gems bundle install
  12. Run the one-time application setup script
    bundle exec bin/setup
  13. Create an initial admin user
    bundle exec rake admin
    then follow the prompts to add the first user
  14. Test your configuration by running your development server
    bundle exec rake hydra:server
    then visit the application at http://localhost:3000
  15. Edit fcrepo_wrapper_dev.yml to set the data directory to an unshared location (TODO: add detail)
  16. 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