SlideShare a Scribd company logo
1 of 37
OSGi Cloud Ecosystems



                  David Bosschaert
        Principal Engineer, Red Hat
                 david@redhat.com
                      October 2012
Agenda

●   PaaS today
●   OSGi Cloud Ecosystems
●   'Demo'
PaaS offerings today (1)
●   General deployment containers
    –   Application Servers
        ●   i.e. deploy .WAR files in the cloud
    –   Continuous Build Jenkins/Hudson
●   Dynamic Language based
    –   e.g. Python/Ruby/JavaScript
    –   Often come with a Cloud-based IDE
●   Support for specific technology
    –   E.g. deploy Google App Engine on my own
        cloud
Paas offerings today (2)
●   Typically per cloud-VM instance
    –   you need to do your own scaling
    –   sometimes it can dynamically add replicas
        ●   of your entire deployment
    –   instances don't know much about others
        ●   although they might connect to a cloud data store
●   Today's PaaS
    –   suitable if you can deploy multiple instances of the
        same app
    –   harder to use if you have a composite application
        ●   with a variety of components
        ●   across different nodes
We need a better cloud!
●   Where things are more dynamic
●   Where not every cloud VM image has just one purpose
●   Where a bunch of different nodes work together
       to form one logical application
●   Where each cloud image could play different roles over time
●   Where we can easily migrate from one cloud vendor to another
Example cloud-based Application (1)
●   Has a web front-end
    –   host needs to be accessible from outside
         ●   (well known hostname)
●   Uses messaging
    –   replicated message broker
●   Has a data store
●   And a back end
    –   does the heavy lifting, computation
    –   integrates with 3rd party providers
●   Each entity on a different node
Example cloud-based Application (2)
                                               Every entity runs on a
                                                different cloud node



                      Back End
                      Back End
                                                Read and update
        Notifies                                request data




                                         Database
          Message
                                           Database
           Queue




                       Web
                        Web
    Submit request       Web
                         Web                    Store request data
                     Front-end
                          Web
                     Front-end
                          Web
                      Front-end
                      Front-end
                       Front-end
                        Front-end



                              User interacts
Dynamic Scaling
                    and correction
●   I want all these elements to scale
    dynamically
    –   possibly based on some domain-specific rules
●   I want the system to be able to correct itself
    –   e.g. when a Cloud VM dies/becomes inaccessible
●   I don't want to worry about reconfiguring clients
    –   when a service moves to another node
●   I want the system to be portable
    –   so I can move to another cloud
    –   in case of entire cloud failure
How do I get all this?
I need an entity that orchestrates, a Provisioner
●   Needs to be able to remotely deploy
    –   to the nodes in the system
    –   decide at runtime what the role of a certain VM is
●   Needs to know the topology
    –   as well as the application specifics
I need a flexible cloud platform
●   repurpose a Cloud VM
●   without sending the whole image to a machine again
Portability: I want to shield myself from cloud-vendor specific APIs
●   as much as possible
●   standards based
OSGi Cloud Ecosystems
●   A number of OSGi frameworks
    –   great because of their dynamic capabilities
●   Each in a separate VM/cloud node
●   Bound together to form a logical ecosystem
    –   via ecosystem-wide discovery mechanism

●   Environment
    –   OSGi Frameworks can find out about other frameworks
    –   Can easily communicate with other frameworks
    –   and services running on these frameworks
OSGi Cloud Ecosystems




A highly dynamic OSGi environment where Cloud
nodes/VMs, bundles and services come and go
How does this work?
●   Start off with a number of 'empty'
    OSGi frameworks in the cloud
    –   basic infrastructure provided
         ●   remote services capability
         ●   ecosystem support
    –   no application logic
●   A provisioner decides what goes where
    –   knows about your application
    –   and reacts to changes in topology / runtime system health
●   Discovery component provides OSGi service visibility
    across frameworks
    –   deals with service migrations
Ecosystem Support
●   Each framework registers
    –   OSGiFramework service
    –   Remote Deployment service
●   These are visible across the Ecosystem
    –   as OSGi services
    –   (via OSGi Remote Services specs)
●   But not outside
OSGiFramework Service
●   One per running Framework in the Ecosystem
    –   Available via Remote Services
●   Provides information about the framework
    public interface OSGiFramework {
      String getFrameworkVariable(String name);
    }

