Name: trln-vagrant-quickstart
Owner: NCSU Libraries
Description: Experimental Vagrant quickstart for TRLN Blacklight testing
Created: 2016-02-22 15:35:47.0
Updated: 2016-09-13 22:41:00.0
Pushed: 2016-07-29 18:16:58.0
Homepage: null
Size: 18
Language: Puppet
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This project contains the setup for a
vagrant-based box for the TRLN Blacklight Quickstart
application. It uses puppet as the primary
provisioning mechanism.
Install vagrant and puppet on your host. Everything was developed with the Virtualbox provider, so probably you'll want to have that available.
or
cripts; ./quickstart.sh; cd ..; vagrant up --provider=virtualbox
Will install some required puppet modules and download some files that will be built into packages on the guest VM.
ant up
installs and provisions the virtual machine, does a git clone
of the
blacklight quickstart, and runs its installation script. The result will be a ready-to-go Blacklight installation in /home/vagrant/projects/trln-blacklight-quickstart
(see that project's documentation for information about how to work with it). One of the steps is compiling the latest Ruby, so be warned that it can actually take a while. You will probably see a significant pause after the line
utput by the process. This is where `ruby-install` is compiling a fresh
ion of Ruby for the VM (see below for why).
convenience, the cloned git repository will also be available in
jects/trln-blacklight-quickstart` so you can use the git configuration of
host system and edit the files in the Rails project using the tools
lable on your host system.
og into your Vagrant machine, simply type
If everything worked and you've created an index and started rails (bundle exec rails s
from the project directory on the guest)
Blacklight can be accessed via a browser in the host via [http://localhost:8088]; Solr will be available via [http://localhost:8983/solr] (from either the guest or the host).
The Vagrantfile forwards port 3000 on the guest to 8088 on the host, and 8983 on the guest to 8983 on the host.
It got nearly to the end and “Initialize quickstart application” failed!
Running the init.sh
script is the very last step in provisioning the machine, but it encompasses a number of tasks. One which I can't make completely reliable involves downloading, verifying, and unpacking Solr. You can tell this is the problem if something like
ksum of downloaded file /tmp/solr-5.4.1.tgz does not match
shows up in the output of the vagrant up
command. If that happens, it's easy to fix:
grant ssh
w connected to the VM
projects/trln-blacklight-quickstart
/tmp/solr-\*.tgz
ndle exec rake trln:solr:install
And your download will start again. If it fails (again?!) you could try again and run it on the host machine (cd projects/trln-blacklight-quickstart
) … it should work.
And your download will start again.
What if I don't want to use Vagrant?
You can start with a traditional server, or your own workstation, and just
the machine and probably be perfectly happy. You might need to track down a few dependencies, though.
What's up with chruby
and ruby-install
?
These are complicated pieces of the puzzle, and the need to compile them (or, more properly,
the Ruby version installed by ruby-install
increases the initial install time. One of the issues is that there are
different implementations of Ruby, and one of them (MRI) is better for running
Rails / Blacklight, while the other (JRuby) is better for running the indexing
process, and we're testing both. So the install process creates a VM where
it's easy to switch between these implementations quickly.
Why Not Just Provide a (preconfigured) Vagrant Box?
We could do that! We should do that (maybe)!
In fact it's a better idea than what this does since we could avoid all the package installation and compilation at the start and reduce the amount of time it takes to get going.
However, doing that right means having more infrastructure in place than I want to assume. We avoid having to store large binaries in the repository (for now). Vagrant is also not necessarily the technology we will end up going with.
In part this is a learning and demonstration exercise. It's not intended for production use. In particular I will not present the puppet module definition of the right way to do things; it is in part an artifact of not having a configuration management infrastructure that can support such a project.
quickstart.sh fails with “Error: Could not initialize global default settings: ERROR: Failed to build gem native extension.“
Try running sudo ./quickstart.sh
instead.
vagrant up
fails with /sbin/mount.vboxsf: mounting failed with the error: No such device
Run vagrant reload
All code is provided under a GPL v3 license, and is copyright North Carolina State University 2016.