1PUNGI(1)                             Pungi                            PUNGI(1)
2
3
4

NAME

6       pungi - Pungi Documentation
7
8       Contents:
9

ABOUT PUNGI

11         [image: Pungi Logo] [image]
12
13       Pungi is a distribution compose tool.
14
15       Composes  are  release snapshots that contain release deliverables such
16       as:
17
18       · installation trees
19
20         · RPMs
21
22         · repodata
23
24         · comps
25
26       · (bootable) ISOs
27
28       · kickstart trees
29
30         · anaconda images
31
32         · images for PXE boot
33
34   Tool overview
35       Pungi consists of multiple separate  executables  backed  by  a  common
36       library.
37
38       The  main  entry-point  is  the pungi-koji script. It loads the compose
39       configuration and kicks off the process. Composing itself  is  done  in
40       phases.   Each  phase  is  responsible for generating some artifacts on
41       disk and updating the compose object that is threaded through  all  the
42       phases.
43
44       Pungi itself does not actually do that much. Most of the actual work is
45       delegated to separate executables. Pungi just makes sure that  all  the
46       commands  are  invoked  in the appropriate order and with correct argu‐
47       ments. It also moves the artifacts to correct locations.
48
49       The executable name pungi-koji comes from the fact that most  of  those
50       separate  executables submit tasks to Koji that does the actual work in
51       an auditable way.
52
53       However unlike doing everything manually in Koji, Pungi will make  sure
54       you are building all images from the same package set, and will produce
55       even deliverables that Koji can not create like YUM repos and installer
56       ISOs.
57
58   Links
59       · Upstream GIT: https://pagure.io/pungi/
60
61       · Issue tracker: https://pagure.io/pungi/issues
62
63       · Questions can be asked on #fedora-releng IRC channel on FreeNode
64
65   Origin of name
66       The name Pungi comes from the instrument used to charm snakes. Anaconda
67       being the software Pungi was manipulating, and anaconda being a  snake,
68       led to the referential naming.
69
70       The  first  name,  which  was suggested by Seth Vidal, was FIST, Fedora
71       Installation <Something> Tool. That  name  was  quickly  discarded  and
72       replaced with Pungi.
73
74       There  was  also a bit of an inside joke that when said aloud, it could
75       sound like punji, which is a sharpened stick at the bottom of  a  trap.
76       Kind of like software…
77

PHASES

79       Each  invocation  of  pungi-koji  consists of a set of phases.  [image:
80       phase diagram] [image]
81
82       Most of the phases run sequentially (left-to-right in the diagram), but
83       there are use cases where multiple phases run in parallel. This happens
84       for phases whose main point is to wait for a Koji task to finish.
85
86   Init
87       The first phase to ever run. Can not be skipped. It prepares the  comps
88       files  for  variants  (by filtering out groups and packages that should
89       not be there).  See comps for details about how this is done.
90
91   Pkgset
92       This phase loads a set of packages that should be composed. It has  two
93       separate  results:  it  prepares repos with packages in work/ directory
94       (one per arch) for further processing, and it returns a data  structure
95       with mapping of packages to architectures.
96
97   Buildinstall
98       Spawns  a bunch of threads, each of which runs either lorax or buildin‐
99       stall command (the latter coming from anaconda package).  The  commands
100       create  boot.iso  and  other  boot  configuration  files.  The image is
101       finally linked into the compose/ directory as netinstall media.
102
103       The created images are also needed for creating  live  media  or  other
104       images in later phases.
105
106       With  lorax  this phase runs one task per variant.arch combination. For
107       buildinstall command there is only one task per architecture and  prod‐
108       uct.img should be used to customize the results.
109
110   Gather
111       This  phase  uses  data  collected by pkgset phase and figures out what
112       packages should be in each variant. The basic  mapping  can  come  from
113       comps  file,  a JSON mapping or additional_packages config option. This
114       inputs can then be enriched by adding all dependencies.  See  gathering
115       for details.
116
117       Once  the  mapping is finalized, the packages are linked to appropriate
118       places and the rpms.json manifest is created.
119
120   ExtraFiles
121       This phase collects extra files from the configuration and copies  them
122       to the compose directory. The files are described by a JSON file in the
123       compose subtree where the files are copied. This metadata is  meant  to
124       be distributed with the data (on ISO images).
125
126   Createrepo
127       This  phase  creates RPM repositories for each variant.arch tree. It is
128       actually reading the rpms.json manifest to figure  out  which  packages
129       should be included.
130
131   OSTree
132       Updates  an  ostree repository with a new commit with packages from the
133       compose.  The repository lives outside of the compose  and  is  updated
134       immediately. If the compose fails in a later stage, the commit will not
135       be reverted.
136
137       Implementation wise, this phase runs rpm-ostree command in Koji runroot
138       (to allow running on different arches).
139
140   Productimg
141       Creates product.img files for customizing the bootable media created in
142       buildinstall phase.
143
144   Createiso
145       Generates ISO files and accumulates enough metadata to be able to  cre‐
146       ate image.json manifest. The file is however not created in this phase,
147       instead it is dumped in the pungi-koji script itself.
148
149       The files include a repository with all RPMs from  the  variant.  There
150       will be multiple images if the packages do not fit on a single image.
151
152       The  image  will  be  bootable if buildinstall phase is enabled and the
153       packages fit on a single image.
154
155       There can also be images with  source  repositories.  These  are  never
156       bootable.
157
158   ExtraIsos
159       This  phase  is  very  similar to createiso, except it combines content
160       from multiple variants onto a  single  image.  Packages,  repodata  and
161       extra  files  from each configured variant are put into a subdirectory.
162       Additional extra files can be put into top  level  of  the  image.  The
163       image will be bootable if the main variant is bootable.
164
165   LiveImages, LiveMedia
166       Creates  media  in  Koji  with koji spin-livecd, koji spin-appliance or
167       koji spin-livemedia command. When the media are  finished,  the  images
168       are  copied  into  the  compose/  directory  and metadata for images is
169       updated.
170
171   ImageBuild
172       This phase wraps up koji image-build.  It  also  updates  the  metadata
173       ultimately responsible for images.json manifest.
174
175   OSBS
176       This phase builds docker base images in OSBS.
177
178       The finished images are available in registry provided by OSBS, but not
179       downloaded directly into the compose. The is metadata about the created
180       image in compose/metadata/osbs.json.
181
182   OSTreeInstaller
183       Creates  bootable  media  that carry an ostree repository as a payload.
184       These images are created by running lorax with special templates. Again
185       it runs in Koji runroot.
186
187   ImageChecksum
188       Responsible  for generating checksums for the images. The checksums are
189       stored in image manifest as well as files on disk. The list  of  images
190       to  be  processed  is  obtained  from  the image manifest. This way all
191       images will get the same checksums irrespective of the phase that  cre‐
192       ated them.
193
194   Test
195       This  phase  is supposed to run some sanity checks on the finished com‐
196       pose.
197
198       The first test is to run repoclosure on  each  repository.  By  default
199       errors  are only reported in the log, the compose will still be consid‐
200       ered a success.  The actual error has to be looked up  in  the  compose
201       logs directory.  Configuration allows customizing this.
202
203       The  other  test  is to check all images listed the metadata and verify
204       that they look sane. For ISO files headers are checked  to  verify  the
205       format is correct, and for bootable media a check is run to verify they
206       have properties that allow booting.
207

CONFIG FILE FORMAT

209       The configuration file parser is provided by kobo
210
211       The file follows a Python-like format. It consists  of  a  sequence  of
212       variables that have a value assigned to them.
213
214          variable = value
215
216       The  variable  names  must  follow  the same convention as Python code:
217       start with a letter and consist  of  letters,  digits  and  underscores
218       only.
219
220       The  values can be either an integer, float, boolean (True or False), a
221       string or None. Strings must be enclosed in  either  single  or  double
222       quotes.
223
224       Complex types are supported as well.
225
226       A list is enclosed in square brackets and items are separated with com‐
227       mas.  There can be a comma after the last item as well.
228
229          a_list = [1,
230                    2,
231                    3,
232                   ]
233
234       A tuple works like a list, but is enclosed in parenthesis.
235
236          a_tuple = (1, "one")
237
238       A dictionary is wrapped in brackets, and consists of key:  value  pairs
239       separated by commas. The keys can only be formed from basic types (int,
240       float, string).
241
242          a_dict = {
243              'foo': 'bar',
244              1: None
245          }
246
247       The value assigned to a variable can also be taken from  another  vari‐
248       able.
249
250          one = 1
251          another = one
252
253       Anything  on a line after a # symbol is ignored and functions as a com‐
254       ment.
255
256   Importing other files
257       It is possible to include another configuration  file.  The  files  are
258       looked up relative to the currently processed file.
259
260       The general structure of import is:
261
262          from FILENAME import WHAT
263
264       The FILENAME should be just the base name of the file without extension
265       (which must be .conf). WHAT can either be a  comma  separated  list  of
266       variables or *.
267
268          # Opens constants.conf and brings PI and E into current scope.
269          from constants import PI, E
270
271          # Opens common.conf and brings everything defined in that file into current
272          # file as well.
273          from common import *
274
275       NOTE:
276          Pungi  will  copy  the configuration file given on command line into
277          the logs/ directory. Only this single file will be copied,  not  any
278          included  ones.  (Copying  included  files  requires  a  fix in kobo
279          library.)
280
281          The JSON-formatted dump of configuration is correct though.
282
283   Formatting strings
284       String interpolation is available as well. It uses a %-encoded  format.
285       See Python documentation for more details.
286
287          joined = "%s %s" % (var_a, var_b)
288
289          a_dict = {
290              "fst": 1,
291              "snd": 2,
292          }
293          another = "%(fst)s %(snd)s" % a_dict
294

CONFIGURATION

