Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

Adds microservice to connect Islandora to FITS webservice #3

Merged
merged 32 commits into from
Jan 2, 2020

Conversation

ajstanley
Copy link
Contributor

GitHub Issue: (link)

  • Other Relevant Links (Google Groups discussion, related pull requests,
    Release pull requests, etc.)

What does this Pull Request do?

Downloads, configures and installs a microservice to connect to FITs webservice. The connectors have been added already to the Alpaca role.

What's new?

All new code.
It will create a new media type dynamically - each new field type coming back from the fits xml will be added to the media type on ingest.

How should this be tested?

Once this role is run you should be able to add any Original File and a new Fits Metadata media associated with the owning object.

Additional Notes:

Any additional information that you think would be helpful when reviewing this
PR.

Interested parties

@Islandora-Devops/committers

@dannylamb
Copy link
Contributor

@ajstanley Hrm.... I added your fork to the requirements.yml file for fits, but it definitely didn't install crayfits or the islandora_fits module. Let me see what's up and I'll provide some instructions if I can sort out what I need to do to get this code to execute.

@ajstanley
Copy link
Contributor Author

ajstanley commented Jul 29, 2019 via email

@dannylamb
Copy link
Contributor

I had to add the role back into one of the plays linked in by playbook.yml. I'm testing it out now.

@dannylamb
Copy link
Contributor

dannylamb commented Aug 5, 2019

I'm getting this when the role starts doing its thang:

TASK [Islandora-Devops.fits : Install FITS] ************************************
Monday 05 August 2019  16:15:54 -0300 (0:00:00.502)       0:39:05.127 ********* 
changed: [default]

TASK [Islandora-Devops.fits : Move FITS into place] ****************************
Monday 05 August 2019  16:17:03 -0300 (0:01:08.432)       0:40:13.560 ********* 
changed: [default]

TASK [Islandora-Devops.fits : Install FITS web service] ************************
Monday 05 August 2019  16:17:03 -0300 (0:00:00.540)       0:40:14.100 ********* 
changed: [default]

TASK [Islandora-Devops.fits : Set fits.home in catalina.properties] ************
Monday 05 August 2019  16:17:06 -0300 (0:00:02.671)       0:40:16.771 ********* 
ERROR! The requested handler 'restart tomcat8' was not found in either the main handlers list nor in the listening handlers list
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

I don't even think it's gotten to your improvements yet. And that fits code is pretty stale. We removed it well over a year ago. Maybe there's a different way to restart tomcat we should be doing?

@dannylamb
Copy link
Contributor

dannylamb commented Aug 5, 2019

Maybe it's a order of operations type thing. I added the fits role to the crayfish play, but maybe it needs to be on the tomcat play? Because this encompasses apache and tomcat, it may be a little tricky to figure out what needs to go where. I think in the long run, we'd need

  1. the fits role
  2. a crayfits role (or just make it part of crayfish)
  3. an islandora_fits role to download/enable the drupal module, though maybe that could get thrown into config in geerlingguy's role if we can sort out the timing issues.

Let me see if I can get this sorted out. At least it's trying to run the fits role now.

@ajstanley
Copy link
Contributor Author

ajstanley commented Aug 5, 2019 via email

@dannylamb
Copy link
Contributor

Ok, I added the fits role back to the tomcat role a la Islandora-Devops/islandora-playbook@cc83a0a. Unfortunately, I forgot to pull in the newest ansible-role-alpaca in the requirements file, so there was no listener with the latest. Once I've got it, I'll issue a PR to claw-playbook with what I've got and we'll go from there.

@dannylamb
Copy link
Contributor

@ajstanley I've pushed up what I've got to a fits branch: https://github.com/Islandora-Devops/claw-playbook/compare/fits

So now everything is downloading and deploying, but I'm getting 500's from CrayFits. And I can't seem to track down the log make heads or tails of what's happening.

