Guillotina

Ramon Navarro
Ramon NavarroCTO at Onna
GUILLOTINA
An Async REST Resource DB to manage millions of objects
CoFounder/CTO Onna - SF/BCN
Connect and search all knowledge

inside an enterprise with ML
Ramon Navarro Bosch
Plone Software Foundation & FWT Member
Web Framework Engineer 😱 !!
BACKGROUND
“Organizing data is where we spend more time and its boring.”
Data Scientist Sysadmin / Engineers
Tables / CSV Docs / Unstructured data
NOSQLSQL
WEB FRAMEWORKS
• Angular/React : Server rendering frameworks are
dead
• Most sources of data comes from the web/api
• Lots of experience on storing, distributing,
managing resources
Web Framework

Communities
Data Scientist

Communities
Connect live data web framework with data scientist framework
Long time ago … 18 years … Zope and ZODB was created
object oriented DB and web application server
Then 16 years ago … Plone was created
layer on top of Z stack to provide CMS
Then 7 years ago … Pyramid was created
merge pylons + repoze.bfg (zope fork)
Then 2 years ago … Plone REST API was created
Abstraction layer for creating resources on top of Plone 5
300 python packages
Then 1 years ago … plone.server was created
Rewrite from scratch of minimum Plone backend with py 3.6 and asyncio
Guillotina
TRANSACTION
All operations are managed to
be durable and confirmed,
conflict resolution policies
TREE
Information is

organized in

