riad gozim€¦ · microservices riad gozim 2018 ome annual users meeting. omero - a recap 1. a...

30
Open Microscopy Environment Centre for Gene Regulation & Expression School of Life Sciences, University of Dundee Dundee, Scotland, UK Microservices Riad Gozim 2018 OME Annual Users Meeting

Upload: others

Post on 15-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Open Microscopy EnvironmentCentre for Gene Regulation & ExpressionSchool of Life Sciences, University of DundeeDundee, Scotland, UK

Microservices

Riad Gozim2018 OME Annual Users Meeting

Page 2: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

OMERO - a recap

1

Page 3: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

A quick refresh (IDR)

Big data

● 46TB of data

● 50M images

● 160GB database

2

Publically available

● Runs on OMERO

● Analysis, sharing and reuse of scientific image data

Highly flexible

● Suitable for many projects

● Human cells, images from the Tara Oceans, fungi

Page 4: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

OMERO.mapr

What is Mapr?

o Plugin to OMERO.web

o Built in python, pip installable (https://github.com/ome/omero-mapr#installing-from-pypi)

3

What does it do?

o Search and browse attributes linked to images in

the form of annotations (key-value)

Page 5: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

OMERO-mapr

4

Page 6: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

OMERO.mapr querying “map-annotations”

5

Page 7: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

“map-annotations” query flow

6

● IDR database - 160GB

● Query pulls together properties from numerous

tables

● Perceivably slow for deployments outside of the IDR

Page 8: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

How do we keep OMERO.mapr fast

o Nginx - load balancer

o Nginx - cache

7

Page 9: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

8

With cache hit With cache miss

Data request

Data result

Page 10: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Cache can only go so far

Cache needs to be manually populated when data is added

to IDR

Cache has be deleted and reprimed - takes time

Not a good solution for our users who can’t keep up with

updates

9

Page 11: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

The challenge

How do we optimise queries in OMERO.mapr?

How do we release any changes without rewriting lots of

code?

How do we deploy those updates without requiring a big

update?

10

Page 12: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Microservices

11

Monolithic Architecture Microservice Architecture

Page 13: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Microservices

o New features can be added

with well-defined boundaries

o Allows developers to work

separately on independent

parts

o Microservices can be

deployed, maintained,

updated, and scaled

independently of each other in

a continuous fashion12

Microservice Architecture

Page 14: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Microservices

● New features can be added with well-defined

boundaries for each piece of functionality

● Allows developers to work separately on independent

parts of OMERO

● Microservices can be deployed, maintained, updated,

and scaled independently of each other in a continuous

fashion

● Compute can be spread across more hardware

13

Page 15: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Granularity

14

Page 16: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Our types of microservice

1. Microservice as a client

2. Microservice as a server

15

Page 17: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Microservices as a client

16

Page 18: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Microservices as a server

17

Page 19: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Microservices as server, for OMERO.mapr

Change the way OMERO.mapr queries the database

Add optimisations at the database layer

Make changes silently

Does not use ICE

18

Page 20: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Architecture overview with microservice

19

Page 21: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Mapr microservice “omero-ms-mapr”

Split up monolithic code base

Added OMERO.server optimisation at the database layer

PSQL Materialised Views

Microservice built with Java and Vert.x

20

Page 22: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

A bit about Vert.x

o Polyglot fundamentals

o Async IO HTTP

implementation

o Single and multithreaded

worker “verticles”

o EventBus

o Well suited to

microservices

o Easy to build with

21

Page 23: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

As a user of IDR, what changes will I see??

Nothing - Just better performance when you click to view

something that hasn’t been cached

22

Page 24: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Nginx configuration

23

Page 25: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

To sum up

o Give us the ability to address performance bottlenecks

o Allow us to do this with minimal disruption

o Make it easier to develop more features in future

o Allow us to deploy to more hardware

24

Page 26: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Additional

- gitlab - build OMERO.server:

- https://gitlab.com/openmicroscopy/incubator/omero-dsl

- https://gitlab.com/openmicroscopy/incubator/omero-all

- gitlab - mapr

- https://gitlab.com/openmicroscopy/incubator/omero-ms-map

- Glencoe microservices:

- https://github.com/glencoesoftware/omero-ms-core

- https://github.com/glencoesoftware/omero-ms-thumbnail

- https://github.com/glencoesoftware/omero-ms-image-region

- https://github.com/glencoesoftware/omero-ms-pixel-buffer

25

Page 27: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Deployment options

26

Page 28: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Future directions

27

Page 29: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Some results of speed

28

Page 30: Riad Gozim€¦ · Microservices Riad Gozim 2018 OME Annual Users Meeting. OMERO - a recap 1. A quick refresh (IDR) Big data 46TB of data ... Introduction to gitlab/incubator OMERO.server

Lessons

1. Introduction to gitlab/incubator OMERO.server

2. Opening omero-all with an IDE

3. A bit about gradle

4. Building omero-all with gradle or IDE

5. Publishing to maven local

6. Creating an application to use omero-all

29