ualbertalib / jupiter

Jupiter is a University of Alberta Libraries-based initiative to create a sustainable and extensible digital asset management system. This is phase 2 (Digitization).
https://era.library.ualberta.ca/
MIT License
23 stars 10 forks source link

Jupiter

Github Build Status

Architecture

Jupiter Architecture Diagram

ERD Diagram (November 17th, 2020)

Requirements:

Generate Documentation

$ bundle exec rake rdoc

View Documentation

$ open doc/index.html is the location for docs created by rdoc

$ open docs/rdoc/index.html is the location for docs created by rerdoc

Check your style

For Ruby files: $ bundle exec rubocop

For ERB files: $ bundle exec erblint .

For javascript files: $ yarn lint

Run tests

$ bundle exec rails test

Run system tests

By default, rails test will not run the system tests. To run them use:

$ bundle exec rails test:system

Seed your development database

$ bundle exec rake db:seed

Please note that by default the seeding process will download community logos from the web. If you are not on a network, or otherwise wish to prevent this behaviour, please set the enviroment variable SKIP_DOWNLOAD_COMMUNITY_LOGOS.

Note: You may need chromedriver and perhaps a few other dependencies installed to run these system tests in selenium.

REGenerate Documentation

$ bundle exec rake rerdoc

Subdomains

Jupiter runs under subdomains. So you will need to configure your local environment accordingly. As an example you can set up the following entries in your /etc/hosts file:

127.0.0.1       era.demo.com
127.0.0.1       digitalcollections.demo.com

Once this is done, you can navigate to era.demo.com:3000 or digitalcollections.demo.com:3000 to access your development environment.

Some alternatives is you may also use the localhost top level domain (e.g: you can just navigate to era.ualberta.localhost:3000 or digitalcollections.ualberta.localhost:3000 to access your development environment without configuring /etc/hosts ). Another alternative is you can use services like lvh.me (e.g: navigate to era.lvh.me:3000 or digitalcollections.lvh.me:3000 to access your development environment).

UAT Environment

The UAT server is accessible on all library staff workstation, and through VPN on any external IP address. More details regarding access and deployment can be found: Jupiter UAT Setup

Docker

This project comes with a docker setup to easily setup your own local development environment for jupiter in just a few steps.

Step 1: Make sure you have docker, docker-compose, git and Ruby installed:

  1. Install Docker (Requires version 1.13.0+)
  2. Install Docker Compose (Requires version 1.10.0+)
  3. Install git
  4. Install Ruby (v3.1+)

Still need more help? Check out the following

OSX / Windows

These will install docker, docker-compose, and Docker Desktop on your machine.

Linux

Use your distribution's package manager to install docker and docker-compose.

Step 2: Get Jupiter source code

Clone the Jupiter repository from github:

git clone git@github.com:ualbertalib/jupiter.git
cd jupiter

Step 3: Initial Setup of Jupiter

You can run bin/setup to setup Jupiter on your machine. This will:

bin/setup

Step 4: Start the Rails server

To run your application, you can use the bin/dev command:

bin/dev

This starts up Overmind (or fallback to Foreman) running the Procfile.dev config.

We've configured this to run the Rails server, Sidekiq background worker and CSS/JS bundling out of the box.

Here's a couple of useful Overmind commands:

# Debugging with byebug/pry: connect to the `web` process to be able to input commands:
overmind connect web
# Then disconnect by hitting [Ctrl+B] (or your tmux prefix) and then [D].

# Restart a process without restarting all the other ones:
overmind restart web

# If something goes wrong, you can kill all running processes:
overmind kill

Now everything should be up and running!

Step 5: Open and view Jupiter!

Now everything is ready, you can go and view Jupiter! Just open your favorite browser and go to the following url:

Docker compose demo edition

Want to quickly try out and explore Jupiter? This project comes with a demo docker setup to easily setup your own local development environment for jupiter in just a few steps.

Step 1: Get Jupiter source code

Clone the Jupiter repository from github:

git clone git@github.com:ualbertalib/jupiter.git
cd jupiter

Step 2: Start docker and docker compose

To build, create, start and setup your docker containers simply run:

docker-compose -f docker-compose.demo.yml build
docker-compose -f docker-compose.demo.yml up -d

Now everything should be up and running!

Step 3: Open and view Jupiter!

Now everything is ready, you can go and view Jupiter! Just open your favorite browser and go to the following url:

era.ualberta.localhost:3000

For production deployment (on UAT environment)

To setup the environment variables needed for deployment, modify the sample .env_deployment file with variable values needed for the deployment:

cp .env_deployment_sample .env_deployment
vi .env_deployment

To build, create, start and setup your docker containers simply run:

docker-compose -f docker-compose.production.yml up -d

For the first time of the deployment, set up the database:

docker-compose -f docker-compose.production.yml run web rails db:setup

Common gotchas for docker?

Want to setup Virus-Checking and FITS characterization?

The Clamby repository has instructions on setting up clamav on various operating systems

For characterization you need to install FITS and ensure that fits.sh is in your Rails' process' PATH Hydra-File_Characterization, which Hydra-Works leverages, has more information on configuring the characterization setup.

Characterization is turned off by default for the development environment. If you would like to turn it on without modifying the config files, set the environment variable RUN_FITS_CHARACTERIZATION.

Configuring SAML

(TODO: Provide an alternatives to IST IdP for non production environments?)

Batch Ingest

Jupiter comes with a handy rake task for batch ingesting items/theses.

Items Batch Ingest via Google Drive for Admins

Batch ingest for items can now also be done via the admin dashboard. There is a new tab called "Batch ingest" where you can create a new batch ingest by providing a manifest file and files from Google Drive.

For more info about this admin batch ingest screen and how to configure it, please see the documentation in DI internal