Jupiter is a University of Alberta Libraries-based initiative to create a sustainable and extensible digital asset management system. This is phase 1 (IR).
murny Merge pull request #929 from ualbertalib/dependabot/bundler/uglifier-…
…4.1.20

Bump uglifier from 4.1.19 to 4.1.20
Latest commit a6215fa Nov 19, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github revert mysterious changes to other two existing templates Aug 10, 2018
app apply before_validation to all / don't have to hit the db in test Nov 1, 2018
bin Add solr config copying for predeploy script Jul 23, 2018
config Fix time in sidekiq cron schedule, convert time to use UTC timezone (#… Oct 17, 2018
db fix the missing typo, update CHANGLOG Oct 15, 2018
docs Update Sep 14, 2018
lib Will I ever learn to run rubocop before pushing? No. Sep 14, 2018
log Open the pod bay doors please, Hal Jun 12, 2017
public Fix some invalid html/etc from html/w3c linter tools Mar 12, 2018
solr Use select2 for communities/collections typeahead (#278) Nov 23, 2017
test apply before_validation to all / don't have to hit the db in test Nov 1, 2018
tmp COME BACK Jan 31, 2018
vendor Transition typeahead off of select2 to easy-autocomplete instead Mar 28, 2018
.dockerignore Some fixes for UAT environment Jul 20, 2018
.editorconfig Font awesome issues (#108) Sep 6, 2017
.env_deployment_sample Some fixes for UAT environment Jul 20, 2018
.gitignore Turn on characterization in development environment based on ENV var. ( Mar 8, 2018
.hound.yml Deposit item (#280) Jan 26, 2018
.rubocop.yml Merge fixes Jul 9, 2018
.scss-lint.yml Switch select2 over to selectize Apr 3, 2018
.travis.yml Set travis to just run ruby 2.4.1 Apr 3, 2018
CHANGELOG.md Updated Changelog to tag the release 1.2.6 (#914) Nov 5, 2018
Dockerfile Switch docker stuff over to postgres Feb 13, 2018
Dockerfile.deployment Bump ruby version to 2.5.0, as some code requires 2.4+ (e.g: String.m… Jul 23, 2018
Gemfile Thanks @mbarnett! Sep 27, 2018
Gemfile.lock Bump uglifier from 4.1.19 to 4.1.20 Nov 19, 2018
LICENSE Add MIT license (#266) Nov 16, 2017
README.md Batch ingest rake task for items (#838) Sep 11, 2018
Rakefile Open the pod bay doors please, Hal Jun 12, 2017
config.ru Open the pod bay doors please, Hal Jun 12, 2017
docker-compose.deployment.yml Map file-storage volume into worker container, so sidekiq can process… Jul 26, 2018
docker-compose.lightweight.yml Merge branch 'master' into 472_ualbertalib_docker-fcrepo4 Feb 22, 2018
docker-compose.yml update to use ualbertalib/docker-fcrepo4 Feb 20, 2018
package.json Open the pod bay doors please, Hal Jun 12, 2017

README.md

Jupiter

Build Status

Architecture

Jupiter Architecture Diagram

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

$ bundle exec rubocop

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

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 and docker-compose installed:

  1. Install Docker (Requires version 1.13.0+)
  2. Install Docker Compose (Requires version 1.10.0+)

Still need more help? Check out the following

OSX / Windows

These will install docker, docker-compose, and docker-machine 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: Start docker and docker compose

For development environment

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

docker-compose build
docker-compose up -d

Now everything should be up and running. If you need seed data for your database, then run the following command:

docker-compose run web rails db:seed

Step 4: 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:

(Note: ip address may be different if you are using docker-machine)

Want to run the test suite in docker?

  1. Start up all the docker containers, like you did above (if its not already running):
docker-compose up -d
  1. Then you can run the test suite:
docker-compose run web rails test
  1. Run system tests or rubocop? Just change the command:
docker-compose run web rails test:system
docker-compose run web rubocop

Docker compose lightweight edition

If you want to develop in rails locally on your own machine, there is also a docker-compose.lightweight.yml provided. This will give you the datastores you require (solr/fedora) and potentially others if you need them (postgres/redis (commented out by default)). Just run:

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

And everything else is how you would normally develop in a rails project.

(See other sections of this README for more information about developing in a rails project environment)

For 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.deployment.yml up -d

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

docker-compose run web rails db:setup

Common gotchas for docker?

  • If your having issues, logs are the best place to first look at what went wrong.

    To check all container logs:

    docker-compose logs

    Better yet you can check an individual container log by supplying the container name to the previous command. For example if I want to see the web container logs:

    docker-compose logs web
  • If your switching between docker-compose and local development on your machine, you may encounter in weird permissions on files that docker has created (/tmp/pids/, etc.). Simply just sudo rm them.

  • If you would like to run Postgres in a container, but docker-compose reports that port 3306 is already in use, you likely have a Postgres instance already running on the host. You will need to shutdown Postgres before you can start the container. On Ubuntu, sudo service postgresql stop on the host will do the trick. Another option is to configure docker and the rails app to look for Postgres using a different port.

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

  • Update secrets.yml (and maybe omniauth.rb) for the SAML implementation (you may need to generate a certificate/key for certain environments)
  • Give IST's Identity Provider (uat-login or login) the metadata for our service provider
    • Quick way to view this metadata is to the start the Rails server and navigate to http://localhost:3000/auth/saml/metadata (feel free to edit this metadata accordingly for example adding Organization and ContactPerson metadata)
  • Once this is complete, login via SAML should be working successfully. Try it out!

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

Batch Ingest

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

  • First you need to provide a csv file which outlines all the items metadata you wish to ingest. An example template for what an expected csv file might look like can can be found here. You can make a copy of this template, fill it out with your items metadata, and then download the first sheet as a CSV file (File > Download as > Comma-seperated values (.csv, current sheet)).

  • All associated files for the items outlined in the csv file above must live in the same directory. So as an example if we have downloaded the csv file to ~/Downloads/example-batch-ingest-file.csv, then any file that was referenced in the csv file, should also live in the ~/Downloads directory.

  • Now we can run the batch ingest on the command line using the following rake task:

    rails jupiter:batch_ingest_items[csv_path]

    The argument csv_path is the location of the csv file. So in the above example, this might look like:

    rails jupiter:batch_ingest_items["~/Downloads/example-batch-ingest-file.csv"]

    After running the above command, you should have just successfully batch ingested your items into jupiter!