-
Notifications
You must be signed in to change notification settings - Fork 9
Developer VM Setup
conorom edited this page Apr 27, 2016
·
23 revisions
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.
- Install Vagrant & VirtualBox following the instructions on their websites.
- Open a terminal window and clone the project repo
git clone https://github.com/curationexperts/heliotrope.git
- Change directory to the project directory
cd heliotrope
- 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.
- Start Vagrant
vagrant up
Note steps 7 through 11 should be automatically completed by bootstrap.sh as soon as the VM is created. If there are no failures, login to the VM (step 6) and skip to step 12. - Connect to your VM
vagrant ssh
- Update package lists
sudo apt-get update
- Upgrade existing packages
sudo apt-get upgrade
- Install MySQL client libraries (missing from the Hydra-Camp VM)
sudo apt-get install -y libmysqlclient-dev
- Within your VM (at a prompt like
vagrant@hydra-devbox:~$
) change directory to the shared working directory
cd /vagrant
- Install missing gems
bundle install
- Run the one-time application setup script
bundle exec bin/setup
- Create an initial admin user
bundle exec rake admin
then follow the prompts to add the first user - Test your configuration by running your development server
bundle exec rake hydra:server
then visit the application at http://localhost:3000 - Edit fcrepo_wrapper_dev.yml to set the data directory to an unshared location (TODO: add detail)
- 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
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