the joy of microservices

17
Microservices Paul Pound University of Prince Edward Island

Upload: buithu

Post on 03-Jan-2017

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: The Joy of Microservices

MicroservicesPaul Pound

University of Prince Edward Island

Page 2: The Joy of Microservices

What do we mean when we say microservices?

● Small focused tasks (in our case they are often used for creating derivatives)

● Our Microservices are invoked via events in Fedora (via JMS/Stomp messages)

Microservices

Page 3: The Joy of Microservices

Currently we have two versions.● Python version - the original version.

○ https://github.com/Islandora/islandora_microservices

● PHP version - developed so we could leverage existing Islandora php code including tuque○ https://github.com/roblib/php_listeners○ This version has been updated to use

Taverna.

Microservices

Page 4: The Joy of Microservices

● OCR● Image manipulation - thumbnails, image

conversion (tiff to jp2)● File conversion - convert Word or Open

Office files to PDF, convert PDF to PDFa● Technical metadata, crosswalks● Handles● Some security policy management

(publishing an object)● Other?

Microservices common usage

Page 5: The Joy of Microservices

● Services and their dependencies can be installed, configured and maintained once.

● UPEI has a number of Drupal servers and instead

of installing Tesseract, Imagemagick etc. on each

one we can install and maintain these packages

in one place but use them with various Fedora or Drupal installs

● Consistency - Microservices will be invoked if an object is modified by an external script, Islandora, Hydra or the Fedora admin client.

Microservices Advantages

Page 6: The Joy of Microservices

● With Taverna we can also leverage third party external services.

Advantages Continued

Page 7: The Joy of Microservices

Old PHP architecture

Page 8: The Joy of Microservices

CS482 UPEI student project to integrate the old PHP microservices with Taverna.

Goals of this project:● Create and manage workflow using

Taverna Workbench● Store Taverna T2flow in Fedora content

models

Current Microservices implementation

Page 9: The Joy of Microservices

● When our listener receive a message we will get the corresponding T2flow document from the objects content model and pass that on to Taverna Server.

● Taverna server then dispatches the workflow to the correct locations

● Taverna workbench for creating/designing workflow

Current Microservices cont’d

Page 10: The Joy of Microservices

Current architecture

Page 11: The Joy of Microservices
Page 13: The Joy of Microservices

To create a workflow you need Taverna Workbench installed.

● Click import new services and choose WSDL Service and enter a url to the services soap endpoint.

● Drag and drop functions to the canvas● Configure the functions

○ don’t forget looping and security.● Documentation● Demo workbench

Create a workflow

Page 14: The Joy of Microservices

Example Workflow

Page 15: The Joy of Microservices

There are two config.xml files.

One file contains configuration information for the services exposed via SOAP.

● /var/www/html/php_listeners

The other is the configuration information for the listener.

● /opt/php_listeners

Configure microservices

Page 17: The Joy of Microservices

● on centos○ cd /opt/php_listeners○ php listener.php○ tail -f listener.log

● add a tiff a page to a book to trigger services.

Demo microservices