296       Please  read  productmd documentation for terminology and other release
297       and compose related details.
298
299   Minimal Config Example
300          # RELEASE
301          release_name = "Fedora"
302          release_short = "Fedora"
303          release_version = "23"
304
305          # GENERAL SETTINGS
306          comps_file = "comps-f23.xml"
307          variants_file = "variants-f23.xml"
308          module_defaults_dir = "module_defaults"
309
310          # KOJI
311          koji_profile = "koji"
312          runroot = False
313
314          # PKGSET
315          sigkeys = [None]
316          pkgset_source = "koji"
317          pkgset_koji_tag = "f23"
318
319          # CREATEREPO
320          createrepo_checksum = "sha256"
321
322          # GATHER
323          gather_method = "deps"
324          greedy_method = "build"
325          check_deps = False
326
327          # BUILDINSTALL
328          buildinstall_method = "lorax"
329
330   Release
331       Following mandatory options describe a release.
332
333   Options
334       release_name [mandatory]
335              (str) – release name
336
337       release_short [mandatory]
338              (str) – release short name, without spaces and  special  charac‐
339              ters
340
341       release_version [mandatory]
342              (str) – release version
343
344       release_type = “ga” (str) – release type, for example ga,
345              updates or updates-testing. See list of all valid values in pro‐
346              ductmd documentation.
347
348       release_internal = False
349              (bool) – whether the compose is meant for public consumption
350
351   Example
352          release_name = "Fedora"
353          release_short = "Fedora"
354          release_version = "23"
355          # release_type = "ga"
356
357   Base Product
358       Base product options are optional and we need to  them  only  if  we’re
359       composing a layered product built on another (base) product.
360
361   Options
362       base_product_name
363              (str) – base product name
364
365       base_product_short
366              (str)  –  base  product  short  name, without spaces and special
367              characters
368
369       base_product_version
370              (str) – base product major version
371
372       base_product_type = “ga”
373              (str) – base product type, “ga”, “updates” etc., for  full  list
374              see documentation of productmd.
375
376   Example
377          release_name = "RPM Fusion"
378          release_short = "rf"
379          release_version = "23.0"
380
381          base_product_name = "Fedora"
382          base_product_short = "Fedora"
383          base_product_version = "23"
384
385   General Settings
386   Options
387       comps_file [mandatory]
388              (scm_dict,  str  or  None)  –  reference  to comps XML file with
389              installation groups
390
391       variants_file [mandatory]
392              (scm_dict or str) – reference to variants XML file that  defines
393              release variants and architectures
394
395       module_defaults_dir [optional]
396              (scm_dict or str) – reference the module defaults directory con‐
397              taining modulemd-defaults YAML documents
398
399       failable_deliverables [optional]
400              (list) – list which deliverables on which variant and  architec‐
401              ture can fail and not abort the whole compose. This only applies
402              to buildinstall and iso parts. All other artifacts can  be  con‐
403              figured in their respective part of configuration.
404
405              Please  note  that * as a wildcard matches all architectures but
406              src.
407
408       comps_filter_environments [optional]
409              (bool) – When set to False, the comps files  for  variants  will
410              not have their environments filtered to match the variant.
411
412       tree_arches
413              ([str])  –  list  of  architectures which should be included; if
414              undefined, all architectures from variants.xml will be included
415
416       tree_variants
417              ([str]) – list of variants which should be  included;  if  unde‐
418              fined, all variants from variants.xml will be included
419
420       repoclosure_strictness
421              (list)  – variant/arch mapping describing how repoclosure should
422              run.  Possible values are
423
424                 · off – do not run repoclosure
425
426                 · lenient – (default) run repoclosure and  write  results  to
427                   logs, but detected errors are only reported in logs
428
429                 · fatal – abort compose when any issue is detected
430
431              When  multiple blocks in the mapping match a variant/arch combi‐
432              nation, the last value will win.
433
434       repoclosure_backend
435              (str) – Select which tool should be used to run repoclosure over
436              created repositories. By default yum is used, but you can switch
437              to dnf.  Please note that when dnf is used, the build  dependen‐
438              cies  check  is skipped. On Python 3, only dnf backend is avail‐
439              able.
440
441       compose_type
442              (str) – Allows to set default compose type. Type set via a  com‐
443              mand-line option overwrites this.
444
445   Example
446          comps_file = {
447              "scm": "git",
448              "repo": "https://git.fedorahosted.org/git/comps.git",
449              "branch": None,
450              "file": "comps-f23.xml.in",
451          }
452
453          variants_file = {
454              "scm": "git",
455              "repo": "https://pagure.io/pungi-fedora.git ",
456              "branch": None,
457              "file": "variants-fedora.xml",
458          }
459
460          failable_deliverables = [
461              ('^.*$', {
462                  # Buildinstall can fail on any variant and any arch
463                  '*': ['buildinstall'],
464                  'src': ['buildinstall'],
465                  # Nothing on i386 blocks the compose
466                  'i386': ['buildinstall', 'iso', 'live'],
467              })
468          ]
469
470          tree_arches = ["x86_64"]
471          tree_variants = ["Server"]
472
473          repoclosure_strictness = [
474              # Make repoclosure failures fatal for compose on all variants …
475              ('^.*$', {'*': 'fatal'}),
476              # … except for Everything where it should not run at all.
477              ('^Everything$', {'*': 'off'})
478          ]
479
480   Image Naming
481       Both image name and volume id are generated based on the configuration.
482       Since the volume id is limited to 32 characters, there  are  more  set‐
483       tings available.  The process for generating volume id is to get a list
484       of possible formats and try them sequentially until  one  fits  in  the
485       length limit. If substitutions are configured, each attempted volume id
486       will be modified by it.
487
488       For layered products, the candidate formats are first  image_volid_lay‐
489       ered_product_formats  followed by image_volid_formats.  Otherwise, only
490       image_volid_formats are tried.
491
492       If no format matches the length limit, an error will  be  reported  and
493       compose aborted.
494
495   Options
496       There a couple common format specifiers available for both the options:
497
498              · compose_id
499
500              · release_short
501
502              · version
503
504              · date
505
506              · respin
507
508              · type
509
510              · type_suffix
511
512              · label
513
514              · label_major_version
515
516              · variant
517
518              · arch
519
520              · disc_type
521
522       image_name_format [optional]
523              (str|dict)  –  Python’s  format  string to serve as template for
524              image names. The value can also be a dict  mapping  variant  UID
525              regexes  to  the  format string. The pattern should not overlap,
526              otherwise it is undefined which one will be used.
527
528              This format will be used for all phases generating images.  Cur‐
529              rently that means createiso, live_images and buildinstall.
530
531              Available extra keys are:
532
533                     · disc_num
534
535                     · suffix
536
537       image_volid_formats [optional]
538              (list) – A list of format strings for generating volume id.
539
540              The extra available keys are:
541
542                     · base_product_short
543
544                     · base_product_version
545
546       image_volid_layered_product_formats [optional]
547              (list)  –  A list of format strings for generating volume id for
548              layered products.  The  keys  available  are  the  same  as  for
549              image_volid_formats.
550
551       restricted_volid = False
552              (bool)  –  New  versions of lorax replace all non-alphanumerical
553              characters with dashes (underscores are preserved). This  option
554              will mimic similar behaviour in Pungi.
555
556       volume_id_substitutions [optional]
557              (dict)  – A mapping of string replacements to shorten the volume
558              id.
559
560       disc_types [optional]
561              (dict) – A mapping  for  customizing  disc_type  used  in  image
562              names.
563
564              Available keys are:
565
566                     · boot  –  for  boot.iso  images created in  buildinstall
567                       phase
568
569                     · live – for images created by live_images phase
570
571                     · dvd – for images created by createiso phase
572
573                     · ostree – for ostree installer images
574
575              Default values are the same as the keys.
576
577   Example
578          # Image name respecting Fedora's image naming policy
579          image_name_format = "%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s%(suffix)s"
580          # Use the same format for volume id
581          image_volid_formats = [
582              "%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s"
583          ]
584          # No special handling for layered products, use same format as for regular images
585          image_volid_layered_product_formats = []
586          # Replace "Cloud" with "C" in volume id etc.
587          volume_id_substitutions = {
588              'Cloud': 'C',
589              'Alpha': 'A',
590              'Beta': 'B',
591              'TC': 'T',
592          }
593
594          disc_types = {
595              'boot': 'netinst',
596              'live': 'Live',
597              'dvd': 'DVD',
598          }
599
600   Signing
601       If you want to sign deliverables generated during pungi  run  like  RPM
602       wrapped images. You must provide few configuration options:
603
604       signing_command [optional]
605              (str)  –  Command that will be run with a koji build as a single
606              argument. This command must not require  any  user  interaction.
607              If you need to pass a password for a signing key to the command,
608              do this via command line option of the command  and  use  string
609              formatting    syntax   %(signing_key_password)s.    (See   sign‐
610              ing_key_password_file).
611
612       signing_key_id [optional]
613              (str) – ID of the key that will be used for the  signing.   This
614              ID will be used when crafting koji paths to signed files (kojip‐
615              kgs.fedoraproject.org/pack‐
616              ages/NAME/VER/REL/data/signed/KEYID/..).
617
618       signing_key_password_file [optional]
619              (str) – Path to a file with password that will be formatted into
620              signing_command string via %(signing_key_password)s string  for‐
621              mat  syntax (if used).  Because pungi config is usualy stored in
622              git and is part of compose logs we don’t  want  password  to  be
623              included  directly  in  the  config.   Note: If - string is used
624              instead of a filename, then you will be asked for  the  password
625              interactivelly right after pungi starts.
626
627   Example
628          signing_command = '~/git/releng/scripts/sigulsign_unsigned.py -vv --password=%(signing_key_password)s fedora-24'
629          signing_key_id = '81b46521'
630          signing_key_password_file = '~/password_for_fedora-24_key'
631
632   Git URLs
633       In multiple places the config requires URL of a Git repository to down‐
634       load some file from. This URL is passed on to Koji. It is  possible  to
635       specify which commit to use using this syntax:
636
637          git://git.example.com/git/repo-name.git?#<rev_spec>
638
639       The  <rev_spec>  pattern  can be replaced with actual commit SHA, a tag
640       name, HEAD to indicate that tip of default branch  should  be  used  or
641       origin/<branch_name> to use tip of arbitrary branch.
642
643       If  the  URL specifies a branch or HEAD, Pungi will replace it with the
644       actual commit SHA. This will later show up in Koji tasks and help  with
645       tracing what particular inputs were used.
646
647       NOTE:
648          The  origin must be specified because of the way Koji works with the
649          repository. It will clone the repository then  switch  to  requested
650          state  with  git  reset --hard REF. Since no local branches are cre‐
651          ated, we need to use full specification including the  name  of  the
652          remote.
653
654   Createrepo Settings
655   Options
656       createrepo_checksum
657              (str)  –  specify checksum type for createrepo; expected values:
658              sha512, sha256, sha. Defaults to sha256.
659
660       createrepo_c = True
661              (bool) – use createrepo_c (True) or legacy createrepo (False)
662
663       createrepo_deltas = False
664              (list) – generate delta RPMs  against  an  older  compose.  This
665              needs to be used together with --old-composes command line argu‐
666              ment. The value should be a mapping of  variants  and  architec‐
667              tures  that should enable creating delta RPMs. Source and debug‐
668              info repos never have deltas.
669
670       createrepo_use_xz = False
671              (bool) – whether to pass --xz to the  createrepo  command.  This
672              will cause the SQLite databases to be compressed with xz.
673
674       createrepo_num_threads
675              (int)  –  how  many  concurrent  createrepo  process to run. The
676              default is to use one thread per CPU available on the machine.
677
678       createrepo_num_workers
679              (int) – how many concurrent createrepo  workers  to  run.  Value
680              defaults to 3.
681
682       createrepo_database
683              (bool)  – whether to create SQLite database as part of the repo‐
684              data. This is only useful as an optimization for  clients  using
685              Yum  to  consume  to  the  repo. Default value depends on gather
686              backend. For DNF it’s turned off, for Yum the default is True.
687
688       createrepo_extra_args
689              ([str]) – a list of extra arguments passed on to  createrepo  or
690              createrepo_c  executable.  This  could  be  useful  for enabling
691              zchunk generation and pointing it to correct dictionaries.
692
693       product_id = None
694              (scm_dict) – If specified, it should point to a  directory  with
695              certificates  <variant_uid>-<arch>-*.pem.  Pungi  will copy each
696              certificate file into the relevant Yum repositories as a produc‐
697              tid  file in the repodata directories. The purpose of these pro‐
698              ductid   files   is   to   expose   the    product    data    to
699              subscription-manager.   subscription-manager  inclues  a  “prod‐
700              uct-id” Yum plugin that can  read  these  productid  certificate
701              files from each Yum repository.
702
703       product_id_allow_missing = False
704              (bool)  –  When  product_id  is  used and a certificate for some
705              variant and architecture is missing, Pungi  will  exit  with  an
706              error  by default.  When you set this option to True, Pungi will
707              ignore the missing certificate and simply log a warning message.
708
709   Example
710          createrepo_checksum = "sha"
711          createrepo_deltas = [
712              # All arches for Everything should have deltas.
713              ('^Everything$', {'*': True}),
714              # Also Server.x86_64 should have them (but not on other arches).
715              ('^Server$', {'x86_64': True}),
716          ]
717
718   Package Set Settings
719   Options
720       sigkeys
721              ([str or None]) – priority list of sigkeys; if the list includes
722              an empty string or  None, unsigned packages will be allowed
723
724       pkgset_source [mandatory]
725              (str)  –  “koji”  (any  koji instance) or “repos” (arbitrary yum
726              repositories)
727
728       pkgset_koji_tag
729              (str|[str]) – tag(s) to read package set from. This  option  can
730              be omitted for modular composes.
731
732       pkgset_koji_builds
733              (str|[str]) – extra build(s) to include in a package set defined
734              as NVRs.
735
736       pkgset_koji_module_tag
737              (str|[str]) – tags to read module from. This option works  simi‐
738              larly to listing tags in variants XML. If tags are specified and
739              variants XML specifies some modules via NSVC (or part of),  only
740              modules  matching  that  list  will  be used (and taken from the
741              tag). Inheritance is used automatically.
742
743       pkgset_koji_inherit = True
744              (bool) – inherit builds from parent tags; we  can  turn  it  off
745              only if we have all builds tagged in a single tag
746
747       pkgset_koji_inherit_modules = False
748              (bool)  –  the  same  as above, but this only applies to modular
749              tags. This option applies to the content tags that  contain  the
750              RPMs.
751
752       pkgset_repos
753              (dict)  –  A mapping of architectures to repositories with RPMs:
754              {arch: [repo]}. Only use when pkgset_source = "repos".
755
756       pkgset_exclusive_arch_considers_noarch = True
757              (bool) – If a package includes noarch in its ExclusiveArch  tag,
758              it will be included in all architectures since noarch is compat‐
759              ible with everything. Set this option to False to ignore  noarch
760              in ExclusiveArch and always consider only binary architectures.
761
762   Example
763          sigkeys = [None]
764          pkgset_source = "koji"
765          pkgset_koji_tag = "f23"
766
767   Buildinstall Settings
768       Script  or process that creates bootable images with Anaconda installer
769       is historically called buildinstall.
770
771   Options
772       buildinstall_method
773              (str)  –  “lorax”  (f16+,  rhel7+)  or   “buildinstall”   (older
774              releases)
775
776       lorax_options
777              (list) – special options passed on to lorax.
778
779              Format: [(variant_uid_regex, {arch|*: {option: name}})].
780
781              Recognized options are:
782
783                     · bugurl str (default None)
784
785                     · nomacboot bool (default True)
786
787                     · noupgrade bool (default True)
788
789                     · add_template [str] (default empty)
790
791                     · add_arch_template [str] (default empty)
792
793                     · add_template_var [str] (default empty)
794
795                     · add_arch_template_var [str] (default empty)
796
797                     · rootfs_size – [int] (default empty)
798
799                     · version  –  [str] (default from release_version) – used
800                       as --version and --release argument on the  lorax  com‐
801                       mand line
802
803                     · dracut_args  –  [[str]]  (default empty) override argu‐
804                       ments for dracut. Please note that if  this  option  is
805                       used,  lorax  will  not use any other arguments, so you
806                       have to provide a full list and can not just add  some‐
807                       thing.
808
809       lorax_extra_sources
810              (list)  –  a  variant/arch  mapping  with  urls for extra source
811              repositories added to Lorax command line. Either one repo  or  a
812              list can be specified.
813
814       buildinstall_kickstart
815              (scm_dict)  –  If  specified, this kickstart file will be copied
816              into each file and pointed to in boot configuration.
817
818       buildinstall_topdir
819              (str) – Full path to top directory where  the  runroot  buildin‐
820              stall Koji tasks output should be stored. This is useful in sit‐
821              uation when the Pungi compose is not generated on the same stor‐
822              age as the Koji task is running on. In this case, Pungi can pro‐
823              vide input repository for runroot task using HTTP  and  set  the
824              output  directory for this task to buildinstall_topdir. Once the
825              runroot task finishes, Pungi will copy the  results  of  runroot
826              tasks to the compose working directory.
827
828       buildinstall_skip
829              (list)  – mapping that defines which variants and arches to skip
830              during  buildinstall;  format:   [(variant_uid_regex,   {arch|*:
831              True})]. This is only supported for lorax.
832
833   Example
834          buildinstall_method = "lorax"
835
836          # Enables macboot on x86_64 for all variants and builds upgrade images
837          # everywhere.
838          lorax_options = [
839              ("^.*$", {
840                  "x86_64": {
841                      "nomacboot": False
842                  }
843                  "*": {
844                      "noupgrade": False
845                  }
846              })
847          ]
848
849          # Don't run buildinstall phase for Modular variant
850          buildinstall_skip = [
851              ('^Modular', {
852                  '*': True
853              })
854          ]
855
856          # Add another repository for lorax to install packages from
857          lorax_extra_sources = [
858              ('^Simple$', {
859                  '*': 'https://example.com/repo/$basearch/',
860              })
861          ]
862
863       NOTE:
864          It is advised to run buildinstall (lorax) in koji, i.e. with runroot
865          enabled for clean build environments, better logging, etc.
866
867       WARNING:
868          Lorax installs RPMs into  a  chroot.  This  involves  running  %post
869          scriptlets  and  they  frequently run executables in the chroot.  If
870          we’re composing for multiple architectures, we must use runroot  for
871          this reason.
872
873   Gather Settings
874   Options
875       gather_method [mandatory]
876              (str*|*dict)  –  Options are deps, nodeps and hybrid.  Specifies
877              whether and how package dependencies should be pulled in.   Pos‐
878              sible  configuration  can  be  one value for all variants, or if
879              configured per-variant it can be a simple string hybrid or  a  a
880              dictionary  mapping  source  type  to a value of deps or nodeps.
881              Make sure only one regex matches each variant, as  there  is  no
882              guarantee  which value will be used if there are multiple match‐
883              ing ones. All used sources must have a configured method  unless
884              hybrid solving is used.
885
886       gather_fulltree = False
887              (bool)  –  When  set  to  True  all RPMs built from an SRPM will
888              always be included. Only use when gather_method = "deps".
889
890       gather_selfhosting = False
891              (bool) – When set to True, Pungi will build a self-hosting  tree
892              by  following  build dependencies. Only use when gather_method =
893              "deps".
894
895       greedy_method
896              (str) – This option controls how package requirements are satis‐
897              fied in case a particular Requires has multiple candidates.
898
899              · none – the best packages is selected to satisfy the dependency
900                and only that one is pulled into the compose
901
902              · all – packages that provide the symbol are pulled in
903
904              · build – the best package is selected, and  then  all  packages
905                from the same build that provide the symbol are pulled in
906
907              NOTE:
908                 As  an  example  let’s work with this situation: a package in
909                 the compose has Requires: foo. There are three packages  with
910                 Provides:  foo: pkg-a, pkg-b-provider-1 and pkg-b-provider-2.
911                 The pkg-b-* packages are build from the same source  package.
912                 Best match determines pkg-b-provider-1 as best matching pack‐
913                 age.
914
915                 · With greedy_method = "none" only pkg-b-provider-1  will  be
916                   pulled in.
917
918                 · With  greedy_method  =  "all"  all  three  packages will be
919                   pulled in.
920
921                 · With  greedy_method  =   "build"   ``pkg-b-provider-1   and
922                   pkg-b-provider-2 will be pulled in.
923
924       gather_backend
925              (str)  –This  changes the entire codebase doing dependency solv‐
926              ing, so it can change the result in unpredictable ways.
927
928              On Python 2, the choice is between yum or dnf  and  defaults  to
929              yum. On Python 3 dnf is the only option and default.
930
931              Particularly the multilib work is performed differently by using
932              python-multilib library. Please refer to multilib option to  see
933              the differences.
934
935       multilib
936              (list) – mapping of variant regexes and arches to list of multi‐
937              lib methods
938
939              Available methods are:
940
941                     · none – no package matches this method
942
943                     · all – all packages match this method
944
945                     · runtime – packages that install some shared object file
946                       (*.so.*) will match.
947
948                     · devel  –  packages  whose  name  ends  with  -devel  or
949                       --static suffix will be matched. When dnf is used, this
950                       method  automatically  enables  runtime method as well.
951                       With yum backend this  method  also  uses  a  hardcoded
952                       blacklist and whitelist.
953
954                     · kernel  –  packages  providing  kernel  or kernel-devel
955                       match this method (only in yum backend)
956
957                     · yaboot – only yaboot package on ppc arch  matches  this
958                       (only in yum backend)
959
960       additional_packages
961              (list)  –  additional  packages  to be included in a variant and
962              architecture;  format:  [(variant_uid_regex,   {arch|*:   [pack‐
963              age_globs]})]
964
965              The  packages  specified here are matched against RPM names, not
966              any other provides in the package not the name of  source  pack‐
967              age.  Shell  globbing  is  used,  so wildcards are possible. The
968              package can be specified as name only or name.arch.
969
970       filter_packages
971              (list) – packages to be excluded from a  variant  and  architec‐
972              ture; format: [(variant_uid_regex, {arch|*: [package_globs]})]
973
974              See additional_packages for details about package specification.
975
976       filter_modules
977              (list) – modules to be excluded from a variant and architecture;
978              format: [(variant_uid_regex, {arch|*: [name:stream]})]
979
980              Both name and stream can use shell-style  globs.  If  stream  is
981              omitted, all streams are removed.
982
983              This  option  only  applies to modules taken from Koji tags, not
984              modules explicitly listed in variants XML without any tags.
985
986       filter_system_release_packages
987              (bool) – for each variant, figure out the  best  system  release
988              package and filter out all others. This will not work if a vari‐
989              ant needs more than one system release package.  In  such  case,
990              set this option to False.
991
992       gather_prepopulate = None
993              (scm_dict)  –  If  specified, you can use this to add additional
994              packages. The format of the file pointed to by this option is  a
995              JSON mapping {variant_uid: {arch: {build: [package]}}}. Packages
996              added through this option can not be removed by filter_packages.
997
998       multilib_blacklist
999              (dict) – multilib blacklist; format: {arch|*: [package_globs]}.
1000
1001              See additional_packages for details about package specification.
1002
1003       multilib_whitelist
1004              (dict) – multilib blacklist; format: {arch|*:  [package_names]}.
1005              The  whitelist  must  contain  exact package names; there are no
1006              wildcards or pattern matching.
1007
1008       gather_lookaside_repos = []
1009              (list) – lookaside repositories used for package gathering; for‐
1010              mat: [(variant_uid_regex, {arch|*: [repo_urls]})]
1011
1012       hashed_directories = False
1013              (bool)  –  put  packages  into “hashed” directories, for example
1014              Packages/k/kernel-4.0.4-301.fc22.x86_64.rpm
1015
1016       check_deps = True
1017              (bool) – Set to False if you don’t want  the  compose  to  abort
1018              when some package has broken dependencies.
1019
1020       require_all_comps_packages = False
1021              (bool)  – Set to True to abort compose when package mentioned in
1022              comps file can not be found in the package  set.  When  disabled
1023              (the  default), such cases are still reported as warnings in the
1024              log.
1025
1026       gather_source_mapping
1027              (str) – JSON mapping with initial packages for the compose.  The
1028              value  should  be  a  path  to JSON file with following mapping:
1029              {variant: {arch: {rpm_name: [rpm_arch|None]}}}.
1030
1031       gather_profiler = False
1032              (bool) – When set to True the gather  tool  will  produce  addi‐
1033              tional performance profiling information at the end of its logs.
1034              Only takes effect when gather_backend = "dnf".
1035
1036       variant_as_lookaside
1037              (list) – a variant/variant mapping that tells one or more  vari‐
1038              ants  in compose has other variant(s) in compose as a lookaside.
1039              Only top level variants are supported (not addons/layered  prod‐
1040              ucts). Format: [(variant_uid, variant_uid)]
1041
1042   Example
1043          gather_method = "deps"
1044          greedy_method = "build"
1045          check_deps = False
1046          hashed_directories = True
1047
1048          gather_method = {
1049              "^Everything$": {
1050                  "comps": "deps"     # traditional content defined by comps groups
1051              },
1052              "^Modular$": {
1053                  "module": "nodeps"  # Modules do not need dependencies
1054              },
1055              "^Mixed$": {            # Mixed content in one variant
1056                  "comps": "deps",
1057                  "module": "nodeps"
1058              }
1059              "^OtherMixed$": "hybrid",   # Using hybrid depsolver
1060          }
1061
1062          additional_packages = [
1063              # bz#123456
1064              ('^(Workstation|Server)$', {
1065                  '*': [
1066                      'grub2',
1067                      'kernel',
1068                  ],
1069              }),
1070          ]
1071
1072          filter_packages = [
1073              # bz#111222
1074              ('^.*$', {
1075                  '*': [
1076                      'kernel-doc',
1077                  ],
1078              }),
1079          ]
1080
1081          multilib = [
1082              ('^Server$', {
1083                  'x86_64': ['devel', 'runtime']
1084              })
1085          ]
1086
1087          multilib_blacklist = {
1088              "*": [
1089                  "gcc",
1090              ],
1091          }
1092
1093          multilib_whitelist = {
1094              "*": [
1095                  "alsa-plugins-*",
1096              ],
1097          }
1098
1099          # gather_lookaside_repos = [
1100          #     ('^.*$', {
1101          #         'x86_64': [
1102          #             "https://dl.fedoraproject.org/pub/fedora/linux/releases/22/Everything/x86_64/os/",
1103          #             "https://dl.fedoraproject.org/pub/fedora/linux/releases/22/Everything/source/SRPMS/",
1104          #         ]
1105          #     }),
1106          # ]
1107
1108       NOTE:
1109          It  is  a  good  practice  to  attach  bug/ticket  numbers  to addi‐
1110          tional_packages,  filter_packages,  multilib_blacklist  and   multi‐
1111          lib_whitelist to track decisions.
1112
1113   Koji Settings
1114   Options
1115       koji_profile
1116              (str)  –  koji profile name. This tells Pungi how to communicate
1117              with your chosen Koji instance. See Koji’s  documentation  about
1118              profiles  for  more  information  about  how to set up your Koji
1119              client profile. In the examples, the  profile  name  is  “koji”,
1120              which points to Fedora’s koji.fedoraproject.org.
1121
1122       runroot_method
1123              (str)  –  Runroot method to use. It can further specify the run‐
1124              root method in case the runroot is set to True.
1125
1126              Available methods are:
1127
1128                     · local – runroot tasks are run locally
1129
1130                     · koji – runroot tasks are run in Koji
1131
1132                     · openssh – runroot tasks are run on remote machine  con‐
1133                       nected  using  OpenSSH.   The runroot_ssh_hostnames for
1134                       each architecture must be set and the user under  which
1135                       Pungi   runs  must  be  configured  to  login  as  run‐
1136                       root_ssh_username using the SSH key.
1137
1138       runroot_channel
1139              (str) – name of koji channel
1140
1141       runroot_tag
1142              (str) – name of koji build tag used for runroot
1143
1144       runroot_weights
1145              (dict) – customize task weights for various runroot  tasks.  The
1146              values  in  the  mapping  should  be  integers,  the keys can be
1147              selected from the  following  list.  By  default  no  weight  is
1148              assigned and Koji picks the default one according to policy.
1149
1150                 · buildinstall
1151
1152                 · createiso
1153
1154                 · ostree
1155
1156                 · ostree_installer
1157
1158   Example
1159          koji_profile = "koji"
1160          runroot_channel = "runroot"
1161          runroot_tag = "f23-build"
1162
1163   Runroot “openssh” method settings
1164   Options
1165       runroot_ssh_username
1166              (str) – For openssh runroot method, configures the username used
1167              to login the remote machine to run the runroot task. Defaults to
1168              “root”.
1169
1170       runroot_ssh_hostnames
1171              (dict)  –  For  openssh runroot method, defines the hostname for
1172              each architecture on which the runroot task should  be  running.
1173              Format: {"x86_64": "runroot-x86-64.localhost.tld", ...}
1174
1175       runroot_ssh_init_template
1176              (str)  [optional] – For openssh runroot method, defines the com‐
1177              mand to initializes the runroot task on the remote machine. This
1178              command  is executed as first command for each runroot task exe‐
1179              cuted.
1180
1181              The command can print a string which is then available as  {run‐
1182              root_key}  for  other SSH commands. This string might be used to
1183              keep the context across different SSH commands executed for sin‐
1184              gle runroot task.
1185
1186              The  goal of this command is setting up the environment for real
1187              runroot commands. For example preparing the unique mock environ‐
1188              ment, mounting the desired file-systems, …
1189
1190              The  command  string  can  contain following variables which are
1191              replaced by the real values before executing the init command:
1192
1193              · {runroot_tag} - Tag  to  initialize  the  runroot  environment
1194                from.
1195
1196              When not set, no init command is executed.
1197
1198       runroot_ssh_install_packages_template
1199              (str)  [optional] – For openssh runroot method, defines the tem‐
1200              plate for command to install the packages requested to  run  the
1201              runroot task.
1202
1203              The  template  string  can contain following variables which are
1204              replaced by the real values before executing  the  install  com‐
1205              mand:
1206
1207              · {runroot_key}  -  Replaced  with  the  string returned by run‐
1208                root_ssh_init_template if used. This can be used to  keep  the
1209                track  of  context  of SSH commands beloging to single runroot
1210                task.
1211
1212              · {packages} - White-list separated list of packages to install.
1213
1214              Example (The {runroot_key} is expected to be set to mock  config
1215              file  using  the  runroot_ssh_init_template  command.): "mock -r
1216              {runroot_key} --install {packages}"
1217
1218              When not set, no command to install packages on  remote  machine
1219              is executed.
1220
1221       runroot_ssh_run_template
1222              (str)  [optional] – For openssh runroot method, defines the tem‐
1223              plate for the main runroot command.
1224
1225              The template string can contain following  variables  which  are
1226              replaced  by  the  real values before executing the install com‐
1227              mand:
1228
1229              · {runroot_key} - Replaced with  the  string  returned  by  run‐
1230                root_ssh_init_template  if  used. This can be used to keep the
1231                track of context of SSH commands beloging  to  single  runroot
1232                task.
1233
1234              · {command} - Command to run.
1235
1236              Example  (The {runroot_key} is expected to be set to mock config
1237              file using the  runroot_ssh_init_template  command.):  "mock  -r
1238              {runroot_key} chroot -- {command}"
1239
1240              When not set, the runroot command is run directly.
1241
1242   Extra Files Settings
1243   Options
1244       extra_files
1245              (list) – references to external files to be placed in os/ direc‐
1246              tory   and   media;   format:   [(variant_uid_regex,    {arch|*:
1247              [scm_dict]})].  See  scm_support for details. If the dict speci‐
1248              fies a target key, an additional subdirectory will be used.
1249
1250   Example
1251          extra_files = [
1252              ('^.*$', {
1253                  '*': [
1254                      # GPG keys
1255                      {
1256                          "scm": "rpm",
1257                          "repo": "fedora-repos",
1258                          "branch": None,
1259                          "file": [
1260                              "/etc/pki/rpm-gpg/RPM-GPG-KEY-22-fedora",
1261                          ],
1262                          "target": "",
1263                      },
1264                      # GPL
1265                      {
1266                          "scm": "git",
1267                          "repo": "https://pagure.io/pungi-fedora",
1268                          "branch": None,
1269                          "file": [
1270                              "GPL",
1271                          ],
1272                          "target": "",
1273                      },
1274                  ],
1275              }),
1276          ]
1277
1278   Extra Files Metadata
1279       If extra files are specified  a  metadata  file,  extra_files.json,  is
1280       placed  in  the  os/  directory  and media. The checksums generated are
1281       determined by media_checksums option. This metadata file is in the for‐
1282       mat:
1283
1284          {
1285            "header": {"version": "1.0},
1286            "data": [
1287              {
1288                "file": "GPL",
1289                "checksums": {
1290                  "sha256": "8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643"
1291                },
1292                "size": 18092
1293              },
1294              {
1295                "file": "release-notes/notes.html",
1296                "checksums": {
1297                  "sha256": "82b1ba8db522aadf101dca6404235fba179e559b95ea24ff39ee1e5d9a53bdcb"
1298                },
1299                "size": 1120
1300              }
1301            ]
1302          }
1303
1304   Productimg Settings
1305       Product  images are placed on installation media and provide additional
1306       branding and Anaconda changes specific to product variants.
1307
1308   Options
1309       productimg = False
1310              (bool) – create  product  images;  requires  buildinstall_method
1311              option
1312
1313       productimg_install_class
1314              (scm_dict, str) – reference to install class file
1315
1316       productimg_po_files
1317              (scm_dict,  str)  –  reference  to a directory with po files for
1318              install class translations
1319
1320   Example
1321          productimg = True
1322          productimg_install_class = {
1323              "scm": "git",
1324              "repo": "http://git.example.com/productimg.git",
1325              "branch": None,
1326              "file": "fedora23/%(variant_id)s.py",
1327          }
1328          productimg_po_files = {
1329              "scm": "git",
1330              "repo": "http://git.example.com/productimg.git",
1331              "branch": None,
1332              "dir": "po",
1333          }
1334
1335   CreateISO Settings
1336   Options
1337       createiso_skip = False
1338              (list) – mapping that defines which variants and arches to  skip
1339              during createiso; format: [(variant_uid_regex, {arch|*: True})]
1340
1341       createiso_max_size
1342              (list)  –  mapping  that  defines maximum expected size for each
1343              variant and arch. If the ISO is larger than the limit, a warning
1344              will be issued.
1345
1346              Format: [(variant_uid_regex, {arch|*: number})]
1347
1348       createiso_max_size_is_strict
1349              (list)  –  Set  the  value to True to turn the warning from cre‐
1350              ateiso_max_size into a hard error that will abort  the  compose.
1351              If  there are multiple matches in the mapping, the check will be
1352              strict if at least one match says so.
1353
1354              Format: [(variant_uid_regex, {arch|*: bool})]
1355
1356       create_jigdo = True
1357              (bool) – controls the creation of jigdo from ISO
1358
1359       create_optional_isos = False
1360              (bool) – when set  to  True,  ISOs  will  be  created  even  for
1361              optional variants. By default only variants with type variant or
1362              layered-product will get ISOs.
1363
1364       createiso_break_hardlinks = False
1365              (bool) – when set to True, all files that should go on  the  ISO
1366              and  have  a hardlink will be first copied into a staging direc‐
1367              tory. This should work around a  bug  in  genisoimage  including
1368              incorrect link count in the image, but it is at the cost of hav‐
1369              ing to copy a potentially significant amount of data.
1370
1371              The staging directory is deleted when ISO is  successfully  cre‐
1372              ated.  In  that case the same task to create the ISO will not be
1373              re-runnable.
1374
1375       iso_size = 4700000000
1376              (int|str) – size of ISO image. The value  should  either  be  an
1377              integer  meaning size in bytes, or it can be a string with k, M,
1378              G suffix (using multiples of 1024).
1379
1380       split_iso_reserve = 10MiB
1381              (int|str) – how much free space should be left on each disk. The
1382              format is the same as for iso_size option.
1383
1384       iso_hfs_ppc64le_compatible = True
1385              (bool)  –  when  set  to  False,  the Apple/HFS compatibility is
1386              turned off for ppc64le ISOs. This option only  makes  sense  for
1387              bootable  products, and affects images produced in createiso and
1388              extra_isos phases.
1389
1390       NOTE:
1391          Source architecture needs to be listed  explicitly.   Excluding  ‘*’
1392          applies only on binary arches.  Jigdo causes significant increase of
1393          time to ISO creation.
1394
1395   Example
1396          createiso_skip = [
1397              ('^Workstation$', {
1398                  '*': True,
1399                  'src': True
1400              }),
1401          ]
1402
1403   Automatic generation of version and release
1404       Version and release values for certain artifacts can be generated auto‐
1405       matically  based  on  release  version,  compose  label, date, type and
1406       respin. This can be used to shorten the config and keep it the same for
1407       multiple uses.
1408
1409┌───────────────────────┬───────────────┬──────────┬──────────┬────────┬──────────────┐
1410│Compose ID             │ Label         │ Version  │ Date     │ Respin │ Release      │
1411├───────────────────────┼───────────────┼──────────┼──────────┼────────┼──────────────┤
1412F-Rawhide-20170406.n.0 -             Rawhide  20170406 0      20170406.n.0 
1413├───────────────────────┼───────────────┼──────────┼──────────┼────────┼──────────────┤
1414F-26-20170329.1        Alpha-1.6     26_Alpha 20170329 1      1.6          
1415├───────────────────────┼───────────────┼──────────┼──────────┼────────┼──────────────┤
1416F-Atomic-25-20170407.0 RC-20170407.0 25       20170407 0      20170407.0   
1417├───────────────────────┼───────────────┼──────────┼──────────┼────────┼──────────────┤
1418F-Atomic-25-20170407.0 -             25       20170407 0      20170407.0   
1419└───────────────────────┴───────────────┴──────────┴──────────┴────────┴──────────────┘
1420
1421       All non-RC milestones from label  get  appended  to  the  version.  For
1422       release either label is used or date, type and respin.
1423
1424   Common options for Live Images, Live Media and Image Build
1425       All images can have ksurl, version, release and target specified. Since
1426       this can create a lot of duplication, there are global options that can
1427       be used instead.
1428
1429       For each of the phases, if the option is not specified for a particular
1430       deliverable, an option named <PHASE_NAME>_<OPTION> is checked. If  that
1431       is  not specified either, the last fallback is global_<OPTION>. If even
1432       that is unset, the value is considered to not be specified.
1433
1434       The kickstart URL is configured by these options.
1435
1436          · global_ksurl – global fallback setting
1437
1438          · live_media_ksurl
1439
1440          · image_build_ksurl
1441
1442          · live_images_ksurl
1443
1444       Target is specified by these settings.
1445
1446          · global_target – global fallback setting
1447
1448          · live_media_target
1449
1450          · image_build_target
1451
1452          · live_images_target
1453
1454       Version is specified by these options. If no version is set, a  default
1455       value will be provided according to automatic versioning.
1456
1457          · global_version – global fallback setting
1458
1459          · live_media_version
1460
1461          · image_build_version
1462
1463          · live_images_version
1464
1465       Release  is  specified  by  these  options.  If set to a magic value to
1466       !RELEASE_FROM_LABEL_DATE_TYPE_RESPIN, a value will be generated accord‐
1467       ing to automatic versioning.
1468
1469          · global_release – global fallback setting
1470
1471          · live_media_release
1472
1473          · image_build_release
1474
1475          · live_images_release
1476
1477       Each  configuration  block  can also optionally specify a failable key.
1478       For live images it should have a boolean  value.  For  live  media  and
1479       image  build  it  should  be a list of strings containing architectures
1480       that are optional. If any deliverable fails on  an  optional  architec‐
1481       ture,  it  will  not abort the whole compose. If the list contains only
1482       "*", all arches will be substituted.
1483
1484   Live Images Settings
1485       live_images
1486              (list) – Configuration for the particular image. The elements of
1487              the list should be tuples (variant_uid_regex, {arch|*: config}).
1488              The config should be a dict with these keys:
1489
1490                 · kickstart (str)
1491
1492                 · ksurl (str) [optional] – where to get the kickstart from
1493
1494                 · name (str)
1495
1496                 · version (str)
1497
1498                 · target (str)
1499
1500                 · repo (str|[str]) – repos specified by URL or variant UID
1501
1502                 · specfile (str) – for images wrapped in RPM
1503
1504                 · scratch (bool) – only RPM-wrapped images  can  use  scratch
1505                   builds, but by default this is turned off
1506
1507                 · type  (str)  – what kind of task to start in Koji. Defaults
1508                   to live meaning koji spin-livecd will be used.  Alternative
1509                   option is appliance corresponding to koji spin-appliance.
1510
1511                 · sign (bool) – only RPM-wrapped images can be signed
1512
1513       live_images_no_rename
1514              (bool)  –  When set to True, filenames generated by Koji will be
1515              used.   When  False,  filenames  will  be  generated  based   on
1516              image_name_format configuration option.
1517
1518   Live Media Settings
1519       live_media
1520              (dict)  –  configuration for koji spin-livemedia; format: {vari‐
1521              ant_uid_regex: [{opt:value}]}
1522
1523              Required options:
1524
1525                 · name (str)
1526
1527                 · version (str)
1528
1529                 · arches ([str]) – what architectures to build the media for;
1530                   by default uses all arches for the variant.
1531
1532                 · kickstart (str) – name of the kickstart file
1533
1534              Available options:
1535
1536                 · ksurl (str)
1537
1538                 · ksversion (str)
1539
1540                 · scratch (bool)
1541
1542                 · target (str)
1543
1544                 · release   (str)   –   a   string   with   the  release,  or
1545                   !RELEASE_FROM_LABEL_DATE_TYPE_RESPIN to automatically  gen‐
1546                   erate  a  suitable  value.  See  automatic  versioning  for
1547                   details.
1548
1549                 · skip_tag (bool)
1550
1551                 · repo (str|[str]) – repos specified by URL or variant UID
1552
1553                 · title (str)
1554
1555                 · install_tree_from (str) – variant to take install tree from
1556
1557   Image Build Settings
1558       image_build
1559              (dict)  –  config   for   koji   image-build;   format:   {vari‐
1560              ant_uid_regex: [{opt: value}]}
1561
1562              By  default, images will be built for each binary arch valid for
1563              the variant. The config can specify a list of arches  to  narrow
1564              this down.
1565
1566       NOTE:
1567          Config  can  contain  anything  what is accepted by koji image-build
1568          --config configfile.ini
1569
1570          Repo can be specified either as a string or a list  of  strings.  It
1571          will  be  automatically transformed into format suitable for koji. A
1572          repo for the currently built variant will be added as well.
1573
1574          If        you        explicitly        set        release         to
1575          !RELEASE_FROM_LABEL_DATE_TYPE_RESPIN,  it  will  be  replaced with a
1576          value generated as described in automatic versioning.
1577
1578          If you explicitly set release to !RELEASE_FROM_DATE_RESPIN, it  will
1579          be  replaced  with  a value generated as described in automatic ver‐
1580          sioning.
1581
1582          If you explicitly set version to !VERSION_FROM_VERSION, it  will  be
1583          replaced  with  a value generated as described in automatic version‐
1584          ing.
1585
1586          Please don’t set install_tree. This gets automatically set by  pungi
1587          based  on  current variant. You can use install_tree_from key to use
1588          install tree from another variant.
1589
1590          Both the install tree and repos can use one of following formats:
1591
1592              · URL to the location
1593
1594              · name of variant in the current compose
1595
1596              · absolute path on local filesystem (which  will  be  translated
1597                using configured mappings or used unchanged, in which case you
1598                have to ensure the koji builders can access it)
1599
1600          You can set either a single format, or a list of formats. For avail‐
1601          able values see help output for koji image-build command.
1602
1603          If  ksurl  ends  with  #HEAD, Pungi will figure out the SHA1 hash of
1604          current HEAD and use that instead.
1605
1606          Setting scratch to True will run the koji tasks as scratch builds.
1607
1608   Example
1609          image_build = {
1610              '^Server$': [
1611                  {
1612                      'image-build': {
1613                          'format': ['docker', 'qcow2']
1614                          'name': 'fedora-qcow-and-docker-base',
1615                          'target': 'koji-target-name',
1616                          'ksversion': 'F23',     # value from pykickstart
1617                          'version': '23',
1618                          # correct SHA1 hash will be put into the URL below automatically
1619                          'ksurl': 'https://git.fedorahosted.org/git/spin-kickstarts.git?somedirectoryifany#HEAD',
1620                          'kickstart': "fedora-docker-base.ks",
1621                          'repo': ["http://someextrarepos.org/repo", "ftp://rekcod.oi/repo"],
1622                          'distro': 'Fedora-20',
1623                          'disk_size': 3,
1624
1625                          # this is set automatically by pungi to os_dir for given variant
1626                          # 'install_tree': 'http://somepath',
1627                      },
1628                      'factory-parameters': {
1629                          'docker_cmd':  "[ '/bin/bash' ]",
1630                          'docker_env': "[ 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' ]",
1631                          'docker_labels': "{'Name': 'fedora-docker-base', 'License': u'GPLv2', 'RUN': 'docker run -it --rm ${OPT1} --privileged -v \`pwd\`:/atomicapp -v /run:/run -v /:/host --net=host --name ${NAME} -e NAME=${NAME} -e IMAGE=${IMAGE} ${IMAGE} -v ${OPT2} run ${OPT3} /atomicapp', 'Vendor': 'Fedora Project', 'Version': '23', 'Architecture': 'x86_64' }",
1632                      }
1633                  },
1634                  {
1635                      'image-build': {
1636                          'format': ['docker', 'qcow2']
1637                          'name': 'fedora-qcow-and-docker-base',
1638                          'target': 'koji-target-name',
1639                          'ksversion': 'F23',     # value from pykickstart
1640                          'version': '23',
1641                          # correct SHA1 hash will be put into the URL below automatically
1642                          'ksurl': 'https://git.fedorahosted.org/git/spin-kickstarts.git?somedirectoryifany#HEAD',
1643                          'kickstart': "fedora-docker-base.ks",
1644                          'repo': ["http://someextrarepos.org/repo", "ftp://rekcod.oi/repo"],
1645                          'distro': 'Fedora-20',
1646                          'disk_size': 3,
1647
1648                          # this is set automatically by pungi to os_dir for given variant
1649                          # 'install_tree': 'http://somepath',
1650                      }
1651                  },
1652                  {
1653                      'image-build': {
1654                          'format': 'qcow2',
1655                          'name': 'fedora-qcow-base',
1656                          'target': 'koji-target-name',
1657                          'ksversion': 'F23',     # value from pykickstart
1658                          'version': '23',
1659                          'ksurl': 'https://git.fedorahosted.org/git/spin-kickstarts.git?somedirectoryifany#HEAD',
1660                          'kickstart': "fedora-docker-base.ks",
1661                          'distro': 'Fedora-23',
1662
1663                          # only build this type of image on x86_64
1664                          'arches': ['x86_64']
1665
1666                          # Use install tree and repo from Everything variant.
1667                          'install_tree_from': 'Everything',
1668                          'repo': ['Everything'],
1669
1670                          # Set release automatically.
1671                          'release': '!RELEASE_FROM_LABEL_DATE_TYPE_RESPIN',
1672                      }
1673                  }
1674              ]
1675          }
1676
1677   OSTree Settings
1678       The ostree phase of Pungi can create and  update  ostree  repositories.
1679       This  is  done by running rpm-ostree compose in a Koji runroot environ‐
1680       ment. The ostree repository itself is  not  part  of  the  compose  and
1681       should be located in another directory. Any new packages in the compose
1682       will be added to the repository with a new commit.
1683
1684       ostree (dict) – a mapping of configuration for each. The format  should
1685              be  {variant_uid_regex:  config_dict}.  It  is possible to use a
1686              list of configuration dicts as well.
1687
1688              The configuration dict for each  variant  arch  pair  must  have
1689              these keys:
1690
1691              · treefile – (str) Filename of configuration for rpm-ostree.
1692
1693              · config_url – (str) URL for Git repository with the treefile.
1694
1695              · repo – (str|dict|[str|dict]) repos specified by URL or variant
1696                UID or a dict of repo options,  baseurl  is  required  in  the
1697                dict.
1698
1699              · ostree_repo – (str) Where to put the ostree repository
1700
1701              These keys are optional:
1702
1703              · keep_original_sources  – (bool) Keep the existing source repos
1704                in the tree config file. If  not  enabled,  all  the  original
1705                source repos will be removed from the tree config file.
1706
1707              · config_branch  – (str) Git branch of the repo to use. Defaults
1708                to master.
1709
1710              · arches – ([str]) List of architectures  for  which  to  update
1711                ostree.   There  will be one task per architecture. By default
1712                all architectures in the variant are used.
1713
1714              · failable – ([str]) List of architectures for which this deliv‐
1715                erable is not release blocking.
1716
1717              · update_summary  –  (bool)  Update  summary metadata after tree
1718                composing.  Defaults to False.
1719
1720              · force_new_commit – (bool) Do  not  use  rpm-ostree’s  built-in
1721                change detection.  Defaults to False.
1722
1723              · version – (str) Version string to be added as versioning meta‐
1724                data.    If   this   option    is    set    to    !OSTREE_VER‐
1725                SION_FROM_LABEL_DATE_TYPE_RESPIN,  a  value  will be generated
1726                automatically as $VERSION.$RELEASE.  If this option is set  to
1727                !VERSION_FROM_VERSION_DATE_RESPIN,  a  value will be generated
1728                automatically as $VERSION.$DATE.$RESPIN.  See how those values
1729                are created.
1730
1731              · tag_ref  –  (bool, default True) If set to False, a git refer‐
1732                ence will not be created.
1733
1734              · ostree_ref – (str) To override value ref from treefile.
1735
1736   Example config
1737          ostree = {
1738              "^Atomic$": {
1739                  "treefile": "fedora-atomic-docker-host.json",
1740                  "config_url": "https://git.fedorahosted.org/git/fedora-atomic.git",
1741                  "repo": [
1742                      "Server",
1743                      "http://example.com/repo/x86_64/os",
1744                      {"baseurl": "Everything"},
1745                      {"baseurl": "http://example.com/linux/repo", "exclude": "systemd-container"},
1746                  ],
1747                  "keep_original_sources": True,
1748                  "ostree_repo": "/mnt/koji/compose/atomic/Rawhide/",
1749                  "update_summary": True,
1750                  # Automatically generate a reasonable version
1751                  "version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
1752                  # Only run this for x86_64 even if Atomic has more arches
1753                  "arches": ["x86_64"],
1754              }
1755          }
1756
1757   Ostree Installer Settings
1758       The  ostree_installer  phase  of  Pungi  can  produce  installer  image
1759       bundling  an  OSTree  repository. This always runs in Koji as a runroot
1760       task.
1761
1762       ostree_installer
1763              (dict) – a variant/arch mapping  of  configuration.  The  format
1764              should be [(variant_uid_regex, {arch|*: config_dict})].
1765
1766              The configuration dict for each variant arch pair must have this
1767              key:
1768
1769              These keys are optional:
1770
1771              · repo – (str|[str]) repos specified by URL or variant UID
1772
1773              · release – (str) Release value to set for the installer  image.
1774                Set  to  !RELEASE_FROM_LABEL_DATE_TYPE_RESPIN  to generate the
1775                value automatically.
1776
1777              · failable – ([str]) List of architectures for which this deliv‐
1778                erable is not release blocking.
1779
1780              These optional keys are passed to lorax to customize the build.
1781
1782              · installpkgs – ([str])
1783
1784              · add_template – ([str])
1785
1786              · add_arch_template – ([str])
1787
1788              · add_template_var – ([str])
1789
1790              · add_arch_template_var – ([str])
1791
1792              · rootfs_size – ([str])
1793
1794              · template_repo – (str) Git repository with extra templates.
1795
1796              · template_branch – (str) Branch to use from template_repo.
1797
1798              The  templates  can either be absolute paths, in which case they
1799              will be used as configured; or they can be  relative  paths,  in
1800              which case template_repo needs to point to a Git repository from
1801              which to take the templates.
1802
1803              If the templates need to run with additional dependencies,  that
1804              can be configured with the optional key:
1805
1806              · extra_runroot_pkgs – ([str])
1807
1808       ostree_installer_overwrite = False
1809              (bool) – by default if a variant including OSTree installer also
1810              creates regular installer images in  buildinstall  phase,  there
1811              will  be  conflicts (as the files are put in the same place) and
1812              Pungi will report an error and fail the compose.
1813
1814              With this option it is possible to opt-in for  the  overwriting.
1815              The traditional boot.iso will be in the iso/ subdirectory.
1816
1817   Example config
1818          ostree_installer = [
1819              ("^Atomic$", {
1820                  "x86_64": {
1821                      "repo": [
1822                          "Everything",
1823                          "https://example.com/extra-repo1.repo",
1824                          "https://example.com/extra-repo2.repo",
1825                      ],
1826                      "release": "!RELEASE_FROM_LABEL_DATE_TYPE_RESPIN",
1827                      "installpkgs": ["fedora-productimg-atomic"],
1828                      "add_template": ["atomic-installer/lorax-configure-repo.tmpl"],
1829                      "add_template_var": [
1830                          "ostree_osname=fedora-atomic",
1831                          "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host",
1832                      ],
1833                      "add_arch_template": ["atomic-installer/lorax-embed-repo.tmpl"],
1834                      "add_arch_template_var": [
1835                          "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/",
1836                          "ostree_osname=fedora-atomic",
1837                          "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host",
1838                      ]
1839                      'template_repo': 'https://git.fedorahosted.org/git/spin-kickstarts.git',
1840                      'template_branch': 'f24',
1841                  }
1842              })
1843          ]
1844
1845   OSBS Settings
1846       Pungi  can  build  container  images  in  OSBS.  The build is initiated
1847       through Koji container-build plugin. The base image will be using  RPMs
1848       from  the  current  compose and a Dockerfile from specified Git reposi‐
1849       tory.
1850
1851       Please note that the image is uploaded to a registry and  not  exported
1852       into  compose directory. There will be a metadata file in compose/meta‐
1853       data/osbs.json with details about the built images (assuming  they  are
1854       not scratch builds).
1855
1856       osbs   (dict) – a mapping from variant regexes to configuration blocks.
1857              The format should be {variant_uid_regex: [config_dict]}.
1858
1859              The configuration for each image must have at least these keys:
1860
1861              · url – (str) URL pointing to a Git repository with  Dockerfile.
1862                Please see Git URLs section for more details.
1863
1864              · target – (str) A Koji target to build the image for.
1865
1866              · git_branch – (str) A branch in SCM for the Dockerfile. This is
1867                required by OSBS to avoid race conditions when multiple builds
1868                from the same repo are submitted at the same time. Please note
1869                that url should contain the branch or tag  name  as  well,  so
1870                that it can be resolved to a particular commit hash.
1871
1872              Optionally  you  can specify failable. If it has a truthy value,
1873              failure to create the image will not abort the whole compose.
1874
1875              NOTE:
1876                 Once OSBS gains support for multiple architectures, the usage
1877                 of  this option will most likely change to list architectures
1878                 that are allowed to fail.
1879
1880              The configuration will pass other  attributes  directly  to  the
1881              Koji task.  This includes name, version, scratch and priority.
1882
1883              A value for yum_repourls will be created automatically and point
1884              at a repository in the current compose. You can add extra repos‐
1885              itories  with  repo  key having a list of urls pointing to .repo
1886              files or just variant uid, Pungi will create the .repo file  for
1887              that variant. gpgkey can be specified to enable gpgcheck in repo
1888              files for variants.
1889
1890       osbs_registries
1891              (dict) – It is possible to  configure  extra  information  about
1892              where to push the image (unless it is a scratch build). For each
1893              finished build, Pungi will try to match NVR  against  a  key  in
1894              this  mapping  (using  shell-style globbing) and take the corre‐
1895              sponding value and collect them across  all  built  images.  The
1896              data  will  be  saved into logs/global/osbs-registries.json as a
1897              mapping from Koji NVR to the registry data.  The  same  data  is
1898              also sent to the message bus on osbs-request-push topic once the
1899              compose finishes successfully. Handling the message and perform‐
1900              ing the actual push is outside of scope for Pungi.
1901
1902   Example config
1903          osbs = {
1904              "^Server$": {
1905                  # required
1906                  "url": "git://example.com/dockerfiles.git?#HEAD",
1907                  "target": "f24-docker-candidate",
1908                  "git_branch": "f24-docker",
1909
1910                  # optional
1911                  "name": "fedora-docker-base",
1912                  "version": "24",
1913                  "repo": ["Everything", "https://example.com/extra-repo.repo"],
1914                  # This will result in three repo urls being passed to the task.
1915                  # They will be in this order: Server, Everything, example.com/
1916                  "gpgkey": 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release',
1917              }
1918          }
1919
1920   Extra ISOs
1921       Create an ISO image that contains packages from multiple variants. Such
1922       ISO always belongs to one variant, and will be stored in ISO  directory
1923       of that variant.
1924
1925       The  ISO  will  be  bootable  if buildinstall phase runs for the parent
1926       variant. It will reuse boot configuration from that variant.
1927
1928       extra_isos
1929              (dict) – a mapping from variant UID regex to a list of  configu‐
1930              ration blocks.
1931
1932              · include_variants – (list) list of variant UIDs from which con‐
1933                tent should be added to the ISO; the variant of this image  is
1934                added automatically.
1935
1936              Rest of configuration keys is optional.
1937
1938              · filename – (str) template for naming the image. In addition to
1939                the regular placeholders filename is available with  the  name
1940                generated using image_name_format option.
1941
1942              · volid  –  (str) template for generating volume ID. Again volid
1943                placeholder can be used similarly as for file name.  This  can
1944                also  be  a  list of templates that will be tried sequentially
1945                until one generates a volume ID that fits  into  32  character
1946                limit.
1947
1948              · extra_files  –  (list) a list of scm_dict objects. These files
1949                will be put in the top level directory of the image.
1950
1951              · arches – (list) a list of architectures  for  which  to  build
1952                this  image.  By  default  all arches from the variant will be
1953                used. This option can be used to limit them.
1954
1955              · failable_arches – (list) a list of architectures for which the
1956                image  can  fail  to be generated and not fail the entire com‐
1957                pose.
1958
1959              · skip_src – (bool) allows to disable  creating  an  image  with
1960                source packages.
1961
1962              · inherit_extra_files  –  (bool) by default extra files in vari‐
1963                ants are ignored. If you want to include them in the ISO,  set
1964                this option to True.
1965
1966              · max_size  – (int) expected maximum size in bytes. If the final
1967                image is larger, a warning will be issued.
1968
1969   Example config
1970          extra_isos = {
1971              'Server': [{
1972                  # Will generate foo-DP-1.0-20180510.t.43-Server-x86_64-dvd1.iso
1973                  'filename': 'foo-{filename}',
1974                  'volid': 'foo-{arch}',
1975
1976                  'extra_files': [{
1977                      'scm': 'git',
1978                      'repo': 'https://pagure.io/pungi.git',
1979                      'file': 'setup.py'
1980                  }],
1981
1982                  'include_variants': ['Client']
1983              }]
1984          }
1985          # This should create image with the following layout:
1986          #  .
1987          #  ├── Client
1988          #  │   ├── Packages
1989          #  │   │   ├── a
1990          #  │   │   └── b
1991          #  │   └── repodata
1992          #  ├── Server
1993          #  │   ├── Packages
1994          #  │   │   ├── a
1995          #  │   │   └── b
1996          #  │   └── repodata
1997          #  └── setup.py
1998
1999   Media Checksums Settings
2000       media_checksums
2001              (list) – list of checksum types to compute, allowed  values  are
2002              anything supported by Python’s hashlib module (see documentation
2003              for details).
2004
2005       media_checksum_one_file
2006              (bool) – when True, only one CHECKSUM file will be  created  per
2007              directory;  this option requires media_checksums to only specify
2008              one type
2009
2010       media_checksum_base_filename
2011              (str) – when not set, all checksums will be save to a file named
2012              either  CHECKSUM or based on the digest type; this option allows
2013              adding any prefix to that name
2014
2015              It is possible to use format strings that  will  be  replace  by
2016              actual values.  The allowed keys are:
2017
2018                 · arch
2019
2020                 · compose_id
2021
2022                 · date
2023
2024                 · label
2025
2026                 · label_major_version
2027
2028                 · release_short
2029
2030                 · respin
2031
2032                 · type
2033
2034                 · type_suffix
2035
2036                 · version
2037
2038                 · dirname (only if media_checksum_one_file is enabled)
2039
2040              For    example,    for    Fedora    the    prefix    should   be
2041              %(release_short)s-%(variant)s-%(version)s-%(date)s%(type_suf‐
2042              fix)s.%(respin)s.
2043
2044   Translate Paths Settings
2045       translate_paths
2046              (list)  –  list  of  paths  to translate; format: [(path, trans‐
2047              lated_path)]
2048
2049       NOTE:
2050          This feature becomes useful when you need to transform compose loca‐
2051          tion  into  e.g.  a  HTTP  repo  which  is  can  be  passed  to koji
2052          image-build.  The path part is normalized via os.path.normpath().
2053
2054   Example config
2055          translate_paths = [
2056              ("/mnt/a", "http://b/dir"),
2057          ]
2058
2059   Example usage
2060          >>> from pungi.util import translate_paths
2061          >>> print translate_paths(compose_object_with_mapping, "/mnt/a/c/somefile")
2062          http://b/dir/c/somefile
2063
2064   Miscellaneous Settings
2065       paths_module
2066              (str) – Name of Python module implementing the same interface as
2067              pungi.paths.  This  module  can be used to override where things
2068              are placed.
2069
2070       link_type = hardlink-or-copy
2071              (str) – Method of putting packages into compose directory.
2072
2073              Available options:
2074
2075              · hardlink-or-copy
2076
2077              · hardlink
2078
2079              · copy
2080
2081              · symlink
2082
2083              · abspath-symlink
2084
2085       skip_phases
2086              (list) – List of phase names that should be  skipped.  The  same
2087              functionality is available via a command line option.
2088
2089       release_discinfo_description
2090              (str)  – Override description in .discinfo files. The value is a
2091              format string accepting %(variant_name)s and %(arch)s placehold‐
2092              ers.
2093
2094       symlink_isos_to
2095              (str)  –  If set, the ISO files from buildinstall, createiso and
2096              live_images phases will be put into this destination, and a sym‐
2097              link pointing to this location will be created in actual compose
2098              directory.
2099
2100       dogpile_cache_backend
2101              (str) – If set, Pungi will  use  the  configured  Dogpile  cache
2102              backend to cache various data between multiple Pungi calls. This
2103              can make Pungi faster in case more similar composes are  running
2104              regularly in short time.
2105
2106              For    list    of    available    backends,   please   see   the
2107              https://dogpilecache.readthedocs.io documentation.
2108
2109              Most typical configuration uses the dogpile.cache.dbm backend.
2110
2111       dogpile_cache_arguments
2112              (dict) – Arguments to be used when creating  the  Dogpile  cache
2113              backend.   See  the  particular  backend’s configuration for the
2114              list of possible key/value pairs.
2115
2116              For the dogpile.cache.dbm backend, the value can be for  example
2117              following:
2118
2119                 {
2120                     "filename": "/tmp/pungi_cache_file.dbm"
2121                 }
2122
2123       dogpile_cache_expiration_time
2124              (int)  –  Defines the default expiration time in seconds of data
2125              stored in the Dogpile cache. Defaults to 3600 seconds.
2126

BIG PICTURE EXAMPLES

2128       Actual Pungi configuration files can get very large. This pages  brings
2129       two examples of (almost) full configuation for two different composes.
2130
2131   Fedora Rawhide compose
2132       This  is  a  shortened  configuration  for Fedora Radhide compose as of
2133       2019-10-14.
2134
2135          release_name = 'Fedora'
2136          release_short = 'Fedora'
2137          release_version = 'Rawhide'
2138          release_is_layered = False
2139
2140          bootable = True
2141          comps_file = {
2142              'scm': 'git',
2143              'repo': 'https://pagure.io/fedora-comps.git',
2144              'branch': 'master',
2145              'file': 'comps-rawhide.xml',
2146              # Merge translations by running make. This command will generate the file.
2147              'command': 'make comps-rawhide.xml'
2148          }
2149          module_defaults_dir = {
2150              'scm': 'git',
2151              'repo': 'https://pagure.io/releng/fedora-module-defaults.git',
2152              'branch': 'master',
2153              'dir': '.'
2154          }
2155
2156          variants_file='variants-fedora.xml'
2157          sigkeys = ['12C944D0']
2158
2159          # Put packages into subdirectories hashed by their initial letter.
2160          hashed_directories = True
2161
2162          # There is a special profile for use with compose. It makes Pungi
2163          # authenticate automatically as rel-eng user.
2164          koji_profile = 'compose_koji'
2165
2166          # RUNROOT settings
2167          runroot = True
2168          runroot_channel = 'compose'
2169          runroot_tag = 'f32-build'
2170
2171          # PKGSET
2172          pkgset_source = 'koji'
2173          pkgset_koji_tag = 'f32'
2174          pkgset_koji_inherit = False
2175
2176          filter_system_release_packages = False
2177
2178          # GATHER
2179          gather_method = {
2180              '^.*': {                # For all variants
2181                  'comps': 'deps',    # resolve dependencies for packages from comps file
2182                  'module': 'nodeps', # but not for packages from modules
2183              }
2184          }
2185          gather_backend = 'dnf'
2186          gather_profiler = True
2187          check_deps = False
2188          greedy_method = 'build'
2189
2190          repoclosure_backend = 'dnf'
2191
2192          # CREATEREPO
2193          createrepo_deltas = False
2194          createrepo_database = True
2195          createrepo_use_xz = True
2196          createrepo_extra_args = ['--zck', '--zck-dict-dir=/usr/share/fedora-repo-zdicts/rawhide']
2197
2198          # CHECKSUMS
2199          media_checksums = ['sha256']
2200          media_checksum_one_file = True
2201          media_checksum_base_filename = '%(release_short)s-%(variant)s-%(version)s-%(arch)s-%(date)s%(type_suffix)s.%(respin)s'
2202
2203          # CREATEISO
2204          iso_hfs_ppc64le_compatible = False
2205          create_jigdo = False
2206
2207          # BUILDINSTALL
2208          buildinstall_method = 'lorax'
2209          buildinstall_skip = [
2210              # No installer for Modular variant
2211              ('^Modular$', {'*': True}),
2212              # No 32 bit installer for Everything.
2213              ('^Everything$', {'i386': True}),
2214          ]
2215
2216          # Enables macboot on x86_64 for all variants and disables upgrade image building
2217          # everywhere.
2218          lorax_options = [
2219            ('^.*$', {
2220               'x86_64': {
2221                   'nomacboot': False
2222               },
2223               'ppc64le': {
2224                   # Use 3GB image size for ppc64le.
2225                   'rootfs_size': 3
2226               },
2227               '*': {
2228                   'noupgrade': True
2229               }
2230            })
2231          ]
2232
2233          additional_packages = [
2234              ('^(Server|Everything)$', {
2235                  '*': [
2236                      # Add all architectures of dracut package.
2237                      'dracut.*',
2238                      # All all packages matching this pattern
2239                      'autocorr-*',
2240                  ],
2241              }),
2242
2243              ('^Everything$', {
2244                  # Everything should include all packages from the tag. This only
2245                  # applies to the native arch. Multilib will still be pulled in
2246                  # according to multilib rules.
2247                  '*': ['*'],
2248              }),
2249          ]
2250
2251          filter_packages = [
2252              ("^.*$", {"*": ["glibc32", "libgcc32"]}),
2253              ('(Server)$', {
2254                  '*': [
2255                      'kernel*debug*',
2256                      'kernel-kdump*',
2257                  ]
2258              }),
2259          ]
2260
2261          multilib = [
2262              ('^Everything$', {
2263                  'x86_64': ['devel', 'runtime'],
2264              })
2265          ]
2266
2267          # These packages should never be multilib on any arch.
2268          multilib_blacklist = {
2269              '*': [
2270                  'kernel', 'kernel-PAE*', 'kernel*debug*', 'java-*', 'php*', 'mod_*', 'ghc-*'
2271              ],
2272          }
2273
2274          # These should be multilib even if they don't match the rules defined above.
2275          multilib_whitelist = {
2276              '*': ['wine', '*-static'],
2277          }
2278
2279          createiso_skip = [
2280              # Keep binary ISOs for Server, but not source ones.
2281              ('^Server$', {'src': True}),
2282
2283              # Remove all other ISOs.
2284              ('^Everything$', {'*': True, 'src': True}),
2285              ('^Modular$', {'*': True, 'src': True}),
2286          ]
2287
2288          # Image name respecting Fedora's image naming policy
2289          image_name_format = '%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s.iso'
2290          # Use the same format for volume id
2291          image_volid_formats = [
2292              '%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s'
2293          ]
2294          # Used by Pungi to replace 'Cloud' with 'C' (etc.) in ISO volume IDs.
2295          # There is a hard 32-character limit on ISO volume IDs, so we use
2296          # these to try and produce short enough but legible IDs. Note this is
2297          # duplicated in Koji for live images, as livemedia-creator does not
2298          # allow Pungi to tell it what volume ID to use. Note:
2299          # https://fedoraproject.org/wiki/User:Adamwill/Draft_fedora_image_naming_policy
2300          volume_id_substitutions = {
2301                           'Beta': 'B',
2302                        'Rawhide': 'rawh',
2303                     'Silverblue': 'SB',
2304                       'Cinnamon': 'Cinn',
2305                          'Cloud': 'C',
2306                   'Design_suite': 'Dsgn',
2307                 'Electronic_Lab': 'Elec',
2308                     'Everything': 'E',
2309                 'Scientific_KDE': 'SciK',
2310                       'Security': 'Sec',
2311                         'Server': 'S',
2312                    'Workstation': 'WS',
2313          }
2314
2315          disc_types = {
2316              'boot': 'netinst',
2317              'live': 'Live',
2318          }
2319
2320          translate_paths = [
2321             ('/mnt/koji/compose/', 'https://kojipkgs.fedoraproject.org/compose/'),
2322          ]
2323
2324          # These will be inherited by live_media, live_images and image_build
2325          global_ksurl = 'git+https://pagure.io/fedora-kickstarts.git?#HEAD'
2326          global_release = '!RELEASE_FROM_LABEL_DATE_TYPE_RESPIN'
2327          global_version = 'Rawhide'
2328          # live_images ignores this in favor of live_target
2329          global_target = 'f32'
2330
2331          image_build = {
2332              '^Container$': [
2333                  {
2334                      'image-build': {
2335                              'format': [('docker', 'tar.xz')],
2336                              'name': 'Fedora-Container-Base',
2337                              'kickstart': 'fedora-container-base.ks',
2338                              'distro': 'Fedora-22',
2339                              'disk_size': 5,
2340                              'arches': ['armhfp', 'aarch64', 'ppc64le', 's390x', 'x86_64'],
2341                              'repo': 'Everything',
2342                              'install_tree_from': 'Everything',
2343                              'subvariant': 'Container_Base',
2344                              'failable': ['*'],
2345                              },
2346                      'factory-parameters': {
2347                          'dockerversion': "1.10.1",
2348                          'docker_cmd':  '[ "/bin/bash" ]',
2349                          'docker_env': '[ "DISTTAG=f32container", "FGC=f32", "container=oci" ]',
2350                          'docker_label': '{ "name": "fedora", "license": "MIT", "vendor": "Fedora Project", "version": "32"}',
2351                      },
2352                  },
2353              ],
2354          }
2355
2356          live_media = {
2357              '^Workstation$': [
2358                      {
2359                          'name': 'Fedora-Workstation-Live',
2360                          'kickstart': 'fedora-live-workstation.ks',
2361                          # Variants.xml also contains aarch64 and armhfp, but there
2362                          # should be no live media for those arches.
2363                          'arches': ['x86_64', 'ppc64le'],
2364                          'failable': ['ppc64le'],
2365                          # Take packages and install tree from Everything repo.
2366                          'repo': 'Everything',
2367                          'install_tree_from': 'Everything',
2368                      }
2369                  ],
2370              '^Spins': [
2371                  # There are multiple media for Spins variant. They use subvariant
2372                  # field so that they can be indentified in the metadata.
2373                  {
2374                      'name': 'Fedora-KDE-Live',
2375                      'kickstart': 'fedora-live-kde.ks',
2376                      'arches': ['x86_64'],
2377                      'repo': 'Everything',
2378                      'install_tree_from': 'Everything',
2379                      'subvariant': 'KDE'
2380
2381                  },
2382                  {
2383                      'name': 'Fedora-Xfce-Live',
2384                      'kickstart': 'fedora-live-xfce.ks',
2385                      'arches': ['x86_64'],
2386                      'failable': ['*'],
2387                      'repo': 'Everything',
2388                      'install_tree_from': 'Everything',
2389                      'subvariant': 'Xfce'
2390                  },
2391              ],
2392          }
2393
2394          failable_deliverables = [
2395              # Installer and ISOs for server failing do not abort the compose.
2396              ('^Server$', {
2397                  '*': ['buildinstall', 'iso'],
2398              }),
2399              ('^.*$', {
2400                  # Buildinstall is not blocking
2401                  'src': ['buildinstall'],
2402                  # Nothing on i386, ppc64le blocks the compose
2403                  'i386': ['buildinstall', 'iso'],
2404                  'ppc64le': ['buildinstall', 'iso'],
2405                  's390x': ['buildinstall', 'iso'],
2406              })
2407          ]
2408
2409          live_target = 'f32'
2410          live_images_no_rename = True
2411          live_images = [
2412              ('^Workstation$', {
2413                  'armhfp': {
2414                      'kickstart': 'fedora-arm-workstation.ks',
2415                      'name': 'Fedora-Workstation-armhfp',
2416                      # Again workstation takes packages from Everything.
2417                      'repo': 'Everything',
2418                      'type': 'appliance',
2419                      'failable': True,
2420                  }
2421              }),
2422              ('^Server$', {
2423                  # But Server has its own repo.
2424                  'armhfp': {
2425                      'kickstart': 'fedora-arm-server.ks',
2426                      'name': 'Fedora-Server-armhfp',
2427                      'type': 'appliance',
2428                      'failable': True,
2429                  }
2430              }),
2431          ]
2432
2433          ostree = {
2434              "^Silverblue$": {
2435                  "version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
2436                  # To get config, clone master branch from this repo and take
2437                  # treefile from there.
2438                  "treefile": "fedora-silverblue.yaml",
2439                  "config_url": "https://pagure.io/workstation-ostree-config.git",
2440                  "config_branch": "master",
2441                  # Consume packages from Everything
2442                  "repo": "Everything",
2443                  # Don't create a reference in the ostree repo (signing automation does that).
2444                  "tag_ref": False,
2445                  # Don't use change detection in ostree.
2446                  "force_new_commit": True,
2447                  # This is the location for the repo where new commit will be
2448                  # created. Note that this is outside of the compose dir.
2449                  "ostree_repo": "/mnt/koji/compose/ostree/repo/",
2450                  "ostree_ref": "fedora/rawhide/${basearch}/silverblue",
2451                  "arches": ["x86_64", "ppc64le", "aarch64"],
2452                  "failable": ['*'],
2453              }
2454          }
2455
2456          ostree_installer = [
2457              ("^Silverblue$", {
2458                  "x86_64": {
2459                      "repo": "Everything",
2460                      "release": None,
2461                      "rootfs_size": "8",
2462                      # Take templates from this repository.
2463                      'template_repo': 'https://pagure.io/fedora-lorax-templates.git',
2464                      'template_branch': 'master',
2465                      # Use following templates.
2466                      "add_template": ["ostree-based-installer/lorax-configure-repo.tmpl",
2467                                       "ostree-based-installer/lorax-embed-repo.tmpl",
2468                                       "ostree-based-installer/lorax-embed-flatpaks.tmpl"],
2469                      # And add these variables for the templates.
2470                      "add_template_var": [
2471                          "ostree_install_repo=https://kojipkgs.fedoraproject.org/compose/ostree/repo/",
2472                          "ostree_update_repo=https://ostree.fedoraproject.org",
2473                          "ostree_osname=fedora",
2474                          "ostree_oskey=fedora-32-primary",
2475                          "ostree_contenturl=mirrorlist=https://ostree.fedoraproject.org/mirrorlist",
2476                          "ostree_install_ref=fedora/rawhide/x86_64/silverblue",
2477                          "ostree_update_ref=fedora/rawhide/x86_64/silverblue",
2478                          "flatpak_remote_name=fedora",
2479                          "flatpak_remote_url=oci+https://registry.fedoraproject.org",
2480                          "flatpak_remote_refs=runtime/org.fedoraproject.Platform/x86_64/f30 app/org.gnome.Baobab/x86_64/stable",
2481                      ],
2482                      'failable': ['*'],
2483                  },
2484              })
2485          ]
2486
2487   RCM Tools compose
2488       This is a small compose used to deliver packages to  Red  Hat  internal
2489       users. The configuration is split into two files.
2490
2491          # rcmtools-common.conf
2492
2493          release_name = "RCM Tools"
2494          release_short = "RCMTOOLS"
2495          release_version = "2.0"
2496          release_type = "updates"
2497          release_is_layered = True
2498          createrepo_c = True
2499          createrepo_checksum = "sha256"
2500
2501          # PKGSET
2502          pkgset_source = "koji"
2503          koji_profile = "brew"
2504          pkgset_koji_inherit = True
2505
2506
2507          # GENERAL SETTINGS
2508          bootable = False
2509          comps_file = "rcmtools-comps.xml"
2510          variants_file = "rcmtools-variants.xml"
2511          sigkeys = ["3A3A33A3"]
2512
2513
2514          # RUNROOT settings
2515          runroot = False
2516
2517
2518          # GATHER
2519          gather_method = "deps"
2520          check_deps = True
2521
2522          additional_packages = [
2523              ('.*', {
2524                  '*': ['puddle', 'rcm-nexus'],
2525                  }
2526              ),
2527          ]
2528
2529          # Set repoclosure_strictness to fatal to avoid installation dependency
2530          # issues in production composes
2531          repoclosure_strictness = [
2532              ("^.*$", {
2533                  "*": "fatal"
2534              })
2535          ]
2536
2537       Configuration  specific for different base products is split into sepa‐
2538       rate files.
2539
2540          # rcmtools-common.conf
2541          from rcmtools-common import *
2542
2543          # BASE PRODUCT
2544          base_product_name = "Red Hat Enterprise Linux"
2545          base_product_short = "RHEL"
2546          base_product_version = "7"
2547
2548          # PKGSET
2549          pkgset_koji_tag = "rcmtools-rhel-7-compose"
2550
2551          # remove i386 arch on rhel7
2552          tree_arches = ["aarch64", "ppc64le", "s390x", "x86_64"]
2553
2554          check_deps = False
2555
2556          # Packages in these repos are available to satisfy dependencies inside the
2557          # compose, but will not be pulled in.
2558          gather_lookaside_repos = [
2559              ("^Client|Client-optional$", {
2560                  "x86_64": [
2561                      "http://example.redhat.com/rhel/7/Client/x86_64/os/",
2562                      "http://example.redhat.com/rhel/7/Client/x86_64/optional/os/",
2563                  ],
2564              }),
2565               ("^Workstation|Workstation-optional$", {
2566                  "x86_64": [
2567                      "http://example.redhat.com/rhel/7/Workstation/x86_64/os/",
2568                      "http://example.redhat.com/rhel/7/Workstation/x86_64/optional/os/",
2569                  ],
2570              }),
2571              ("^Server|Server-optional$", {
2572                  "aarch64": [
2573                      "http://example.redhat.com/rhel/7/Server/aarch64/os/",
2574                      "http://example.redhat.com/rhel/7/Server/aarch64/optional/os/",
2575                  ],
2576                  "ppc64": [
2577                      "http://example.redhat.com/rhel/7/Server/ppc64/os/",
2578                      "http://example.redhat.com/rhel/7/Server/ppc64/optional/os/",
2579                  ],
2580                  "ppc64le": [
2581                      "http://example.redhat.com/rhel/7/Server/ppc64le/os/",
2582                      "http://example.redhat.com/rhel/7/Server/ppc64le/optional/os/",
2583                  ],
2584                  "s390x": [
2585                      "http://example.redhat.com/rhel/7/Server/s390x/os/",
2586                      "http://example.redhat.com/rhel/7/Server/s390x/optional/os/",
2587                  ],
2588                  "x86_64": [
2589                      "http://example.redhat.com/rhel/7/Server/x86_64/os/",
2590                      "http://example.redhat.com/rhel/7/Server/x86_64/optional/os/",
2591                  ],
2592              })
2593          ]
2594

EXPORTING FILES FROM SCM

2596       Multiple places in Pungi can use files from external storage. The  con‐
2597       figuration  is  similar  independently  of  the  backend  that is used,
2598       although some features may be different.
2599
2600       The so-called scm_dict is always put into configuration  as  a  dictio‐
2601       nary, which can contain following keys.
2602
2603       · scm  –  indicates  which SCM system is used. This is always required.
2604         Allowed values are:
2605
2606         · file – copies files from local filesystem
2607
2608         · git – copies files from a Git repository
2609
2610         · cvs – copies files from a CVS repository
2611
2612         · rpm – copies files from a package in the compose
2613
2614         · koji – downloads archives from a given build in Koji build system
2615
2616       · repo
2617
2618         · for Git and CVS backends this should be URL to the repository
2619
2620         · for RPM backend this should be a shell style glob matching  package
2621           names (or a list of such globs)
2622
2623         · for file backend this should be empty
2624
2625         · for Koji backend this should be an NVR or package name
2626
2627       · branch
2628
2629         · branch  name  for  Git  and  CVS  backends, with master and HEAD as
2630           defaults
2631
2632         · Koji tag for koji backend if only package name is given
2633
2634         · otherwise should not be specified
2635
2636       · file – a list of files that should be exported.
2637
2638       · dir – a directory that should be exported. All its contents  will  be
2639         exported. This option is mutually exclusive with file.
2640
2641       · command  – defines a shell command to run after Git clone to generate
2642         the needed file (for example to run  make).  Only  supported  in  Git
2643         backend.
2644
2645   Koji examples
2646       There are two different ways how to configure the Koji backend.
2647
2648          {
2649              # Download all *.tar files from build my-image-1.0-1.
2650              "scm": "koji",
2651              "repo": "my-image-1.0-1",
2652              "file": "*.tar",
2653          }
2654
2655          {
2656              # Find latest build of my-image in tag my-tag and take files from
2657              # there.
2658              "scm": "koji",
2659              "repo": "my-image",
2660              "branch": "my-tag",
2661              "file": "*.tar",
2662          }
2663
2664       Using  both  tag name and exact NVR will result in error: the NVR would
2665       be interpreted as a package name, and would not match anything.
2666
2667   file vs. dir
2668       Exactly one of these two options has to be specified. Documentation for
2669       each configuration option should specify whether it expects a file or a
2670       directory.
2671
2672       For extra_files phase either key is valid and should be chosen  depend‐
2673       ing on what the actual use case.
2674
2675   Caveats
2676       The rpm backend can only be used in phases that would extract the files
2677       after pkgset phase finished. You can’t get comps file from a package.
2678
2679       Depending on Git repository URL configuration Pungi can only export the
2680       requested  content using git archive. When a command should run this is
2681       not possible and a clone is always needed.
2682
2683       When using koji backend, it is required to  provide  configuration  for
2684       Koji  profile  to be used (koji_profile). It is not possible to contact
2685       multiple different Koji instances.
2686

PROGRESS NOTIFICATION

2688       Pungi has the ability to emit notification messages about progress  and
2689       general  status of the compose. These can be used to e.g. send messages
2690       to fedmsg. This is implemented by actually calling a separate script.
2691
2692       The script will be called with one argument describing action that just
2693       happened.  A  JSON-encoded  object  will be passed to standard input to
2694       provide more information about the event. At the very least, the object
2695       will contain a compose_id key.
2696
2697       The  script is invoked in compose directory and can read other informa‐
2698       tion there.
2699
2700       Currently these messages are sent:
2701
2702          · status-change – when composing starts, finishes or fails; a status
2703            key is provided to indicate details
2704
2705          · phase-start – on start of a phase
2706
2707          · phase-stop – when phase is finished
2708
2709          · createiso-targets – with a list of images to be created
2710
2711          · createiso-imagedone – when any single image is finished
2712
2713          · createiso-imagefail – when any single image fails to create
2714
2715          · fail-to-start  – when there are incorrect CLI options or errors in
2716            configuration file; this message does not contain  compose_id  nor
2717            is it started in the compose directory (which does not exist yet)
2718
2719          · ostree  – when a new commit is created, this message will announce
2720            its hash and the name of ref it is meant for.
2721
2722       For phase related messages phase_name key is provided as well.
2723
2724       A pungi-fedmsg-notification script is  provided  and  understands  this
2725       interface.
2726
2727   Setting it up
2728       The  script  should  be provided as a command line argument --notifica‐
2729       tion-script.
2730
2731          --notification-script=pungi-fedmsg-notification
2732

GATHERING PACKAGES

2734       A compose created by Pungi consists of one or more variants. A  variant
2735       contains a subset of the content targeted at a particular use case.
2736
2737       There  are  different  types of variants. The type affects how packages
2738       are gathered into the variant.
2739
2740       The inputs for gathering are defined by various gather  sources.  Pack‐
2741       ages  from  all  sources  are collected to create a big list of package
2742       names, comps groups names and a list of packages that  should  be  fil‐
2743       tered out.
2744
2745       NOTE:
2746          The  inputs for both explicit package list and comps file are inter‐
2747          preted as RPM names, not any arbitrary provides nor  source  package
2748          name.
2749
2750       Next,  gather_method defines how the list is processed. For nodeps, the
2751       results from source are used pretty much as is [1]. For deps method,  a
2752       process will be launched to figure out what dependencies are needed and
2753       those will be pulled in.
2754
2755       [1]  The lists are filtered based on what packages are available in the
2756            package set, but nothing else will be pulled in.
2757
2758   Variant types
2759       Variant
2760              is a base type that has no special behaviour.
2761
2762       Addon  is  built  on top of a regular variant. Any packages that should
2763              go to both the addon and its parent will be removed from  addon.
2764              Packages  that  are  only  in  addon  but  pulled  in because of
2765              gather_fulltree option will be moved to parent.
2766
2767       Integrated Layered Product
2768              works similarly to addon. Additionally, all packages from addons
2769              on  the same parent variant are removed integrated layered prod‐
2770              ucts.
2771
2772              The main difference between  an  addon  and  integrated  layered
2773              product  is that integrated layered product has its own identity
2774              in the metadata (defined with product name and version).
2775
2776              NOTE:
2777                 There’s also Layered Product as  a  term,  but  this  is  not
2778                 related  to variants. It’s used to describe a product that is
2779                 not a standalone operating system and is instead meant to  be
2780                 used on some other base system.
2781
2782       Optional
2783              contains  packages that complete the base variants’ package set.
2784              It always has fulltree and selfhosting enabled, so  it  contains
2785              build  dependencies  and  packages  which  were not specifically
2786              requested for base variant.
2787
2788       Some configuration options are overridden for particular variant types.
2789
2790   Depsolving configuration
2791                      ┌──────────┬──────────────┬──────────────┐
2792                      │Variant   │ Fulltree     │ Selfhosting  │
2793                      ├──────────┼──────────────┼──────────────┤
2794                      │base      │ configurable │ configurable │
2795                      ├──────────┼──────────────┼──────────────┤
2796                      │addon/ILP │ enabled      │ disabled     │
2797                      ├──────────┼──────────────┼──────────────┤
2798                      │optional  │ enabled      │ enabled      │
2799                      └──────────┴──────────────┴──────────────┘
2800
2801   Profiling
2802       Profiling data on the pungi-gather tool can be enabled by  setting  the
2803       gather_profiler configuration option to True.
2804
2805   Modular compose
2806       A compose with gather_source set to module is called modular. The pack‐
2807       age list is determined by a list of modules.
2808
2809       The list of modules that will be put into a variant is defined  in  the
2810       variants.xml   file.   The  file  can  contain  either  Name:Stream  or
2811       Name:Stream:Version references. See Module Naming Policy  for  details.
2812       When  Version is missing from the specification, Pungi will ask PDC for
2813       the latest one.
2814
2815       The module metadata in PDC contains a list of RPMs  in  the  module  as
2816       well as Koji tag from which the packages can be retrieved.
2817
2818   Restrictions
2819          · A modular compose must always use Koji as a package set source.
2820

PROCESSING COMPS FILES

2822       The  comps  file  that Pungi takes as input is not really pure comps as
2823       used by tools like DNF. There are extensions used to customize how  the
2824       file is processed.
2825
2826       The first step of Pungi processing is to retrieve the actual file. This
2827       can use anything that scm_support supports.
2828
2829       Pungi extensions are arch attribute on packageref, group  and  environ‐
2830       ment  tags.  The  value  of this attribute is a comma separated list of
2831       architectures.
2832
2833       Second step Pungi performs is creating a file  for  each  architecture.
2834       This is done by removing all elements with incompatible arch attribute.
2835       No additional clean up is performed on this file. The resulting file is
2836       only used internally for the rest of the compose process.
2837
2838       Third and final step is to create comps file for each Variant.Arch com‐
2839       bination.  This is the actual file that will be included  in  the  com‐
2840       pose.  The  start  file is the original input file, from which all ele‐
2841       ments with incompatible architecture are removed. Then clean up is per‐
2842       formed  by removing all empty groups, removing non-existing groups from
2843       environments and categories and finally removing empty environments and
2844       categories.  As  a last step groups not listed in the variants file are
2845       removed.
2846

CONTRIBUTING TO PUNGI

2848   Set up development environment
2849       In order to work on Pungi, you should install recent version of Fedora.
2850       These packages will have to installed:
2851
2852          · createrepo_c
2853
2854          · cvs
2855
2856          · gcc
2857
2858          · genisoimage
2859
2860          · gettext
2861
2862          · git
2863
2864          · gobject-introspection
2865
2866          · isomd5sum
2867
2868          · jigdo
2869
2870          · kobo
2871
2872          · krb5-devel
2873
2874          · libcurl-devel
2875
2876          · libmodulemd
2877
2878          · libselinux-python
2879
2880          · lorax
2881
2882          · python-dogpile-cache
2883
2884          · python-jsonschema
2885
2886          · python-kickstart
2887
2888          · python-libcomps
2889
2890          · python-lockfile
2891
2892          · python-lxml
2893
2894          · python2-multilib
2895
2896          · python-productmd
2897
2898          · PyYAML
2899
2900          · repoview
2901
2902          · rpm-devel
2903
2904          · syslinux
2905
2906          · yum
2907
2908          · yum-utils
2909
2910       For running unit tests, these packages are recommended as well:
2911
2912          · python-mock
2913
2914          · python-nose
2915
2916          · python-nose-cov
2917
2918          · python-unittest2
2919
2920          · rpmdevtools
2921
2922          · python-parameterized
2923
2924       While  being  difficult,  it  is  possible  to work on Pungi using vir‐
2925       tualenv.  Install python-virtualenvwrapper (after installation you have
2926       to  add  the  command  to source /usr/local/bin/virtualenvwrapper.sh to
2927       your shell startup file, depending on where it was installed by package
2928       manager)  and  use following steps.  It will link system libraries into
2929       the virtual environment and install all packages preferably  from  PyPI
2930       or  from  tarball. You will still need to install all of the non-Python
2931       packages above as they are used by calling an executable.
2932
2933          $ mkvirtualenv pungienv
2934          $ for pkg in gi libcomps pykickstart rpmUtils selinux urlgrabber yum; do ln -vs "$(deactivate && python -c 'import os, '$pkg'; print(os.path.dirname('$pkg'.__file__))')" "$(virtualenvwrapper_get_site_packages_dir)"; done
2935          $ for pkg in _deltarpm krbV _selinux deltarpm sqlitecachec _sqlitecache; do ln -vs "$(deactivate && python -c 'import os, '$pkg'; print('$pkg'.__file__)')" "$(virtualenvwrapper_get_site_packages_dir)"; done
2936          $ pip install -U pip
2937          $ PYCURL_SSL_LIBRARY=nss pip install pycurl --no-binary :all:
2938          $ pip install beanbag jsonschema 'kobo>=0.6.0' lockfile lxml mock nose nose-cov productmd pyopenssl python-multilib requests requests-kerberos setuptools sphinx ordered_set koji PyYAML dogpile.cache parameterized
2939
2940       Now you should be able to run all existing tests.
2941
2942   Developing
2943       Currently the development workflow for Pungi is on master branch:
2944
2945       · Make your own fork at https://pagure.io/pungi
2946
2947       · Clone your fork locally (replacing $USERNAME with your own):
2948
2949            git clone git@pagure.io:forks/$USERNAME/pungi.git
2950
2951       · cd into your local clone and add the remote upstream for rebasing:
2952
2953            cd pungi
2954            git remote add upstream git@pagure.io:pungi.git
2955
2956         NOTE:
2957            This workflow assumes that you never git commit  directly  to  the
2958            master  branch  of  your  fork.  This will make more sense when we
2959            cover rebasing below.
2960
2961       · create a topic branch based on master:
2962
2963            git branch my_topic_branch master
2964            git checkout my_topic_branch
2965
2966       · Make edits, changes, add new features, etc. and  then  make  sure  to
2967         pull  from  upstream  master  and  rebase  before  submitting  a pull
2968         request:
2969
2970            # lets just say you edited setup.py for sake of argument
2971            git checkout my_topic_branch
2972
2973            # make changes to setup.py
2974            git add setup.py
2975            git commit -s -m "added awesome feature to setup.py"
2976
2977            # now we rebase
2978            git checkout master
2979            git pull --rebase upstream master
2980            git push origin master
2981            git push origin --tags
2982            git checkout my_topic_branch
2983            git rebase master
2984
2985            # resolve merge conflicts if any as a result of your development in
2986            # your topic branch
2987            git push origin my_topic_branch
2988
2989         NOTE:
2990            In order to for your commit to be merged, you must sign-off on it.
2991            Use -s option when running git commit.
2992
2993       · Create pull request in the pagure.io web UI
2994
2995       · For  convenience, here is a bash shell function that can be placed in
2996         your ~/.bashrc and called such  as  pullupstream  pungi-4-devel  that
2997         will automate a large portion of the rebase steps from above:
2998
2999            pullupstream () {
3000              if [[ -z "$1" ]]; then
3001                printf "Error: must specify a branch name (e.g. - master, devel)\n"
3002              else
3003                pullup_startbranch=$(git describe --contains --all HEAD)
3004                git checkout $1
3005                git pull --rebase upstream master
3006                git push origin $1
3007                git push origin --tags
3008                git checkout ${pullup_startbranch}
3009              fi
3010            }
3011
3012   Testing
3013       You  must  write  unit  tests  for  any  new  code  (except for trivial
3014       changes). Any code without sufficient test coverage may not be merged.
3015
3016       To run all existing tests, suggested method is to use  nosetests.  With
3017       additional  options,  it  can generate code coverage. To make sure even
3018       tests from executable files are run, don’t  forget  to  use  the  --exe
3019       option.
3020
3021          $ make test
3022          $ make test-cover
3023
3024          # Running single test file
3025          $ python tests/test_arch.py [TestCase...]
3026
3027       In  the  tests/  directory there is a shell script test_compose.sh that
3028       you can use to try and create a miniature compose on  dummy  data.  The
3029       actual data will be created by running make test-data in project root.
3030
3031          $ make test-data
3032          $ make test-compose
3033
3034       This  testing  compose does not actually use all phases that are avail‐
3035       able, and there is no checking that the  result  is  correct.  It  only
3036       tells you whether it crashed or not.
3037
3038       NOTE:
3039          Even  when  it  finishes  successfully,  it  may  print errors about
3040          repoclosure on Server-Gluster.x86_64 in test phase. This  is  not  a
3041          bug.
3042
3043   Documenting
3044       You  must  write  documentation  for  any  new  features and functional
3045       changes.  Any code without sufficient documentation may not be merged.
3046
3047       To generate the documentation, run make doc in project root.
3048

TESTING PUNGI

3050   Test Data
3051       Tests require test data and not all of it is  available  in  git.   You
3052       must create test repositories before running the tests:
3053
3054          make test-data
3055
3056       Requirements: createrepo_c, rpmbuild
3057
3058   Unit Tests
3059       Unit  tests  cover  functionality of Pungi python modules.  You can run
3060       all of them at once:
3061
3062          make test
3063
3064       which is shortcut to:
3065
3066          python2 setup.py test
3067          python3 setup.py test
3068
3069       You can alternatively run individual tests:
3070
3071          cd tests
3072          ./<test>.py [<class>[.<test>]]
3073
3074   Functional Tests
3075       Because compose is quite complex process and not everything is  covered
3076       with  unit  tests  yet, the easiest way how to test if your changes did
3077       not break anything badly is to start a compose on  a  relatively  small
3078       and well defined package set:
3079
3080          cd tests
3081          ./test_compose.sh
3082

MANAGING COMPOSE FROM MULTIPLE PARTS

3084       There  may  be  cases  where it makes sense to split a big compose into
3085       separate parts, but create a compose output that links all output  into
3086       one familiar structure.
3087
3088       The pungi-orchestrate tools allows that.
3089
3090       It  works  with  an INI-style configuration file. The [general] section
3091       contains information about identity of the main compose. Other sections
3092       define individual parts.
3093
3094       The  parts are scheduled to run in parallel, with the minimal amount of
3095       serialization. The final compose directory will contain  hard-links  to
3096       the files.
3097
3098   General settings
3099       target Path to directory where the final compose should be created.
3100
3101       compose_type
3102              Type of compose to make.
3103
3104       release_name
3105              Name of the product for the final compose.
3106
3107       release_short
3108              Short name of the product for the final compose.
3109
3110       release_version
3111              Version of the product for the final compose.
3112
3113       release_type
3114              Type of the product for the final compose.
3115
3116       extra_args
3117              Additional  arguments that wil be passed to the child Pungi pro‐
3118              cesses.
3119
3120       koji_profile
3121              If specified, a current event will be retrieved  from  the  Koji
3122              instance and used for all parts.
3123
3124       kerberos
3125              If  set  to yes, a kerberos ticket will be automatically created
3126              at the start.  Set keytab and principal as well.
3127
3128       kerberos_keytab
3129              Path to keytab file used to create the kerberos ticket.
3130
3131       kerberos_principal
3132              Kerberos principal for the ticket
3133
3134       pre_compose_script
3135              Commands to execute before first part is  started.  Can  contain
3136              multiple commands on separate lines.
3137
3138       post_compose_script
3139              Commands  to execute after the last part finishes and final sta‐
3140              tus is updated. Can contain multiple commands on separate lines.
3141
3142                 post_compose_script =
3143                     compose-latest-symlink $COMPOSE_PATH
3144                     custom-post-compose-script.sh
3145
3146              Multiple environment variables are defined for the scripts:
3147
3148                 · COMPOSE_PATH
3149
3150                 · COMPOSE_ID
3151
3152                 · COMPOSE_DATE
3153
3154                 · COMPOSE_TYPE
3155
3156                 · COMPOSE_RESPIN
3157
3158                 · COMPOSE_LABEL
3159
3160                 · RELEASE_ID
3161
3162                 · RELEASE_NAME
3163
3164                 · RELEASE_SHORT
3165
3166                 · RELEASE_VERSION
3167
3168                 · RELEASE_TYPE
3169
3170                 · RELEASE_IS_LAYERED YES for layered products, empty other‐
3171                   wise
3172
3173                 · BASE_PRODUCT_NAME – only set for layered products
3174
3175                 · BASE_PRODUCT_SHORT – only set for layered products
3176
3177                 · BASE_PRODUCT_VERSION – only set for layered products
3178
3179                 · BASE_PRODUCT_TYPE – only set for layered products
3180
3181       notification_script
3182              Executable  name (or path to a script) that will be used to send
3183              a message once the compose is finished. In order for a valid URL
3184              to  be included in the message, at least one part must configure
3185              path translation that would apply to location of main compose.
3186
3187              Only two messages will be sent, one for start and one for finish
3188              (either successful or not).
3189
3190   Partial compose settings
3191       Each part should have a separate section in the config file.
3192
3193       It can specify these options:
3194
3195       config Path  to  configuration  file that describes this part. If rela‐
3196              tive, it is resolved relative to the file with parts  configura‐
3197              tion.
3198
3199       just_phase, skip_phase
3200              Customize which phases should run for this part.
3201
3202       depends_on
3203              A  comma  separated  list  of  other parts that must be finished
3204              before this part starts.
3205
3206       failable
3207              A boolean toggle to mark a part as failable. A failure  in  such
3208              part  will  mark the final compose as incomplete, but still suc‐
3209              cessful.
3210

AUTHOR

3212       Daniel Mach
3213
3215       2019, Red Hat, Inc.
3216
3217
3218
3219
32204.1                              Dec 06, 2019                         PUNGI(1)
Impressum