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  li‐
36       brary.
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 In‐
71       stallation <Something> Tool. That name was quickly  discarded  and  re‐
72       placed 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 fi‐
101       nally linked into the compose/ directory as netinstall media.
102
103       The created images are also needed for creating live media or other im‐
104       ages 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   Createiso
141       Generates  ISO files and accumulates enough metadata to be able to cre‐
142       ate image.json manifest. The file is however not created in this phase,
143       instead it is dumped in the pungi-koji script itself.
144
145       The  files  include  a repository with all RPMs from the variant. There
146       will be multiple images if the packages do not fit on a single image.
147
148       The image will be bootable if buildinstall phase  is  enabled  and  the
149       packages fit on a single image.
150
151       There  can  also  be  images  with source repositories. These are never
152       bootable.
153
154   ExtraIsos
155       This phase is very similar to createiso,  except  it  combines  content
156       from  multiple variants onto a single image. Packages, repodata and ex‐
157       tra files from each configured variant are put into a subdirectory. Ad‐
158       ditional  extra files can be put into top level of the image. The image
159       will be bootable if the main variant is bootable.
160
161   LiveImages, LiveMedia
162       Creates media in Koji with koji  spin-livecd,  koji  spin-appliance  or
163       koji  spin-livemedia  command.  When the media are finished, the images
164       are copied into the compose/ directory and metadata for images  is  up‐
165       dated.
166
167   ImageBuild
168       This  phase wraps up koji image-build. It also updates the metadata ul‐
169       timately responsible for images.json manifest.
170
171   OSBuild
172       Similarly to image build, this phases creates a koji osbuild  task.  In
173       the background it uses OSBuild Composer to create images.
174
175   OSBS
176       This phase builds container 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   ImageContainer
183       This phase builds a container image in OSBS, and stores the metadata in
184       the same file as OSBS phase. The container produced here wraps  a  dif‐
185       ferent  image, created it ImageBuild or OSBuild phase. It can be useful
186       to deliver a VM image to containerized environments.
187
188   OSTreeInstaller
189       Creates bootable media that carry an ostree repository  as  a  payload.
190       These images are created by running lorax with special templates. Again
191       it runs in Koji runroot.
192
193   Repoclosure
194       Run repoclosure on each repository. By default errors are only reported
195       in  the log, the compose will still be considered a success. The actual
196       error has to be looked up in the compose logs directory.  Configuration
197       allows customizing this.
198
199   ImageChecksum
200       Responsible  for generating checksums for the images. The checksums are
201       stored in image manifest as well as files on disk. The list  of  images
202       to  be  processed is obtained from the image manifest. This way all im‐
203       ages will get the same checksums irrespective of the phase that created
204       them.
205
206   Test
207       This  phase  is supposed to run some sanity checks on the finished com‐
208       pose.
209
210       The only test is to check all images listed  the  metadata  and  verify
211       that  they  look  sane. For ISO files headers are checked to verify the
212       format is correct, and for bootable media a check is run to verify they
213       have properties that allow booting.
214

CONFIG FILE FORMAT

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

CONFIGURATION

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

BIG PICTURE EXAMPLES