●   Static metadata as Service Registration properties
●   Dynamic metadata via getFrameworkVariable()
                  static metadata           dynamic metadata
            cloud type/version        available memory

            location (country code)   available diskspace

            OSGi framework version    machine load factor

            processor architecture    network throughput

            Java version              ...

            IP address

            app-defined (custom)
Provisioning
●   Need a Remote Deployment API
    –   that spans the Ecosystem
    –   works in the cloud
●   OSGi RFC 182 provides a REST API
    –   As Jan Rellermeyer discussed earlier today
    –   Add a Java client API and that would probably do it
A sample Provisioner (1/2)
// Listen for the OSGiFramework service
ServiceTracker st = new ServiceTracker(context, OSGiFramework.class.getName(),
                                        null) {
    public Object addingService(ServiceReference reference) {
        topologyChanged();
        return super.addingService(reference);
    }

     public void removedService(ServiceReference reference, Object service) {
         topologyChanged();
         super.removedService(reference, service);
     }
};

// React to changes in the topology
void topologyChanged() {
    // Deploy the web front-end
    if (getDeployments(WEB).size() == 0)
        addDeployment(WEB);

     // Deploy the Service two times.
     if (getDeployments(SERVICE).size() < 2)
         addDeployment(SERVICE);
}
A sample Provisioner (2/2)
void addDeployment(DeploymentType type) {
    ServiceReference[] possibleFrameworks = getFrameworkReferences();
    ServiceReference target = getMostSuitableFramework(type, possibleFrameworks);
    if (target == null) {
        // No suitable framework found
        return null;
    }

    String[] bundles = getDeploymentBundles(type, target);
    deployToFramework(target, bundles);
}