trees of objects
RESOURCES
Objects are resources with
schema attributes, annotations,
OO inheritance and static/
dynamic behaviors.
RESOURCE
SCHEMA
JSON/
PYTHON
Direct mapping of JSON
schemas and python schemas
SECURITY
Full definition of permissions /
roles / principals with global
and local inheritance of
permissions on the tree.Allow,
Deny, Unset,AllowSingle (no
inheritance)
CRUD
DynamicTraversal CRUD
HTTP verbs mapping for each
content type
Custom endpoints for specific
operations
GET
HEAD
POST
PUTPATCH
ASYNCIO
All based on asyncio for
network integrations with
external indexers, db, services
Based aioHTTP
CORS
Cors configured globally and
enabled by default
WEBSOCKET
Websocket connection to
apply operations throw
frames. Mapping of REST API
on aTCP async channel.
TUS
Binary resumable file upload
EVENT
Event based system to trigger
operations in code
REGISTRY
Configuration registry x main
container
QUEUE
Operational queue and after
response tasks
MULTI DB
Mount multiple DBs and
partition objects pickles based
onTree position
POSTGRESQL
COCKROACH
FILE CLOUD
Support for S3/GCloud
storage.
***local distributed FS
soon***
INDEX
Elasticsearch indexing
DIST CACHE
Redis backend
SWAGGER
Automatic API documentation
generation
CONTAINERS
Docker / K8s / Nomad out
the box
EXPLICIT PY
All configuration is defined on
the code using decorators
@configure.service()
guillotina(x) = argmin Zope/Plone(x)
* zope.interface still used
Traversal
/DB/MAIN_CONTAINER/OBJ1/OBJ2
• Only >= Python 3.5
• Designed to host millions of objects
• Memory optimizations
• Apply operations to contained objects in async
• Authentication & authorization extensions (oauth2
flow supported)
• Reusable UI JS components from Plone (Widgets/
SPA)
TRY IT !
{
"databases": [{
"db": {
"storage": "postgresql",
"transaction_strategy": "resolve",
"dsn": {
"scheme": "postgres",
"dbname": "guillotina",
"user": "postgres",
"host": "localhost",
"password": "",
"port": 5432
},
"pool_size": 40,
"read_only": false
}
}],
"host": "127.0.0.1",
"port": 8080,
"static": [
{"favicon.ico": "static/favicon.ico"}
],
"root_user": {
"password": "root"
},
"cors": {
"allow_origin": ["*"],
"allow_methods": ["GET", "POST", "DELETE", "HEAD", "PATCH"],
"allow_headers": ["*"],
"expose_headers": ["*"],
"allow_credentials": true,
"max_age": 3660
},
"utilities": []
}
docker run -p 5432:5432 -d postgres
psql -h localhost -U postgres << EOF
CREATE DATABASE guillotina;
EOF
pip install guillotina
guillotina -c config.json
curl -X GET http://localhost:8080
curl -u root:root http://localhost:8080
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Container","id":"mycontainer","title":"My Lovely Container"}' 
http://localhost:8080/db/ | jq .
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Folder","id":"myfolder"}' http://localhost:8080/db/mycontainer | jq .
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Folder"}' http://localhost:8080/db/mycontainer | jq .
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Item","id":"myitem"}' http://localhost:8080/db/mycontainer/myfolder | jq .
curl -X PATCH -u root:root -H "Content-Type: application/json" 
-d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq .
curl -X GET -u root:root -H "Content-Type: application/json" 
-d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq .
curl -X DELETE -u root:root -H "Content-Type: application/json" 
http://localhost:8080/db/mycontainer | jq .
DATA MODEL
Resource &
Container
Interface
Schema fields
Static
Behaviors
Dynamic
Behaviors
from guillotina import configure
from guillotina.content import Item
from guillotina.interfaces import IItem
from guillotina import schema
class ICustomType(IItem):
foo = schema.Text()
@configure.contenttype(
type_name="CustomType",
schema=ICustomType,
behaviors=[
"guillotina.behaviors.dublincore.IDublinCore",
"example.behaviors.ICustomBehavior",
])
class CustomType(Item):
pass
@configure.subscriber(for_=(ICustomType, IObjectAddedEvent))
async def created_userfolder(obj, evnt):
...
@configure.service(
context=ICustomType, name='@myEndpoint', method='GET',
permission='guillotina.AccessContent')
class MyEndpoint(Service):
async def __call__(self):
...
WIP
WIP : DISTRIBUTED HIVE
Execute an operation to all objects in distributed execution
Based on etcd
Dynamic workers that are going to compute a task
No aggregation callback
Batch mass modification of the model
guillotina_hive
(thanks @vangheezy)
from guillotina.traversal import traverse
async def my_task(task_info, root, request):
data = task_info.data
path = data['path']
ob, end_path = await traverse(request, root, path.lstrip('/').split('/'))
assert len(end_path) == 0
from guillotina.component import getUtility
from guillotina_hive.interfaces import IHiveUtility
hive = getUtility(IHiveUtility)
task_info = TaskInfo('my_task', {'foo': 'bar'})
await hive.push_task(task_info)
WIP : INFERENCE
Right now using tf serving
Storing models as resources on the api
TF loader adapter to get the model with cache
Manages tf serving service provisioning on k8s
guillotina_tf
URI_RESOURCE/@applyModel?model=URI_MODEL
Use event system on create/update apply model
WIP : DISTRIBUTEDTRAINING
Right now using tf distributed
Storing models as resources on the api
Start workers and parameters servers with k8s
Offer the tf operation to add guillotina REST API as source
Reinforcement learning support
ML architecture definition on guillotina with RestrictedPython
guillotina_tflearn
send_to_learn(FEED,ARCHITECTURE, MODEL_URL)
Websocket feedback
“Why gRPC has no asyncio support?”
“Made in Barcelona, looking for contributions”
l
October 16 22 2017
Come to the Digital Experience Conference
2017.ploneconf.org
PREGUNTES ?
GRÀCIES !
ramon@plone.org
CORE : https://github.com/plone/guillotina
DOCS : http://guillotina.readthedocs.io/en/latest/
PYPI : https://pypi.python.org/pypi/guillotina
MODULES : https://github.com/guillotinaweb
1 of 47

Recommended

Pipelines for model deployment by
Pipelines for model deploymentPipelines for model deployment
Pipelines for model deploymentRamon Navarro
311 views18 slides
End to-end example: consumer loan acceptance scoring using kubeflow by
End to-end example: consumer loan acceptance scoring using kubeflowEnd to-end example: consumer loan acceptance scoring using kubeflow
End to-end example: consumer loan acceptance scoring using kubeflowRadovan Parrak
107 views8 slides
Kubeflow Pipelines (with Tekton) by
Kubeflow Pipelines (with Tekton)Kubeflow Pipelines (with Tekton)
Kubeflow Pipelines (with Tekton)Animesh Singh
6.8K views26 slides
Kibana + timelion: time series with the elastic stack by
Kibana + timelion: time series with the elastic stackKibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stackSylvain Wallez
7.6K views34 slides
Putting Kafka Together with the Best of Google Cloud Platform by
Putting Kafka Together with the Best of Google Cloud Platform Putting Kafka Together with the Best of Google Cloud Platform
Putting Kafka Together with the Best of Google Cloud Platform confluent
2.7K views26 slides
Building a fully Kafka-based product as a Data Scientist | Patrick Neff, BAADER by
Building a fully Kafka-based product as a Data Scientist | Patrick Neff, BAADERBuilding a fully Kafka-based product as a Data Scientist | Patrick Neff, BAADER
Building a fully Kafka-based product as a Data Scientist | Patrick Neff, BAADERHostedbyConfluent
483 views27 slides

