Rails(~> 7.0) engine that provides data models and services for a JSON API for digital asset management. Implements ActiveStorage for Cloud or local storage for files.
Please see the Wiki for more information.
-
Ensure you have the following installed on your development machine
Postgresql ~9.6(v 12 stable is recommended)RedisImagemagickRuby >= 3.1- Docker
-
Clone Project
-
Run
bundle install -
Setup development dependencies(See the Running guide below)
-
Check
spec/internal/config/database.ymland make sure yourpostgrescredentials are correct. -
Run
$ rails curator:setup-- this will run the database setup scripts for you -
(Optional) run
$ rails generate curator:install-- this will add an initializer for customizingCurator.configsettings
Curator requires several additional services:
- Solr (for indexing records)
- BPLDC Authority API (for retrieving authority data for controlled vocabluaries)
- Ark Manager (for creating persistent identifiers and permalinks)
- Azurite (for testing azure cloud storage)
- Avi Processor (for creating derivatives from primary files. NOTE this project is still in development and is not needed at the moment)
To set up these services:
- Add Environment variables. Make sure the URLs for these services are set as
ENVvariables (AUTHORITY_API_URL,SOLR_URL,AVI_PROCESSOR_API_URL,INGEST_SOURCE_DIRECTORY). You can set these using thespec/internal/.env.#{RAILS_ENV}.samplefiles. For development copy/rename thespec/internal/.env.development.sampletospec/internal/.envORspec/internal/.env.development. You are also required to create an.envand set the variables listed in the.env.docker.samplefile in the root of curator. These are required to start the docker containers - Start the docker containers with
docker-compose upThis will run docker images of theark_manager,bpldc_authority_api,azuriteas well as internal sharedpostgresandrediscontainers. On start theark-managerandbpldc_authority_apiapps will runbundle exec rails db:preparewhich will wither run pending migrations OR runrails db:setup. NOTE the postgres container is NOT exposed to the host machine so you will need to run a local instance of postgres for the curator app itself. - Install the Azure Cli on your local machine for your given operating system. NOTE.If installing on linux apt/deb DO NOT use the install with one command option as it appears broken in Ubuntu 16.04. Follow the step by step guide instead.
- Setup azure containers on azurite instance.
- First check if the containers exist by running. This will help test if you are having issues with your
--connection-stringparam. See the Configure Connection String guide to troubleshoot problems you may have.:az storage container exists --name 'primary' --connection-string 'UseDevelopmentStorage=true'az storage container exists --name 'derivatives' --connection-string 'UseDevelopmentStorage=true'
- If both containers return
{exist: false}run the following two commands:az storage container create -n primary --connection-string "UseDevelopmentStorage=true" --public-access offaz storage container create -n derivatives --connection-string "UseDevelopmentStorage=true" --public-access container
- First check if the containers exist by running. This will help test if you are having issues with your
- In the Curator project, start Solr using the following command (see solr_wrapper for more documentation):
$ cd ./spec/internal && solr_wrapper(development)$ solr_wrapper(test)
Any input/suggestions are appreciated as we develop this. Please contact Ben or Eben.
In addition to the Docker containers described above, Solr needs to be running before specs can be run.
Prior to starting Solr, create config directory (only needs to be run once):
# populates spec/internal/solr/conf
$ git submodule init
$ git submodule update --remote
To start Solr in Test mode (use a separate console session):
$ cd spec/internal
$ solr_wrapper --config .solr_wrapper_test
Run the specs:
$ bundle exec rake spec
Special thank you to the Samvera community and Jonathan Rochkind for providing this project with gems and code samples to develop this.
The gem is available as open source under the terms of the MIT License.