Blame doc/modularity.rst

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