More Related Content

What's hot

The magic behind your Lyft ride prices: A case study on machine learning and ... by
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...Karthik Murugesan
558 views36 slides
Kafka Streams - From the Ground Up to the Cloud by
Kafka Streams - From the Ground Up to the CloudKafka Streams - From the Ground Up to the Cloud
Kafka Streams - From the Ground Up to the CloudVMware Tanzu
1.3K views14 slides
Apache Kafka as Message Queue for your microservices and other occasions by
Apache Kafka as Message Queue for your microservices and other occasionsApache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasionsMichael Reinsch
922 views20 slides
Kafka and Kafka Streams in the Global Schibsted Data Platform by
Kafka and Kafka Streams in the Global Schibsted Data PlatformKafka and Kafka Streams in the Global Schibsted Data Platform
Kafka and Kafka Streams in the Global Schibsted Data PlatformFredrik Vraalsen
181 views41 slides
2020 07-30 elastic agent + ingest management by
2020 07-30 elastic agent + ingest management2020 07-30 elastic agent + ingest management
2020 07-30 elastic agent + ingest managementDaliya Spasova
248 views46 slides
The Past, Present, and Future of Apache Flink® by
The Past, Present, and Future of Apache Flink®The Past, Present, and Future of Apache Flink®
The Past, Present, and Future of Apache Flink®Aljoscha Krettek
132 views33 slides

What's hot(20)

The magic behind your Lyft ride prices: A case study on machine learning and ... by Karthik Murugesan
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...
Karthik Murugesan558 views
Kafka Streams - From the Ground Up to the Cloud by VMware Tanzu
Kafka Streams - From the Ground Up to the CloudKafka Streams - From the Ground Up to the Cloud
Kafka Streams - From the Ground Up to the Cloud
VMware Tanzu1.3K views
Apache Kafka as Message Queue for your microservices and other occasions by Michael Reinsch
Apache Kafka as Message Queue for your microservices and other occasionsApache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasions
Michael Reinsch922 views
Kafka and Kafka Streams in the Global Schibsted Data Platform by Fredrik Vraalsen
Kafka and Kafka Streams in the Global Schibsted Data PlatformKafka and Kafka Streams in the Global Schibsted Data Platform
Kafka and Kafka Streams in the Global Schibsted Data Platform
Fredrik Vraalsen181 views
2020 07-30 elastic agent + ingest management by Daliya Spasova
2020 07-30 elastic agent + ingest management2020 07-30 elastic agent + ingest management
2020 07-30 elastic agent + ingest management
Daliya Spasova248 views
The Past, Present, and Future of Apache Flink® by Aljoscha Krettek
The Past, Present, and Future of Apache Flink®The Past, Present, and Future of Apache Flink®
The Past, Present, and Future of Apache Flink®
Aljoscha Krettek132 views
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl... by confluent
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
confluent1.4K views
Distributed Kafka Architecture Taboola Scale by Apache Kafka TLV
Distributed Kafka Architecture Taboola ScaleDistributed Kafka Architecture Taboola Scale
Distributed Kafka Architecture Taboola Scale
Apache Kafka TLV792 views
A Walkthrough of InfluxCloud 2.0 by Tim Hall by InfluxData
A Walkthrough of InfluxCloud 2.0 by Tim HallA Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim Hall
InfluxData397 views
Experience with C++11 in ArangoDB by Max Neunhöffer
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDB
Max Neunhöffer1.8K views
James Turner (Caplin) - Enterprise HTML5 Patterns by akqaanoraks
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
akqaanoraks868 views
Streaming your Lyft Ride Prices - Flink Forward SF 2019 by Thomas Weise
Streaming your Lyft Ride Prices - Flink Forward SF 2019Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019
Thomas Weise508 views
Distributed Tracing with OpenTracing, ZipKin and Kubernetes by Container Solutions
Distributed Tracing with OpenTracing, ZipKin and KubernetesDistributed Tracing with OpenTracing, ZipKin and Kubernetes
Distributed Tracing with OpenTracing, ZipKin and Kubernetes
Container Solutions9.2K views
Microservice-based software architecture by ArangoDB Database
Microservice-based software architectureMicroservice-based software architecture
Microservice-based software architecture
ArangoDB Database2.1K views
The journey of Moving from AWS ELK to GCP Data Pipeline by Randy Huang
The journey of Moving from AWS ELK to GCP Data PipelineThe journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data Pipeline
Randy Huang1.3K views
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream... by Flink Forward
Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Flink Forward122 views
WebAPI::DBIC - Automated RESTful API's by Michael Francis
WebAPI::DBIC - Automated RESTful API'sWebAPI::DBIC - Automated RESTful API's
WebAPI::DBIC - Automated RESTful API's
Michael Francis816 views
Change Data Capture - Scale by the Bay 2019 by Petr Zapletal
Change Data Capture - Scale by the Bay 2019Change Data Capture - Scale by the Bay 2019
Change Data Capture - Scale by the Bay 2019
Petr Zapletal379 views
Flink September 2015 Community Update by Robert Metzger
Flink September 2015 Community UpdateFlink September 2015 Community Update
Flink September 2015 Community Update
Robert Metzger829 views