2357       Actual Pungi configuration files can get very large. This pages  brings
2358       two examples of (almost) full configuration for two different composes.
2359
2360   Fedora Rawhide compose
2361       This  is  a  shortened  configuration  for Fedora Radhide compose as of
2362       2019-10-14.
2363
2364          release_name = 'Fedora'
2365          release_short = 'Fedora'
2366          release_version = 'Rawhide'
2367          release_is_layered = False
2368
2369          bootable = True
2370          comps_file = {
2371              'scm': 'git',
2372              'repo': 'https://pagure.io/fedora-comps.git',
2373              'branch': 'master',
2374              'file': 'comps-rawhide.xml',
2375              # Merge translations by running make. This command will generate the file.
2376              'command': 'make comps-rawhide.xml'
2377          }
2378          module_defaults_dir = {
2379              'scm': 'git',
2380              'repo': 'https://pagure.io/releng/fedora-module-defaults.git',
2381              'branch': 'master',
2382              'dir': '.'
2383          }
2384
2385          variants_file='variants-fedora.xml'
2386          sigkeys = ['12C944D0']
2387
2388          # Put packages into subdirectories hashed by their initial letter.
2389          hashed_directories = True
2390
2391          # There is a special profile for use with compose. It makes Pungi
2392          # authenticate automatically as rel-eng user.
2393          koji_profile = 'compose_koji'
2394
2395          # RUNROOT settings
2396          runroot = True
2397          runroot_channel = 'compose'
2398          runroot_tag = 'f32-build'
2399
2400          # PKGSET
2401          pkgset_source = 'koji'
2402          pkgset_koji_tag = 'f32'
2403          pkgset_koji_inherit = False
2404
2405          filter_system_release_packages = False
2406
2407          # GATHER
2408          gather_method = {
2409              '^.*': {                # For all variants
2410                  'comps': 'deps',    # resolve dependencies for packages from comps file
2411                  'module': 'nodeps', # but not for packages from modules
2412              }
2413          }
2414          gather_backend = 'dnf'
2415          gather_profiler = True
2416          check_deps = False
2417          greedy_method = 'build'
2418
2419          repoclosure_backend = 'dnf'
2420
2421          # CREATEREPO
2422          createrepo_deltas = False
2423          createrepo_database = True
2424          createrepo_use_xz = True
2425          createrepo_extra_args = ['--zck', '--zck-dict-dir=/usr/share/fedora-repo-zdicts/rawhide']
2426
2427          # CHECKSUMS
2428          media_checksums = ['sha256']
2429          media_checksum_one_file = True
2430          media_checksum_base_filename = '%(release_short)s-%(variant)s-%(version)s-%(arch)s-%(date)s%(type_suffix)s.%(respin)s'
2431
2432          # CREATEISO
2433          iso_hfs_ppc64le_compatible = False
2434          create_jigdo = False
2435
2436          # BUILDINSTALL
2437          buildinstall_method = 'lorax'
2438          buildinstall_skip = [
2439              # No installer for Modular variant
2440              ('^Modular$', {'*': True}),
2441              # No 32 bit installer for Everything.
2442              ('^Everything$', {'i386': True}),
2443          ]
2444
2445          # Enables macboot on x86_64 for all variants and disables upgrade image building
2446          # everywhere.
2447          lorax_options = [
2448            ('^.*$', {
2449               'x86_64': {
2450                   'nomacboot': False
2451               },
2452               'ppc64le': {
2453                   # Use 3GB image size for ppc64le.
2454                   'rootfs_size': 3
2455               },
2456               '*': {
2457                   'noupgrade': True
2458               }
2459            })
2460          ]
2461
2462          additional_packages = [
2463              ('^(Server|Everything)$', {
2464                  '*': [
2465                      # Add all architectures of dracut package.
2466                      'dracut.*',
2467                      # All all packages matching this pattern
2468                      'autocorr-*',
2469                  ],
2470              }),
2471
2472              ('^Everything$', {
2473                  # Everything should include all packages from the tag. This only
2474                  # applies to the native arch. Multilib will still be pulled in
2475                  # according to multilib rules.
2476                  '*': ['*'],
2477              }),
2478          ]
2479
2480          filter_packages = [
2481              ("^.*$", {"*": ["glibc32", "libgcc32"]}),
2482              ('(Server)$', {
2483                  '*': [
2484                      'kernel*debug*',
2485                      'kernel-kdump*',
2486                  ]
2487              }),
2488          ]
2489
2490          multilib = [
2491              ('^Everything$', {
2492                  'x86_64': ['devel', 'runtime'],
2493              })
2494          ]
2495
2496          # These packages should never be multilib on any arch.
2497          multilib_blacklist = {
2498              '*': [
2499                  'kernel', 'kernel-PAE*', 'kernel*debug*', 'java-*', 'php*', 'mod_*', 'ghc-*'
2500              ],
2501          }
2502
2503          # These should be multilib even if they don't match the rules defined above.
2504          multilib_whitelist = {
2505              '*': ['wine', '*-static'],
2506          }
2507
2508          createiso_skip = [
2509              # Keep binary ISOs for Server, but not source ones.
2510              ('^Server$', {'src': True}),
2511
2512              # Remove all other ISOs.
2513              ('^Everything$', {'*': True, 'src': True}),
2514              ('^Modular$', {'*': True, 'src': True}),
2515          ]
2516
2517          # Image name respecting Fedora's image naming policy
2518          image_name_format = '%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s.iso'
2519          # Use the same format for volume id
2520          image_volid_formats = [
2521              '%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s'
2522          ]
2523          # Used by Pungi to replace 'Cloud' with 'C' (etc.) in ISO volume IDs.
2524          # There is a hard 32-character limit on ISO volume IDs, so we use
2525          # these to try and produce short enough but legible IDs. Note this is
2526          # duplicated in Koji for live images, as livemedia-creator does not
2527          # allow Pungi to tell it what volume ID to use. Note:
2528          # https://fedoraproject.org/wiki/User:Adamwill/Draft_fedora_image_naming_policy
2529          volume_id_substitutions = {
2530                           'Beta': 'B',
2531                        'Rawhide': 'rawh',
2532                     'Silverblue': 'SB',
2533                       'Cinnamon': 'Cinn',
2534                          'Cloud': 'C',
2535                   'Design_suite': 'Dsgn',
2536                 'Electronic_Lab': 'Elec',
2537                     'Everything': 'E',
2538                 'Scientific_KDE': 'SciK',
2539                       'Security': 'Sec',
2540                         'Server': 'S',
2541                    'Workstation': 'WS',
2542          }
2543
2544          disc_types = {
2545              'boot': 'netinst',
2546              'live': 'Live',
2547          }
2548
2549          translate_paths = [
2550             ('/mnt/koji/compose/', 'https://kojipkgs.fedoraproject.org/compose/'),
2551          ]
2552
2553          # These will be inherited by live_media, live_images and image_build
2554          global_ksurl = 'git+https://pagure.io/fedora-kickstarts.git?#HEAD'
2555          global_release = '!RELEASE_FROM_LABEL_DATE_TYPE_RESPIN'
2556          global_version = 'Rawhide'
2557          # live_images ignores this in favor of live_target
2558          global_target = 'f32'
2559
2560          image_build = {
2561              '^Container$': [
2562                  {
2563                      'image-build': {
2564                              'format': [('docker', 'tar.xz')],
2565                              'name': 'Fedora-Container-Base',
2566                              'kickstart': 'fedora-container-base.ks',
2567                              'distro': 'Fedora-22',
2568                              'disk_size': 5,
2569                              'arches': ['armhfp', 'aarch64', 'ppc64le', 's390x', 'x86_64'],
2570                              'repo': 'Everything',
2571                              'install_tree_from': 'Everything',
2572                              'subvariant': 'Container_Base',
2573                              'failable': ['*'],
2574                              },
2575                      'factory-parameters': {
2576                          'dockerversion': "1.10.1",
2577                          'docker_cmd':  '[ "/bin/bash" ]',
2578                          'docker_env': '[ "DISTTAG=f32container", "FGC=f32", "container=oci" ]',
2579                          'docker_label': '{ "name": "fedora", "license": "MIT", "vendor": "Fedora Project", "version": "32"}',
2580                      },
2581                  },
2582              ],
2583          }
2584
2585          live_media = {
2586              '^Workstation$': [
2587                      {
2588                          'name': 'Fedora-Workstation-Live',
2589                          'kickstart': 'fedora-live-workstation.ks',
2590                          # Variants.xml also contains aarch64 and armhfp, but there
2591                          # should be no live media for those arches.
2592                          'arches': ['x86_64', 'ppc64le'],
2593                          'failable': ['ppc64le'],
2594                          # Take packages and install tree from Everything repo.
2595                          'repo': 'Everything',
2596                          'install_tree_from': 'Everything',
2597                      }
2598                  ],
2599              '^Spins': [
2600                  # There are multiple media for Spins variant. They use subvariant
2601                  # field so that they can be identified in the metadata.
2602                  {
2603                      'name': 'Fedora-KDE-Live',
2604                      'kickstart': 'fedora-live-kde.ks',
2605                      'arches': ['x86_64'],
2606                      'repo': 'Everything',
2607                      'install_tree_from': 'Everything',
2608                      'subvariant': 'KDE'
2609
2610                  },
2611                  {
2612                      'name': 'Fedora-Xfce-Live',
2613                      'kickstart': 'fedora-live-xfce.ks',
2614                      'arches': ['x86_64'],
2615                      'failable': ['*'],
2616                      'repo': 'Everything',
2617                      'install_tree_from': 'Everything',
2618                      'subvariant': 'Xfce'
2619                  },
2620              ],
2621          }
2622
2623          failable_deliverables = [
2624              # Installer and ISOs for server failing do not abort the compose.
2625              ('^Server$', {
2626                  '*': ['buildinstall', 'iso'],
2627              }),
2628              ('^.*$', {
2629                  # Buildinstall is not blocking
2630                  'src': ['buildinstall'],
2631                  # Nothing on i386, ppc64le blocks the compose
2632                  'i386': ['buildinstall', 'iso'],
2633                  'ppc64le': ['buildinstall', 'iso'],
2634                  's390x': ['buildinstall', 'iso'],
2635              })
2636          ]
2637
2638          live_target = 'f32'
2639          live_images_no_rename = True
2640          live_images = [
2641              ('^Workstation$', {
2642                  'armhfp': {
2643                      'kickstart': 'fedora-arm-workstation.ks',
2644                      'name': 'Fedora-Workstation-armhfp',
2645                      # Again workstation takes packages from Everything.
2646                      'repo': 'Everything',
2647                      'type': 'appliance',
2648                      'failable': True,
2649                  }
2650              }),
2651              ('^Server$', {
2652                  # But Server has its own repo.
2653                  'armhfp': {
2654                      'kickstart': 'fedora-arm-server.ks',
2655                      'name': 'Fedora-Server-armhfp',
2656                      'type': 'appliance',
2657                      'failable': True,
2658                  }
2659              }),
2660          ]
2661
2662          ostree = {
2663              "^Silverblue$": {
2664                  "version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
2665                  # To get config, clone master branch from this repo and take
2666                  # treefile from there.
2667                  "treefile": "fedora-silverblue.yaml",
2668                  "config_url": "https://pagure.io/workstation-ostree-config.git",
2669                  "config_branch": "master",
2670                  # Consume packages from Everything
2671                  "repo": "Everything",
2672                  # Don't create a reference in the ostree repo (signing automation does that).
2673                  "tag_ref": False,
2674                  # Don't use change detection in ostree.
2675                  "force_new_commit": True,
2676                  # This is the location for the repo where new commit will be
2677                  # created. Note that this is outside of the compose dir.
2678                  "ostree_repo": "/mnt/koji/compose/ostree/repo/",
2679                  "ostree_ref": "fedora/rawhide/${basearch}/silverblue",
2680                  "arches": ["x86_64", "ppc64le", "aarch64"],
2681                  "failable": ['*'],
2682              }
2683          }
2684
2685          ostree_installer = [
2686              ("^Silverblue$", {
2687                  "x86_64": {
2688                      "repo": "Everything",
2689                      "release": None,
2690                      "rootfs_size": "8",
2691                      # Take templates from this repository.
2692                      'template_repo': 'https://pagure.io/fedora-lorax-templates.git',
2693                      'template_branch': 'master',
2694                      # Use following templates.
2695                      "add_template": ["ostree-based-installer/lorax-configure-repo.tmpl",
2696                                       "ostree-based-installer/lorax-embed-repo.tmpl",
2697                                       "ostree-based-installer/lorax-embed-flatpaks.tmpl"],
2698                      # And add these variables for the templates.
2699                      "add_template_var": [
2700                          "ostree_install_repo=https://kojipkgs.fedoraproject.org/compose/ostree/repo/",
2701                          "ostree_update_repo=https://ostree.fedoraproject.org",
2702                          "ostree_osname=fedora",
2703                          "ostree_oskey=fedora-32-primary",
2704                          "ostree_contenturl=mirrorlist=https://ostree.fedoraproject.org/mirrorlist",
2705                          "ostree_install_ref=fedora/rawhide/x86_64/silverblue",
2706                          "ostree_update_ref=fedora/rawhide/x86_64/silverblue",
2707                          "flatpak_remote_name=fedora",
2708                          "flatpak_remote_url=oci+https://registry.fedoraproject.org",
2709                          "flatpak_remote_refs=runtime/org.fedoraproject.Platform/x86_64/f30 app/org.gnome.Baobab/x86_64/stable",
2710                      ],
2711                      'failable': ['*'],
2712                  },
2713              })
2714          ]
2715
2716   RCM Tools compose
2717       This is a small compose used to deliver packages to  Red  Hat  internal
2718       users. The configuration is split into two files.
2719
2720          # rcmtools-common.conf
2721
2722          release_name = "RCM Tools"
2723          release_short = "RCMTOOLS"
2724          release_version = "2.0"
2725          release_type = "updates"
2726          release_is_layered = True
2727          createrepo_c = True
2728          createrepo_checksum = "sha256"
2729
2730          # PKGSET
2731          pkgset_source = "koji"
2732          koji_profile = "brew"
2733          pkgset_koji_inherit = True
2734
2735
2736          # GENERAL SETTINGS
2737          bootable = False
2738          comps_file = "rcmtools-comps.xml"
2739          variants_file = "rcmtools-variants.xml"
2740          sigkeys = ["3A3A33A3"]
2741
2742
2743          # RUNROOT settings
2744          runroot = False
2745
2746
2747          # GATHER
2748          gather_method = "deps"
2749          check_deps = True
2750
2751          additional_packages = [
2752              ('.*', {
2753                  '*': ['puddle', 'rcm-nexus'],
2754                  }
2755              ),
2756          ]
2757
2758          # Set repoclosure_strictness to fatal to avoid installation dependency
2759          # issues in production composes
2760          repoclosure_strictness = [
2761              ("^.*$", {
2762                  "*": "fatal"
2763              })
2764          ]
2765
2766       Configuration  specific for different base products is split into sepa‐
2767       rate files.
2768
2769          # rcmtools-common.conf
2770          from rcmtools-common import *
2771
2772          # BASE PRODUCT
2773          base_product_name = "Red Hat Enterprise Linux"
2774          base_product_short = "RHEL"
2775          base_product_version = "7"
2776
2777          # PKGSET
2778          pkgset_koji_tag = "rcmtools-rhel-7-compose"
2779
2780          # remove i386 arch on rhel7
2781          tree_arches = ["aarch64", "ppc64le", "s390x", "x86_64"]
2782
2783          check_deps = False
2784
2785          # Packages in these repos are available to satisfy dependencies inside the
2786          # compose, but will not be pulled in.
2787          gather_lookaside_repos = [
2788              ("^Client|Client-optional$", {
2789                  "x86_64": [
2790                      "http://example.redhat.com/rhel/7/Client/x86_64/os/",
2791                      "http://example.redhat.com/rhel/7/Client/x86_64/optional/os/",
2792                  ],
2793              }),
2794               ("^Workstation|Workstation-optional$", {
2795                  "x86_64": [
2796                      "http://example.redhat.com/rhel/7/Workstation/x86_64/os/",
2797                      "http://example.redhat.com/rhel/7/Workstation/x86_64/optional/os/",
2798                  ],
2799              }),
2800              ("^Server|Server-optional$", {
2801                  "aarch64": [
2802                      "http://example.redhat.com/rhel/7/Server/aarch64/os/",
2803                      "http://example.redhat.com/rhel/7/Server/aarch64/optional/os/",
2804                  ],
2805                  "ppc64": [
2806                      "http://example.redhat.com/rhel/7/Server/ppc64/os/",
2807                      "http://example.redhat.com/rhel/7/Server/ppc64/optional/os/",
2808                  ],
2809                  "ppc64le": [
2810                      "http://example.redhat.com/rhel/7/Server/ppc64le/os/",
2811                      "http://example.redhat.com/rhel/7/Server/ppc64le/optional/os/",
2812                  ],
2813                  "s390x": [
2814                      "http://example.redhat.com/rhel/7/Server/s390x/os/",
2815                      "http://example.redhat.com/rhel/7/Server/s390x/optional/os/",
2816                  ],
2817                  "x86_64": [
2818                      "http://example.redhat.com/rhel/7/Server/x86_64/os/",
2819                      "http://example.redhat.com/rhel/7/Server/x86_64/optional/os/",
2820                  ],
2821              })
2822          ]
2823

