Introducing Whales

Walter Reyes
Sudo by Icalia Labs
3 min readJun 29, 2017

Dockerizing your applications was never this easy

You probably have heard of Docker, have you? That magic tool that allows programmers to mix and match technologies, distribute and manage applications in isolated containers. Basically, Docker bridges the gap between development and deployment processes, reducing efforts and risk problems within application dependencies inside containers, in other words, Docker is a new way of doing almost everything in containers, and also is open source

Docker containers are great, but implementing them was a little more complicated than it needed to be. That’s the main reason why we buckle up at Icalia Labs and built Whales a set of tools that helps you dockerize your applications, go and see the demo for yourself.

How does it work?

All you need for Whales is to have Docker up and running on your machine and then just run the following command inside the folder of the application you want to dockerize:

docker run \
— interactive — tty — rm \
— env API_BASE_URI=whales.herokuapp.com \
— env BELUGAS_CODE=”${PWD}” \
— volume /var/run/docker.sock:/var/run/docker.sock \
— volume $(pwd):/code whalesil/whales

By default, it will output the files (dev.Dockerfil& docker-compose.yml) you need to run your application with Docker in a development environment. If you want the Dockerfile for production, no worries we have a command for that too:

docker run \
— interactive — tty — rm \
— env API_BASE_URI=whales.herokuapp.com \
— env BELUGAS_CODE=”${PWD}” \
— volume /var/run/docker.sock:/var/run/docker.sock \
— volume $(pwd):/code whalesil/whales whales tame -e=”production”

See it for yourself:

Architecture

The Architecture is simple, it is composed as a flow, a chain of micro-apps that work together to dockerize your project. We call these Whales and Belugas (A type of whale)

The command you send on the terminal sends a signal to the starting whale to start the process of dockerizing your project.

All of these whales have a single responsibility in the process and each of them depends on the rest, it is a chain of requests between them to dockerize your project.

This is the diagram flow:

Now, let’s summarizes what is happening:

  1. Dev runs a command to dockerize his project.
  2. whales ask his bud belugas the features of your project.
  3. Belugas is the head member of the Belugas Team. The Belugas Team is the Feature Detector Team and Belugas starts by calling his bud belugas-linguistic to start gathering the features.
  4. Belugas Linguistic will take your repo and detect what language is build on then it will call belugas-<language> to gather the features of your project.
  5. Depending on the language, belugas-php, belugas-ruby or belugas-python will analyze your project to gather the features it can find.
  6. Then belugas-<language> will send the features back to beluga.
  7. Beluga will send the features to whales.
  8. whales will receive the features and send them to whales-api.
  9. whales-api will check the features and gather the recipes to compose the Dockerfile and docker-compose.yml and display it on the terminal.
  10. Happy Dev has a dockerized project.

This is the process the Whales Team goes through each time a Dev needs to dockerize a project.

Supported Languages

Whales use Belugas analyzers to detect multiple features on a project based on a code static analysis, in other words, thanks to this analyzers we can detect which language, framework, database and dependencies your project use.

Currently, we have the following analyzers:

We hope the Whales Team could help you dockerize your project!

You liked this? Starred us on Github o send us some love at Twitter

--

--