Modularity in the cloud A case study
Paul Bakker Architect at Luminis Technologies @pbakker
The case Educational system focussed on personalized learning Used in high schools in The Netherlands Expand to other countries in the near future
Cross device HTML 5 + JS A RESTful web services m d a OSGi services t u Apache Felix Mongo S3
Amdatu: OSGi Cloud components JAX-RS Apache Licensed open source project MONGO DB BlobStores Multi-tenancy Search OpenSocial...
Some numbers 190 bundles in a deployment 120 PulseOn bundles
Deployment Load Balancer Load Balancer PulseOn nodeload PulseOn node PulseOn node School A PulseOn node PulseOn node PulseOn node School B Mongo Mongo Mongo Mongo Mongo Mongo
Availability zones Load Balancer PulseOn node PulseOn node PulseOn node PulseOn node PulseOn node PulseOn node Mongo Mongo Mongo Mongo Mongo Mongo Availability Zone 1 Availability Zone 2
Horizontal scalability Horizontal scaling requires stateless nodes HTML5 clients need less server side state Any state should go to some kind of store
Auto scaling Considerable higher loads during school hours Enough capacity Without paying for idle servers at night...
Cluster per school Load Balancer small node Always use a load balancer because we don t want downtime during scaling
Early morning... Load Balancer small node
Early morning... Load Balancer small node large node large node
End of the day... Load Balancer small node large node large node
End of the day... Load Balancer small node
But how do we install our software on a node?
Provisioning servers
User Interface ace screenshot REST API Shell scripting
Provisioning servers AWS Auto Scaling 1. Start Load Balancer Node 2. register 3. register 4. provision Apache ACE deployment package
./as- create- launch- config demo - - image- id ami- 0ee8e07a - - instance- type m1.small - - region eu- west- 1 - - group sg- ce1420ba - - user- data- file userdata.txt./as- create- auto- scaling- group demo - - launch- configuration demo - - min- size 1 - - max- size 1 - - availability- zones eu- west- 1a - - load- balancers demo - - tag "k=name,v=demo,p=true"
Build releases CI server 1. GIT tag -runbundles: org.apache.felix.http.jetty;version=2.2.0,\ org.apache.felix.gogo.command;version=0.10.0,\ org.apache.felix.gogo.runtime;version=0.10.0,\ org.apache.felix.gogo.shell;version=0.10.0,\ osgi.cmpn;version='(4.2.0,4.2.1]',\ org.amdatu.security.tokenprovider.api;version=latest,\ org.amdatu.security.tokenprovider.impl;version=latest,\ org.amdatu.web.rest.doc,\ com.lopexs.arl.opensocial.config;version=latest,\ jackson-core-asl,\ 4. Distribution 2. Baseline 3. Publish Apache ACE 5. Provision Release OBR Targets
How do we know which bundles to update?
Semantic versioning is usually about package versions Export-Package: org.apache.felix.dm;version="3.1.0"
Semantic versioning demystified 1.0.0.x major.minor.micro(.qualifier) Major: Backward incompatible change Minor: Backward compatible change Micro: Implementation change Qualifier: Label, e.g. build number
Semantic versioning on bundles Bundle-Version: 1.0.0 Important for deployment!
Baselining Bytecode analysis Compare build with latest release Check if version numbers should be bumped
Continuous deployment CI server 1. GIT tag -runbundles: org.apache.felix.http.jetty;version=2.2.0,\ org.apache.felix.gogo.command;version=0.10.0,\ org.apache.felix.gogo.runtime;version=0.10.0,\ org.apache.felix.gogo.shell;version=0.10.0,\ osgi.cmpn;version='(4.2.0,4.2.1]',\ org.amdatu.security.tokenprovider.api;version=latest,\ org.amdatu.security.tokenprovider.impl;version=latest,\ org.amdatu.web.rest.doc,\ com.lopexs.arl.opensocial.config;version=latest,\ jackson-core-asl,\ 4. Distribution 2. Baseline 3. Publish Apache ACE 5. Provision Release OBR Snapshot OBR CD server
How does this fit other applications? Works in the The architecture fits most modern web cloud (but not a requirement) applications Tooling and frameworks are now mature enough
amdatu.org
Recommended reading ;)
There is more... Tomorrow 11.00 Two hour introduction to OSGi
There is more... Cloud provisioning http://ace.apache.org/ Cloud OSGi services http://www.amdatu.org/ Eclipse OSGi plugin http://bndtools.org/ That s us http://luminis.eu/
Merci Mahalo Dank U Danke Grazie Obrigado Takk Gracias Thank you