EXPORTING FILES FROM SCM

2825       Multiple places in Pungi can use files from external storage. The  con‐
2826       figuration  is  similar  independently of the backend that is used, al‐
2827       though some features may be different.
2828
2829       The so-called scm_dict is always put into configuration  as  a  dictio‐
2830       nary, which can contain following keys.
2831
2832scm  –  indicates  which SCM system is used. This is always required.
2833         Allowed values are:
2834
2835file – copies files from local filesystem
2836
2837git – copies files from a Git repository
2838
2839cvs – copies files from a CVS repository
2840
2841rpm – copies files from a package in the compose
2842
2843koji – downloads archives from a given build in Koji build system
2844
2845repo
2846
2847         • for Git and CVS backends this should be URL to the repository
2848
2849         • for RPM backend this should be a shell style glob matching  package
2850           names (or a list of such globs)
2851
2852         • for file backend this should be empty
2853
2854         • for Koji backend this should be an NVR or package name
2855
2856branch
2857
2858         • branch  name  for Git and CVS backends, with master and HEAD as de‐
2859           faults
2860
2861         • Koji tag for koji backend if only package name is given
2862
2863         • otherwise should not be specified
2864
2865file – a list of files that should be exported.
2866
2867dir – a directory that should be exported. All its contents  will  be
2868         exported. This option is mutually exclusive with file.
2869
2870command  – defines a shell command to run after Git clone to generate
2871         the needed file (for example to run  make).  Only  supported  in  Git
2872         backend.
2873
2874   Koji examples
2875       There are two different ways how to configure the Koji backend.
2876
2877          {
2878              # Download all *.tar files from build my-image-1.0-1.
2879              "scm": "koji",
2880              "repo": "my-image-1.0-1",
2881              "file": "*.tar",
2882          }
2883
2884          {
2885              # Find latest build of my-image in tag my-tag and take files from
2886              # there.
2887              "scm": "koji",
2888              "repo": "my-image",
2889              "branch": "my-tag",
2890              "file": "*.tar",
2891          }
2892
2893       Using  both  tag name and exact NVR will result in error: the NVR would
2894       be interpreted as a package name, and would not match anything.
2895
2896   file vs. dir
2897       Exactly one of these two options has to be specified. Documentation for
2898       each configuration option should specify whether it expects a file or a
2899       directory.
2900
2901       For extra_files phase either key is valid and should be chosen  depend‐
2902       ing on what the actual use case.
2903
2904   Caveats
2905       The rpm backend can only be used in phases that would extract the files
2906       after pkgset phase finished. You can’t get comps file from a package.
2907
2908       Depending on Git repository URL configuration Pungi can only export the
2909       requested  content using git archive. When a command should run this is
2910       not possible and a clone is always needed.
2911
2912       When using koji backend, it is required to  provide  configuration  for
2913       Koji  profile  to be used (koji_profile). It is not possible to contact
2914       multiple different Koji instances.
2915

