From Fedora Project Wiki
(initial version, unfinished)
 
(next version, still incomplete)
Line 12: Line 12:
The Modularity team uses [http://pkgs.stg.fedoraproject.org/cgit/modules/testmodule.git/tree/testmodule.yaml a shorter modulemd file] to test builds, but it can also be used as a base for new modules. Another good example is
The Modularity team uses [http://pkgs.stg.fedoraproject.org/cgit/modules/testmodule.git/tree/testmodule.yaml a shorter modulemd file] to test builds, but it can also be used as a base for new modules. Another good example is
[http://pkgs.stg.fedoraproject.org/cgit/modules/base-runtime.git/plain/base-runtime.yaml base-runtime.yml]
[http://pkgs.stg.fedoraproject.org/cgit/modules/base-runtime.git/plain/base-runtime.yaml base-runtime.yml]


There is a [https://github.com/fedora-modularity/check_modulemd python program] that checks modulemd files for errors. You need to install some packages to use this:
There is a document [https://fedoraproject.org/wiki/Modularity/Development/Developing_and_Building_Modules#How_to_get_the_list_of_all_the_dependencies.3F 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.
 
The [https://github.com/fedora-modularity/check_modulemd check_modulemd] program checks modulemd files for errors. You need to install some packages to use this:
* python2-aexpect - dependency for python-avocado
* python2-aexpect - dependency for python-avocado
* python2-avocado - avocado testing framework
* python2-avocado - avocado testing framework
Line 21: Line 22:
* hunspell-en-US - English dictionary (needed only for check_modulemd.py)
* hunspell-en-US - English dictionary (needed only for check_modulemd.py)
<br>
<br>
Then run <pre>./run-checkmmd.sh /path/to/modulemd/file</pre>
Then run <pre>./run-checkmmd.sh /path/to/modulemd/file</pre> and check the output for errors.
 
== Building the module locally ==
 
The build_module script from the [https://github.com/asamalik/build-module 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.
 
== Building the module in Fedora infrastructure ==
 
This step requires that the git repo with the modulemd file has been pushed to git://pkgs.stg.fedoraproject.org/modules/. Check with rel-eng to gain write access there.

Revision as of 16:06, 16 January 2017

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

TBD

Write a new modulemd file

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.

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 check_modulemd.py)
  • hunspell-en-US - English dictionary (needed only for check_modulemd.py)


Then run

./run-checkmmd.sh /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.

Building the module in Fedora infrastructure

This step requires that the git repo with the modulemd file has been pushed to git://pkgs.stg.fedoraproject.org/modules/. Check with rel-eng to gain write access there.