And how it will benefit our customers in the long run
It is well-known that distributed systems are complex, making deployment, testing, and development challenging. It would be best to have a high level of automation and modern cloud-native deployment toolsets to handle complex distributed system deployments.
All Borneo applications are distributed, composed of many AWS resources and micro-services allocated across multiple availability zones. On top of that, as the Borneo software handles the customer data directly, most deployments are on-premise, which further complicates the deployment situation.
If the Borneo deployment software doesn't address these challenges pragmatically, they result in one or more of the following undesirable outcomes:
All these can potentially lead to unpleasant deployment experiences and fewer customer conversions.
The Borneo deployment model is based on a layered architectural model where each inner layer exists independently. This helps us quickly change the internal workings without affecting the outer layers and transparently reduce the complexity of deployments by bringing invaluable abstractions.
(Abstractions through layered Architecture)
At the core of the deployment, we use reusable Terraform modules and code to create the required AWS infrastructure and deploy the micro-services to Kubernetes(EKS) cluster using helm charts. All the Helm Charts and related Terraform codes are hosted on a GitHub repository accessible only to customers through a unique GitHub deploy key. We create individual GitHub deploy keys per customer for easy repo access and management, and this also helps us quickly revoke customer access without affecting other users if needed.
The terraform backend state-file management, terraform per stack configuration, and installation of Terraform binary is managed by a Command Line Interface(CLI) tool called borneo
, developed and managed by the Borneo deployment team. This CLI tool abstracts away a lot of complexity for the user and simplifies the overall deployment experience using various automation and integrations, and some notable ones are:
Another important reason for the need for a wrapper tool is the inability of Terraform to independently deploy and upgrade each micro-service without changing the base terraform configuration root directory (can't deploy code from subdirectories) --- An essential goal if you want to manage the deployment lifecycle of each micro-services independently without creating multi-level gigantic terraform modules.
The below diagram shows how the CLI tool works at a high level.
The borneo
CLI tool is written in Go Programming language and is reasonably fast, and compiles down to a simple binary without any other run time dependency. This makes go binaries easy to ship and distribute. Also, go has enabled us to use some of the Hashicorp curated terraform libraries directly. As of this time of writing, these libraries are only available if you use the Go Programming language.
Users need to download the borneo
CLI binary based on their workstation CPU architecture and GitHub deploy key before starting the deployment (need Borneo deployment teams to help here, including allowing access to Borneo ECR repo). Borneo deployment team uses GitHub actions and goreleaser open-source tool to automate the build and distribution of borneo
binary for different platforms. Once the necessary files are downloaded, the user needs to gain the AWS API access privileges to their AWS account to deploy the new Borneo application.
Once the above steps are completed, the user can start with first-time initialisation. If the CLI is not in the user's default PATH, the user can add the CLI binary location as an additional step. This enables the user to use the deploy tool as any standard terminal command.
Step 1: Initialisation
$ borneo init
During the first run, the tool will install the terraform binary, download the deploy code from the Borneo GitHub repo, and ask a handful of questions from the user like cluster name, AWS region, user email ID, etc. and creates a local copy of initial deploy configuration. The tool also saves a copy in the S3 bucket for retrieval if the local copy goes missing or gets corrupted. If needed, the user can rerun the init
command multiple times without any side effects, as this action is idempotent. The init
step usually takes less than a minute to complete. After the initialisation, a user can proceed with the deployment.
Step 2: Deploy the Application
$ borneo deploy
If there is no option provided with the deploy
command, by default, it will start deploying the whole Borneo Application stack, including the underlying AWS infrastructure. The below flowchart explains the deployment steps in detail.
A typical deploy process usually takes up to ~30 to 35 min to complete, enabling our users to enjoy and assess the value of Borneo applications quickly.
The main highlights of the Borneo deployment model are following:
Using optimal deploy tool abstractions, we could abstract away most of the complexity of deploying distributed Borneo applications for our users. Also, underneath, without overwhelming the user, this model enabled us to utilise many modern cloud-native open-source deployment toolsets that most customers are familiar with --- helm charts for application packaging, Terraform for infrastructure as code management and Kubernetes based application deployment to avoid any vendor lock-in.