The diagram above and the steps below illustrate the workflow of subscribing to a multi-tenant cartridge:
- Cartridge deployer will deploy an application in Private PaaS.
The user with the cartridge deployer role will deploy a cartridge in WSO2 Private PaaS either via REST API, CLI or GUI. - Cloud Controller will send the
Service Created
event to the Topology topic in Message Broker.
Cloud Controller will send theService Created
event to the Topology in order to notify it that a new cartridge has been successfully deployed. Cartridge deployer will deploy a Multi-tenant service cluster.
The user with the cartridge deployer role will deploy a multi-tenant service cluster in WSO2 Private PaaS either via REST API or GUI.- Stratos Manager will send the new subscription details to the Cloud Controller (CC).
Stratos Manager will send the subscription details, which include the cartridges, policies and subscription key, to Cloud Controller via a service call. - Cloud Controller will publisher the
Cluster Created
event to the Topology topic in Message Broker (MB).
Cloud Controller will create a payload for the subscription, which includes the subscription key and the subscription cluster ID. The subscription cluster ID refers to the cluster domain, which is unique for that particular subscription. Thereafter, Cloud Controller will publish theCluster Created
event, which includes the associated policy names, to the Topology topic. - Auto-scaler will receive the Topology topic update from Message Broker.
As Auto-scaler has already subscribed to the Topology topic, it will receive theCluster Created
event, which was published by Cloud Controller. - Auto-scaler will send its decision to Cloud Controller.
When Auto-scaler receives theCluster Created
event message, it will update its in-memory Topology. Auto-scaler is responsible for making decisions, as to what instance to create and where (i.e., in which region or zone) to create the instance. Therefore, Auto-scaler will evaluate the corresponding subscription rules, which are within Auto-scaler for that specific subscription, and send its decision to Cloud Controller via a service call.
Cloud Controller will publish the
Instance Spawned
event to the Topology topic in Message Broker.
After receiving the message from Auto-scaler, Cloud Controller will update the payload with the following information: Member ID and Service endpoint of the Message Broker and Complex Event Processor (CEP). Thereafter, Cloud Controller will spawn an instance in the specified region using jclouds and pass the payload to that instance. Once the instance has been spawned Cloud Controller will update the Topology topic with theMember Created
event.In the future, the
Instance Spawned
event will be renamed toMember Created
.- Cartridge Agent will publish the
Instance Started
event to theInstance Status
topic in Message Broker.
A Cartridge Agent will be included in every instance and will start-up automatically. After the Cartridge Agent has started up, it will initially subscribe to theInstance Notifier
topic. Thereafter, the Cartridge Agent will publish theInstance Started
event to theInstance Status
topic. - Cloud Controller will receive the
Instance Status
topic update from Message Broker.
After Cloud Controller gets theInstance Started
event, Cloud Controller will publish theMember Started
event to the Topology topic in the Message Broker. - Stratos Manager will receive the
Instance Status
topic update from Message Broker.
After Stratos Manager receives theInstance Started
event, Stratos Manager will sendArtifact Update
event to all the clusters created for the above subscription. TheArtifact Update
event will contain the repository information and the encrypted repository password, which was encrypted using thesubscription key
. - Cartridge Agent will publish the
Instance Activated
event to theInstance Status
topic in Message Broker.
After the artifacts are deployed, Cartridge Agent will wait until the ports get active and the applications are started. Thereafter, Cartridge Agent will publish theInstance Activated
event to theInstance Status
topic, with member information. Furthermore, Cartridge Agent will also start the cartridge health publisher, which is used to publish periodical health statistics to the CEP via Thrift. - Cloud Controller will receive the
Instance Status
topic update from Message Broker.
Cloud Controller will receive theInstance Activated
event from Message Broker. - Cloud Controller will publish the
Member Activated
event to the Topology topic in Message Broker.
Cloud Controller will publish theMember Activated
event to the Topology topic indicating that the cartridge is ready to be used. - Load Balancer will receive the Topology topic update from Message Broker.
Load Balancer will receive theMember Activated
event from the Topology topic. - Load Balancer will update its member list in each cluster.
Load Balancer will update its in-memory Topology of that relevant cluster and also update the relevant cluster member list of the load balancing endpoint.
- The user will subscribe to a cartridge.
Stratos Manager will generate a subscription key for the subscription and store it against the repository information. - Cartridge Agent will receive the
Artifact Update
event.
After receiving theArtifact Update
event, Cartridge Agent will decrypt the repository information with thesubscription key
, get the artifact and store it in its memory. Thereafter, Cartridge Agent will use the latter information to get the Git clone or Git pull to update its artifacts. These artifacts will be deployed in the server, which is running in the cartridge instance. - Cartridge Agent will periodically publish health statistics to CEP.
Cartridge Agent will periodically publish health statistics, which will include memory consumption and load average, to CEP.