Getting Started - Activiti Cloud
Getting Started with Activiti Cloud
Activiti Cloud is a set of Cloud Native components designed from the ground up to work in distributed environments. We have chosen Kubernetes as our main deployment infrastructure and we are using Spring Cloud / Spring Boot along with Docker for containerization of these components.
We have gone through a very valuable journey, meeting very passionate developers, communities and existing and potential customers who are looking to leverage these technologies (and business automation solutions) to reduce time to market and improve business agility in the Cloud. We have also contributed with these communities, making sure that the Open Source projects that we consume get back our valuable feedback and contributions.
Activiti Cloud includes 5 foundational building blocks:
Activiti Cloud Runtime Bundle
Activiti Cloud Query
Activiti Cloud Audit
Activiti Cloud Connectors
Activiti Cloud Notifications Service (GraphQL)
These building blocks are Spring Boot Starters that can be attached to any Spring Boot (2.x) application. These building blocks are enhanced with Spring Cloud functionalities which provide the Cloud Native capabilities.
By using these components you can create Activiti Cloud applications that:
can be scaled independently based on demand
can be managed in completely isolated cycles
can be upgraded and maintained independently
can provide domain specific features using the right tool for the job
On this tutorial, we wanted to show how to get started by deploying an example set of these building blocks in Kubernetes. We strongly recommend having a real Kubernetes Cluster such as GKE, PKS or EKS. We have tested the content of this blog post in AWS (Using Kops, PKS, GKE and also with Jenkins X)
Let’s get started with Kubernetes, HELM, and Activiti Cloud.
Prerequisites
The quickest and easiest way to deploy things to Kubernetes is by using HELM charts. HELM, as described in the official documentation, is: “a tool that streamlines installing and managing Kubernetes applications. Think of it like apt/yum/homebrew for Kubernetes.”
As part of Activiti Cloud, we have created a set of hierarchical HELM charts that can be used to deploy several components, some related to infrastructure (such as SSO and Gateway) and some Application specific components like Runtime Bundle, Audit Service, Query Service and a Cloud Connector.
This “Activiti Cloud Full Example” deploys the following components:
One important thing to notice is that each of the Activiti Cloud components can be used independently. This example is intended to show a large-scale deployment scenario. You can start small with a Runtime Bundle (which provides the process and task runtimes), but if you want to scale things up you need to know what you are aiming for, and this charts shows you exactly that.
Install Kubectl and HELM
Steps 1 and 2: Create a K8 cluster and configure it
Step 3: Deploy Activiti Cloud Full Example
The first step is to register the Activiti Cloud HELM charts into HELM running the following commands:
The Activiti Cloud Full Example Chart can be customized to turn on and off different features, but there is one mandatory parameter that needs to be provided which is the external domain name that is going to be used by this installation:
1-a) Configure your deployment for AWS
Go to the AWS Management Console and open the Route 53 console. Go to Hosted zones and select a public Hosted Zones and create a new Record Set. Name it using “*” character in order to create a wildcard. In the Alias Target, select the DNS name of the Ingress controller (ELB) that we deployed earlier.
Use "your-public-domain" to deploy Activiti Helm chart in the next section. In our case: raphaelallegre.com
1-b) Configure your deployment for GCP
With GCP, use "<EXTERNAL-IP>.nip.io" to deploy Activiti Helm chart. In our case: 35.194.42.164.nip.io
2) Deploy the Helm chart
Once you have resolved you domain name, install Helm chart by running the Helm install command using your public domain name to set the global.gateway.domain
key. In our case replace the string “REPLACEME” with the domain from previous step.
In our case for AWS, we use:
In our case for GCP, we use:
Here is the example result for AWS:
Below is the BPMN 2 modelling application. Default user: modeler/password.
Step 4: Use the deployed services
Import the collection in Postman using Import button.
Before calling any service you will need to create a new Environment in Postman. You can do that by going to the Manage Environment icon (cog)
Then “Add” a new environment and add a name to it. Now you need to configure the variables for the environment: “gateway”, “idm” and “realm”
For gateway you need to copy the url associated with your Ingress, the same for idm which is SSO and IDM using Keycloak. For the realm enter “activiti”:
Click Save or Update and then you are ready to start using that Environment. Make sure that you select the environment in the dropdown on the right:
As shown in the previous screenshot, if you go to the keycloak directory and select the “getKeycloakToken testuser” you will get the token which will be used to authenticate further requests. Notice that this token is time sensitive and it will be automatically invalidated so you might need to get it again if you start getting unauthorized errors.
Once you get the token for a user, you can interact with all the user endpoints. For example, you can create a request to see which Process Definitions are deployed inside our Example Runtime Bundle:
Now you can also start a new Process Instance from our SimpleProcess:
You can check that the audit service contains the events associated to the just started process instance.
And that the query service already contains information about the process execution:
You are now ready to start consuming these services to automate your own business processes.
Finally, you can access to all services Swagger documentation by pointing your browser to:
All our services are using SpringFox to generate this documentation and provide a UI for it.
Summary
In this tutorial we have seen how to create a Kubernetes cluster (using GKE or EKS) and deploy an Activiti Cloud application using the Activiti Cloud HELM charts. If you are not familiar with Kubernetes, Docker and GKE or AWS this might look like a lot of new information and it is our mission to simplify all the steps covered in these getting started guides. For that reason, we recommend you checkout the Jenkins X project, which greatly simplifies the first two sections about creating clusters and configuring the basic infrastructure for your projects.
As part of the Activiti Cloud initiative we are making sure that we follow best practices coming from the Kubernetes, Docker and Spring Cloud communities and we are contributing back with fixes and feedback to make this technology stack the best for Cloud Native applications.
Last updated