Similar to Guillotina

Guillotina: The Asyncio REST Resource API by
Guillotina: The Asyncio REST Resource APIGuillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource APINathan Van Gheem
1K views59 slides
OrientDB introduction - NoSQL by
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQLLuca Garulli
9.9K views15 slides
Terrastore - A document database for developers by
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developersSergio Bossa
3.5K views38 slides
Developing your first application using FIWARE by
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
1.7K views60 slides
Just one-shade-of-openstack by
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstackRoberto Polli
186 views28 slides
Saving Time And Effort With QuickBase Api - Sergio Haro by
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroQuickBase, Inc.
7.8K views33 slides

Similar to Guillotina(20)

Guillotina: The Asyncio REST Resource API by Nathan Van Gheem
Guillotina: The Asyncio REST Resource APIGuillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource API
Nathan Van Gheem1K views
OrientDB introduction - NoSQL by Luca Garulli
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQL
Luca Garulli9.9K views
Terrastore - A document database for developers by Sergio Bossa
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
Sergio Bossa3.5K views
Developing your first application using FIWARE by FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
FIWARE1.7K views
Just one-shade-of-openstack by Roberto Polli
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
Roberto Polli186 views
Saving Time And Effort With QuickBase Api - Sergio Haro by QuickBase, Inc.
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
QuickBase, Inc.7.8K views
비동기 회고 발표자료 by Benjamin Kim
비동기 회고 발표자료비동기 회고 발표자료
비동기 회고 발표자료
Benjamin Kim5.1K views
The Magic Revealed: Four Real-World Examples of Using the Client Object Model... by SPTechCon
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
SPTechCon3K views
Icinga 2009 at OSMC by Icinga
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMC
Icinga402 views
Build powerfull and smart web applications with Symfony2 by Hugo Hamon
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
Hugo Hamon6.4K views
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas by MapR Technologies
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael HausenblasBerlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
MapR Technologies14.3K views
High quality ap is with api platform by Nelson Kopliku
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
Nelson Kopliku1.1K views
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A... by Matt Stubbs
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...
Matt Stubbs352 views
iguazio - nuclio overview to CNCF (Sep 25th 2017) by Eran Duchan
iguazio - nuclio overview to CNCF (Sep 25th 2017)iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)
Eran Duchan351 views
nuclio Overview October 2017 by iguazio
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017
iguazio3.4K views
OSMC 2009 | Icinga by Icinga Team by NETWAYS
OSMC 2009 | Icinga by Icinga TeamOSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga Team
NETWAYS31 views
HTML5 tutorial: canvas, offfline & sockets by Remy Sharp
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
Remy Sharp6.7K views
Hammock, a Good Place to Rest by Stratoscale
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to Rest
Stratoscale1.4K views

More from Ramon Navarro

