Automated Deployments and Developmental pipeline for loklak server

Loklak Server project has been growing and seeing an increase in the users consuming the APIs, the contributors and has been extending its reach into other territories like IOT and Artificial Intelligence chats. As the project grew, It became important to keep the server easily deployable which was done previously by integrating the one click button deployment procedures to Loklak Server for anybody to spin up their own servers.

As we grew we made quite a few mistakes in the development, overriding others’ work, conflicting patches and the system kept breaking as we migrated from Java 7 to Java 8. To avoid problems due to an increase in contributions and a lot of members working together, there needed to be a stronger engineering workflow to ensure that the development still goes unhampered and there’s lesser time taken to pull and review.

View post on

We’ve strongly adopted the build and release per commit where instead of periodically taking the upstream changes and deploying onto the server we now leverage existing continuous integration tools that we’ve employed to run the builds for us to also perform the deployments onto the staging / dev servers. This was done using Heroku and Travis, where every successful travis build runs a trigger to Heroku to deploy and run the server on the staging server. This has dramatically reduced the errors that we encountered before and also proved as the testing ground for new features before moving them to the production server at


provider: heroku
email: [email protected]
strategy: git
secure: D2o+G28w42F9rDbde......PL/Q=
app: loklak-server-dev
branch: development

Automated Deployments and Developmental pipeline for loklak server

Loklak Server just a click away – One Click Deployments

As a person with an Android background working on the loklak project for the first time last month, I really did have a lot to pick up, and somehow I had to get started off.

I checked out the loklak docs which listed the process of deploying the server on your local machine or on Heroku / DigitalOcean / AWS, and all of those processes were lengthy and needed a bit of time to get set up, and besides I had never worked with Heroku before so I had to read up how it worked. There was no other feature to speed up the deployment process at that time, and that is when we decided to add a new feature: One Click Deploy!

One Click Deploy is the easiest, most convenient method to start up your own loklak server. Instead of going through the long drawn setting up through the terminal, you can simply deploy your server and get loklak running with a single click. We extended our list of supported platforms, and today, loklak server can be started onto Heroku, Scalingo, Docker Cloud and Bluemix, just with a single click. And all you need to do? Give your deployed app a name. That’s it. Quite literally.

Screen Shot 2016-06-01 at 12.08.47 AM

Integrating One Click Deploy into loklak, at first, wasn’t too big of a task. For Heroku, I just created an app.json file and linked it to the custom buildpack we had here. For Scalingo, I similarly had to create a scalingo.json, however I had issues as they didn’t have a JDK for Heroku Buildpacks, so I contacted them and they mended their own codebase to accommodate Heroku, and it finally worked. The Bluemix deployment was a bit more tedious: we had to make a manifest.yml and a pipeline.yml file, and then added a Bluemix start shell script and a Bluemix buildpack to make it work.

However, we did end up facing a lot of challenges after a period of time. After some days, our deployed servers started crashing. I communicated with the Scalingo team over email and they told us that our servers used an Xmx (maximum memory) of 600 MB while Scalingo containers worked with 512 MB, thus increasing swapping and reducing performance hereby crashing the applications. This was sorted by keeping an environment variable $ENVXmx which set the Xmx level based on the environment.

Finally, we decided to update our existing codebase to support Java 8, and as a result, we modified our buildpacks (Bluemix and Heroku) to accommodate for this change. This took a couple of days but finally it was done.

So at the end of it all, loklak finally has a much needed feature with which you can experience it in a matter of seconds, and a way with which you can set up multiple servers in just a few minutes, to multiple platforms. We have plans for having a deployment to Azure as well, and will plan on implementing it in the days to come 🙂

Loklak Server just a click away – One Click Deployments