Commit Graph

240 Commits

Author SHA1 Message Date
Dennis Gilmore 6a682f64fe Merge #357 `Improve error messages for gathering packages` 2016-08-10 11:36:18 +00:00
Lubomír Sedlář ef99e28849 [test] Only check bootability for images on x86_64 and i386
Current check does not really work for other arches.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-08-10 13:02:56 +02:00
Lubomír Sedlář 761a0ef40e Improve error messages for gathering packages
When package has incompatible arch for a tree, the same error message
could be raised from two different places. This patch adds more
information to the message, so that it is easier to find the actual
problem.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-08-10 09:32:39 +02:00
Dennis Gilmore 247149d4e1 Merge #339 `Refactor failables, step 1` 2016-08-03 07:36:34 +00:00
Lubomír Sedlář 463088d580 Refactor failables
This is a breaking change as big part of current failable_deliverables
options will be ignored.

There is no change for buildinstall and creatiso phase.

Failability for artifacts in other phases is now configured per
artifact. It already works correctly for ostree and ostree_installer
phases (even per-arch). For OSBS phase there is currently only a binary
switch as it does not handle multiple arches yet. When it gains that
support, the option should contain list of non-blocking architectures.

For live images, live media and image build phases each config block can
configure list of failable arches. If the list is not empty, it can
fail. Once we have a way to fail only some arches, the config will not
need to change.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-07-27 13:06:01 +02:00
Lubomír Sedlář 7d0ee41f23 Stop setting release in OSBS phase
Atomic Reactor does not honor this option. In the future we might need
to reintroduce this feature, but given that it does not work in the
current form it is better removed.

Fixes: #348
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-07-27 09:52:06 +02:00
Dennis Gilmore 664c5e54a3 Merge #351 `Remove ambiguous imports` 2016-07-26 13:54:44 +00:00
Lubomír Sedlář 22e94caf3c [test] Correctly check bootable ISOs
ISO image without MBR and GPT can still be bootable if it has an El
Torito boot catalog. The test phase must accept such images.

This slightly defeats the point of the check: to verify the ISO is
hybrid. However, based on the metadata we have no way to actually tell
if the image is supposed to be hybrid.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-07-22 14:11:06 +02:00
Lubomír Sedlář d51550da84 Remove ambiguous imports
Make all imports either use full package name starting with `pungi` or
use explicitly relative import. This will avoid issues when importing a
module that shadows another module on PYTHONPATH.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-07-20 13:36:42 +02:00
Lubomír Sedlář f0dca7687e Merge #347 `Remove duplicate definition of find_old_composes.` 2016-07-20 08:43:47 +00:00
Dennis Gilmore 9861e80c80 Merge #342 `Simplify naming format placeholders` 2016-07-01 00:04:17 +00:00
Dennis Gilmore 5ae58b6d46 Merge #345 `createrepo: use separate logs for different pkg_type` 2016-07-01 00:03:46 +00:00
Ralph Bean ad44ef4695 Remove duplicate definition of find_old_composes...
This lives now in pungi.util.  It was copied there long ago and all the
places that reference it reference it in that location.

I think this code in pungi.phases.pkgset is unused and can be removed.

The other function moved to the common module.

Signed-off-by: Ralph Bean <rbean@redhat.com>
2016-06-30 16:43:34 -04:00
Qixiang Wan c32080e7f9 [createrepo] fix 'createrepo_deltas' option
'createrepo_deltas = False' in configuration doesn't work

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2016-06-30 18:44:25 +08:00
Lubomír Sedlář a1b86b93ea createrepo: use separate logs for different pkg_type
Instead of overwriting the same log file, make sure we keep all the logs
for debuginfo, source and binary packages.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-29 07:46:33 +02:00
Lubomír Sedlář a72182c817 Simplify naming format placeholders
This patch makes it possible to use different style format placeholders.
Instead of the percent encoding it is now possible to use simple curly
braces.

    %(foo)s -> {foo}