Plone server by
Plone serverPlone server
Plone serverRamon Navarro
1.6K views75 slides
How containers helped a SaaS startup be developed and go live by
How containers helped a SaaS startup be developed and go liveHow containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go liveRamon Navarro
1.4K views50 slides
Plone 5 and machine learning by
Plone 5 and machine learningPlone 5 and machine learning
Plone 5 and machine learningRamon Navarro
623 views42 slides
CI on large open source software : Plone & Plone 5 is here! by
CI on large open source software : Plone & Plone 5 is here!CI on large open source software : Plone & Plone 5 is here!
CI on large open source software : Plone & Plone 5 is here!Ramon Navarro
1.8K views24 slides
Resource registries plone conf 2014 by
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014Ramon Navarro
1.4K views30 slides
Pyramid by
PyramidPyramid
PyramidRamon Navarro
2.3K views9 slides

More from Ramon Navarro(11)

How containers helped a SaaS startup be developed and go live by Ramon Navarro
How containers helped a SaaS startup be developed and go liveHow containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go live
Ramon Navarro1.4K views
Plone 5 and machine learning by Ramon Navarro
Plone 5 and machine learningPlone 5 and machine learning
Plone 5 and machine learning
Ramon Navarro623 views
CI on large open source software : Plone & Plone 5 is here! by Ramon Navarro
CI on large open source software : Plone & Plone 5 is here!CI on large open source software : Plone & Plone 5 is here!
CI on large open source software : Plone & Plone 5 is here!
Ramon Navarro1.8K views
Resource registries plone conf 2014 by Ramon Navarro
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014
Ramon Navarro1.4K views
Multilingual sites in plone by Ramon Navarro
Multilingual sites in ploneMultilingual sites in plone
Multilingual sites in plone
Ramon Navarro2.1K views
Presentacio meetup Python BCN by Ramon Navarro
Presentacio meetup Python BCNPresentacio meetup Python BCN
Presentacio meetup Python BCN
Ramon Navarro466 views
plone.app.multilingual by Ramon Navarro
plone.app.multilingual plone.app.multilingual
plone.app.multilingual
Ramon Navarro6.6K views
WPD Barcelona 2008 Què és Plone ? by Ramon Navarro
WPD Barcelona 2008 Què és Plone ?WPD Barcelona 2008 Què és Plone ?
WPD Barcelona 2008 Què és Plone ?
Ramon Navarro412 views

Recently uploaded

Basic Design Flow for Field Programmable Gate Arrays by
Basic Design Flow for Field Programmable Gate ArraysBasic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate ArraysUsha Mehta
10 views21 slides
02. COLEGIO - KIT SANITARIO .pdf by
02. COLEGIO - KIT SANITARIO .pdf02. COLEGIO - KIT SANITARIO .pdf
02. COLEGIO - KIT SANITARIO .pdfRAULALEJANDROMALDONA
5 views7 slides
Different type of computer networks .pptx by
Different  type of computer networks .pptxDifferent  type of computer networks .pptx
Different type of computer networks .pptxnazmul1514788
19 views22 slides
PIT Interpretation - Use only PIT-W EN.ppt by
PIT Interpretation - Use only PIT-W EN.pptPIT Interpretation - Use only PIT-W EN.ppt
PIT Interpretation - Use only PIT-W EN.pptRabindra Shrestha
5 views45 slides
unit 1.pptx by
unit 1.pptxunit 1.pptx
unit 1.pptxrrbornarecm
5 views53 slides
Pitchbook Repowerlab.pdf by
Pitchbook Repowerlab.pdfPitchbook Repowerlab.pdf
Pitchbook Repowerlab.pdfVictoriaGaleano
9 views12 slides

Recently uploaded(20)

