Skip to content

UMNLibraries/cdm-blacklightify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

691 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. bundle dependencies
# Foreman is not part of the gem bundle, install it independently
$ gem install foreman

# Install bundled rubygems
$ bundle install

# Install JS dependencies
$ yarn 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.
# Warm up redis first time, which usually avoids compile errors
$ foreman start redis
# Ctrl-c once redis is compiled and running

# Warm up Solr too before first full run so download does not interfere
$ foreman start solr
# Ctrl-c when solr is downloaded and started

# After redis & solr are prepped, proceed with everything
# Start all services (should work after redis & solr are prepped)
$ 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. Documentation of foreman options at https://ddollar.github.io/foreman/

# Start solr only (via foreman because other startup shell actions are defined too)
$ foreman start solr

# Start everything except sidekiq
$ foreman start -m   all=1,sidekiq=0

# Start only sidekiq, which also needs redis
$ foreman start -m redis=1,sidekiq=1

# Start Rails/Puma without the whole foreman suite
# (port 3000, limited to only the local network interface)
# Rails won't actually like this because it wants solr to do anything
$ 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

About

Blacklightify a CONTENTdm collection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors