UMNLibraries / cdm-blacklightify

Blacklightify a CONTENTdm collection
MIT License
2 stars 0 forks source link

cdm-blacklightify

Blacklightify a CONTENTdm collection

Requirements

  1. Ruby (3.1)
  2. Ruby on Rails (6.1)
  3. Java Runtime Environment (JRE) version 1.8 for Solr
  4. ImageMagick (http://www.imagemagick.org/script/index.php) due to carrierwave
  5. Oniguruma for ruby-jq bindings, used by fast solr export (brew install oniguruma, apt-get install libonig-dev, yum install oniguruma-devel )
  6. Redis for sidekiq
  7. Git-flow branching workflow tools (Installation docs)

Installation

  1. Clone the repository
$ git clone git@github.com:UMNLibraries/cdm-blacklightify.git cdm-blacklightify
$ cd cdm-blacklightify
  1. Setup git-flow
    $ git flow init

Choose branches (accept defaults):

  1. bundle dependencies
$ bundle install
  1. Configure DotEnv files
$ cp .env.example .env

Fill in missing env var values (@TODO: share via LastPass?)

  1. Prepare development database

Build the project database tables and load our test fixtures for development use.

$ bundle exec rails db:migrate
$ bundle exec rails db:fixtures:load
  1. Start development services via foreman. This will result in Redis being downloaded, compiled, and started up in tmp/, Solr being download and/or started via solr_wrapper using the config at .solr_wrapper.yml, Sidekiq queuing service starting, and finally, the Rails development web server.
$ bundle exec foreman start

OPTIONAL: Starting some services independently is possible if a fast startup is desired, especially when the Sidekiq job queue won't be needed.

# Start solr without the whole foreman suite
$ bundle exec solr_wrapper --config .solr_wrapper.yml

# Start Rails/Puma without the whole foreman suite
# (port 3000, limited to only the local network interface)
$ bundle exec rails server -b 127.0.0.1 -p 3000

Visit http://localhost:3000 in your browser to see your locally running instance

Load the Development Index

  1. For development, a test record set can be quickly loaded from a stored JSON fixture. This will load test/fixtures/dev_solr_harvest.json.gz directly into Solr. NOTE This will erase your current index.
$ bundle exec rake umedia:solr:index_dev

Harvest More Documents

  1. Assuming Redis and Sidekiq are running (started with foreman), run Harvest rake task
$ bundle exec rake umedia:index:harvest_dev
  1. (Optional) Commit to Solr

As your harvest is running, you can occasionally sent a commit to Solr to see what documents you have harvested.

$ bundle exec rake umedia:index:commit

Additional Usage

Thumbnail management

# Store all thumbs
$ bundle exec umedia:thumbnails:store

# Store specific thumbs by doc id, space separated
$ DOC_IDS='p16022coll262:172 p16022coll262:173' bundle exec rake umedia:thumbnails:store

# Purge all thumbs
$ bundle exec umedia:thumbnails:purge

# Purge thumbs by doc id, space separated
$ DOC_IDS='p16022coll262:172 p16022coll262:173' bundle exec rake umedia:thumbnails:purge

Example Items