From Fedora Project Wiki
(wr)
(Replaced content with "{{admon/important|This page is deprecated| All Fedora Modularity Documentation has moved to the new [https://docs.pagure.org/modularity/ Fedora Modularity Documentation we...")
 
Line 1: Line 1:
== Composing Modules with Pungi ==
{{admon/important|This page is deprecated| All Fedora Modularity Documentation has moved to the new [https://docs.pagure.org/modularity/ Fedora Modularity Documentation website] with source hosted along side the code in the [https://pagure.io/modularity Fedora Modularity website git repository]}}
 
After you have downloaded [[Modularity/Development/Getting_Pungi_(Modularity_Style)|Pungi (Modularity style)]] and [[Modularity/Development/Getting_Fedora_Packages_for_Testing|the necessary Fedora packages/repositories]], you can compose a module. Unlike with the versions of pungi currently used for composing Fedora, this process is split into separate steps with our prototype, using several distinct scripts.
 
This document assumes that the checked out repositories are located in <code>$WORKSPACE</code>, the local package repositories are in <code>$REPOS</code> and the compose and intermediate data will be output into <code>$COMPOSES</code>. You need to activate the environment for running the pungi prototype, as the case may be by either sourcing <code>$HOME/.modularity.sh</code> or, if you set up a Python virtualenv, by running <code>workon modularity</code>.
 
=== Gathering the component packages ===
 
The <code>pungi-gather-prototype</code> script produces a manifest of the desired packages and their dependencies, in our example for a core and shells. For productive use, these packages would come e.g. from a specific koji tag. You may want to add the local repository with the minimized packages, but then you have to ensure that they are preferred over the normal Fedora packages (see [[Modularity/Development/Getting_Fedora_Packages_for_Testing]] for details).
 
<pre>"$WORKSPACE"/pungi/bin/pungi-gather-prototype \
    --arch x86_64 --target-dir "$COMPOSES" \
    --config "$WORKSPACE"/pungi-modularity/pungi-inputs/core.yaml \
    --source-repo-from-path "$REPOS"/fedora-24-beta-x86_64 \
    --source-repo-from-path "$REPOS"/fedora-24-beta-src
"$WORKSPACE"/pungi/bin/pungi-gather-prototype \
    --arch x86_64 --target-dir "$COMPOSES" \
    --config "$WORKSPACE"/pungi-modularity/pungi-inputs/shells.yaml \
    --source-repo-from-path "$REPOS"/fedora-24-shells-x86_64 \
    --source-repo-from-path "$REPOS"/fedora-24-shells-src \
    --source-repo-from-path "$REPOS"/fedora-24-beta-x86_64 \
    --source-repo-from-path "$REPOS"/fedora-24-beta-src</pre>
 
The script will output the location where it wrote the manifest after it is run. At this point the manifests should be in <code>$COMPOSES/manifest-{core,shells}-$date-$hash.$serial</code> where <code>$date</code> is the current date, <code>$hash</code> a hash of the configuration input file and <code>$serial</code> a serial number which will be incremented if you run the same invocation several times.
 
=== Creating repositories from the manifests ===
 
The <code>pungi-createrepo-prototype</code> script creates an installable repository from the previously gathered manifests. You need to supply the manifest directory locations from the previous step.
 
<pre>"$WORKSPACE"/pungi/bin/pungi-createrepo-prototype \
    --arch x86_64 --target-dir "$COMPOSES" \
    --source-repo-from-path "$REPOS"/fedora-24-beta-x86_64 \
    --source-repo-from-path "$REPOS"/fedora-24-beta-src \
    --static-content-manifest "$COMPOSES/manifest_core-x86_64-$date-$hash.$serial/" \
    --extra-file "$COMPOSES/manifest_core-x86_64-$date-$hash.$serial/fm-metadata.yaml"
"$WORKSPACE"/pungi/bin/pungi-createrepo-prototype \
    --arch x86_64 --target-dir "$COMPOSES" \
    --source-repo-from-path "$REPOS"/fedora-24-shells-x86_64 \
    --source-repo-from-path "$REPOS"/fedora-24-shells-src \
    --source-repo-from-path "$REPOS"/fedora-24-beta-x86_64 \
    --source-repo-from-path "$REPOS"/fedora-24-beta-src \
    --static-content-manifest "$COMPOSES/manifest_shells-x86_64-$date-$hash.$serial/" \
    --extra-file "$COMPOSES/manifest_shells-x86_64-$date-$hash.$serial/fm-metadata.yaml"</pre>
 
This may seem a bit roundabout since we started out with repositories, but it will collect only the packages defined in the <code>core.yaml</code> and <code>shells.yaml</code> configuration files and their dependencies.
 
At this point, the repositories should be at <code>$COMPOSES/repo_{core,shells}-x86_64-$date-$hash.$serial</code>
 
=== Composing the module ===
 
The <code>pungi-compose-prototype</code> script composes the module metadata from the variants file <code>"$WORKSPACE"/pungi-modularity/pungi-inputs/variants-fm.xml</code> and the previously created repositories.
 
<pre>"$WORKSPACE"/pungi/bin/pungi-compose-prototype \
    --release fedora-24 --arch x86_64 --target-dir "$COMPOSES" \
    --variants-file "$WORKSPACE"/pungi-modularity/pungi-inputs/variants-fm.xml</pre>
 
At this point the compose metadata directory should be at <code>$COMPOSES/compose_fedora-24-$date.$serial</code>.

Latest revision as of 07:57, 20 February 2017

Important.png
This page is deprecated
All Fedora Modularity Documentation has moved to the new Fedora Modularity Documentation website with source hosted along side the code in the Fedora Modularity website git repository