Basic Design Flow for Field Programmable Gate Arrays by Usha Mehta
Basic Design Flow for Field Programmable Gate ArraysBasic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate Arrays
Usha Mehta10 views
Different type of computer networks .pptx by nazmul1514788
Different  type of computer networks .pptxDifferent  type of computer networks .pptx
Different type of computer networks .pptx
nazmul151478819 views
GDSC Mikroskil Members Onboarding 2023.pdf by gdscmikroskil
GDSC Mikroskil Members Onboarding 2023.pdfGDSC Mikroskil Members Onboarding 2023.pdf
GDSC Mikroskil Members Onboarding 2023.pdf
gdscmikroskil72 views
Programmable Logic Devices : SPLD and CPLD by Usha Mehta
Programmable Logic Devices : SPLD and CPLDProgrammable Logic Devices : SPLD and CPLD
Programmable Logic Devices : SPLD and CPLD
Usha Mehta27 views
Field Programmable Gate Arrays : Architecture by Usha Mehta
Field Programmable Gate Arrays : ArchitectureField Programmable Gate Arrays : Architecture
Field Programmable Gate Arrays : Architecture
Usha Mehta23 views
Web Dev Session 1.pptx by VedVekhande
Web Dev Session 1.pptxWeb Dev Session 1.pptx
Web Dev Session 1.pptx
VedVekhande23 views
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf by AlhamduKure
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdfASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf
AlhamduKure10 views
IRJET-Productivity Enhancement Using Method Study.pdf by SahilBavdhankar
IRJET-Productivity Enhancement Using Method Study.pdfIRJET-Productivity Enhancement Using Method Study.pdf
IRJET-Productivity Enhancement Using Method Study.pdf
SahilBavdhankar10 views
Solution Challenge Introduction.pptx by GDSCCEC
Solution Challenge Introduction.pptxSolution Challenge Introduction.pptx
Solution Challenge Introduction.pptx
GDSCCEC13 views
Ansari: Practical experiences with an LLM-based Islamic Assistant by M Waleed Kadous
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic Assistant
M Waleed Kadous12 views
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc... by csegroupvn
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
csegroupvn16 views

