Blame doc/modularity.rst

Packit 6f3914
..
Packit 6f3914
  Copyright (C) 2019 Red Hat, Inc.
Packit 6f3914
Packit 6f3914
  This copyrighted material is made available to anyone wishing to use,
Packit 6f3914
  modify, copy, or redistribute it subject to the terms and conditions of
Packit 6f3914
  the GNU General Public License v.2, or (at your option) any later version.
Packit 6f3914
  This program is distributed in the hope that it will be useful, but WITHOUT
Packit 6f3914
  ANY WARRANTY expressed or implied, including the implied warranties of
Packit 6f3914
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Packit 6f3914
  Public License for more details.  You should have received a copy of the
Packit 6f3914
  GNU General Public License along with this program; if not, write to the
Packit 6f3914
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit 6f3914
  02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
Packit 6f3914
  source code or documentation are not subject to the GNU General Public
Packit 6f3914
  License and may only be used or replicated with the express permission of
Packit 6f3914
  Red Hat, Inc.
Packit 6f3914
Packit 6f3914
.. _modularity-label:
Packit 6f3914
Packit 6f3914
############
Packit 6f3914
 Modularity
Packit 6f3914
############
Packit 6f3914
Packit 6f3914
Modularity is new way of building, organizing and delivering packages.
Packit 6f3914
For more details see: https://docs.pagure.org/modularity/
Packit 6f3914
Packit 6f3914
Packit 6f3914
=============
Packit 6f3914
 Definitions
Packit 6f3914
=============
Packit 6f3914
Packit 6f3914
modulemd
Packit 6f3914
    Every repository can contain ``modules`` metadata with modulemd documents.
Packit 6f3914
    These documents hold metadata about modules such as ``Name``, ``Stream`` or list of packages.
Packit 6f3914
Packit 6f3914
(non-modular) package
Packit 6f3914
    Package that doesn't belong to a module.
Packit 6f3914
Packit 6f3914
modular package
Packit 6f3914
    Package that belongs to a module. It is listed in modulemd under the ``artifacts`` section.
Packit 6f3914
    Modular packages can be also identified by having ``%{modularitylabel}`` RPM header set.
Packit 6f3914
Packit 6f3914
(module) stream
Packit 6f3914
    Stream is a collection of packages, a virtual repository. It is identified with
Packit 6f3914
    ``Name`` and ``Stream`` from modulemd separated with colon, for example "postgresql:9.6".
Packit 6f3914
Packit 6f3914
    Module streams can be ``active`` or ``inactive``. ``active`` means the RPM
Packit 6f3914
    packages from this stream are included in the set of available packages.
Packit 6f3914
    Packages from ``inactive`` streams are filtered out.  Streams are
Packit 6f3914
    ``active`` either if marked as ``default`` or if they are explicitly
Packit 6f3914
    ``enabled`` by a user action. Streams that satisfy dependencies of
Packit 6f3914
    ``default`` or ``enabled`` streams are also considered ``active``.  Only
Packit 6f3914
    one stream of a particular module can be ``active`` at a given point in
Packit 6f3914
    time.
Packit 6f3914
Packit 6f3914
Packit 6f3914
===================
Packit 6f3914
 Package filtering
Packit 6f3914
===================
Packit 6f3914
Without modules, packages with the highest version are used by default.
Packit 6f3914
Packit 6f3914
Module streams can distribute packages with lower versions than available in the
Packit 6f3914
repositories available to the operating system. To make such packages available
Packit 6f3914
for installs and upgrades, the non-modular packages are filtered out when they match
Packit 6f3914
by name with modular packages from any existing stream.
Packit 6f3914
Packit 6f3914
Packit 6f3914
=====================
Packit 6f3914
 Hotfix repositories
Packit 6f3914
=====================
Packit 6f3914
In special cases, a user wants to cherry-pick individual packages provided outside module
Packit 6f3914
streams and make them available on along with packages from the active streams.
Packit 6f3914
Under normal circumstances, such packages are filtered out.
Packit 6f3914
To make the system use packages from a repository regardless of their modularity,
Packit 6f3914
specify ``module_hotfixes=true`` in the .repo file. This protects the repository from package filtering.
Packit 6f3914
Packit 6f3914
Please note the hotfix packages do not override module packages, they only become
Packit 6f3914
part of available package set. It's the package ``Epoch``, ``Version`` and ``Release``
Packit 6f3914
what determines if the package is the latest.
Packit 6f3914
Packit 6f3914
Packit 6f3914
======================
Packit 6f3914
 Fail-safe mechanisms
Packit 6f3914
======================
Packit 6f3914
Packit 6f3914
Packit 6f3914
Repositories with module metadata are unavailable
Packit 6f3914
=================================================
Packit 6f3914
When a repository with module metadata is unavailable, package filtering must keep working.
Packit 6f3914
Non-modular RPMs must remain unavailable and must never get on the system.
Packit 6f3914
Packit 6f3914
This happens when:
Packit 6f3914
Packit 6f3914
* user disables a repository via ``--disablerepo`` or uses ``--repoid``
Packit 6f3914
* user removes a .repo file from disk
Packit 6f3914
* repository is not available and has ``skip_if_unavailable=true``
Packit 6f3914
Packit 6f3914
DNF keeps copies of the latest modulemd for every active stream
Packit 6f3914
and uses them if there's no modulemd available for the stream.
Packit 6f3914
This keeps package filtering working correctly.
Packit 6f3914
Packit 6f3914
The copies are made any time a transaction is resolved and started.
Packit 6f3914
That includes RPM transactions as well as any ``dnf module <enable|disable|reset>`` operations.
Packit 6f3914
Packit 6f3914
When the fail-safe data is used, dnf show such modules as part of @modulefailsafe repository.
Packit 6f3914
Packit 6f3914
Packit 6f3914
Orphaned modular packages
Packit 6f3914
=========================
Packit 6f3914
All packages that are built as a part of a module have ``%{modularitylabel}`` RPM header set.
Packit 6f3914
If such package becomes part of RPM transaction and cannot be associated with any available
Packit 6f3914
modulemd, DNF prevents from getting it on the system (package is available, but cannot be
Packit 6f3914
installed, upgraded, etc.)