Sign inSign up

aptrust/pharos

Sponsored OSS

By Academic Preservation Trust

•Updated over 6 years ago

Image
0

7.1K

aptrust/pharos repository overview

⁠Pharos

Codacy Badge Code Climate

Build StatusContinuous IntegrationCode Coverage
developBuild Status (Development)Coverage Status
⁠Requirements

Since mid 2019 the Pharos app has been containerized. You may use the Baremetal or Docker version for development.

⁠Docker Version Requirements
⁠Baremetal Version Requirements

Installing the Postgres gem on Mac with Postgres.app: gem install pg -v 1.2.0 -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config

⁠Configuration

We use dotenv⁠ for application configuration. See .env file in this repository for configuration parameters with default/development values. This file is updated by deployment according to it's environment.

⁠Development Credentials

After running rake pharos:setup or make build and make dev you can log in with

⁠Docker Development Quick-Start

Once you have the Docker suite installed you may run make and see list of make targets you can run with make <target>. To get started run:

  1. make build This builds containers based on the current git version of the repository. If you get an error about "docker login," run docker login registry.gitlab.com

  2. make dev will start all containers (Postgres, Pharos, Nginx) and populate the database with seed data to get started.

  3. You may now open a web browser and open http://localhost:9292 and log-in with development credentials⁠

TargetDescription
buildBuild the Pharos container from current repo. Make sure to commit all changes beforehand
build-ncBuild the Pharos container from scratch, no cached layers.
cleanClean the generated/compiled files
devRun Pharos for development on localhost
devcleanStop and remove running Docker containers
devstopStop running Docker containers. Can pick up dev later
downStop containers for Pharos, Postgresql, Nginx. For local development.
dtestRun Pharos spec tests
helpThis help.
integrationRuns Pharos container with fixtures for integration tests.
integration_cleanStops and removes Pharos integration containers.
pushPush the Docker image up to the registry
releaseMake a release by building and publishing the {version} as latest tagged containers to Gitlab
revisionShow me the git hash
runJust run Pharos in foreground
runcmdStart Pharos container, run command and exit.
runconsoleRun Rails Console
runshellRun Pharos container with interactive shell
test-ciRun Pharos spec tests in CI
upStart containers in background for Pharos, Postgresql, Nginx. For local development.
⁠Common Docker tasks
  • Enter running environment in demo/prod
    • cd /srv/docker/pharos
    • sudo docker-compose exec pharos bash
  • Run a one-off command within the environment
    • cd /srv/docker/pharos
    • make runcmd <somecommand>
⁠Baremetal Development Quick-Start
  1. Make sure the requirements are met⁠
  2. Install dependencies: bundle install
  3. Create db schema: rake db:migrate
  4. Initial setup of seed data: rake pharos:setup
  5. Start appserver bundle exec puma

⁠Setting up Test Data
  • Populating stub data for testing.

There is a simple rake task to setup dummy data in SQL. by default this rake task sets up 16 or so institutions (one for each partner), about 5 fake users in each institution, 3-10 Intellectual Objects and 3-30 Generic Files for each Intellectual Object with a handful of Premis Events for each.

rake pharos:populate_db

Note the Generic File Object pid that will be output so you can use that to load the proper object in the web interface for testing.

  • Adding an event failure

A simple factory will allow you to add a failed version of any of the current premis events just by using the factory name and adding _fail at the end. So to add some fake data for a failed event for testing you could do the following in code or at command line.

#Start by getting the object you want to add the failed event to.
gf = GenericFile.first

#Then add the event as attributes
gf.add_event(FactoryBot.attributes_for(:premis_events_fixity_check_fail))
gf.save

⁠API Documentation

Swagger docs at https://aptrust.github.io/pharos/⁠

Tag summary

Content type

Image

Digest

Size

863.7 MB

Last updated

over 6 years ago

docker pull aptrust/pharos

This week's pulls

Pulls:

23

Last week