Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup instructions based on claw-playbook #20

Closed
seth-shaw-unlv opened this issue Dec 7, 2018 · 16 comments
Closed

Setup instructions based on claw-playbook #20

seth-shaw-unlv opened this issue Dec 7, 2018 · 16 comments

Comments

@seth-shaw-unlv
Copy link
Contributor

Given a vagrant up of claw playbook, how would we set up riprap to audit the included Fedora repository?

@mjordan
Copy link
Owner

mjordan commented Dec 10, 2018

@seth-shaw-unlv there is one piece missing that is required to put Riprap into production - a "fetchresourcelist" plugin to generate a list of resources to check. #14 and #6 address this. I have done some work on #14 (which would have the jsonapi module as a dependency) since to begin with, I think it makes sense to use Drupal as the source of the list of resources to check.

I'll start some concrete work on the Riprap plugin this week. Then we'll be in a position to document setting it up with a CLAW playbook.

@mjordan
Copy link
Owner

mjordan commented Dec 11, 2018

@seth-shaw-unlv making good progress on a "fetchresourcelist" plugin to generate a list of resources. See #14 for details. Need to convert Drupal URLs for media files to Fedora URLs, which I should get to today.

@mjordan
Copy link
Owner

mjordan commented Dec 31, 2018

@seth-shaw-unlv thanks for your patience.

Here's a rough draft. It assumes you are running a CLAW Playbook with fcrepo 5.

  1. Install Riprap on your Vagrant guest following the instructions in the Riprap readme, but don't bother loading the sample data, e.g., skip the php bin/console -n doctrine:fixtures:load command. You will probably want to use MySQL but SQLite works fine but you'll need to install it on the guest, e.g. sudo apt-get install sqlite3.
  2. The default config should work for you, but to be sure, look at lines 10-23 in config/services.yaml.islandora and adjust accordingly.
  3. Copy config/services.yaml.islandora to config/services.yaml
  4. To populate Riprap's database with fixity events on media in your CLAW Playbook instance, run the check fixity command a few times, a couple of minutes apart, e.g. php bin/console app:riprap:check_fixity. Each time you run this command, it will tell you how many fixity checks it performed.
  5. Start the built-in Symfony web server by running php bin/console server:start *:8001. This will provide a REST endpoint at http://localhost:8001/api/fixity.
  6. Install and configure https://github.com/mjordan/islandora_riprap to get media-level reports from within Drupal. Since you want to run Riprap on the Vagrant guest, you should use http://localhost:8001/api/fixity in the "Riprap microservice REST endpoint" config setting.

@mjordan
Copy link
Owner

mjordan commented Jan 1, 2019

@seth-shaw-unlv I have added a bunch of content to the Riprap README that should cover this. Please let me know what you think.

@seth-shaw-unlv
Copy link
Contributor Author

Thanks, @mjordan! I will take a look at it sometime this week.

@mjordan
Copy link
Owner

mjordan commented Jan 2, 2019

Cool. I just edited the instructions above to reflect some work I did yesterday.

@seth-shaw-unlv
Copy link
Contributor Author

On CentOS,

  • I cloned the application to /opt/riprap
  • cp config/services.yaml.islandora config/services.yaml. Everything looked good, so I didn't change anything
  • composer install
  • Database
    • created a MySQL user 'riprap'
    • updated the doctrine.yaml file
    • updated the .env file
    • migrated the database

So far, so good.

I ran php bin/console app:riprap:check_fixity and was notified:

In PluginFetchResourceListFromDrupal.php line 123:
                                                                                       
  Warning: count(): Parameter must be an array or an object that implements Countable  

I ran it again, verbosely, and was additionally given the stack trace:

Exception trace:
 App\Command\PluginFetchResourceListFromDrupal->execute() at /opt/riprap/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /opt/riprap/src/Command/CheckFixityCommand.php:70
 App\Command\CheckFixityCommand->execute() at /opt/riprap/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /opt/riprap/vendor/symfony/console/Application.php:904
 Symfony\Component\Console\Application->doRunCommand() at /opt/riprap/vendor/symfony/framework-bundle/Console/Application.php:89
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /opt/riprap/vendor/symfony/console/Application.php:262
 Symfony\Component\Console\Application->doRun() at /opt/riprap/vendor/symfony/framework-bundle/Console/Application.php:75
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/riprap/vendor/symfony/console/Application.php:145
 Symfony\Component\Console\Application->run() at /opt/riprap/bin/console:39

So, $node_list_array['data'] doesn't appear to be an array, but it must be something because it didn't throw a key error. Any idea what is going on or how I should debug this?

@mjordan
Copy link
Owner

mjordan commented Jan 3, 2019

Did you start the Symfony web server?

@seth-shaw-unlv
Copy link
Contributor Author

Maybe this is a Drupal configuration issue. curl -I http://localhost:8000/jsonapi/node/islandora_object responds with a 404.

@seth-shaw-unlv
Copy link
Contributor Author

Not yet, it was your step 5 when I was on 4.

@seth-shaw-unlv
Copy link
Contributor Author

I've started it now (php bin/console server:start *:8001). No change in the error when running the fixity check.

@mjordan
Copy link
Owner

mjordan commented Jan 3, 2019

How about installing https://www.drupal.org/project/jsonapi and enabling it? I didn't include that step above, but it is in the Riprap README.... which is long and detailed.

@seth-shaw-unlv
Copy link
Contributor Author

There we go. I needed to composer require drupal/jsonapi and enable it. Now it is working.

@seth-shaw-unlv
Copy link
Contributor Author

Ah. I see now. I inferred from the readme that it was a core module that would already be available, not something I needed to install separately. The readme should probably link to the JSON:API project page.

@mjordan
Copy link
Owner

mjordan commented Jan 3, 2019

Yeah. Any suggestions like that are useful. Let me do that. Once you've installed JSON:API, let me know how it goes.

@mjordan
Copy link
Owner

mjordan commented Jan 25, 2019

@seth-shaw-unlv closing this, reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants