...
Getting Valkyrized Hyrax up and running locally using Docker
[August 31, 2022: The following isn't merged into the main
branch yet on Github but should be by community sprint start time to allow local building and running of a Valkyrized Hyrax-based application using Postgres via Docker.]
First, make sure you have installed Docker and Docker Compose v2. Then clone the Hyrax repository.
Within your cloned repository (the hyrax
directory) is a .koppie directory that contains a test and development application called Koppie. This is similar to Dassie, but with no Fedora server loaded, and any forwarded network ports are incremented from the Dassie value.
Starting Koppie from the hyrax directory using docker compose
Build docker images for Koppie:
docker compose -
...
Make sure Dassie is not running:
docker-compose down
Note if you have Hyrax running locally from previous builds, you might need to clear out old volumes (which will wipe out local data):
...
f docker-compose-koppie.yml build
Start Koppie:
docker compose -f docker-compose-koppie.yml up
Load localhost:3001 in a browser.
Koppie runs as a different project than Dassie, so it should be possible to run both concurrently (assuming your workstation has enough RAM).
Running Commands (for testing changes, for example)
Currently Koppie should not be used for running specs, Dassie should be used instead until the specs can be updated for a valkyrie only environment.
Run specs on Dassie
The following shows an example of running rspec
on the catalog_controller
:
docker compose up
docker compose exec app sh
cd /app/samvera/hyrax-engine/
bundle exec rspec ./spec/controllers/catalog_controller_spec.rb
You may have to run bundle install
from inside the the hyrax-engine directory
Run rails console on Koppie
docker compose -f docker-compose-koppie.yml
...
up
Build docker images for Koppie:
docker-docker compose -f docker-compose-koppie.yml exec app bundle exec rails c
Troubleshooting
If the postgres service logs show permissions errors, there may be old data from alternate versions of the postgres image. The old data volumes can deleted by using
docker compose -f docker-compose-koppie.yml
...
down -v
Errors such as
exec /app/samvera/hyrax-entrypoint.sh: no such file or directory
in the app, sidekiq and db_migrate services may indicate an outdated cached hyrax-base image layer was used to build the koppie image. Trydocker compose -f docker-compose-koppie.yml
...
build --no-cache
to rebuild all the image layers.It was also seen on a Windows 10 host and was resolved by using the git
--core.autocrlf
option when cloning the repo.
Reference Documentation
References for Hyrax Development:
...