Hi Devs, As many of us have already experienced, verifying service grouping functionality is a very time consuming process with a real Infrastructure as a Service (IaaS) platform. This may include:
- Setting up and configuring an IaaS - Creating base images - Setting up puppet master - Implementing and installing puppet modules - Fixing issues in puppet modules, cartridge agent, start up scripts, etc - Time it takes to activate an instance - The cost involved with using a public IaaS In addition, for people who are contributing to REST API, UI, documentation, CLI it is quite difficult to execute all of the above to setup a Stratos environment. This is a topic we discussed for sometime for now, but we couldn't make any progress. During past few days I spent some time in implementing a mock IaaS in Cloud Controller to simulate the basic features of a standard IaaS. Initially this was a challenging task because the existing IaaS interface we had in Cloud Controller did not had methods like createInstance(), terminateInstance(), rather those were invoked via jclouds interface. As a result the following abstraction was introduced: Now the communication between Cloud Controller and IaaS is completely handled via the Iaas interface and jclouds specific features are moved to JcloudsIaas abstract class. Further more IaaS implementation classes were renamed accordingly. *How does it work:* - Mock IaaS starts a Mock Member thread or each instance created - A sample private IP and a public IP will be assigned to the instance - Mock Member will publish Instance Started and Instance Activated events once the thread is started - Afterwards it will start publishing sample health statistics values to CEP - If the Mock IaaS was asked to terminate an instance it will stop the relevant thread *How to use the Mock IaaS:* - Set IaaS provider as "mock" in all cartridge definitions. - Create an application definition (by including above cartridges) and prepare autoscaling policies, group definitions and application deployment policy. - Start ActiveMQ - Extract the Stratos package and start the server (no custom configurations needed) - Deploy the above artifacts I verified this feature with the latest service grouping functionality introduced in the master branch and it worked as expected. As a result this was committed to master branch. Thanks Imesh -- Imesh Gunaratne Technical Lead, WSO2 Committer & PMC Member, Apache Stratos
