Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation •...

19
Symbiota2 Technical Update Mary Barkworth – Utah State University Ben Brandt – Northern Arizona University Neil Cobb – Northern Arizona University Curtis Dyreson – Utah State University Will Pearse – Utah State University

Transcript of Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation •...

Page 1: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Symbiota2 Technical UpdateMary Barkworth – Utah State University

Ben Brandt – Northern Arizona UniversityNeil Cobb – Northern Arizona University

Curtis Dyreson – Utah State University Will Pearse – Utah State University

Page 2: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Outline• Installation

• Architecture

Page 3: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Installation• Symbiota site/portal manager installs and maintains

– Web server (typically apache)– DBMS (MySQL)– PHP– Search Engine (SOLR)– Symbiota code (from github)– Other goodies, e.g., phpmyadmin– Edits to various config files to configure

• Goal: make Symbiota2 easy to install, update, configure

Page 4: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Docker• Virtual machine, basic Linux environment• Runs on Mac, Windows, Linux, Android (but not Windows

CE, iOS)• Containers for various software

My Computer

Apache

MySQL

PHP …

DockerImageBuild

Your Computer

Docker Virtual MachineDockerImage

DockerImage

Page 5: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Symbiota2 Installation and Updates• Install Docker once

– Download Docker image from Symbiota2 github– Edit .env file to choose DBMS and configure– Run Docker at a terminal

docker-compose –up –d

– All necessary software provided in the image– Code example

• For developers– IDEs like PHPStorm update the Docker image– Canned starter database

Page 6: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Outline• Installation

• Architecture

Page 7: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Architecture of a Web Site - 1995

client server

GET http://symbiota2.org/api/index.htm

/api

foo.htm

index.htm

/junk

Page 8: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Architecture of a Web Site - 2005

client server

GET http://symbiota2.org/api/index.php

/api

foo.php

index.php

/junk

PHPInterpreter

MySQL DBMS

Page 9: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

JavascriptInterpreter

Architecture of a Web Site - Current

client server

GET http://symbiota2.org/api/index

/api

foo.php

index.php

/junk

WebServices

MySQL DBMS

Router

ORM

Page 10: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Object-Relational Mapping (ORM)• Symbiota2 Tables and Relationships

– Next Slide

• Doctrine2 provides– Database abstraction

Drivers for MySQL, Postgres, SQLite– Map tables to objects

• Specify using annotations– Code Example

Page 11: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)
Page 12: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Benefits of Doctrine2 ORM• DBMS abstraction

Drivers for MySQL, Postgres, SQLite

• Schema is (completely) defined by ORM– Can generate DBMS schema from ORM– Define new ORM mappings, creates new tables in database– Change the ORM, changes pushed to the schema– Can migrate from MySQL to Postgres

Page 13: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

JavascriptInterpreter

Architecture of a Web Site - Current

client server

GET http://symbiota2.org/api/index

/api

foo.php

index.php

/junk

WebServices

DBMS

Router

ORM

Doctrine2

Page 14: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

API-Platform• Built on top of Symfony• Generates

– Router– Web services– Documentation

• Uses ORM and @API annotations– Code Example

Page 15: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

JavascriptInterpreter

Architecture of a Web Site - Current

client server

GET http://symbiota2.org/api/index

/api

foo.php

index.php

/junk

WebServices

DBMS

Router

ORM

Doctrine2 API Platform

Page 16: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

For Developers• Read-only developers

– Got you covered– Use an existing GET web service

• Data modification developers– Use an existing PUT web service– Use event model to attach data cleaners/transformers

• New kinds of data developers– Create ORM– Grow API Platform service end points from the ORM

Page 17: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Future - Controllers• Extra layer of abstraction

• ORM level may be too low-level• Can change ORM level

WebServicesORM

DBMS

Controllers

Page 18: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)

Future - Event-Based Model

• Cleaning plugin hooks into events between ORM and Web Services

• Translation plugin hooks into post Web Services events

JavascriptInterpreter

client server

GET http://smbiota2.org/api/index

/api

foo.php

index.php

/junk

WebServices

DBMS

Router

ORM

JavascriptInterpreter

client server

GET http://smbiota2.org/api/index

/api

foo.php

index.php

/junk

WebServices

DBMS

Router

ORM

Page 19: Symbiota2 Technical Updatesymbiota2.org/wp-content/uploads/2019/03/S2... · Installation • Symbiota site/portal manager installs and maintains – Web server (typically apache)