PROGRESS NOTIFICATION

2917       Pungi has the ability to emit notification messages about progress  and
2918       general  status of the compose. These can be used to e.g. send messages
2919       to fedmsg. This is implemented by actually calling a separate script.
2920
2921       The script will be called with one argument describing action that just
2922       happened.  A  JSON-encoded  object  will be passed to standard input to
2923       provide more information about the event. At the very least, the object
2924       will contain a compose_id key.
2925
2926       The  script is invoked in compose directory and can read other informa‐
2927       tion there.
2928
2929       Currently these messages are sent:
2930
2931status-change – when composing starts, finishes or fails; a status
2932            key is provided to indicate details
2933
2934phase-start – on start of a phase
2935
2936phase-stop – when phase is finished
2937
2938createiso-targets – with a list of images to be created
2939
2940createiso-imagedone – when any single image is finished
2941
2942createiso-imagefail – when any single image fails to create
2943
2944fail-to-start  – when there are incorrect CLI options or errors in
2945            configuration file; this message does not contain  compose_id  nor
2946            is it started in the compose directory (which does not exist yet)
2947
2948ostree  – when a new commit is created, this message will announce
2949            its hash and the name of ref it is meant for.
2950
2951       For phase related messages phase_name key is provided as well.
2952
2953       A pungi-fedmsg-notification script is provided and understands this in‐
2954       terface.
2955
2956   Setting it up
2957       The  script  should  be provided as a command line argument --notifica‐
2958       tion-script.
2959
2960          --notification-script=pungi-fedmsg-notification
2961

