sciencehistory / chf-sufia

sufia-based hydra app
Other
9 stars 4 forks source link

Make ./bin/setup run neccesary sufia/hydra setup #509

Open jrochkind opened 7 years ago

jrochkind commented 7 years ago

See #507

rake curation_concerns:workflow:load and rake sufia:default_admin_set:create, not sure if they're idempotent, not sure if ./bin/setup is usually idempotent.

I made the ticket @hackmastera

jrochkind commented 7 years ago

rake sufia:default_admin_set:create

is idempotent in current implementation at least. https://github.com/projecthydra/sufia/blob/master/app/services/sufia/admin_set_create_service.rb#L5

rake curation_concerns:workflow:load appears to also be idempotent; goes through like 3 or 4 classes to do what it does, but appears to use AR find_or_create_by relevant attributes for each record.

jrochkind commented 7 years ago

See #507.

Doing this reliably is a pain, because you need fedora/solr to be running. If you are in dev, you might want the script to automatically start with solr_wrapper/fc_repo_wrapper, if they aren't already running. But if you are in production -- and you might want to setup a new machine in production like this -- then you can't use the wrappers.

Hmm, I might just make a dev:setup rake task that tries to all of this, that you only run in dev. In production you're still on your own -- but our capistrano task handles these things anyway in production, so you're good.

I might also leave this for later, not urgent right now.

Ways to check in code if solr and fedora are running:

https://github.com/projecthydra-labs/hyku/blob/9352612004d05d59cfe5a4ae9385dfc166aa4542/app/models/solr_endpoint.rb#L12

https://github.com/projecthydra-labs/hyku/blob/9352612004d05d59cfe5a4ae9385dfc166aa4542/app/models/fcrepo_endpoint.rb#L12