The old format is still available.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-28 13:03:36 +02:00
Lubomír Sedlář 11bbbae2ed Treat variants without comps groups as having all of them
If the `<groups></groups>` section is not specified in the variants XML
file, all groups will be used in this variant. The section must be
omitted completely, not just empty. This is (and was) correct according
to the DTD, it just lead to crash before.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-28 09:01:30 +02:00
Lubomír Sedlář 8323a735e7 Always generate rpms.json file
Even if gather phase is skipped, it will still generate a rpms.json
metadata file. It will have no payload, but the header structure is
there.

Createrepo phase had to be updated to ignore variants that have no RPMs
listed in metadata.

There is one more fix for writing treeinfo files: if repomd.xml files
are not generated, it will no longer crash.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-27 08:50:19 +02:00
Lubomír Sedlář 8e4b1e278c [extra-files] Only copy files when there is a config
Instead of running the copy function for all variant.arch pairs
unconditionally, only do it if there is something to do. This makes the
log more understandable.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-23 07:25:52 +02:00
Lubomír Sedlář 170cd8f72d [extra-files] Refactoring
* remove duplicated function arguments
 * move logic into smaller and well documented functions

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-23 07:25:52 +02:00
Lubomír Sedlář 74001d5aa5 [extra-files] Skip whole phase if not configured
This checks the configuration in one place rather than doing it for each
variant/arch combination.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-23 07:25:52 +02:00
Lubomír Sedlář b67f6369db [extra-files] Copy files using existing function
Instead of calling cp as a system command. This will help debug problems
if something fails.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-23 07:25:52 +02:00
Lubomír Sedlář b4fc97be03 [osbs] Add a phase to build images in OSBS
It will take RPM repo from a variant in this compose and a Dockerfile
from configured git and use it to build an image.

The build images are uploaded to some a Docker registry by OSBS and are
not directly part of compose (because there is no export function).
There is a new metadata file `osbs.json` that has some information that
can be used to find the image.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-22 10:02:03 +02:00
Dennis Gilmore 6800501217 Merge #325 `Fix checking optional ISO images in test phase` 2016-06-06 11:56:51 +00:00
Dennis Gilmore 5b5f9b7460 Merge #320 `images.json: Move src images under binary arches.` 2016-06-06 11:56:11 +00:00
Lubomír Sedlář b2a266c3e4 Fix checking optional ISO images in test phase
Instead of iterating over image manifest, loop through all variants and
arches and see if there are any images. This avoids a crash for variants
nested under other variants (layered products, optionals or addons).

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-06 10:41:06 +02:00
Daniel Mach f78709aaf9 images.json: Move src images under binary arches.
Signed-off-by: Daniel Mach <dmach@redhat.com>
2016-06-02 10:17:06 -04:00
Lubomír Sedlář b62b468ccf [createiso] Enable customizing media reserve
Add a documented and tested config options for setting ISO parameters
instead of hardcoding magic values.

Fixes: #256
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-02 08:34:49 +02:00
Lubomír Sedlář a8d7f8a63e [createiso] Add test for splitting media
This patch also fixes a bug where packages in hashed directories would
not be recognized as such and would not be placed after other files.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-02 08:34:49 +02:00
Lubomír Sedlář 961648819f [buildinstall] Fix bad error message
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-27 12:18:16 +02:00
Dennis Gilmore 264c7b1ddf Merge #309 `Add compatibility for Python 2.6` 2016-05-27 01:23:34 +00:00
Lubomír Sedlář 022a4d36f5 [ostree-installer] Put images to os/ directory
Instead of putting everything to <variant>/<arch>/iso, move images/,
EFI/ and isolinux/ subdirs to <variant>/<arch>/os. The nicely named ISO
image is still in the original location.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-26 09:58:56 +02:00
Lubomír Sedlář b634a18a7f Stop using str.format
On Python 2.6, it requires the format placeholder to have explicit index
of argument, so using % formatting is easier.