GATHERING PACKAGES

2963       A compose created by Pungi consists of one or more variants. A  variant
2964       contains a subset of the content targeted at a particular use case.
2965
2966       There  are  different  types of variants. The type affects how packages
2967       are gathered into the variant.
2968
2969       The inputs for gathering are defined by various gather  sources.  Pack‐
2970       ages  from  all  sources  are collected to create a big list of package
2971       names, comps groups names and a list of packages that  should  be  fil‐
2972       tered out.
2973
2974       NOTE:
2975          The  inputs for both explicit package list and comps file are inter‐
2976          preted as RPM names, not any arbitrary provides nor  source  package
2977          name.
2978
2979       Next,  gather_method defines how the list is processed. For nodeps, the
2980       results from source are used pretty much as is [1]. For deps method,  a
2981       process will be launched to figure out what dependencies are needed and
2982       those will be pulled in.
2983
2984       [1]  The lists are filtered based on what packages are available in the
2985            package set, but nothing else will be pulled in.
2986
2987   Variant types
2988       Variant
2989              is a base type that has no special behaviour.
2990
2991       Addon  is  built  on top of a regular variant. Any packages that should
2992              go to both the addon and its parent will be removed from  addon.
2993              Packages  that  are  only  in  addon  but  pulled  in because of
2994              gather_fulltree option will be moved to parent.
2995
2996       Integrated Layered Product
2997              works similarly to addon. Additionally, all packages from addons
2998              on  the same parent variant are removed integrated layered prod‐
2999              ucts.
3000
3001              The main difference between  an  addon  and  integrated  layered
3002              product  is that integrated layered product has its own identity
3003              in the metadata (defined with product name and version).
3004
3005              NOTE:
3006                 There’s also Layered Product as a term, but this is  not  re‐
3007                 lated  to  variants.  It’s used to describe a product that is
3008                 not a standalone operating system and is instead meant to  be
3009                 used on some other base system.
3010
3011       Optional
3012              contains  packages that complete the base variants’ package set.
3013              It always has fulltree and selfhosting enabled, so  it  contains
3014              build  dependencies and packages which were not specifically re‐
3015              quested for base variant.
3016
3017       Some configuration options are overridden for particular variant types.
3018
3019   Depsolving configuration
3020                      ┌──────────┬──────────────┬──────────────┐
3021                      │Variant   │ Fulltree     │ Selfhosting  │
3022                      ├──────────┼──────────────┼──────────────┤
3023                      │base      │ configurable │ configurable │
3024                      ├──────────┼──────────────┼──────────────┤
3025                      │addon/ILP │ enabled      │ disabled     │
3026                      ├──────────┼──────────────┼──────────────┤
3027                      │optional  │ enabled      │ enabled      │
3028                      └──────────┴──────────────┴──────────────┘
3029
3030   Profiling
3031       Profiling data on the pungi-gather tool can be enabled by  setting  the
3032       gather_profiler configuration option to True.
3033
3034   Modular compose
3035       A compose with gather_source set to module is called modular. The pack‐
3036       age list is determined by a list of modules.
3037
3038       The list of modules that will be put into a variant is defined  in  the
3039       variants.xml   file.   The  file  can  contain  either  Name:Stream  or
3040       Name:Stream:Version references. See Module Naming Policy  for  details.
3041       When  Version is missing from the specification, Pungi will ask PDC for
3042       the latest one.
3043
3044       The module metadata in PDC contains a list of RPMs  in  the  module  as
3045       well as Koji tag from which the packages can be retrieved.
3046
3047   Restrictions
3048          • A modular compose must always use Koji as a package set source.
3049

