| |
@@ -0,0 +1,147 @@
|
| |
+ # User docs of fedmod modularity tools
|
| |
+
|
| |
+ fedmod provides tools for working with Fedora's modulemd metadata format
|
| |
+ that aren't related to actually building them (for build commands, see
|
| |
+ fedpkg and mbs-build).
|
| |
+
|
| |
+ Currently, this consists of:
|
| |
+
|
| |
+ * `fedmod rqoquery`: simple repoquery-like commands providing operations
|
| |
+ like listing modules, resolving dependencies for packages, finding out
|
| |
+ where a certain package is, etc.
|
| |
+ * `fedmod rpm2module`: generates a draft modulemd file based on
|
| |
+ the given RPM name (multiple RPM names can be given, but the resulting
|
| |
+ draft module will lack any descriptive metadata in that case)
|
| |
+ * `fedmod fetch-metadata`: download the F27 package and module metadata needed
|
| |
+ to generate draft module definitions (the metadata sets to use are not yet
|
| |
+ configurable)
|
| |
+
|
| |
+
|
| |
+ ## Using the repoquery-like commands
|
| |
+
|
| |
+ **List all modules**
|
| |
+
|
| |
+ Lists all modules available.
|
| |
+
|
| |
+ ```
|
| |
+ $ fedmod list-modules
|
| |
+ module1
|
| |
+ module2
|
| |
+ ...
|
| |
+ ```
|
| |
+
|
| |
+ **List all modularized packages**
|
| |
+
|
| |
+ Lists all packages that have been modularized. It can optionally list only duplicate packages, and show in which modules every package is.
|
| |
+
|
| |
+ ```
|
| |
+ $ fedmod list-rpms
|
| |
+ pkg1
|
| |
+ pkg2
|
| |
+ ...
|
| |
+
|
| |
+ $ fedmod list-rpms --duplicate-only
|
| |
+ pkg2
|
| |
+ ...
|
| |
+
|
| |
+ $ fedmod list-rpms --list-modules
|
| |
+ pkg1 (module1)
|
| |
+ pkg2 (module2, module3)
|
| |
+ ...
|
| |
+ ```
|
| |
+
|
| |
+ **Resolve package dependencies**
|
| |
+
|
| |
+ Resolve package dependencies which is useful for creating new modules. User can also specify modular dependencies.
|
| |
+
|
| |
+ ```
|
| |
+ $ fedmod resolve-deps pkg
|
| |
+ pkg2
|
| |
+ pkg3
|
| |
+ pkg4
|
| |
+ ...
|
| |
+
|
| |
+ $ fedmod resolve-deps -m host -m platform pkg
|
| |
+ pkg3
|
| |
+ ```
|
| |
+
|
| |
+ **Find package in modules**
|
| |
+
|
| |
+ Finds out whether a certain package has been modularized and in which module(s).
|
| |
+
|
| |
+ ```
|
| |
+ $fedmod where-is-package pkg
|
| |
+ module1
|
| |
+ module2
|
| |
+ ```
|
| |
+
|
| |
+ **List packages of a module**
|
| |
+
|
| |
+ Lists all packages in a given module. Can also list full NEVRAs.
|
| |
+
|
| |
+ ```
|
| |
+ $ fedmod module-packages module
|
| |
+ pkg1
|
| |
+ pkg2
|
| |
+
|
| |
+ $ fedmod module-packages --full-nevra module
|
| |
+ pkg1-0:2.4.28-3.module_e7ab08d3.x86_64
|
| |
+ pkg2-0:4.5.20-1.module_e7ab08d3.x86_64
|
| |
+ ```
|
| |
+
|
| |
+ ## Modulemd creation
|
| |
+
|
| |
+ Before generating any draft modulemd files, first run the following command to
|
| |
+ fetch and locally cache the required metadata files:
|
| |
+
|
| |
+ $ fedmod fetch-metadata
|
| |
+
|
| |
+ `fedmod rpm2module [RPM NAMES]` will then create a modulemd file from the
|
| |
+ given package names and emit it on `stdout`. The YAML metadata can be written
|
| |
+ directly to a file instead by passing the ``--output` (or `-o`) option:
|
| |
+
|
| |
+ $ fedmod rpm2module -o graphite-web.yaml graphite-web
|
| |
+
|
| |
+ Only module level build dependencies are generated by default - there is no
|
| |
+ attempt to make the generated module definition self-hosting. If a self-hosting
|
| |
+ module is desired, then the `--build-deps N` option can be passed, where `N` is
|
| |
+ the number of levels of recursive build dependencies to attempt to include (this
|
| |
+ can quickly become unmanageable due to dependencies on build tools that
|
| |
+ themselves have complex build requirements, but are not yet part of a defined
|
| |
+ module)
|
| |
+
|
| |
+ The following metadata is currently used as input to the draft module generation
|
| |
+ process:
|
| |
+
|
| |
+ * Package dependency definitions are pulled from the regular Fedora 27
|
| |
+ release and updates repositories, with the metadata being downloaded for
|
| |
+ local use via the `fedmod fetch-metadata` command
|
| |
+
|
| |
+ * Installable module definitions are pulled from the modular Fedora Bikeshed
|
| |
+ repository, with the metadata being downloaded for local use via the
|
| |
+ `fedmod fetch-metadata` command
|
| |
+
|
| |
+ * The definition of Fedora's build-only `bootstrap` module is retrieved
|
| |
+ directly from the relevant
|
| |
+ [dist-git repository](https://src.fedoraproject.org/modules/bootstrap/raw/master/f/bootstrap.yaml)
|
| |
+
|
| |
+ * Descriptive metadata is taken from the system running `fedmod`. Due to this,
|
| |
+ `fedmod` currently only supports Fedora 26+. (This will be fixed to use
|
| |
+ the same repository metadata as is used for package dependency resolution)
|
| |
+
|
| |
+ Module dependencies currently err on the side of making the generated modules
|
| |
+ smaller by permitting generated modules to depend on packages that aren't
|
| |
+ listed as part of the public API of other modules. This reflects the fact that
|
| |
+ those transitive dependencies are typically the reason for the lower level
|
| |
+ modules appearing in the dependency set in the first place, as well as the fact
|
| |
+ that true dependency isolation will start being enforced once modules begin
|
| |
+ including opaque container images, such that only the client libraries are
|
| |
+ installed into shared environments.
|
| |
+
|
| |
+ Other limitations in generated `modulemd` files:
|
| |
+
|
| |
+ * `components` are only given a name and rationale, relying on the default
|
| |
+ settings for everything else
|
| |
+ * the stream for module level dependencies is currently hardcoded to `f27`.
|
| |
+ This isn't right, but we can't set anything better until the mechanism for
|
| |
+ depending on multiple streams without naming them specifically is defined.
|
| |
We should switch over to click for real at some point - right now we're using it for the progress bars in the metadata downloader, but I never got around to switching the actual arg parsing over.