Kubernetes


Kubernetes is a container orchestration technology that was initially implemented by Google for their “Google search”. It allows to easily provide and scale services based on containers. We implement our physics engine and our compile-server as containers. Therefore, both can run on Kubernetes and can theoretically scale like the Google search (if you have enough resources or money). The compile-server also uses its local Kubernetes (in which it runs) as a service provider to start compilation jobs as new containers. The compilation server can therefore facilitate the complete power of a cluster to provide its users with compiled robot (Lejos) programs. As jobs (as an elemental resource) are directly implemented by Kubernetes, failed builds will therefore be automatically restarted and its status could be observed.

Compilation Architecture

The figure above illustrates how the compilation architecture uses Kubernetes. At the beginning of a compilation procedure, a program will be fetched from the so-called Code2Canvas. This program will be transformed by the LejosMainCodeGen to produce actual Java code. This robot program in form of java code will be piped to the Compile Requester. The Compile Requester creates a request to the NXTCompilationServer that runs inside Kubernetes. Therefore, the program passes the Traefik Loadbalacer, first. Through the Traefik Loadbalacer, multiple instances of the compile server can theoretically run in parallel. For each request, the compile server spawns a new compilation job. When a compilation job was finished, its results will be piped back to the originator of the request. In our Unity application, the compiled program can then be saved in The Program store.

Deployment


We provide you with everything necessary to deploy it on your k8s cluster (a set of yml files basically)
Hint: We use k3s as it already contains a quite good set of tools like a loadbalancer (traefik)

Physics Engine Deployment