Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3

...

Note

80% Confidence it’s Possible — but it will be complicated and hacky

  • The current methods of downloading external packages AND pruning OS ISOs down to a minimal set of packages will both result in broken modular repositories.

    • This could be solved by recreating the RPM’s module streams with exactly the same NSVCA values as the source repository—but practically every step of that will be hacky and require unsupported tooling or several workarounds.

  • The repo manipulation methods (createrepo, repoclosure) aren’t module-aware

...

  • RPM packages from repo modules contain a ModularityLabel header that is unique to the module’s name + stream + version + context + architecture (NSVCA). DNF must install these RPMs from modules (with modular metadata)—and will refuse to install them as ursine packages.

    • dir2module and repo2modules require a complete NSVCA string generating module metadata for a directory of RPMs.

    • 5️⃣ The dir2module script provided by the EPEL8 RPM modulemd-tools-0.7-1.el8.noarch does not create a default (or any) profile for the module it creates; it is effectively useless; use repo2module instead (which is still missing the Arch in NSVCA).

  • A repackaged (slim) module’s name and stream and context and architecture must match the values in the source repo’s metadata for the original module.

    • This is required so the packages maintain continuity with the complete upstream repo (e.g., receiving update from the complete AppStream repo, epel-modular, etc)

    • The versionnumber must evaluate to more than the earlier (module versions) and less than the version of later modules in the full source repository. This number (like stream and context) is an arbitrary string set by the build platform, so we have to get it

    • For practical purposes, you need to mirror the repo’s metadata YAML at the same time as you retrieve the packages—it might be updated later, even if the packages you see hosted there are the same

  • The ModularityLabel header is string unique to a module builds' NSVCfor a particular platform. The header data in RPMs packaged by RHEL/CentOS build system looks useful because a string it’s in NSVC format, however this data is actually arbitrary and cannot be relied uponto provide accurate NSVC data for the module.

  • The only canonical source for a module’s correct NSVCA/P data is the source repo’s metadata (generally under repodata/{XXXXX}-modules.yaml.gz, and defined by repodata/repomd.xml under <data type="modules">`)

  • 🎉 I’ve tested a repacked “slim” repo alongside a repo with the full module w/identical NSVCA details, and it successfully resolved its metadata/packages with the full module.

    • This should also behave correctly with updated modules, but I haven’t been able to stage that yet.

...

Info

Notes:

...

Code Block
languagebash
find "$DIR_WITH_RPMS" -name \*.rpm \
  -exec rpm -qp {} --qf '%-62{NVRA}   %{ModularityLabel}\n' \; \
  | grep -v '(none)' \
  | tee modular_rpms.txt

...

Code Block
389-ds-base-1.4.3.8-56.module_el8.3.0+473604+53682548ab7bf9cc.x86_64         389-ds:1.4:80300202008311741078030020201222185615:618f7055
389-ds-base-devellibs-1.4.3.8-56.module_el8.3.0+473604+53682548ab7bf9cc.x86_64    389-ds:1.4:80300202008311741078030020201222185615:618f7055
389-ds-base-legacy-tools-python3-distro-1.4.3.80-52.module_el8.3.0+473562+53682548.x86_64e162826a.noarch        389-dspython36:13.46:80300202008311741078030020201104034153:618f705524f1489c
389python3-dslib389-base-libs-1.4.3.8-56.module_el8.3.0+473604+53682548.x86_64ab7bf9cc.noarch      389-ds:1.4:80300202008311741078030020201222185615:618f7055
389-ds-base-snmp-1.4.3.8-5ruby-2.5.5-106.module_el8.3.0+473571+53682548.x86_64bab7c6bc.i686                  389-dsruby:12.45:80300202008311741078030020201104071226:618f705530b713e6
HdrHistogramruby-2.15.115-2106.module_el8.23.0+460571+6583c1d0.noarchbab7c6bc.x86_64        jmc:rhel8:8020020200731165725:21dc74c6 HdrHistogram-javadoc-2.1.11-2.module_el8.2.0+460+6583c1d0.noarch   jmc:rhel8:8020020200731165725:21dc74c6 Judy-1.0.5-18.module_el8.1.0+217+4d875839.x86_64   mariadbruby:102.35:8010020191115015915:cdc1202b
ant-1.10.5-1.module_el8.0.0+47+197dca37.noarch   ant:1.10:8000020190624202340:f7e686af
ant-lib-1.10.5-1.module_el8.0.0+47+197dca37.noarch   ant:1.10:8000020190624202340:f7e686af
aopalliance-1.0-17.module_el8.0.0+39+6a9b6e22.noarch   maven:3.5:8000020190624140656:f7e686af
aopalliance-1.0-20.module_el8.3.0+568+0c23fd64.noarch   maven:3.6:8030020201104064112:a623df058030020201104071226:30b713e6

However, it isn’t possible to re-create specific module/streams based on the RPM’s ModularityLabel headers.

...

  • Create a modular repo from packages that already have a common module header
    (warning)

    Status
    colourYellow
    titleWARNING
    The approach of taking N:S:V:C:A from the RPM headers below is a.) incomplete and b.) cannot be relied upon to be accurate or present—the ModularityLabel header can contain any String.

    (warning)

    Status
    colourRed
    titleDO NOT PRODUCTIZE
    Use another means to obtain N:V:S:C:A data; preferably from the repo itself (the data is sourced from the source repository’s {XXXXX}-modules.yaml.gz file)

    Code Block
    # Get the ModularityLabel from the RPMs
    ##########################################################
    #### UPDATE: DO NOT USE OR PRODUCTIZE THIS TECHNIQUE #####
    ##########################################################
    
    # Notes: 
    #  - All RPMs in the module must have a SINGLE and IDENTICAL ModularityLabel
    #  - The only thing required of this String is that it is unique to RPMs 
    #    from other modules (and different versions/contexts of this module)
    find "$DIR_WITH_RPMS" -name \*.rpm  \
      -exec rpm -qp {} --qf '%{ModularityLabel}\n' \;  \
      | sort -u
    
    ### WARNING: the ModularityLabel headers in RPMs build by EL and EPEL 
    ####         are (currently) in N:S:V:C format by convention, but in 
    #####        reality this string is arbitrary and cannot be relied upon
    #####        to reflect the actual source module's metadata.
    #####        The actual NVSCA/P data can *ONLY* be obtained from the 
    #####        original repo's metadata
    MODULE_HEADER=nodejs:10:8020020200707141642:6a468ee4
    
    

...