Creating ABF build bots
Terms and Definitions
- Project — software source code, documentation and other artifacts accompanied by meta-information necessary to build and distribute the software product as a package.
- Group — users working on the same project. ABF allows to manage access privileges on both per-user and per-group levels.
- Platform — a group of repositories to be handled as a single entity. Such groupings are useful for creating different products from the same set of packages.
- Repository — a set of packages grouped together according to certain criteria: main packages, auxiliary packages, non-free software, etc.
- Product — ISO image of a distribution built on the basis of some platform.
- Reverse dependency — a package that requires the current one; "reverse build dependency" stands for a dependency necessary for building a package
- Web UI
- Build core
- Build client (bot)
- ISO generation module
- management of build clients (bots)
- creation/removal of platforms
- creation/removal of repositories
- creation/removal of build tasks
- publishing containers into repository
- creation/removal of projects
- calculation of reverse dependencies for the project
- calculation of direct dependencies for the project
The build core receives commands from Web UI using XML-RPC
Build server processes these requests and sends result back to WebUI
There are 2 kinds of platforms in ABF:
- Main platforms
- User platforms
Main platforms are supposed to build and maintain the whole distributions
User platforms are intended for building and maintaining user projects that can be built for different distributions
Project build workflow
- WebUI sends a build request
- Build core checks if the requested project can be built and puts appropriate task in the queue
- The task is processed, reverse dependency tree is built, if necessary
- Build task is formed for the build client; this task is put in the clients' queue
- When connecting to the build server, every client reports for which distributions and hardware architectures it can build packages
- A client receives the build task and processes it
- When package is built, one can use WebUI to send a request on publishing the resulting container
- Build server checks if it possible to publish the container puts appropriate task in the queue
- During publishing all built packages are moved to repositories they belong to. The ABF database storing information about packages is updated.
- WebUI is informed that container is published.
Build client (bot)
Client is used to build packages. Build clients can differ in the following ways:
- supported hardware architectures
- supported target distributions
- First, build client receives a task from the core. Then packages from the task are built one by one.
Project build algorithm:
- Inform core that the project build has been started
- Take project sources from Git repository and increment release in the spec file (this increment is performed automatically for rpm-based distributions)
- Commit spec file changes back to the repo and create src.rpm
- Create list of repositories that should be enabled (this depends on the build type - is this a build for a personal repository or for the main one)
- Build package and publish container with updated metadata
- Send build status to the build core
If dependency loops are detected, the build process is performed once more using the results from the previous run.
When all projects are built, build client performs automated testing of resulting packages. During this testing, the client tries to install all packages into the chroot environment; this test is used to check that packages have all necessary requirements listed in their Requires tags.
If package tests are passed successfully, packages are sent to the build core.
- To speed up the process, chroot is created in tmpfs
- Repositories are connected using HTTP
- Build results can be investigated using WebUI
ISO generation module
This module is used to build distribution ISO images. It is implemented as XML RPC server which receives tasks from the build core
WebUI allows to configure scripts and files necessary for ISO creation and add tarballs with additional files required for this process.
ISO creation workflow:
- Web part sends a 'build ISO' request
- The request is put into the module queue
- WebUI receives notification when the generation starts
- Tarballs with additional files specified in WebUI are downloaded, if any
- ISO generation script is launched
- When generation is finished, a corresponding notification is sent to WebUI
Adding support for more distributions
If you want to build your own distribution using ABF you should develop corresponding build client and ISO generation module. In order to do this, you can use existing templates. If you want to add support for your distribution in the main ABF instance, please send a request to email@example.com. You will be provided with necessary help, templates, documentation, etc. When your build client and ISO generator are ready you should send them to ABF developers for review. If everything is ok, ABF team will help to integrate the new stuff into the main ABF instance.