PROCESSING COMPS FILES

3051       The  comps  file  that Pungi takes as input is not really pure comps as
3052       used by tools like DNF. There are extensions used to customize how  the
3053       file is processed.
3054
3055       The first step of Pungi processing is to retrieve the actual file. This
3056       can use anything that scm_support supports.
3057
3058       Pungi extensions are arch attribute on packageref, group  and  environ‐
3059       ment tags. The value of this attribute is a comma separated list of ar‐
3060       chitectures.
3061
3062       Second step Pungi performs is creating a file  for  each  architecture.
3063       This is done by removing all elements with incompatible arch attribute.
3064       No additional clean up is performed on this file. The resulting file is
3065       only used internally for the rest of the compose process.
3066
3067       Third and final step is to create comps file for each Variant.Arch com‐
3068       bination.  This is the actual file that will be included  in  the  com‐
3069       pose.  The  start  file is the original input file, from which all ele‐
3070       ments with incompatible architecture are removed. Then clean up is per‐
3071       formed  by removing all empty groups, removing non-existing groups from
3072       environments and categories and finally removing empty environments and
3073       categories.  As  a last step groups not listed in the variants file are
3074       removed.
3075

CONTRIBUTING TO PUNGI

3077   Set up development environment
3078       In order to work on Pungi, you should install recent version of Fedora.
3079
3080   Python2
3081       Fedora 29 is recommended because some packages  are  not  available  in
3082       newer Fedora release, e.g. python2-libcomps.
3083
3084       Install required packages
3085
3086          $ sudo dnf install -y krb5-devel gcc make libcurl-devel python2-devel python2-createrepo_c kobo-rpmlib yum python2-libcomps python2-libselinx
3087
3088   Python3
3089       Install required packages
3090
3091          $ sudo dnf install -y krb5-devel gcc make libcurl-devel python3-devel python3-createrepo_c python3-libcomps
3092
3093   Developing
3094       Currently the development workflow for Pungi is on master branch:
3095
3096       • Make your own fork at https://pagure.io/pungi
3097
3098       • Clone your fork locally (replacing $USERNAME with your own):
3099
3100            git clone git@pagure.io:forks/$USERNAME/pungi.git
3101
3102       • cd into your local clone and add the remote upstream for rebasing:
3103
3104            cd pungi
3105            git remote add upstream git@pagure.io:pungi.git
3106
3107         NOTE:
3108            This  workflow  assumes  that you never git commit directly to the
3109            master branch of your fork. This will  make  more  sense  when  we
3110            cover rebasing below.
3111
3112       • create a topic branch based on master:
3113
3114            git branch my_topic_branch master
3115            git checkout my_topic_branch
3116
3117       • Make  edits,  changes,  add  new features, etc. and then make sure to
3118         pull from upstream master and rebase before  submitting  a  pull  re‐
3119         quest:
3120
3121            # lets just say you edited setup.py for sake of argument
3122            git checkout my_topic_branch
3123
3124            # make changes to setup.py
3125            black setup.py
3126            tox
3127            git add setup.py
3128            git commit -s -m "added awesome feature to setup.py"
3129
3130            # now we rebase
3131            git checkout master
3132            git pull --rebase upstream master
3133            git push origin master
3134            git push origin --tags
3135            git checkout my_topic_branch
3136            git rebase master
3137
3138            # resolve merge conflicts if any as a result of your development in
3139            # your topic branch
3140            git push origin my_topic_branch
3141
3142         NOTE:
3143            In order to for your commit to be merged:
3144
3145            • you must sign-off on it. Use -s option when running git commit.
3146
3147            • The code must be well formatted via black and pass flake8 check‐
3148              ing. Run tox -e black,flake8 to do the check.
3149
3150       • Create pull request in the pagure.io web UI
3151
3152       • For convenience, here is a bash shell function that can be placed  in
3153         your  ~/.bashrc  and  called  such as pullupstream pungi-4-devel that
3154         will automate a large portion of the rebase steps from above:
3155
3156            pullupstream () {
3157              if [[ -z "$1" ]]; then
3158                printf "Error: must specify a branch name (e.g. - master, devel)\n"
3159              else
3160                pullup_startbranch=$(git describe --contains --all HEAD)
3161                git checkout $1
3162                git pull --rebase upstream master
3163                git push origin $1
3164                git push origin --tags
3165                git checkout ${pullup_startbranch}
3166              fi
3167            }
3168
3169   Testing
3170       You must write  unit  tests  for  any  new  code  (except  for  trivial
3171       changes). Any code without sufficient test coverage may not be merged.
3172
3173       To run all existing tests, suggested method is to use tox.
3174
3175          $ sudo dnf install python3-tox -y
3176
3177          $ tox -e py3
3178          $ tox -e py27
3179
3180       Alternatively  you could create a vitualenv, install deps and run tests
3181       manually if you don’t want to use tox.
3182
3183          $ sudo dnf install python3-virtualenvwrapper -y
3184          $ mkvirtualenv --system-site-packages py3
3185          $ workon py3
3186          $ pip install -r requirements.txt -r test-requirements.txt
3187          $ make test
3188
3189          # or with coverage
3190          $ make test-coverage
3191
3192       If you need to run specified tests, pytest is recommended.
3193
3194          # Activate virtualenv first
3195
3196          # Run tests
3197          $ pytest tests/test_config.py
3198          $ pytest tests/test_config.py -k test_pkgset_mismatch_repos
3199
3200       In the tests/ directory there is a shell  script  test_compose.sh  that
3201       you  can  use  to try and create a miniature compose on dummy data. The
3202       actual data will be created by running make test-data in project root.
3203
3204          $ sudo dnf -y install rpm-build createrepo_c isomd5sum genisoimage syslinux
3205
3206          # Activate virtualenv (the one created by tox could be used)
3207          $ source .tox/py3/bin/activate
3208
3209          $ python setup.py develop
3210          $ make test-data
3211          $ make test-compose
3212
3213       This testing compose does not actually use all phases that  are  avail‐
3214       able,  and  there  is  no  checking that the result is correct. It only
3215       tells you whether it crashed or not.
3216
3217       NOTE:
3218          Even when it finishes successfully, it may print  errors  about  re‐
3219          poclosure on Server-Gluster.x86_64 in test phase. This is not a bug.
3220
3221   Documenting
3222       You  must  write  documentation  for  any  new  features and functional
3223       changes.  Any code without sufficient documentation may not be merged.
3224
3225       To generate the documentation, run make doc in project root.
3226