Guillotina

  • 1. GUILLOTINA An Async REST Resource DB to manage millions of objects
  • 2. CoFounder/CTO Onna - SF/BCN Connect and search all knowledge
 inside an enterprise with ML Ramon Navarro Bosch Plone Software Foundation & FWT Member Web Framework Engineer 😱 !!
  • 4. “Organizing data is where we spend more time and its boring.” Data Scientist Sysadmin / Engineers
  • 5. Tables / CSV Docs / Unstructured data NOSQLSQL
  • 6. WEB FRAMEWORKS • Angular/React : Server rendering frameworks are dead • Most sources of data comes from the web/api • Lots of experience on storing, distributing, managing resources
  • 7. Web Framework
 Communities Data Scientist
 Communities Connect live data web framework with data scientist framework
  • 8. Long time ago … 18 years … Zope and ZODB was created object oriented DB and web application server Then 16 years ago … Plone was created layer on top of Z stack to provide CMS Then 7 years ago … Pyramid was created merge pylons + repoze.bfg (zope fork) Then 2 years ago … Plone REST API was created Abstraction layer for creating resources on top of Plone 5 300 python packages Then 1 years ago … plone.server was created Rewrite from scratch of minimum Plone backend with py 3.6 and asyncio
  • 10. TRANSACTION All operations are managed to be durable and confirmed, conflict resolution policies
  • 12. RESOURCES Objects are resources with schema attributes, annotations, OO inheritance and static/ dynamic behaviors. RESOURCE
  • 13. SCHEMA JSON/ PYTHON Direct mapping of JSON schemas and python schemas
  • 14. SECURITY Full definition of permissions / roles / principals with global and local inheritance of permissions on the tree.Allow, Deny, Unset,AllowSingle (no inheritance)
  • 15. CRUD DynamicTraversal CRUD HTTP verbs mapping for each content type Custom endpoints for specific operations GET HEAD POST PUTPATCH
  • 16. ASYNCIO All based on asyncio for network integrations with external indexers, db, services Based aioHTTP
  • 17. CORS Cors configured globally and enabled by default
  • 18. WEBSOCKET Websocket connection to apply operations throw frames. Mapping of REST API on aTCP async channel.
  • 20. EVENT Event based system to trigger operations in code
  • 22. QUEUE Operational queue and after response tasks
  • 23. MULTI DB Mount multiple DBs and partition objects pickles based onTree position POSTGRESQL COCKROACH
  • 24. FILE CLOUD Support for S3/GCloud storage. ***local distributed FS soon***
  • 28. CONTAINERS Docker / K8s / Nomad out the box
  • 29. EXPLICIT PY All configuration is defined on the code using decorators @configure.service()
  • 30. guillotina(x) = argmin Zope/Plone(x) * zope.interface still used
  • 32. • Only >= Python 3.5 • Designed to host millions of objects • Memory optimizations • Apply operations to contained objects in async • Authentication & authorization extensions (oauth2 flow supported) • Reusable UI JS components from Plone (Widgets/ SPA)
  • 34. { "databases": [{ "db": { "storage": "postgresql", "transaction_strategy": "resolve", "dsn": { "scheme": "postgres", "dbname": "guillotina", "user": "postgres", "host": "localhost", "password": "", "port": 5432 }, "pool_size": 40, "read_only": false } }], "host": "127.0.0.1", "port": 8080, "static": [ {"favicon.ico": "static/favicon.ico"} ], "root_user": { "password": "root" }, "cors": { "allow_origin": ["*"], "allow_methods": ["GET", "POST", "DELETE", "HEAD", "PATCH"], "allow_headers": ["*"], "expose_headers": ["*"], "allow_credentials": true, "max_age": 3660 }, "utilities": [] }
  • 35. docker run -p 5432:5432 -d postgres psql -h localhost -U postgres << EOF CREATE DATABASE guillotina; EOF pip install guillotina guillotina -c config.json curl -X GET http://localhost:8080 curl -u root:root http://localhost:8080 curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Container","id":"mycontainer","title":"My Lovely Container"}' http://localhost:8080/db/ | jq . curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Folder","id":"myfolder"}' http://localhost:8080/db/mycontainer | jq . curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Folder"}' http://localhost:8080/db/mycontainer | jq . curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Item","id":"myitem"}' http://localhost:8080/db/mycontainer/myfolder | jq . curl -X PATCH -u root:root -H "Content-Type: application/json" -d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq . curl -X GET -u root:root -H "Content-Type: application/json" -d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq . curl -X DELETE -u root:root -H "Content-Type: application/json" http://localhost:8080/db/mycontainer | jq .
  • 36. DATA MODEL Resource & Container Interface Schema fields Static Behaviors Dynamic Behaviors
  • 37. from guillotina import configure from guillotina.content import Item from guillotina.interfaces import IItem from guillotina import schema class ICustomType(IItem): foo = schema.Text() @configure.contenttype( type_name="CustomType", schema=ICustomType, behaviors=[ "guillotina.behaviors.dublincore.IDublinCore", "example.behaviors.ICustomBehavior", ]) class CustomType(Item): pass
  • 38. @configure.subscriber(for_=(ICustomType, IObjectAddedEvent)) async def created_userfolder(obj, evnt): ... @configure.service( context=ICustomType, name='@myEndpoint', method='GET', permission='guillotina.AccessContent') class MyEndpoint(Service): async def __call__(self): ...
  • 39. WIP
  • 40. WIP : DISTRIBUTED HIVE Execute an operation to all objects in distributed execution Based on etcd Dynamic workers that are going to compute a task No aggregation callback Batch mass modification of the model guillotina_hive (thanks @vangheezy)
  • 41. from guillotina.traversal import traverse async def my_task(task_info, root, request): data = task_info.data path = data['path'] ob, end_path = await traverse(request, root, path.lstrip('/').split('/')) assert len(end_path) == 0 from guillotina.component import getUtility from guillotina_hive.interfaces import IHiveUtility hive = getUtility(IHiveUtility) task_info = TaskInfo('my_task', {'foo': 'bar'}) await hive.push_task(task_info)
  • 42. WIP : INFERENCE Right now using tf serving Storing models as resources on the api TF loader adapter to get the model with cache Manages tf serving service provisioning on k8s guillotina_tf URI_RESOURCE/@applyModel?model=URI_MODEL Use event system on create/update apply model
  • 43. WIP : DISTRIBUTEDTRAINING Right now using tf distributed Storing models as resources on the api Start workers and parameters servers with k8s Offer the tf operation to add guillotina REST API as source Reinforcement learning support ML architecture definition on guillotina with RestrictedPython guillotina_tflearn send_to_learn(FEED,ARCHITECTURE, MODEL_URL) Websocket feedback
  • 44. “Why gRPC has no asyncio support?”
  • 45. “Made in Barcelona, looking for contributions”
  • 46. l October 16 22 2017 Come to the Digital Experience Conference 2017.ploneconf.org
  • 47. PREGUNTES ? GRÀCIES ! ramon@plone.org CORE : https://github.com/plone/guillotina DOCS : http://guillotina.readthedocs.io/en/latest/ PYPI : https://pypi.python.org/pypi/guillotina MODULES : https://github.com/guillotinaweb