ServiceReference   getMostSuitableFramework(DeploymentType type,
                                            ServiceReference... frameworks) {
    for (ServiceReference ref : frameworks) {
        if (type.equals(WEB)) {
            Object prop = ref.getProperty("...framework.ip");
            if (prop instanceof String)
                 if (((String) prop).startsWith("web"))
                     return ref;
        } else if (type.equals(...) {
            // ...
        }
    }
    return null;
}
How do my distributed
        business components interact?
●   Develop them as OSGi Services
    –   then use them via OSGi Remote Services...
●   To publish a service in the ecosystem
        MyService ms = new MyServiceImpl();
        Dictionary msProps = new Hashtable();
        msProps.put("service.exported.interfaces", "*");
        msProps.put("service.exported.configs", "...configtype.ecosystem");
        context.registerService(TestService.class.getName(), ms, msProps);

●   Discovery component gives visibility across ecosystem
    –   System will react automatically to services moving to
        other VMs/nodes
    –   New instances appearing
●   Client simply uses OSGi services as normal
        MyService ms = ... // Obtained from Service Registry
        ms.doit();
OSGi Cloud Ecosystem
●   A fluid system where deployments can come and go
●   Provisioner decides what goes where
    –   Cloud nodes get added, removed
        ● Bundles might get deployed, moved
    –   Ecosystem-wide services appear, disappear
        ●   0, 1, many instances
    –   Service consumers don't need to be reconfigured
        ●   react automatically to changes
        ●   handled by OSGi Remote Services + Discovery
●   System can be repurposed
    –   thanks to OSGi dynamics
    –   no need to send VM images over again
Cloud at the OSGi Alliance
●   RFP 133 (Cloud Computing) accepted
        http://www.osgi.org/bugzilla/show_bug.cgi?id=114
●   RFC 182 REST API
    –   Available as EA draft:
        http://www.osgi.org/News/20121011
●   RFC 183 Cloud Ecosystems
    –   Early stages of discussion at the EEG
    –   Interested? Join the discussion!
●   RFP xxx Distributed Event Admin
    –   more RFPs/RFCs likely to come...
See it in action
●   Pilot on Red Hat's OpenShift cloud
    –   get your own free dev instances
●   All source code available in github
●   For more details see
        http://coderthoughts.blogspot.com
Demo Setup

                           Back End
                           Back End                      Back End
                                                         Back End




Provisioner rules:
● servlet needs to go on

  specific hostname
● exactly 1 testservice               Web Front-end
                                      Web Front-end      ●     displays available frameworks
                                        (Servlet)
                                         (Servlet)
  ● not on servlet host                                  ●     invokes TestService

                                              User interacts
Demo Setup

                           Back End
                           Back End
                                                            Back End
                                                            Back End
                           TestService
                           TestService




Provisioner rules:
● servlet needs to go on

  specific hostname
● exactly 1 testservice                  Web Front-end
                                         Web Front-end      ●     displays available frameworks
                                           (Servlet)
                                            (Servlet)
  ● not on servlet host                                     ●     invokes TestService

                                                 User interacts
Demo Setup

                           Back End
                           Back End                         Back End
                                                            Back End

                           TestService
                           TestService                     TestService
                                                           TestService




Provisioner rules:
● servlet needs to go on

  specific hostname
● exactly 1 testservice                  Web Front-end
                                         Web Front-end      ●     displays available frameworks
                                           (Servlet)
                                            (Servlet)
  ● not on servlet host                                     ●     invokes TestService

                                                 User interacts
Demo Setup – The Servlet
OSGiFramework            and TestService from Service Registry
●   lists available frameworks
    void printFrameworks(PrintWriter out) {
        // frameworkRefs list all OSGiFramework services from the OSGi Service Registry
        for (ServiceReference ref : frameworkRefs) {
            for (String key : ref.getPropertyKeys()) {
                out.println(key + " - " + ref.getProperty(key));
            }
        }
    }

●   invokes a 'computation' service
    void printTestService(PrintWriter out) {
        out.println("<H2>TestService invocation</H2>");
        TestService svc = ... // from the OSGi Service Registry
        if (svc != null)
            out.println("TestService Result: " + svc.doit());
    }
Demo Setup – Services
OSGiFramework            is provided by the Ecosystem
TestService          is a simple OSGi Service
public interface TestService {
    String doit();
}


Registered with Remote Service props
public class Activator implements BundleActivator {
    public void start(BundleContext context) throws Exception {
        TestService ts = new TestServiceImpl();
        Dictionary tsProps = new Hashtable();
        tsProps.put("service.exported.interfaces", "*");
        tsProps.put("service.exported.configs", "...configtype.ecosystem");
        context.registerService(TestService.class.getName(), ts, tsProps);
    }
}
Demo
●   Real demo available online:
      http://www.youtube.com/watch?v=8-9deWm67w0
●   Following is a set of screenshots that capture
    the essence of the demo...
Questions?
Acknowledgements
●   Cloud image Wikimedia Commons
    –   Stratocumuli by de:Benutzer:LivingShadow

More Related Content

What's hot

CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief ComparisonCloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparisonbizalgo
 
What’s new in Nuxeo 5.2?
What’s new in Nuxeo 5.2?What’s new in Nuxeo 5.2?
What’s new in Nuxeo 5.2?Nuxeo
 
OpenStack 101 Technical Overview
OpenStack 101 Technical OverviewOpenStack 101 Technical Overview
OpenStack 101 Technical OverviewOpen Stack
 
Introduction to OpenStack Architecture (Grizzly Edition)
Introduction to OpenStack Architecture (Grizzly Edition)Introduction to OpenStack Architecture (Grizzly Edition)
Introduction to OpenStack Architecture (Grizzly Edition)Ken Pepple
 
Cloud Computing Open Stack Compute Node
Cloud Computing Open Stack Compute NodeCloud Computing Open Stack Compute Node
Cloud Computing Open Stack Compute NodePalak Sood
 
Hacking apache cloud stack
Hacking apache cloud stackHacking apache cloud stack
Hacking apache cloud stackMurali Reddy
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMjbandi
 
Hacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source codeHacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source codeZhongyue Luo
 
Build public private cloud using openstack
Build public private cloud using openstackBuild public private cloud using openstack
Build public private cloud using openstackFramgia Vietnam
 
Distributed Block-level Storage Management for OpenStack, by Danile lee
Distributed Block-level Storage Management for OpenStack, by Danile leeDistributed Block-level Storage Management for OpenStack, by Danile lee
Distributed Block-level Storage Management for OpenStack, by Danile leeHui Cheng
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
 
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)Mirantis
 
Kubernetes #6 advanced scheduling
Kubernetes #6   advanced schedulingKubernetes #6   advanced scheduling
Kubernetes #6 advanced schedulingTerry Cho
 
