tag

Monday, 23 March 2020

3 years ago

3 minutes read

  • Hackathon
  • Cloud Computing
  • Development
  • Product
  • People

Quick Preview — cloudmobility Hackathon

On the 4th and 5th of March, we had the first cloudmobility Hackathon! For those that don't know what a Hackathon is, it's an event where software engineers get together for some hours, days, or even weeks with the objective of discussing new ideas and implement them. In our case, it was just one day and a half, a total of 12 hours.

Tiago Sousa

Tiago Sousa

Software Engineer

Introductionlink

On the 4th and 5th of March, we had the first cloudmobility Hackathon! For those that don't know what a Hackathon is, it's an event where software engineers get together for some hours, days, or even weeks with the objective of discussing new ideas and implement them. In our case, it was just one day and a half, a total of 12 hours.

Of course, in order to be able to participate in such an event, you need an awesome team that was committed and aligned with the objectives of the Hackathon. In the IT world, it's not difficult to find people that are really interested in building something from scratch in just a couple of hours, but we were able to create an awesome team that really wanted to see something rising that would improve the product and facilitate the life for the users. Such team was composed by David Alecrim, Joni Oliveira and Tiago Sousa.

When we started the Hackathon, we already knew what we were about to develop since we had the opportunity to get together before to talk about what we thought could be a nice improvement for cloudmobility and for our clients.

After this discussion, we decided to develop Quick Preview. Quick Preview is an extension of the cloudmobility CLI that would allow the developers to quickly deploy an application based on its Dockerfile.

Nowadays it's truly common to develop a new application using Docker to virtualize the environment (either development or others like production), so we based ourselves on the premise that this project would get a good amount of target audience.

Getting our hands dirtylink

The first hours of the event were mainly to decide what we should tackle first, prioritizing the tasks and splitting them across the team members. Shortly after we identified the requirements and tasks that were needed, each of the team members started to get their hands dirty. Tiago Sousa started by extending the code base for the current cloudmobility CLI to add a new command, the cmy deploy create that would accept three parameters as flags:

  • Path: the path for the client kubeconfig file to connect to the namespace in cloudmobility;
  • Namespace: the namespace id where the application would be deployed in cloudmobility;
  • Repository: the user GitHub repository that would contain the code for the app and the docker file.

David Alecrim started by creating a brand new React app with a Dockerfile that would export a default port where the application would be running and publish it in a GitHub Repository.

Joni Oliveira created a new API (built in go), that would be responsible for receiving all the parameters sent by the CLI and actually deploy the application in cloudmobility, using the helm client API.

Main challengeslink

The development of the Go API presented a few challenges in the development itself, but we could go around those.

The main problems we had in developing the solution were mainly around creating working helm charts for both:

  • The Go API with which the cloudmobility CLI communicates;
  • The helm chart that deploys the user's project (provided by the GitHub URL);
  • The helm chart that would deploy the go API in the cluster

Since this was only a hackathon and the objective was to provide a functional prof of concept that would prove that our idea was feasible and a must for the users, there is a lot of room for improvement, for example:

  • fetch applications for the most common repositories like GitLab, BitBucket, or others;
  • the kubeconfig wouldn't be needed to be passed as a parameter in the CLI since the Go API would be deployed in our management cluster;
  • let the user decide the URL where the application would be available since it was automatically generated as explained below.

Making it availablelink

By the end of the Hackathon, the team was able to achieve their goal and deploy an application that was in a public GitHub Repository with just one command through cloudmobility CLI with the following command:

cmy deploy create
--path=".kubeconfig"
--repository=https://github.com/...
--namespace="namespace-id"
copy

To facilitate the user's life even more, after the execution of the CLI command, the URL where the application would deployed, under cloudmobility infrastructure, was generated automatically based on the user repository name and it would be something like:

https://quick-preview.cloud.eu1.cloudmobility.io
copy

Conclusionslink

These events are really great in a company since it allows everyone to contribute with new ideas for the product, and some of them are really useful as you may see in other blog posts that were or will be published. It also enforces the team union and improves communication and technical skills, by forcing the developers to get out of their comfort zone.

Tiago Sousa

Written by Tiago Sousa

Hey there, my name is Tiago Sousa and I'm a Fullstack Engineer currently working at xgeeks. I'm a technology enthusiast and I try to explore new things to keep myself always updated. My motto is definitely "Sharing is caring" and that's exactly why you are currently reading this!

Interested in collaborating with me?

Let's Talk
footer

All the rights reserved © Tiago Sousa 2022

memoji12

Designed with love by Mauricio Oliveira