Commit Graph

334 Commits

Author SHA1 Message Date
Lubomír Sedlář 9533fca96c koji_wrapper: Always use --profile option with koji
This patch adds this option to all invoked koji commands.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-30 13:00:25 +01:00
Dennis Gilmore 42cdf047cc add missing koji_profile from test compose setting
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2017-01-30 05:06:46 -06:00
Dennis Gilmore c650f04d0b Revert "live-media: Call correct koji alias"
This was accidently merged and is not correct
This reverts commit 02beb35e67.

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2017-01-30 04:44:17 -06:00
Lubomír Sedlář dc7d3b36ab repoclosure: Don't run build deps check
Fixes: #521
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-30 10:16:03 +01:00
Dennis Gilmore 7feadb14ba Merge #518 `Migrate test phase to dnf repoclosure` 2017-01-28 16:49:10 +00:00
Lubomír Sedlář 02beb35e67 live-media: Call correct koji alias
We need call whatever command is configured in koji_profile. It's not
always `koji`.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-26 15:32:21 +01:00
Lubomír Sedlář e3fe67be53 repoclosure: add option to use dnf backend
This adds a new option repoclosure_backend that changes what tool is
used for repoclosure.

Checking build dependencies is currently not supported, as `dnf` does
not have the corresponding option.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-26 13:39:12 +01:00
Lubomír Sedlář 95fc0fa4ab repoclosure: Add test for repoclosure in test phase
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-26 13:27:48 +01:00
Lubomír Sedlář 7a8fa87172 repoclosure: Remove useless wrapper class
We already get namespacing from being in a separate module.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-26 10:55:23 +01:00
Lubomír Sedlář 9af0cca9eb repoclosure: Add a test for the wrapper
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-26 10:55:23 +01:00
Lubomír Sedlář 8418b68fb0 image-build: Pass arches around as a list
Instead of joining the arches as a comma separated string and splitting
it again later. Ultimately we do need the original format to pass to
koji wrapper, but we can produce that value later.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-24 08:50:21 +01:00
Lubomír Sedlář 6c708549c8 image-build: Expand arches for can_fail
We need to work with a list of strings, not a comma-delimited single
string.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-24 08:50:21 +01:00
Qixiang Wan 40df2034a8 image_checksum: add file sizes to checksum files
Write file sizes of images in checksum files with comment lines,
checksum files are in BSD-style which supports comments by starting
a line with '#'.

Example:

$ cat RHEL-7.4-20170123.n.4/compose/Server/x86_64/iso/RHEL-Server-7.4-x86_64-20170123.n.4-CHECKSUM
 # RHEL-7.4-20170123.n.4-Server-x86_64-dvd1.iso: 3725590528 bytes
 # RHEL-7.4-20170123.n.4-Server-x86_64-boot.iso: 377487360 bytes
 SHA256 (RHEL-7.4-20170123.n.4-Server-x86_64-dvd1.iso) = fa3de37fe4b859a0285f16ea1123f44f15aec169aea84bf010aa3821bd58fc41
 SHA256 (RHEL-7.4-20170123.n.4-Server-x86_64-boot.iso) = 74bf68c54665328adb08b09daf773c67e633b5907e3e2797338ab3c1b58fdf48

(No space at the start of line, because git commit message drops lines
start with '#', added one space to avoid that.)

When there are multiple checksum types specified and checksums are
written to individual files, file size of the image will also be
written to every checksum files.

Fixes: #493

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2017-01-23 18:20:21 +08:00
Qixiang Wan a9b275f13b osbs: optionally check GPG signatures
If gpgkey option is defined in config, set gpgcheck=1 and set
gpgkey=<value> in variant repo files.

Fixes: #487
Signed-off-by: Qixiang Wan <qwan@redhat.com>
2017-01-17 13:08:58 +08:00
Qixiang Wan 5d241d316a ostree-installer: Allow multiple repos in ostree installer
Add new key 'repo' to allow specifying multiple repos as the source
repositories. And change 'source_repo_from' to allow specifying multiple
vairant names to use variant repos as source repositories.

Doc of 'source_repo_from' is updated to not mention URL is supported,
though we still support that in code. User should add url of repos in
'repo' key instead of 'source_repo_from'.

Fixes: #508

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2017-01-13 16:57:30 +08:00
Lubomír Sedlář afaa0e025e unified-iso: Create isos with debuginfo packages
When creating unified ISOs, the script will now also create one iso per
architecture containing a repo with debuginfo packages.

There is no switch to turn this off. The images can simply not be
shipped if not wanted.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-11 14:36:25 +01:00
Qixiang Wan 6fbf1e8f59 Create temporary dirs under compose's workdir
Add compose.mkdtemp which creates and returns a unique temporary
directory under <compose_topdir>/work/{global,<arch>}/tmp[-<variant>]/