Building an Angular 2 App
Building an Angular 2 AppBuilding an Angular 2 App
Building an Angular 2 AppFelix Gessert
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-12012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1tcloudcomputing-tw
 
OpenStack Best Practices and Considerations - terasky tech day
OpenStack Best Practices and Considerations  - terasky tech dayOpenStack Best Practices and Considerations  - terasky tech day
OpenStack Best Practices and Considerations - terasky tech dayArthur Berezin
 
Who carries your container? Zun or Magnum?
Who carries your container? Zun or Magnum?Who carries your container? Zun or Magnum?
Who carries your container? Zun or Magnum?Madhuri Kumari
 
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...Laure Vergeron
 

What's hot (20)

CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief ComparisonCloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
 
What’s new in Nuxeo 5.2?
What’s new in Nuxeo 5.2?What’s new in Nuxeo 5.2?
What’s new in Nuxeo 5.2?
 
OpenStack 101 Technical Overview
OpenStack 101 Technical OverviewOpenStack 101 Technical Overview
OpenStack 101 Technical Overview
 
Introduction to OpenStack Architecture (Grizzly Edition)
Introduction to OpenStack Architecture (Grizzly Edition)Introduction to OpenStack Architecture (Grizzly Edition)
Introduction to OpenStack Architecture (Grizzly Edition)
 
Cloud Computing Open Stack Compute Node
Cloud Computing Open Stack Compute NodeCloud Computing Open Stack Compute Node
Cloud Computing Open Stack Compute Node
 
kubernetes 101
kubernetes 101kubernetes 101
kubernetes 101
 
Hacking apache cloud stack
Hacking apache cloud stackHacking apache cloud stack
Hacking apache cloud stack
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
Hacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source codeHacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source code
 
Build public private cloud using openstack
Build public private cloud using openstackBuild public private cloud using openstack
Build public private cloud using openstack
 
Distributed Block-level Storage Management for OpenStack, by Danile lee
Distributed Block-level Storage Management for OpenStack, by Danile leeDistributed Block-level Storage Management for OpenStack, by Danile lee
Distributed Block-level Storage Management for OpenStack, by Danile lee
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
 
Kubernetes #6 advanced scheduling
Kubernetes #6   advanced schedulingKubernetes #6   advanced scheduling
Kubernetes #6 advanced scheduling
 
Building an Angular 2 App
Building an Angular 2 AppBuilding an Angular 2 App
Building an Angular 2 App
 
Session18 Madduri
Session18  MadduriSession18  Madduri
Session18 Madduri
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-12012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
 
OpenStack Best Practices and Considerations - terasky tech day
OpenStack Best Practices and Considerations  - terasky tech dayOpenStack Best Practices and Considerations  - terasky tech day
OpenStack Best Practices and Considerations - terasky tech day
 
Who carries your container? Zun or Magnum?
Who carries your container? Zun or Magnum?Who carries your container? Zun or Magnum?
Who carries your container? Zun or Magnum?
 
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
 

Similar to OSGi Cloud Ecosystems

OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)David Bosschaert
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaertmfrancis
 
OSGi and Cloud Computing - David Bosschaert
OSGi and Cloud Computing - David BosschaertOSGi and Cloud Computing - David Bosschaert
OSGi and Cloud Computing - David Bosschaertmfrancis
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
 
SALSA: A Framework for Dynamic Configuration of Cloud Services
SALSA: A Framework for Dynamic Configuration of Cloud ServicesSALSA: A Framework for Dynamic Configuration of Cloud Services
SALSA: A Framework for Dynamic Configuration of Cloud ServicesDuc-Hung LE
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassPaul Withers
 
Micro services vs hadoop
Micro services vs hadoopMicro services vs hadoop
Micro services vs hadoopGergely Devenyi
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Ruslan Meshenberg
 
SpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSASpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSAOracle Korea
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotClouddaoswald
 
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> KubernetesJJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> KubernetesMauricio (Salaboy) Salatino
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 
2013 05-multicloud-paas-interop-scenarios-fia-dublin
2013 05-multicloud-paas-interop-scenarios-fia-dublin2013 05-multicloud-paas-interop-scenarios-fia-dublin
2013 05-multicloud-paas-interop-scenarios-fia-dublinAlex Heneveld
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
Microservices with kubernetes @190316
Microservices with kubernetes @190316Microservices with kubernetes @190316
Microservices with kubernetes @190316Jupil Hwang
 