@ajstanley
Copy link
Contributor Author

ajstanley commented Aug 6, 2019 via email

@ajstanley
Copy link
Contributor Author

ajstanley commented Aug 6, 2019 via email

Copy link
Contributor

@whikloj whikloj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing this @ajstanley. I tried to mark all the spots so you didn't have to do too much hunting.

@@ -0,0 +1,83 @@
- name: Build site for FITS microservice
blockinfile:
path: "/etc/apache2/conf-available/CrayFits.conf"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use {{ httpd_conf_directory }} to allow for changing Apache install directory.

path: "/etc/apache2/conf-available/CrayFits.conf"
create: yes
block: |
Alias "/crayfits" "/var/www/html/CrayFits/public"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should make /var/www/html/ into a configurable variable so it can be overridden like https://github.com/Islandora-Devops/ansible-role-crayfish/blob/master/defaults/main.yml#L11

create: yes
block: |
Alias "/crayfits" "/var/www/html/CrayFits/public"
<Directory "/var/www/html/CrayFits/public">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to use new (yet to be defined) variable.

- name: Enable FITS site
file:
src: "/etc/apache2/conf-available/CrayFits.conf"
dest: "/etc/apache2/conf-enabled/CrayFits.conf"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of these lines should use {{ http_conf_directory }} as well


- name: Change owner on html dir
file:
path: /var/www/html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use your new install directory variable

- name: Install FITS Microservice from Github
git:
repo: https://github.com/roblib/CrayFits.git
dest: /var/www/html/CrayFits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use yet to be created FITS install directory variable.


- name: Clean Directory (Failure okay)
file:
path: '/var/www/html/CrayFits/vendor/symfony/monolog-bundle'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use yet to be created FITS install directory variable.


- name: Change CrayFits directory ownership, group and permissions
file:
path: /var/www/html/CrayFits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use yet to be created FITS install directory variable.


- name: Open file for logging
file:
path: /var/www/html/CrayFits/var
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use yet to be created FITS install directory variable.

- name: Run Composer On Fits Microservice
composer:
command: update
working_dir: /var/www/html/CrayFits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annnnnnd use yet to be created FITS install directory variable. Also as a TODO, we need to commit the lock file and then just do composer install to ensure everyone installs the same version of the dependencies.

owner: www-data
group: www-data

- name: Download islandora FITS module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think this whole section can be removed. If I understand correctly this is installing the drupal-module. @dannylamb has done that here so this is unnecessary.

@ajstanley
Copy link
Contributor Author

@whikloj - Whole lotta new variables, all seem to be working well. Let me know if you find anything else that needs some attention.

@rosiel
Copy link
Contributor

rosiel commented Sep 16, 2019

@whikloj do these changes meet your requests?

@whikloj
Copy link
Contributor

whikloj commented Sep 16, 2019

Sorry about that @ajstanley and @rosiel. I have not tested the build with these changes but this covers my original review.

fits_install_root: /opt
fits_install_symlink: /opt/fits
fits_user: tomcat8
fits_group: tomcat8
fits_ws: yes
crayfits_home: /var/www/html
fits_src_url: "https://github.com/harvard-lts/fits/releases/download/1.4.1/fits-{{ fits_version }}.zip"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/harvard-lts/fits/releases/download/1.4.1/fits-{{ fits_version }}.zip should be https://github.com/harvard-lts/fits/releases/download/{{ fits_version }}/fits-{{ fits_version }}.zip. No sense hardcoding one and not the other.

Copy link

@seth-shaw-unlv seth-shaw-unlv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor hard-coded value to update. Otherwise, 👍.

@ajstanley
Copy link
Contributor Author

ajstanley commented Jan 2, 2020 via email

@seth-shaw-unlv
Copy link

👏
Doing a final build before merging.

@seth-shaw-unlv seth-shaw-unlv merged commit 804aa23 into islandora-deprecated:master Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants