The Research Database is a digital repository designed for public discovery of the research conducted by economists affiliated with the Federal Reserve Bank of Minneapolis Research Division. Publications, data, and conference proceedings constitute the majority of materials. The Research Database uses open source software, Hyrax, developed by the Samvera community.
BagIt archives can be created from the command line using the bag rake task:
USER_ID=1 BAG_PATH=/tmp/bags rake bag:create[publication1,publication2,publication3]
USER_ID
is the id of the user that will be notified.
The bag will be located in the directory set by the ENV['BAG_PATH']
environment variable or you can specify it when running the rake task. It will be named mpls_fed_research_<time-stamp>.tar
(time stamp being a unix time stamp). The contents of the bag will consist of all the attached files in the specified publications. The created bag will use sha256
to create checksums for the files.
To download a bag that has been created you can visit the route: /bag/mpls_fed_research_<time-stamp>.tar
.
Using docker is the most straightforward way of setting up a local development environment.
git clone git@github.com:MPLSFedResearch/cypripedium.git; cd cypripedium
Bring up the docker container: docker-compose up
Once the container has started, you should be able to visit in your browser:
The best way to know that your local development environment is running as expected is to run the automated test suite:
docker-compose exec web bash
bundle exec rspec spec
bundle exec rake db:setup
to create expected databases and run database migrationssolr_wrapper
; check in your browser at localhost:8983/solr
to see it running.fcrepo_wrapper
; check in your browser at localhost:8984/rest
to see it running.sidekiq
. You can see it running at localhost:3000/sidekiqredis-server
; Redis will run, you can check redis running by running redis-cli ping
in a new windowWhether you use docker or not, there are a few steps necessary to let you interact with your local instance.
Generate collection types and admin set:
bundle exec rails hyrax:default_collection_types:create
bundle exec rails hyrax:default_admin_set:create
Generate a new user and make them an admin on the console
bundle exec rails c
u = User.new
u.display_name = "User Name"
u.email = "email@testdomain.com"
u.password = "password"
u.password_confirmation = "password"
u.save
admin = Role.create(name: "admin")
admin.users << u
admin.save
If you then type u.admin?
it should return True
if the previous steps were successful.
bundle exec rails s
. In your browser, check to see the application running at localhost:3000
.
In the brower session, log in as the admin user you just created.
There are currently 2 environments for cypripedium: the legacy ec2 installation & and the future SSM environment.
To deploy to the legacy environment, the following command will continue to work
cap <environmentname> deploy
To deploy to the new SSM environment, you must have a configured .aws/credentials file, with a profile named "frbm-ssm".
After this is in place,
bundle exec cap ssm deploy
Will deploy to the SSM environment. The deployment system uses tags to determine the instance ids of the relevant target
hosts (SSM does not use ip addresses or the like), based on the value of the host_env
environment variable
For instance, a host with the tags Environment=stage and Project=rdb will be the target of
host_env=stage bundle exec cap ssm deploy
The system defaults host_env to "prod"
When building a new system via Ansible, the "localhost.rb" configuration will be used, and requires no further steps (other than having frbm-ssm profile set up)