Project COLA: Use Case to create a scalable application in the cloud based on...
Project COLA: Use Case to create a scalable application in the cloud based on...Project COLA: Use Case to create a scalable application in the cloud based on...
Project COLA: Use Case to create a scalable application in the cloud based on...Project COLA
 
Multi-Tenant SOA Middleware for Cloud Computing
Multi-Tenant SOA Middleware for Cloud ComputingMulti-Tenant SOA Middleware for Cloud Computing
Multi-Tenant SOA Middleware for Cloud ComputingWSO2
 
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...Amazon Web Services
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Simon Storm
 

Similar to OSGi Cloud Ecosystems (20)

OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaert
 
OSGi and Cloud Computing - David Bosschaert
OSGi and Cloud Computing - David BosschaertOSGi and Cloud Computing - David Bosschaert
OSGi and Cloud Computing - David Bosschaert
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 
SALSA: A Framework for Dynamic Configuration of Cloud Services
SALSA: A Framework for Dynamic Configuration of Cloud ServicesSALSA: A Framework for Dynamic Configuration of Cloud Services
SALSA: A Framework for Dynamic Configuration of Cloud Services
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClass
 
Micro services vs hadoop
Micro services vs hadoopMicro services vs hadoop
Micro services vs hadoop
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3
 
SpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSASpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSA
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
 
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> KubernetesJJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
2013 05-multicloud-paas-interop-scenarios-fia-dublin
2013 05-multicloud-paas-interop-scenarios-fia-dublin2013 05-multicloud-paas-interop-scenarios-fia-dublin
2013 05-multicloud-paas-interop-scenarios-fia-dublin
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Microservices with kubernetes @190316
Microservices with kubernetes @190316Microservices with kubernetes @190316
Microservices with kubernetes @190316
 
Project COLA: Use Case to create a scalable application in the cloud based on...
Project COLA: Use Case to create a scalable application in the cloud based on...Project COLA: Use Case to create a scalable application in the cloud based on...
Project COLA: Use Case to create a scalable application in the cloud based on...
 
Multi-Tenant SOA Middleware for Cloud Computing
Multi-Tenant SOA Middleware for Cloud ComputingMulti-Tenant SOA Middleware for Cloud Computing
Multi-Tenant SOA Middleware for Cloud Computing
 
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 

More from David Bosschaert

Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGiDavid Bosschaert
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixDavid Bosschaert
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)David Bosschaert
 
What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)David Bosschaert
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)David Bosschaert
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)David Bosschaert
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0David Bosschaert
 
Update on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupUpdate on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupDavid Bosschaert
 
What's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise ReleaseWhat's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise ReleaseDavid Bosschaert
 
Distributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDistributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDavid Bosschaert
 
Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009David Bosschaert
 

More from David Bosschaert (13)

Node MCU Fun
Node MCU FunNode MCU Fun
Node MCU Fun
 
Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGi
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
 
What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0
 
Update on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupUpdate on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert Group
 
What's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise ReleaseWhat's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise Release
 
Distributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDistributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancements
 
Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009
 