There are a couple places where the method is still used because the
same argument is used twice.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-25 13:41:49 +02:00
Lubomír Sedlář c8341e1806 [ostree-installer] Allow using external repos as source
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-24 10:06:06 +02:00
Lubomír Sedlář bb4afea4f1 [image-build] Allow using external install trees
This is needed for the twoweek Fedora atomic release to point to regular
nightly composes.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-23 18:30:14 +02:00
Lubomír Sedlář 9dce30a78d [ostree] Use unique work and log paths
Each variant.arch combination can have multiple ostree repos configured,
so we need to make sure the filesystem paths don't clash.

The paths used now are:

    logs/<arch>/<variant>/ostree-<x>/
    work/ostree-<x>/config_repo

The x stands for a number identifying the task. It has no relation to
actual contents of the repo.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-18 08:03:31 +02:00
Lubomír Sedlář eeacb5b9f1 [ostree] Put variant name in ostree log dir
This will prevent log files from being mangled when multiple ostree
repos are created.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-16 18:29:09 +02:00
Lubomír Sedlář 12652ad1fa [ostree] Initialize empty repo
Make sure the directory exists before calling Koji (because otherwise
the mounting will fail). Update the runroot script to initialize the
repo when there are no files in the target destination.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-10 08:27:43 +02:00
Lubomír Sedlář 4e3d87e658 [test] Add checks for created images
The performed checks:
 * If format is ISO, the file must have correct magic string
 * If it's bootable, there must be MBR or GPT

When a check fails on any failable deliverable, it will be logged and
the file removed from metadata (it will still remain on the disk). This
required a change to write the images.json file later (after test
phase).

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-05 15:38:00 +02:00
Lubomír Sedlář 5aadf4ac39 Fix caching global ksurl
The config object from Kobo does not allow keys starting with
underscore, so we prefix it with `private_` instead.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-05 10:44:27 +02:00
Dennis Gilmore c80b7c6894 Merge #273 `Deduplicate configuration a bit` 2016-04-29 12:26:51 +00:00
Lubomír Sedlář d4effc1610 [pkgset] Fix caching RPMs
The test mock did not actually match what is provided by Kobo.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-28 09:05:03 +02:00
Lubomír Sedlář 9f3408fec0 [pkgset] Use context manager for opening file list
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-26 14:58:18 +02:00
Lubomír Sedlář d7012c442a [pkgset] Simplify finding RPM in koji buildroot
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-26 14:44:29 +02:00
Lubomír Sedlář 0c8eb6c0fb [pkgset] Clean up koji package set
* break too long lines
 * remove unneeded code
 * call parent methods with super()

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-26 14:43:43 +02:00
Lubomír Sedlář 2bb65408ee [pkgset] Add tests for KojiPackageSet
There is a lot of mock objects needed: we bypass calls to Koji, use a
mock FileCache that does not need valid RPMs on disk and avoid any
multithreading.

The test data in tests/fixtures/tagged-rpms.json comes from Koji. It is
filtered down to only a few packages to make it manageable.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-22 13:35:17 +02:00
Lubomír Sedlář 65697a7526 [pkgset] Clean up Koji source
* Remove unused imports and variables
 * Simplify code where possible
 * Break too long lines

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-22 09:44:20 +02:00
Lubomír Sedlář 01422983cb [pkgset] Add tests for Koji source
This patch also fixes the bug where using a preconfigured Koji event
would not actually work and instead the latest event would be used.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-22 09:44:20 +02:00
Lubomír Sedlář 084994538b Add common global settings for images
The live_images, live_media and image_build phases have same options
that need to be specified on each image. This leads to a lot of
duplication in the config file. This patch adds global settings and
phase-level settings that allow to significantly reduce duplication.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 18:11:29 +02:00
Lubomír Sedlář a8ff48ce92 Remove duplicated and dead code
in checking whether a phase should be skipped.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 18:11:29 +02:00