Change tempfile.mkdtemp in code to compose.mkdtemp, so temporary
dirs are created under the compose's workdir, this makes it more
easier to maintain the temporary dirs/files especially when compose
fails with amount of temporary files left there.

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2017-01-11 15:25:47 +08:00
Dennis Gilmore baca306edf Merge #495 `osbs: Enable specifying extra repos` 2017-01-04 14:44:13 +00:00
Dennis Gilmore 46f77403df Merge #475 `Allow failure for some arches` 2017-01-04 14:43:22 +00:00
Lubomír Sedlář e260fe5581 Add script to generate unified ISOs
This a standalone script that will look into a compose and create
unified ISO for each architecture. The ISO contains RPM repositories for
all variants that have the arch.

Known issues:
 * The filename does not respect settings. This is tricky because the
   name could include variant name, which we don't have here (by design
   of unified ISO).
 * The same is true for volume id.

In order to test the feature without running actual compose, we need to
add essentially a big chunk of compose. Most of the files are empty, as
their content is never accessed.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-04 10:22:20 +01:00
Lubomír Sedlář e7c8b2affd osbs: Validate config in tests
This makes sure the test configurations will be accepted in real usage.
It also enables us to remove some manual error checking that will be
performed by validator.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-04 09:47:26 +01:00
Lubomír Sedlář 61a4c43db0 osbs: Verify the .repo files contain correct URL
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-04 09:47:26 +01:00
Lubomír Sedlář 814bf4484b osbs: Enable specifying extra repos
The same way live_media and image_build accept additional external repos
or variants list, there is now a `repo` and `repo_from` configuration
key to add these.

Fixes: #486
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-01-04 09:47:19 +01:00
Patrick Uiterwijk c64f75d1b4 Add test for krb_login with principal and keytab
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2016-12-14 12:58:23 +00:00
Patrick Uiterwijk cb4b5cc54d Make sure that the profile name is parsed correctly
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2016-12-14 12:58:23 +00:00
Lubomír Sedlář 356b78d440 image-build: Allow failure only on some arches
This uses the --can-fail option in koji. Failing an optional image will
not abort whole task. If the whole task fails (or there is a problem on
the compose side), we abort unless all arches are optional.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-12-14 10:14:30 +01:00
Lubomír Sedlář 7f56b978ce live-media: Allow some arches to fail
This patch uses the `--can-fail` option of koji command line. If only
optional arches fail, the task will report as success. Failures on
compose box side are ignored if and only if all architectures are
optional.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-12-14 10:14:30 +01:00
Lubomír Sedlář 721932a573 image-build: Use install_tree from parent for nested variants
Buildinstall only runs for top-level variants. Addons, optionals and
integrated layered products must reuse install tree from their parent,
because otherwise there would be no boot.iso.

Fixes: #472
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-12-14 10:04:01 +01:00
Lubomír Sedlář c338219ef0 config: Report unknown options as warnings
Given the way config files can include other files, it is entirely
possible to use the same config file for both Pungi and Distill. Pungi
will however complain about unknown options.

This patch reverts part of c38bb480 and moves deprecation handling back
into schema validation. The validation method then returns a list of
errors and a list of warnings.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-12-13 11:58:08 +01:00
Lubomír Sedlář 56147f2e4d pungi: Handle missing SRPM
Source packages can be excluded while binary packages should still go
into the compose. This patch makes it so that the mapping from binary
packages to source packages contains None in such case. The code is
already capable of handling that. A warning will be emitted for each
binary package without source.

This also allows us to remove some code from `createSourceHashes` that
is now unused.

A test for excluding source package is added as well.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-12-13 10:45:04 +01:00
Qixiang Wan 83428a06bf [ostree-installer] Add 'installer' sub-command to pungi-make-ostree
The new sub-command 'installer' is added to support build OSTree
installer image with pungi-make-ostree. It can take an optional argument
'--extra-config' to read some of configurations from a json file. The
content of the json file can contains the configuration which are
supported in OSTree installer phase, the difference is variant UID is
not supported as a repo url in this case. A valid json file can be like
the following:

{
    "source_repo_from": "http://www.example.com/repo/workstation/os",
    "installpkgs": [
        "fedora-productimg-workstation"
    ],
    "add_template": [
        "/path/to/installer/template/lorax-configure-repo.tmpl"
    ],
    "add_template_var": [
        "ostree_osname=fedora-workstation",
        "ostree_ref=fedora/25/x86_64/workstation"
    ],
    "add_arch_template": [
        "/path/to/installer/template/lorax-embed-repo.tmpl"
    ],
    "add_arch_template_var": [
        "ostree_repo=https://www.example.com/compose/ostree",
        "ostree_osname=fedora-workstation",
        "ostree_ref=fedora/25/x86_64/workstation"
    ]
}

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2016-12-12 19:30:35 +08:00
Qixiang Wan e043604822 [ostree] Add 'tree' sub-command to pungi-make-ostree script
Update pungi-make-ostree to supourt sub-command 'tree', which is just
as the original feature of pungi-make-ostree to compose OSTree tree.
With the change we can add other sub commands later to build other
OSTree artifacts, like the installer image.

Inaddtional to the change, now the the 'tree' command can accept an
optional '--extra-config' parameter to update the original tree
configuration with extra configurations specified in a json file
before composing the OSTree tree.

