Code Monkey home page Code Monkey logo

module-build's Introduction

module-build

A library and a cli tool for building module streams.
The module-build tool only accepts version 3 of the modulemd-packager yaml file format.

Installation

Development

After cloning the project we have to setup the required dependencies.

First we need to fullfill dependencies which are required on system level. This can be done on Fedora 34 and up.

$ sudo dnf install libmodulemd mock createrepo_c

For development we recommend to create a python virtualenv with the --system-site-packages argument.

$ mkvirtualenv -p python3 --system-site-packages module-build

After the virtualenv is created, install the rest of the dependencies with pip.

$ pip install -r requirements.txt

and

$ pip install -r test-requirements.txt

After the dependencies are installed you can run unittests with:

$ tox

To run only flake8 on your code run:

$ tox -e flake8

To enable the module-build commmand in the command line run:


NOTE

We recommend that you run the command below inside a virtualenv.



$ python setup.py develop

CLI usage

Building a module stream

For now module-build only works with Fedora dist-git. We assume that every ref of a component in your modulemd yaml file refers to a dist-git branch and every name of the component refers to a dist-git repository name.

There are 3 required parameters for module-build:

--mock-cfg - mock configuration file
--modulemd - the path to your modulemd yaml file
<working directory> - directory where the log files and built rpms will be stored

$ module-build -f flatpak-runtime.yaml -c /etc/mock/fedora-35-x86_64.cfg ./workdir

If your modulemd yaml file does not provide module name or module stream it can be added by --module-name or --module-stream respectively.

$ module-build -f flatpak-runtime.yaml -c /etc/mock/fedora-35-x86_64.cfg --module-name=flatpak-runtime --module-stream=devel ./workdir


If you want to build a specific context out your module stream you can define it by --module-context parameter:

$ module-build -f flatpak-runtime.yaml -c /etc/mock/fedora-35-x86_64.cfg --module-name=flatpak-runtime --module-stream=devel --module-context=mycontext ./workdir


Resume building a component from a module stream

If a build of a component fails you can resume the build from that component. For this you need to spefify the --resume flag and the --module-version=<version_timestapm> option which can identify which build context you want to resume.

$ module-build -f flatpak-runtime.yaml -c /etc/mock/fedora-35-x86_64.cfg --resume --module-version=20211112140429 ./workdir


Building a module stream with modular dependencies

When your module stream has modular dependencies you have to provide those dependencies to module-build in a form of a repo created by createrepo_c.

For example the flatpak-runtime module is a modular dependency for module flatpak-common. To provide flatpak-runtime you will need to use the --add-repo option to your build.

$ module-build -f flatpak-common.yaml -c /etc/mock/fedora-35-x86_64.cfg --add-repo=/path/to/repository/containin/flatpak-runtime/module ./workdir


Building a module stream components in a custom chroot dir

Sometimes a build of a component can consume a lot of disk space. By default mock stores all its chroots in /var/lib/mock which can cause problems if you are low on disk space. You can change the location of the chroot dir to custom one with option --rootdir.

$ module-build -f flatpak-runtime.yaml -c /etc/mock/fedora-35-x86_64.cfg --rootdir=/path/to/custom/dir/ ./workdir

Building a module stream components from SRPMs

This option allows to build all components directly from SRPM instead of utilizing SCM. You acn turn in on by specifiing directory path with source RPMs in --srpm-dir.

$ module-build -f flatpak-runtime.yaml -c /etc/mock/fedora-35-x86_64.cfg --srpm-dir /path/to/srpms  ./workdir

Building a module in multiprocess mode.

This option allows to build components simultaneously. To utilize this mode, please specify amount of --workers higher than 1. This mode requires to turn off logger stdout by --no-stdout argument.

$ module-build -f perl-bootstrap-new.yaml -c /etc/mock/fedora-35-x86_64.cfg --module-name=perl-bootstrap -w 2 --no-stdout /workdir

module-build's People

Contributors

mcurlej avatar mkulik-rh avatar frenzymadness avatar hroncok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.