WSO2 Stratos2:All-in-One Cloud Platform Lakmal Warusawithana(Software Architect) Damitha Kumarage(Senior technical lead)
Jun 25, 2015
WSO2 Stratos2:All-in-One Cloud Platform
Lakmal Warusawithana(Software Architect)
Damitha Kumarage(Senior technical lead)
We start the session with a use case scenario where benefits of moving your applications to Cloud with Stratos2 highlighted
Then we investigate how Stratos2 architectured to provide cloud-native properties like auto-scaling, distributed-dynamically wired, multi-tenant, support self-service, granularly billed and metered and incrementally deployed
Platform-as-a-Service (PaaS)
SF
Elastic Load Balancer
CL
OU
D C
ON
TR
OL
LE
R
BUSINESS ACTIVITY MONITORING
Overwhelming?
Don’t worry, Let’s learn by example
We are a large scale car manufacturing company zcar.com
We have a problem !!!
Our dealers have their own websites to promote and sell - cars - spare parts But these sites don’t capture all our requirements - don’t contain comprehensive part lists - no uptodate price lists - do not effectively launch our promotions - often contain wrong information related to zcar.com - No proper handling of seasonal
Solution
Host zcar.com own multi-tenanted web site for zcar.com dealers. Our tenants are our dealers
Deploy the application in a zcar.com private PaaS
Use Stratos2
What we need?
IaaS to run Stratos2 A devops team to maintain deploy and maintain Stratos2(outsource?) Development team to develop zcar.com application
Steps
DevOps Tasks Setup IaaS(Openstack, vCloud, EC2)
Install Puppet Master
Customize Stratos2 puppet manifests
Let there be Stratos2
Let there be an WSO2 application server(AS)
cartridge
Deployment
Deployment
Cartridge Developer Tasks Develop any custom cartridges required
Application Developer Tasks Develop zcar.com application for app server
Tenant(dealer) Tasks
Subscribe to Stratos2 application server cartridge
Deploy the application
UI for tenant
UI for tenant
CLI for tenant
Wait …
Does each dealer has separate web application or are they sharing the same
application(multi-tenanted)?
AS is a multi-tenant cartridge
Each tenant get a completely isolated AS environment
Each user has his own zcar application
running in a AS cluster
OK who handle security?
Who handle load?
Who take backups?
Who handle whole lot of other issues that a enterprise application developer(zcar.com
developers) need to worry about?
That’s why you choose Stratos2
Zcar.com is car business
They just know about cars
So let them concentrate on their car app
Rest is Stratos2
Got the picture?
Ok let’s see what happen underneath
Stratos2 Core Components
Stratos 2.0
Understanding the Stratos2 Controller
Cloud Controller(CC): using jclouds creates/removes VM or LXC instances, based on input from ELB Elastic Load Balancer(ELB): distributes requests to the correct instances, based on tenant and load balance, including rewriting URLs Artifact Distribution Coordinator(ADC): takes complete applications and breaks into per-instance components, which are then loaded into instances by Deployment Synchronizer
Understanding the Stratos2 Controller
Deployment Synchronizer: checks out the right code for an Instance Management Console: allows control of all this by either Web UI or interactive command-line tooling Load Monitor: takes information on load from multiple sources
ADC
Tenant-aware ELB
• Fail-over, auto-scaling and multi-tenancy • Single load balancer route incoming requests to clusters of different services in a tenant-aware manner • IaaS independent elasticity Simple textual configuration language
Tenant-aware ELB
Private Jet Mode for tenants Some tenants load to deploy in a single tenant mode Allocate entire service clusters for tenants • Cloud Bursting to hybrid clouds
Cloud Controller
Heart of Stratos 2.0 Foundation Is acting as a bridge between application level and IaaS level via Jclouds API. Enables your system to scale across multiple IaaS providers Is the central location where the service topology resides
Cloud Controller
Responsible for sharing the service topology among Stratos 2.0 core services Supports hot update and deployment of its configuration files Currently support AWS EC2 IaaS provider, Openstack Nova IaaS provider and vCloud IaaS provider Enables cloud burst your system across multiple IaaS providers.
Stratos2 Core Services
• The Stratos Core Services provide essential capabilities to applications running in Stratos2 Cartridges
– Logging-as-a-Service – Data-as-a-Service (MySQL and Cassandra) – Identity-as-a-Service – Registry/Repository (for metadata and config) – Billing and Metering – Storage as a Service(Relational, NoSQL)
Identity Server / Service
• Each tenant is identified by the @tenant-domain • Each tenant admin can choose to manage their tenants user
store either within the Stratos-internal LDAP store or using an external LDAP
• Bulk import • Each tenant user has a OpenId/Infocard as well as SAML2
tokens – Single-signon – Single-Signoff is also supported
Identity Server / Service
• SAML2 is used across the Stratos deployment to ensure a smooth transition (single sign-on) between Stratos services
– SAML2 is also available as sign-on for webapps, gadgets
and other user-deployed content
Stratos2 Cartridges
• A component which can be plugged into Stratos, so that it can use Stratos core services of the Foundation Layer
• Cloud-aware platform environment extending legacy
technologies into the cloud and delivering cloud benefits • Stratos operations teams may create custom cartridges and
host any application, container, or framework in a Stratos Cloud. (Eg: A custom cartridge to bring cloud characteristics to IBM Websphere Application Server, IBM WebSphere ESB, Oracle WebLogic, or JBoss SOA Platform)
• Single tenant or multi-tenanted • Process level isolation and instance-level dedicated tenancy
Stratos2 Cartridges
• A cartridge is a package of code/configuration that plugs into Stratos 2 to offer a new PaaS Service
– e.g. Carbon ESB cartridge plugs in to provide a Stratos ESB-
as-a-Service – PHP Cartridge plugs in to provide PHP-as-a-Service
• A cartridge is a VM image plus config – In Stratos 2 you need a VM Image per IaaS – e.g. need to create both EC2 and LXC image to use on both
IaaS
Stratos2 Cartridges
– A runtime that may (or may not) be optimized to use
Stratos Core Services – e.g. Logging, Authn/Authz, Billing and Metering, Registry-
based Config – Plus a simple script to deploy code or artifacts
• Stratos takes care of: – Spawning instances – Load-balancing and URL Mapping – Autoscaling
User Roles involved in Cartridge Architecture
• Cartridge Creator – Understands the cartridge domain (e.g. PHP) plus Cartridge
SPI – Creates image and configs (including for different IaaS)
• Cartridge Deployer (Stratos Admin/DevOps) – Registers cartridge with Stratos
• Cartridge Subscriber(Tenant Admin) – Subscribes to the cartridge with Scaling parameters Other resources such as persistent file system / DB
User Roles involved in Cartridge Architecture
• Cartridge Users – Per-tenant users or developers – Access deployed applications – Upload applications to the cartridge (optional)
Custom Domain Mapping
• A tenant can have two types of domains for his applications Sub Domain Own Domain
• Suppose that a tenant is going to subscribe to an application
called xmotors • Then his sub domain url would be http://xmotors.as.zcar.com • If the own domain he provide is xmotors.com then his own domain url would be http://xmotors.com
OK now let’s go step further with our zcar.com example
New Problem
Some of the dealers are reluctant to go with the new system because they need some added functionality specific to their region, which is already provided by their existing application Their old system is written in PHP and use database mysql They want part of their old system still accessible to their clients
Solution
Introduce tenant specific php and mysql cartridges
PHP cartridge that ship with Stratos2 is a single-tenanted cartridge MySQL cartridge is also a single tenanted data cartridge that ship with Stratos2
Customize php cartridge and mysql cartridge puppet manifests Let there be PHP and MySQL cartridges Subscribe the tenant for these cartridges Upload the dealer apps
What if dealer specific app is written in Python. Stratos2 does not ship a Python cartridge yet !!!
Simple. Create your own python cartridge. You just need add a new puppet manifest for Python. Rest is for Stratos2. Your cartridge will be dynamically added to Stratos2.
Timelines
Stratos 2.0 Beta1 Released Stratos 2.0 Beta Soon Stratos 2.0 available Q1 2013 –Including PHP, MySQL, WSO2 service Cartridges
–Other cartridges will follow
Questions?