From Fedora Project Wiki

< Modularity‎ | Getting Started

Revision as of 14:52, 18 January 2017 by Karsten (talk | contribs) (Building the module in Fedora infrastructure)

Adding and building a module for Fedora

This document describes the process of adding a new module to the Fedora Modularity project, how to build it locally and how to build it in Fedora infrastructure

Process and policy for how to add a module to Fedora

Adding a module repository is a manual process atm. Find someone from the releas-engineering group to add the new repository and give you write access. Later on this will be automated by MBS, the module build server, but this is still being worked on.

Writing a new modulemd file and verifying its syntax

A modulemd file is a yaml file that contains the module metadata like description, license and dependencies. The sample file in the upstream git repository of modulemd contains a complete documentation of the required and optional yaml tags.

The Modularity team uses a shorter modulemd file to test builds, but it can also be used as a base for new modules. Another good example is base-runtime.yml

There is a document Developing and Building Modules that shows how to get the list of dependencies that need to be added to the modulemd file so that the module can be built.

Once the modulemd file is finished, it is a good idea to check if there any errors in the yaml syntax. The check_modulemd program checks modulemd files for errors. You need to install some packages to use this:

  • python2-aexpect - dependency for python-avocado
  • python2-avocado - avocado testing framework
  • python2-modulemd - Module metadata manipulation library
  • python-enchant - spell checker library (needed only for
  • hunspell-en-US - English dictionary (needed only for

Then run
./ /path/to/modulemd/file
and check the output for errors.

Building the module locally

The build_module script from the build-module repository on github makes local module builds really easy. It sets up the environment and then builds a module and its components locally with mock. The only requirement besides the build-module repository is to have docker installed and running on your system.

The basic usage of build_module is

./build_module /path/to/your/new_module_repository/ /some/directory/for/results

It is required that the name of the new modulemd file, the repository name of that module and the name of the module itself match in order to use the build_module script.

This will download a container with the Module build service, install the dependencies that are listed in the modulemd file and then it will rebuild packages required for the module. This step can take quite some time, depending on the module.

Building the module in Fedora infrastructure

This step uses a local module-build-service and other components in containers and passes results on to the Fedora staging infrastructure. A checkout of the module-build-service is required. Change into your local copy of this repository and run

docker-compose down
docker-compose up --build

This will start MBS and fedmsg and you'll see when messages about module builds are coming in over the Federated Message Bus.