TESTING PUNGI

3228   Test Data
3229       Tests require test data and not all of it is  available  in  git.   You
3230       must create test repositories before running the tests:
3231
3232          make test-data
3233
3234       Requirements: createrepo_c, rpmbuild
3235
3236   Unit Tests
3237       Unit  tests  cover  functionality of Pungi python modules.  You can run
3238       all of them at once:
3239
3240          make test
3241
3242       which is shortcut to:
3243
3244          python2 setup.py test
3245          python3 setup.py test
3246
3247       You can alternatively run individual tests:
3248
3249          cd tests
3250          ./<test>.py [<class>[.<test>]]
3251
3252   Functional Tests
3253       Because compose is quite complex process and not everything is  covered
3254       with  unit  tests  yet, the easiest way how to test if your changes did
3255       not break anything badly is to start a compose on  a  relatively  small
3256       and well defined package set:
3257
3258          cd tests
3259          ./test_compose.sh
3260

MANAGING COMPOSE FROM MULTIPLE PARTS

3262       There  may  be  cases  where it makes sense to split a big compose into
3263       separate parts, but create a compose output that links all output  into
3264       one familiar structure.
3265
3266       The pungi-orchestrate tools allows that.
3267
3268       It  works  with  an INI-style configuration file. The [general] section
3269       contains information about identity of the main compose. Other sections
3270       define individual parts.
3271
3272       The  parts are scheduled to run in parallel, with the minimal amount of
3273       serialization. The final compose directory will contain  hard-links  to
3274       the files.
3275
3276   General settings
3277       target Path to directory where the final compose should be created.
3278
3279       compose_type
3280              Type of compose to make.
3281
3282       release_name
3283              Name of the product for the final compose.
3284
3285       release_short
3286              Short name of the product for the final compose.
3287
3288       release_version
3289              Version of the product for the final compose.
3290
3291       release_type
3292              Type of the product for the final compose.
3293
3294       extra_args
3295              Additional arguments that will be passed to the child Pungi pro‐
3296              cesses.
3297
3298       koji_profile
3299              If specified, a current event will be retrieved  from  the  Koji
3300              instance and used for all parts.
3301
3302       kerberos
3303              If  set  to yes, a kerberos ticket will be automatically created
3304              at the start.  Set keytab and principal as well.
3305
3306       kerberos_keytab
3307              Path to keytab file used to create the kerberos ticket.
3308
3309       kerberos_principal
3310              Kerberos principal for the ticket
3311
3312       pre_compose_script
3313              Commands to execute before first part is  started.  Can  contain
3314              multiple commands on separate lines.
3315
3316       post_compose_script
3317              Commands  to execute after the last part finishes and final sta‐
3318              tus is updated. Can contain multiple commands on separate lines.
3319
3320                 post_compose_script =
3321                     compose-latest-symlink $COMPOSE_PATH
3322                     custom-post-compose-script.sh
3323
3324              Multiple environment variables are defined for the scripts:
3325
3326COMPOSE_PATH
3327
3328COMPOSE_ID
3329
3330COMPOSE_DATE
3331
3332COMPOSE_TYPE
3333
3334COMPOSE_RESPIN
3335
3336COMPOSE_LABEL
3337
3338RELEASE_ID
3339
3340RELEASE_NAME
3341
3342RELEASE_SHORT
3343
3344RELEASE_VERSION
3345
3346RELEASE_TYPE
3347
3348RELEASE_IS_LAYERED YES for layered products, empty other‐
3349                   wise
3350
3351BASE_PRODUCT_NAME – only set for layered products
3352
3353BASE_PRODUCT_SHORT – only set for layered products
3354
3355BASE_PRODUCT_VERSION – only set for layered products
3356
3357BASE_PRODUCT_TYPE – only set for layered products
3358
3359       notification_script
3360              Executable  name (or path to a script) that will be used to send
3361              a message once the compose is finished. In order for a valid URL
3362              to  be included in the message, at least one part must configure
3363              path translation that would apply to location of main compose.
3364
3365              Only two messages will be sent, one for start and one for finish
3366              (either successful or not).
3367
3368   Partial compose settings
3369       Each part should have a separate section in the config file.
3370
3371       It can specify these options:
3372
3373       config Path  to  configuration  file that describes this part. If rela‐
3374              tive, it is resolved relative to the file with parts  configura‐
3375              tion.
3376
3377       just_phase, skip_phase
3378              Customize which phases should run for this part.
3379
3380       depends_on
3381              A  comma separated list of other parts that must be finished be‐
3382              fore this part starts.
3383
3384       failable
3385              A boolean toggle to mark a part as failable. A failure  in  such
3386              part  will  mark the final compose as incomplete, but still suc‐
3387              cessful.
3388

AUTHOR

3390       Daniel Mach
3391
3393       2021, Red Hat, Inc.
3394
3395
3396
3397
33984.2                              Apr 29, 2021                         PUNGI(1)
Impressum