How Kristal.AI built the Android app CI/CD pipeline using Jenkins
July 7, 2021
Kristal.AI is a digital wealth platform that aims to provide private banking solutions through transparent access to investment and services, which are traditionally reserved for the Ultra-high net worth. We leverage technology, algorithms, and human expertise to help clients with portfolio allocations and optimization. We are licensed and operational in Singapore, Hong Kong, and India.At the center of Kristal.AI, sits the 35 person engineering team. While small in number, for building and managing our digital wealth management platform. We are the tech-savvy ones and love to try different things to improve the performance, scalability, and reliability of the platform.Amongst other things, the team is driven by this simple motto:"Some things are meant to be done by machines."- Vineeth Narasimhan, Co-Founder & CTO, Kristal.AI.Here’s our journey of how we built our Android app CI/CD pipeline using Jenkins.
The Problem Statement
Before we moved to Jenkins. we used to manually attach the QA Android device and give the builds via Android Studio. This made sense to our use case at that time as it saved time, rather than going through the DevOps route.Then with the pandemic and WFH situation, we were forced to rethink this approach as we could no longer give the build manually.We started giving build via Slack. We started sending .apk files directly. Why it failed: The build was dependant on the developer’s machine and it was eating up the developer’s time. What if the developer is on leave or his/her system crashes? We had to do something to eliminate this system/developer dependency.
We then moved our Android build process to Jenkins. We already have our backend build deployments set up via Jenkins. So it only made sense to add our Android build process in the same Jenkins machine that we had in AWS.
Now all our builds of staging and prod build automatically go via Jenkins.In a later section, we get into the details of how we implemented this development. But first let's take a look at how this benefited the platform, the team, and the business overall:
The dependency on a single developer machine was eliminated
It freed up the developer’s time which was getting wasted due to the system dependency
Now our developers can focus on building great apps rather than worrying about giving out builds
Deploying Emergency builds has now become easier
Saving developers’ time eventually saves business cost
As it saves developer’s time, which eventually saves business cost
Now to the tech-y part of the article. The Implementation. Here’s how the team implemented this development, broken down into 3 Jobs:
In a Nutshell :
Daily Cron job is triggered at 10:00 AM IST (4:30 AM UTC) to run this workflow
Workflow is divided into 3 jobs
The workflow can also be triggered manually on-demand basis
Workflow Steps Overview :
Job 1: To generate Android build for internal distribution via URL
Job 2: Upload the app files to S3
Job 3: Upload app files to BrowserStack for Automation Testing
Job 4 (Optional): Upload build to Beta if it is prod environment
Workflow In-DepthSummary: This workflow is aimed at providing Android build for testing on a daily purpose. The jobs are run synchronously.No of jobs in the workflow : 3No of machines used: 1 (centOS)Job 1 Steps (Build) :
Send message in Slack that Build has started
Checkout to staging branch
Install NodeJS so that npm command can be used
Install NPM packages. Make sure to have a package-lock.json for correct NPM packages to be installed
Run the android build command which generates APK file which can be distributed to users for testing.
Send message in Slack that Build has completed
Job 2 Steps (Uploading to S3) :
Send message in Slack that Build is uploading to S3
Configure AWS credentials
Copy the APK file from centOS machine to S3
Send message in Slack that Build is ready for testing
Job 3 Steps (Uploading to BrowserStack) :
Upload the APK file from the CentOS machine to BrowserStack so that whenever Automation tests are run, the BrowserStack always has the latest app
Perform Unit and UI testing of the whole app
Prepare Testing Report and publish it in Slack
Job 4 Steps (Uploading to Beta) :
Upload the app build to Beta if is a Prod Workflow
CI/CD is a must in today’s world which really enhances your tech stack. It really saves a lot of boring, repetitive tasks that can be easily done by machines and also is very cost-effective.
This website/application including the ‘KristalFlex’ platform is owned, operated and maintained by Globalise Inc., a company incorporated in United States of America (the “Company”). The information placed on the platform is for informational purposes only and does not constitute as an offer to sell or buy a security. The Company reserves the right to make modifications and alterations to the content available on the platform. The Company is neither registered as an investment advisor nor as a broker dealer. The KristalFlex platform offers users access to investments in global securities through multiple stock exchanges and such other services as may be provided either directly or through its affiliates and partners. Price and availability of products and services offered on the platform are subject to change without prior notice. The Company will not be liable for any lack of availability of products and services you may order through the platform.
Do note that investment in securities market are subject to market risks. The valuation of securities may increase or decrease depending on various factors affecting the securities market. The services being provided by through the KristalFlex platform is not professional investment advice. All the recommended list of offshore funds, portfolios etc. being provided through the platform shall be/are in the form of generic research reports on offshore securities and shall be accessible by all authorised / subscribed users of these services at the same time.
The platform and the services thereunder are provided on an “as is” basis. The Company makes no warranties or representations, express or implied, on products offered through the platform. It accepts no liability for any damages or losses, however caused, in connection with the use of, or on the reliance of its product or related services. The Company is not responsible for any technical failure or malfunctioning of the software or delays of any kind and is also not responsible for non-receipt of any e-mails. You shall bear all responsibility of keeping the password secure and shall be solely responsible for the loss or misuse of the password.
Any descriptions of, references to, or links to other products, publications or services does not constitute an endorsement, authorization, sponsorship by or affiliation with the Company or its affiliates unless expressly stated otherwise. Any such information and/or products have not necessarily been reviewed by the Company and are provided or maintained by third parties over whom the Company exercises no control. Certain hyperlinks or referenced websites on the platform, if any, are for your convenience and forwards you to third parties’ websites. The Company will, under no circumstance, be responsible for the content, the accuracy of the information, and/or quality of products or services provided by or advertised on these third-party websites. The Company does not endorse in anyway any advertisers/ contents of advertisers on its webpages or the KristalFlex platform.
We are licensed in Singapore, Hong Kong and India. Kristal Advisors (SG) Pte. Ltd. presently operates under the CMS license by the Monetary Authority of Singapore (MAS). Kristal Advisors (HK) Ltd is licensed and regulated by the Securities and Futures Commission (SFC) to carry out Type 4 and Type 9 regulated activities and is not involved in the discretionary management of any collective investment scheme. Kristal Advisors Private Ltd. presently operates as a Registered Investment Advisor under the jurisdiction of the Securities and Exchange Board of India (SEBI).
This is offered only to Accredited and Institutional Investors as defined under the Securities and Futures Act, Chapter 289 of Singapore (“Act”), which broadly comprises of regulated financial Institutions, large corporates, high net worth individuals and sophisticated investors.
An Accredited Investor is an individual
Whose net personal assets exceed in value SGD 2 million (or it’s equivalent in a foreign currency) with value of his/her primary residence capped at SGD 1 million, or
Whose financial assets (net of any related liabilities) exceed in value SGD 1 million (or it’s equivalent in a foreign currency), or
Whose income in the preceding 12 months is not less than SGD 300,000 (or it’s equivalent in a foreign currency)
I agree to opt-in as Accredited Investor and will submit required documentation to confirm the same.