Google Summer of Code 2018 Report.
Organization - Mifos Initiative
project - Containerization and deployment of Apache Fineract using Docker technologies and Kubernetes
For the past three months, I have been working on containerizing and deploying Apache Fineract CN as my Google Summer of Code project. Apache Fineract CN is an Application Framework for Digital Financial Services. It is a system to support nationwide financial transactions and to support the creation of an inclusive, interconnected digital economy for every nation in the world. The end result of this project is to configure Apache Fineract CN for production environment such that it not only runs on the cloud but also scales depending on the workload of the system.
Scope of project
Currently, the is a microservice, demo server, that starts up and provision or migrates the Fineract domain services. This method used to start the microservices is not suitable for production, for the following reasons:
- If that microservice fails, the whole system goes down with it.
- Using that microservice, it’s impossible to scale one microservice without scaling the others.
- The microservice is not efficient enough to manage the running domain microservices in production.
- The microservice does not provide liveness and readiness checks for the Fineract microservices.
- If one microservice fails, the system goes down.
- Most importantly, the microservice was not built to be used in production.
This GSoC project aims to prepare Apache Fineract CN for a production-ready environment. That is:
- The domain microservices should scale independently.
- Failure on one microservice should not affect the other microservices.
- The microservices should automatically startup when it fails.
- The microservices should be deployable on any cloud platform.
Business Value from having a Cloud Native
Digital challenges in our time changes the way customers interact with technology, how they expect to interact with businesses, and how they need to invest in IT infrastructure. The rapid growth of devices, data, and applications, combined with the “always connected” customer mentality raises the stakes significant for companies.
Agility is more important than ever. Businesses need to develop, deploy, improve, secure and fix applications, data and infrastructure quickly — sometimes in hours. Yet existing infrastructure and applications — even systems that were architected and implemented 4 or 5 years ago — can’t keep up with the pace of the digital transformation.
Docker Enterprise Edition is the container management and security platform that gives existing applications the ability to run in containers and work the way users expect in the mobile and digital world. Docker provides agility, portability and security for all applications, while optimizing costs for the business.
When an application is packaged into a container, it includes everything that’s required to make the software run. This fundamentally solves the “works on my machine” problem that developers often face when shipping their code to a different environment like staging that has different dependencies than their workstation. Containers are efficient, lightweight, self-contained systems that guarantee applications will always run, regardless of where they’re deployed.
A user can either use Docker Swarm or Kubernetes to manage the Fineract microservices. Currently, Docker Swarm works with the resources on premise while Kubernetes works with Google Container Engine. The number of replicas can be updated independently based on the workload on the different microservices. When a user/developer starts a microservice, Kubernetes does readiness and likeness checks to make sure the services are up and running and that it can process any request. To start the microservices using Docker Swarm, the user needs to run a startup script. This script runs the compose file used to start the tools; MariaDB, Cassandra, ActiveMQ and Eureka needed by the Fineract microservices, the script then test the running services to make sure the tools are ready to receive and process request, then finally the script starts up the Fineract domain services.
A user can either use Docker Swarm or Kubernetes to manage the Fineract microservices in a production environment. For a developer to use Docker Swarm to run and manage the most up to date code for each of the microservices, the developer will need to:
- Setup his/her environment with Apache Fineract CN.
- Run the migration script to migrate the jar file from the .m2 directory to the directory containing the Docker files.
- Run the startup script to start all the microservices.
- Run the shutdown script to shut down all the services,
For a developer to use Kubernetes to run manage the Fineract services, the developer has to:
- Run the Kubernetes scripts to start the tools need by the Fineract services.
- Run the Kubernetes scripts to start all the Fineract microservices.
- Provision services after startup
- Migrate existing services
Links to work done
Design architecture of containerized Fineract CN : https://cwiki.apache.org/confluence/display/FINERACT/Design+architecture+of+Containerized+FineractCN
Github repository : https://github.com/Anh3h/fineract-cn-docker-scripts
Contributing to Mifos has been an incredible Journey. What makes it even more perfect is the fact that I worked on a technology I am passionate about. I have learned a lot and I still have a lot more to learn. For the opportunity to do GSoC I will like to thank Mifos and I would also like to thank Edward Cable (Director of community programs, Mifos Initiative) for being so instrumental during the entire Google Summer of Code period. I thank my mentor (Victor Romero) who has guided me through till the end of this summer internship and the community for their endless support.
- Email: email@example.com
- GitHub: https://github.com/Anh3h
- LinkedIn: https://www.linkedin.com/in/courage-angeh-01aa29122/