Hello Worlds in 22 Langs on Kraken CI
There is a new, quite funny workflow example for Kraken CI. It shows
how to compile and run Hello World programs in various programming
languages, 22 languages.
But first, Kraken CI is a new Continuous Integration tool. It is a modern, open-source, on-premise CI/CD system that is highly scalable and focused on testing. It is licensed under Apache 2.0 license. Its source code is available on Kraken CI GitHub page.
This article is the eighth installment of the series of articles about Kraken CI. Till now we have:
- Part 1, Kraken CI, New Kid on the CI block
- Part 2, Your First Workflow in Kraken CI
- Part 3, Autoscaling CI with Kraken CI
- Part 4, Webhooks in Kraken CI for GitHub, GitLab and Gitea
- Part 5, Autoscaling CI on Kubernetes in Kraken CI
- Part 6, Tests Basics in Kraken CI
- Part 7, What is Wrong with Your Testing?
- Part 8, MLOps with MLflow on Kraken CI
Hello World Programs
Every programmer knows what does `Hello World` program looks like.
Here is an example in C language:
#include<stdio.h>
int main(){
printf(“Hello World\n”);
return 0;
}
But 22? These 22 can be seen in Kraken’s repo on GitHub:
https://github.com/kraken-CI/hello-worlds
Still, there are more languages with Hello Worlds.
The biggest collection can be found here:
http://helloworldcollection.de/.
These are just examples. In our case, they can be compiled and run.
After downloading the repo you may run ./run.sh script providing
the language folder, e.g.:
$ ./run.sh C
This will display, compile and run a C example.
In Kraken’s case, there is defined a workflow that does it for us for
each language. But first, we need to have systems with a compiler or a
runtime for these languages. Docker to the rescue.
Kraken Base Language Images
For each language, there is prepared a Docker image. They are based on
official images for these languages. For Kraken, they got some extras
like Kraken Agent that is running using kraken user (not root).
The list of all lang images is available in the docs.
The Workflow
The mentioned workflow can be found in kraken-workflow.py file.
In short, it looks as follows:

As you may notice, the list of jobs is built dynamically. For each
entry of the list of tuples (lang-name, docker-image), a job is
defined with the same steps but various values for language and Docker
image name. The lang name is passed to ./run.sh script in shell
step. And Docker image name is used in the environments section, in
the system field. Such a list of jobs is then returned in the whole
workflow definition. Each job will be run in parallel in separate
Docker containers.
The example of workflow execution is present in Kraken lab:
https://lab.kraken.ci/runs/5009/jobs. Check the workflow definitions in
branch management page.
This screenshot shows the execution of this workflow:

Summary
This article shows how Kraken CI can build programs written in various
languages. Kraken provides prepared Docker images for many
languages. It is easy to define sophisticated workflows that
dynamically define jobs that can be run in parallel. In the end, it is
nice to observe the results of workflow execution in Kraken UI.