Example:

pungi-make-ostree tree --repo=/ostree --treefile=/path/to/treefile \
--log-dir=/path/to/log --extra-config=/path/to/extra-config.json

The extra-config file can contains the same configuration as OSTree
phase, the difference is it doesn't understand variant UID as source
repo since it's not ran in the chain of phases. A valid configuration
can be like:

{
    "source_repo_from": "http://example.com/repo/x86_64/Server",
    "extra_source_repos": [
        {
            "name": "optional",
            "baseurl": "http://example.com/repo/x86_64/optional",
            "exclude": "systemd-container",
            "gpgcheck": False
        },
        {
            "name": "extra",
            "baseurl": "http://example.com/repo/x86_64/extra",
        }
    ],
    "keep_original_sources": True
}

The OSTree phase is updated to move out the task of updating treefile,
instead of that, it writes the extra configurations to a json file,
then 'pungi-make-ostree tree' will take it by option '--extra-config'.

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2016-12-12 19:30:35 +08:00
Lubomír Sedlář d3cad4795c metadata: Allow creating internal releases
The internal flag in productmd is meant to indicate that a compose is
not meant for publishing. This is potentially useful to allow filtering
in PDC or similar service.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-12-06 12:49:33 +01:00
Qixiang Wan 75934f20e5 Fix PhaseLoggerMixin in case of compose has _logger = None
80fa723 breaks pungi-config-validate that using ValidationCompose
with _logger set to None.

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2016-11-30 14:41:02 +08:00
Lubomír Sedlář dd814a5f4d ostree-installer: Use dvd-ostree as type in metadata
This depends on python-productmd >= 1.3 that understands this format.

Fixes: #417
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-28 10:32:50 +01:00
Lubomír Sedlář 2bd18b1b03 image-build: Reduce duplication
All tests should print complete diffs on failure, so there is no need to
define this in each test separately.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-28 09:28:46 +01:00
Lubomír Sedlář 5148adf233 createrepo: Add tests for adding product certificates
If the certificate is enabled and exists, it will currently be added to
all rpm repositories.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-23 11:17:04 +01:00
Lubomír Sedlář 96fc6fb11e createrepo: Add tests for retrieving product certificates
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-23 11:17:04 +01:00
Qixiang Wan 80fa723b1d Include phase name in log for some phases
Phases createiso, liveimages, image_build, ostree_installer and osbs are
done in parallel, logs from these phases are mixed and and it's not
obvious which log message belongs to which phase. This change adds phase
name in log message for these phases.

The new mixin 'PhaseLoggerMixin' is added to extend a Pungi phase with a
logging logger which copy handlers from compose's logger but with
formatter changed.

Fixes: #58
Signed-off-by: Qixiang Wan <qwan@redhat.com>
2016-11-23 16:47:22 +08:00
Dennis Gilmore 9e52c68c82 Merge #465 `media-split: Print sensible message for unlimited size` 2016-11-17 23:14:44 +00:00
Dennis Gilmore 6c89f86c53 Merge #466 `pungi: Include noarch debuginfo` 2016-11-17 23:14:03 +00:00
Colin Walters 7bcbe30fd2 Expose lorax's --rootfs-size argument
This is going to be necessary for reworking the Atomic Host ISO,
see: https://pagure.io/fedora-lorax-templates/pull-request/6

Signed-off-by: Colin Walters <walters@verbum.org>
2016-11-17 10:17:39 -05:00
Lubomír Sedlář deb8623bd1 pungi: Include noarch debuginfo
The check for arch compatibility should not be performed if the
debuginfo package is noarch. Such packages should be included
unconditionally.

Fixes: #450
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-16 14:50:03 +01:00
Lubomír Sedlář 6203541ac6 media-split: Print sensible message for unlimited size
If the media is bootable, we can not split it. The limit is not used in
that case and we may overflow it with an warning message. The warning
should correctly mention what is going on instead of printing a
non-sensical message about free space on media being some huge number.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-16 14:49:46 +01:00
Lubomír Sedlář b7813d34ac pungi: Fix incorrectly skipped tests
The test was not correctly being skipped in Koji build, causing build
failure.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-16 09:43:19 +01:00
Lubomír Sedlář 3c1e2fba66 pungi: Fix tests on non-x86_64 arches
If the test did not specify an arch explicitly, it fell back on whatever
arch the current machine has. This was causing failures when building
RPM.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-11-16 09:20:10 +01:00
Dennis Gilmore 69d949aaf9 Merge #463 `[ostree] Allow extra repos to get packages for composing OSTree repository` 2016-11-15 21:06:05 +00:00
Dennis Gilmore 3953914bd1 Merge #461 `extra-files: Nice error message on missing RPM` 2016-11-15 21:01:42 +00:00
Dennis Gilmore d4a78a1553 Merge #459 `Fix building images and live media for addons` 2016-11-15 21:00:50 +00:00
Dennis Gilmore 5dc8132fa4 Merge #456 `Add tests for dependency solving` 2016-11-15 20:58:40 +00:00