Buildserver Setup routine Evaluation

The buildserver design describes the setup automation routine. It is designed to install and initialize the different components of the embEDUx buildserver on the buildserver target machine.

The two candidates for the implementation are Python and Ansible. In order to chose the right one, the functionality needs to be compared to the design specifications and previous evaluation results.

Python

Python is a general purpose scripting language that offers a wide variety of standard and additional modules. In theory, there should be no limitation to the complexity of the setup process when Python is used. It is assumed that Python is already known to the reader.

Ansible

Ansible is an administration utility written in Python, with a focus on automation of predefined actions. The actions that are available correspond to modules, and can be customized according to the available module parameters. Standard modules include things like installing packages, enabling system services, manage user accounts, synchronize files to or from the target machines, and many more. Ansible can be extended with custom modules, but the builtin modules already provide great functionality. The connection to the target machine uses SSH.

Quick Introduction

Ansible actions are organized and configured with different entities. All entities are defined in separate files, which are specified in the YAML language.

Hosts

The first entity that needs to be defined is the hosts inventory. The hosts inventory contains the address, SSH username and other host specific information.

Tasks

Tasks use modules and module parameters to define actions that can be run on target hosts. Tasks can be reused and grouped into several other entities.

Variables

Variable files can be specified to each element of the previous two entity groups. There's also a special variable file that, unless overriden, is valid for all hosts at all times.

Setup Steps Evaluation

Executing commands on the target machine

Configuration Templates

As specified under configuration generation in the buildserver design, template generation is required during the buildserver setup.

Package Installation

Docker is the only non-default package that needs to be installed on the remote host.

Docker Container Management

By the time of the design phase, it hasn't been clear yet which container utility will be used to implement the abstraction. The container utility evaluation has chosen Docker. The necessary steps for setting up the container infrastructure during the setup can now be listed, in order to find the right tool for the setup routine.

As specified in the RootFS evaluation, the RootFS build routine needs Gentoo portage. Therefore, the Docker images for the buildserver components will be based on stage3 archives too.

Result Buildserver Setup routine Steps Evaluation

Setup steps Python Ansible
SSH Difficult / manual key management native method / uses SSH-agent
Template Rendering addon jinja2 module / manual file handling native jinja2 template module / easy
Package Installation command module manual SSH commands native apt module / easy
Docker Container Management addon docker-py module / manual API calls native docker module / easy

Result Buildserver Setup routine Evaluation

The original criteria can now be analyzed according to the results of the steps evaluation.

Eval criteria Python Ansible
Ready-for-use components availability ok ok
Extensibility effort medium easy
Templating features uncomfortable comfortable
Code readability good very good

Even though Python is a scripting programming language with many modules available, Ansible is better for the purpose of automating the given tasks. It has builtin modules for all of the required tasks which should allow for an efficient implementation.