OSGi Cloud Ecosystems

  • 1. OSGi Cloud Ecosystems David Bosschaert Principal Engineer, Red Hat david@redhat.com October 2012
  • 2. Agenda ● PaaS today ● OSGi Cloud Ecosystems ● 'Demo'
  • 3. PaaS offerings today (1) ● General deployment containers – Application Servers ● i.e. deploy .WAR files in the cloud – Continuous Build Jenkins/Hudson ● Dynamic Language based – e.g. Python/Ruby/JavaScript – Often come with a Cloud-based IDE ● Support for specific technology – E.g. deploy Google App Engine on my own cloud
  • 4. Paas offerings today (2) ● Typically per cloud-VM instance – you need to do your own scaling – sometimes it can dynamically add replicas ● of your entire deployment – instances don't know much about others ● although they might connect to a cloud data store ● Today's PaaS – suitable if you can deploy multiple instances of the same app – harder to use if you have a composite application ● with a variety of components ● across different nodes
  • 5. We need a better cloud! ● Where things are more dynamic ● Where not every cloud VM image has just one purpose ● Where a bunch of different nodes work together to form one logical application ● Where each cloud image could play different roles over time ● Where we can easily migrate from one cloud vendor to another
  • 6. Example cloud-based Application (1) ● Has a web front-end – host needs to be accessible from outside ● (well known hostname) ● Uses messaging – replicated message broker ● Has a data store ● And a back end – does the heavy lifting, computation – integrates with 3rd party providers ● Each entity on a different node
  • 7. Example cloud-based Application (2) Every entity runs on a different cloud node Back End Back End Read and update Notifies request data Database Message Database Queue Web Web Submit request Web Web Store request data Front-end Web Front-end Web Front-end Front-end Front-end Front-end User interacts
  • 8. Dynamic Scaling and correction ● I want all these elements to scale dynamically – possibly based on some domain-specific rules ● I want the system to be able to correct itself – e.g. when a Cloud VM dies/becomes inaccessible ● I don't want to worry about reconfiguring clients – when a service moves to another node ● I want the system to be portable – so I can move to another cloud – in case of entire cloud failure
  • 9. How do I get all this? I need an entity that orchestrates, a Provisioner ● Needs to be able to remotely deploy – to the nodes in the system – decide at runtime what the role of a certain VM is ● Needs to know the topology – as well as the application specifics I need a flexible cloud platform ● repurpose a Cloud VM ● without sending the whole image to a machine again Portability: I want to shield myself from cloud-vendor specific APIs ● as much as possible ● standards based
  • 10. OSGi Cloud Ecosystems ● A number of OSGi frameworks – great because of their dynamic capabilities ● Each in a separate VM/cloud node ● Bound together to form a logical ecosystem – via ecosystem-wide discovery mechanism ● Environment – OSGi Frameworks can find out about other frameworks – Can easily communicate with other frameworks – and services running on these frameworks
  • 11. OSGi Cloud Ecosystems A highly dynamic OSGi environment where Cloud nodes/VMs, bundles and services come and go
  • 12. How does this work? ● Start off with a number of 'empty' OSGi frameworks in the cloud – basic infrastructure provided ● remote services capability ● ecosystem support – no application logic ● A provisioner decides what goes where – knows about your application – and reacts to changes in topology / runtime system health ● Discovery component provides OSGi service visibility across frameworks – deals with service migrations
  • 13. Ecosystem Support ● Each framework registers – OSGiFramework service – Remote Deployment service ● These are visible across the Ecosystem – as OSGi services – (via OSGi Remote Services specs) ● But not outside
  • 14. OSGiFramework Service ● One per running Framework in the Ecosystem – Available via Remote Services ● Provides information about the framework public interface OSGiFramework { String getFrameworkVariable(String name); } ● Static metadata as Service Registration properties ● Dynamic metadata via getFrameworkVariable() static metadata dynamic metadata cloud type/version available memory location (country code) available diskspace OSGi framework version machine load factor processor architecture network throughput Java version ... IP address app-defined (custom)
  • 15. Provisioning ● Need a Remote Deployment API – that spans the Ecosystem – works in the cloud ● OSGi RFC 182 provides a REST API – As Jan Rellermeyer discussed earlier today – Add a Java client API and that would probably do it
  • 16. A sample Provisioner (1/2) // Listen for the OSGiFramework service ServiceTracker st = new ServiceTracker(context, OSGiFramework.class.getName(), null) { public Object addingService(ServiceReference reference) { topologyChanged(); return super.addingService(reference); } public void removedService(ServiceReference reference, Object service) { topologyChanged(); super.removedService(reference, service); } }; // React to changes in the topology void topologyChanged() { // Deploy the web front-end if (getDeployments(WEB).size() == 0) addDeployment(WEB); // Deploy the Service two times. if (getDeployments(SERVICE).size() < 2) addDeployment(SERVICE); }
  • 17. A sample Provisioner (2/2) void addDeployment(DeploymentType type) { ServiceReference[] possibleFrameworks = getFrameworkReferences(); ServiceReference target = getMostSuitableFramework(type, possibleFrameworks); if (target == null) { // No suitable framework found return null; } String[] bundles = getDeploymentBundles(type, target); deployToFramework(target, bundles); } ServiceReference getMostSuitableFramework(DeploymentType type, ServiceReference... frameworks) { for (ServiceReference ref : frameworks) { if (type.equals(WEB)) { Object prop = ref.getProperty("...framework.ip"); if (prop instanceof String) if (((String) prop).startsWith("web")) return ref; } else if (type.equals(...) { // ... } } return null; }
  • 18. How do my distributed business components interact? ● Develop them as OSGi Services – then use them via OSGi Remote Services... ● To publish a service in the ecosystem MyService ms = new MyServiceImpl(); Dictionary msProps = new Hashtable(); msProps.put("service.exported.interfaces", "*"); msProps.put("service.exported.configs", "...configtype.ecosystem"); context.registerService(TestService.class.getName(), ms, msProps); ● Discovery component gives visibility across ecosystem – System will react automatically to services moving to other VMs/nodes – New instances appearing ● Client simply uses OSGi services as normal MyService ms = ... // Obtained from Service Registry ms.doit();
  • 19. OSGi Cloud Ecosystem ● A fluid system where deployments can come and go ● Provisioner decides what goes where – Cloud nodes get added, removed ● Bundles might get deployed, moved – Ecosystem-wide services appear, disappear ● 0, 1, many instances – Service consumers don't need to be reconfigured ● react automatically to changes ● handled by OSGi Remote Services + Discovery ● System can be repurposed – thanks to OSGi dynamics – no need to send VM images over again
  • 20. Cloud at the OSGi Alliance ● RFP 133 (Cloud Computing) accepted http://www.osgi.org/bugzilla/show_bug.cgi?id=114 ● RFC 182 REST API – Available as EA draft: http://www.osgi.org/News/20121011 ● RFC 183 Cloud Ecosystems – Early stages of discussion at the EEG – Interested? Join the discussion! ● RFP xxx Distributed Event Admin – more RFPs/RFCs likely to come...
  • 21. See it in action ● Pilot on Red Hat's OpenShift cloud – get your own free dev instances ● All source code available in github ● For more details see http://coderthoughts.blogspot.com
  • 22. Demo Setup Back End Back End Back End Back End Provisioner rules: ● servlet needs to go on specific hostname ● exactly 1 testservice Web Front-end Web Front-end ● displays available frameworks (Servlet) (Servlet) ● not on servlet host ● invokes TestService User interacts
  • 23. Demo Setup Back End Back End Back End Back End TestService TestService Provisioner rules: ● servlet needs to go on specific hostname ● exactly 1 testservice Web Front-end Web Front-end ● displays available frameworks (Servlet) (Servlet) ● not on servlet host ● invokes TestService User interacts
  • 24. Demo Setup Back End Back End Back End Back End TestService TestService TestService TestService Provisioner rules: ● servlet needs to go on specific hostname ● exactly 1 testservice Web Front-end Web Front-end ● displays available frameworks (Servlet) (Servlet) ● not on servlet host ● invokes TestService User interacts
  • 25. Demo Setup – The Servlet OSGiFramework and TestService from Service Registry ● lists available frameworks void printFrameworks(PrintWriter out) { // frameworkRefs list all OSGiFramework services from the OSGi Service Registry for (ServiceReference ref : frameworkRefs) { for (String key : ref.getPropertyKeys()) { out.println(key + " - " + ref.getProperty(key)); } } } ● invokes a 'computation' service void printTestService(PrintWriter out) { out.println("<H2>TestService invocation</H2>"); TestService svc = ... // from the OSGi Service Registry if (svc != null) out.println("TestService Result: " + svc.doit()); }
  • 26. Demo Setup – Services OSGiFramework is provided by the Ecosystem TestService is a simple OSGi Service public interface TestService { String doit(); } Registered with Remote Service props public class Activator implements BundleActivator { public void start(BundleContext context) throws Exception { TestService ts = new TestServiceImpl(); Dictionary tsProps = new Hashtable(); tsProps.put("service.exported.interfaces", "*"); tsProps.put("service.exported.configs", "...configtype.ecosystem"); context.registerService(TestService.class.getName(), ts, tsProps); } }
  • 27. Demo ● Real demo available online: http://www.youtube.com/watch?v=8-9deWm67w0 ● Following is a set of screenshots that capture the essence of the demo...
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 37. Acknowledgements ● Cloud image Wikimedia Commons – Stratocumuli by de:Benutzer:LivingShadow