HydraDAM is Rails app built using Sufia, tailored for handling audio and video.
TODO: use gh-md-toc
tool
When we say "installing" here, what we mean is setting up a development
instance, where the assumed Rails environment is the development
. We
do not mean setting up a prodution instance. That is covered in
Deploying
While Sufia is a Rails engine that provides generators to initialize your app and perform upgrades to later Sufia versions, HydraDAM is the result of having run those generators. As such, there is no need to run them again.
That said, the HydraDAM code base does not contain all of the the Sufia installation instructions contain several steps that you must also have to do to set up a HydraDAM instance. So if it looks like we merely copied the Sufia installation instructions in places, and changed the name to "HydraDAM", that's probably what happened.
HydraDAM requires the following software to work:
- Ruby is the language.
- Solr for the search index and Fedora for the data repository (both included as part of hydra-jetty).
- Redis key-value store for processing asynchronous jobs using the Resque gem.
- ImageMagick for thumbnail generation.
- FITS for file characterization.
- FFMPEG for audio-visual transcoding.
NOTE: If you do not already have Solr and Fedora instances you can use in your development environment, you may use hydra-jetty (instructions are provided below to get you up and running quickly and with minimal hassle).
First, you'll need a working Ruby installation. You can install this via your operating system's package manager -- you are likely to get farther with OSX, Linux, or UNIX than Windows but your mileage may vary -- but we recommend using a Ruby version manager such as RVM or rbenv.
The version of Ruby that HydraDAM supports may change over time. But you can
check which versions we test agains in our Travis CI configuration.
Any version listed under the rvm
entry is one we test against.
If you already have instances of Solr and Fedora that you would like to use, you may skip this step. Otherwise feel free to use hydra-jetty, the bundled copy of Jetty, a Java servlet container that is configured to run versions of Solr and Fedora that are known to work with Sufia. Hydra-jetty (since v8.4.0) requires Java 8.
The following rake tasks will install hydra-jetty and start up Jetty with Solr and Fedora.
# downloads the latest hydra-jetty from the web.
rake jetty:clean
# copies the HydraDAM solr and fedora config into the newly downloaded hydra-jetty.
rake sufia:jetty:config
TODO
TODO
File characterization is done using FITS (File Information Tool Set).
- Go to http://projects.iq.harvard.edu/fits/downloads and download a copy of
FITS & unpack it somewhere on your machine. You can also install FITS on OSX
with homebrew
brew install fits
(you may also have to create a symlink fromfits.sh -> fits
in the next step). - Mark fits.sh as executable (
chmod a+x fits.sh
) - Run "fits.sh -h" from the command line and see a help message to ensure FITS is properly installed
- Give your Sufia app access to FITS by:
- Adding the full fits.sh path to your PATH (e.g., in your .bash_profile), OR
- Changing
config/initializers/sufia.rb
to point to your FITS location:config.fits_path = "/<your full path>/fits.sh"
Sufia includes support for transcoding audio and video files. To enable this, make sure to have ffmpeg > 1.0 installed.
On OSX, you can use homebrew for this.
brew install ffmpeg --with-fdk-aac --with-libvpx --with-libvorbis
When we say "running HydraDAM" what we mean is starting the Rails app server, and all dependent services, which includes:
- Solr and Fedora (via jetty)
- redis-server
- resque
The Rails app server will run without Solr or Fedora, but HydraDAM will not work properly as a result. Generally, you may start and stop jetty independently of starting or stopping the Rails app server.
rake jetty:start # this will start jetty
rake jetty:stop # this will stop jetty
rake jetty:restart # this will fill your hard disk with cat pics. Just kidding, it will restart jetty.
To start Redis, simply run:
redis-server
And after Redis is running, you can start the Resque processes like so:
QUEUE=* rake environment resque:work
NOTE: Both the Redis and Resque processes will run until you kill them, so you will need to run them in dedicated terminal windows, or run them in the background.
TODO