Commit Graph

484 Commits

Author SHA1 Message Date
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
Lubomír Sedlář 91119d7d17 [live-media] Add check for live_media_version option
It was used, but the type was not validated.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 18:11:29 +02:00
Lubomír Sedlář 2abf9511c9 [scm-wrapper] Remove unused method
It should have raised NotImplementedError, but we better remove it
altogher since we are missing export_dir anyway.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 29a2b45fb4 [scm-wrapper] Report when file wrapper did not match anything
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 3ac7148b38 [scm-wrapper] Use context manager for managing temp dir
This is a sure way to have it removed, without having to duplicate the
logic in all places where it is used.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 6daf43f72e [scm-wrapper] Reduce code duplication in RPM wrapper
The logic for expanding the list of patterns into a list of actual RPM
paths was duplicated for both exporting a directory and file.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 770ca9c202 [scm-wrapper] Copy files directly
Instead of spawning `cp x/* y` there is now Python code to the same
thing. This should help with debugging if something fails as the
traceback will be more informative (rather than saying a command
failed). As another benefit the tests get much simpler.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 5d14304dd1 [scm-wrapper] Reduce code duplication
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 46ab1cb6f6 [ostree] Set each repo to point to current compose
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-15 08:17:40 +02:00
Lubomír Sedlář e6079e4c85 [ostree-installer] Drop filename setting
This should just use the global default format. Other phases don't have
their own setting either.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-14 14:45:36 +02:00
Lubomír Sedlář 18b6020ac5 Improve logging of failable deliverables
The pungi.global.log should show subvariant for each failed deliverable
(if available). When the compose finishes, there is a new log file in
logs/global/deliverables.json containing details about all deliverables
as triples of (variant, arch, subvariant).

 * `required` lists all deliverables that can not fail
 * `attempted` lists all failable deliverables that were started
 * `failed` is a subset of `attempted` and only contains deliverables
   that failed

If the compose fails, the lists may be incomplete.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-13 13:45:30 +02:00
Lubomír Sedlář ad32b73918 [ostree-installer] Install ostree in runroot
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-12 12:47:02 +02:00
Lubomír Sedlář 31d922692f [pkgset] Print more detailed logs when rpm is not found
Fixes: #265
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-11 15:34:52 +02:00
Lubomír Sedlář a696eb4f3a [ostree-installer] Clone repo with templates
We can't assume the templates will just be available. This patch adds a
configuration option to point to the git repo with them. It will be
cloned at compose box and relative paths to templates will be made
absolute respective to this clone.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-11 10:25:10 +02:00
Lubomír Sedlář f17b5e13ad [ostree-installer] Copy all lorax outputs
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-08 12:48:42 +02:00
Lubomír Sedlář 1bf4bec32c [ostree] Log to stdout as well
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-08 11:37:16 +02:00
Lubomír Sedlář 8799d4cd85 [ostree-installer] Use separate directory for logs
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-08 11:36:06 +02:00
Dennis Gilmore 09222a87a0 Merge #260 `Maybe fix ostree?` 2016-04-08 09:26:11 +00:00
Lubomír Sedlář 81d84a030b [ostree-installer] Put lorax output into work dir
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-08 09:40:41 +02:00
Lubomír Sedlář e705cdd165 [ostree] Move cloning repo back to compose box
and pass absolute path to the config into runroot. This could avoid the
problem of not being able to clone the repo in runroot.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-07 15:28:15 +02:00
Lubomír Sedlář b7948f2d65 [ostree] Mount ostree directory in koji
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-07 14:04:50 +02:00
Dennis Gilmore 5f12c8c9ce Merge #257 `[ostree] Enable marking ostree phase as failable` 2016-04-06 18:36:31 +00:00
Lubomír Sedlář ed12a64a84 [ostree] Enable marking ostree phase as failable
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-06 16:12:29 +02:00
Lubomír Sedlář 7516fbd690 [koji-wrapper] Initialize wrappers sequentially
When multiple threads call `get_profile_module` at the same time, some
of them may get an exception from koji. This should prevent the problem.

Fixes: #253
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-06 15:54:58 +02:00
Lubomír Sedlář 3e1a6edecc [createiso] Simplify code, test phase
A couple arguments passed from phase to worker threads were not
duplicated. Only one copy is passed now.

A test case was added both for the phase itself and for worker thread as
well.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-06 13:25:49 +02:00
Lubomír Sedlář df400002d8 [createiso] Move runroot work to separate script
Instead of running a long command line in the runroot (or locally), move
all that work into a separate script that will be installed. This means
chroot will need to install pungi.

Everything should work as it did before. The only exception to this is
that there is logic to find lorax templates instead of harcoding the
location. This is done using a separate script.

Related: #230
Fixes: #231
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-06 13:25:49 +02:00
Lubomír Sedlář 5b1b6c1c4f [ostree] Use explicit work directory
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-05 12:46:59 +02:00
Lubomír Sedlář 96e7ddd3ea [ostree] Rename atomic to ostree
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-05 09:14:00 +02:00
Lubomír Sedlář ad87ea2d28 [ostree] Move cloning config repo to chroot
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-05 09:13:55 +02:00
Lubomír Sedlář 5ff2d9f957 [ostree] Fix call to kobo.shortcuts.run
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-04 15:39:38 +02:00
Lubomír Sedlář 2ddaea5387 [atomic] Stop creating the os directory
The output directory for Lorax can not exist beforehand, or the process
will fail.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-04 15:39:38 +02:00
Lubomír Sedlář 1ebb9d1773 [checksum] Add arch to file name
This allows the checksum file to include the architecture.

Fixes: #243
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-04 09:38:48 +02:00
Dennis Gilmore 428af17cb1 Merge #242 `Fix wrong file permissions` 2016-04-01 13:19:04 +00:00
Lubomír Sedlář 620cecc409 [variants] Stop printing stuff to stderr unconditionally
Instead of looking for the DTD at module load time do it only when
required. Use a logger (if supplied) to print the warning.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-01 09:25:08 +02:00
Lubomír Sedlář e5f37016e0 Fix atomic/ostree config validations
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-01 07:42:49 +02:00
Lubomír Sedlář c5c2261489 [pungi-wrapper] Remove duplicated code
This is almost exact duplicate of util.makedirs. One copy should be
enough.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-31 10:10:18 +02:00
Lubomír Sedlář 490514e263 [checks] Add a check for too restrictive umask
If umask is set to something too high (>0022), a warning will be
printed. It does not abort the compose though.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-31 10:10:18 +02:00
Lubomír Sedlář 69316d827a [util] Remove umask manipulation from makedirs
This causes a race condition: umask is process-wide setting, so any file
created by another thread while the umask is set to 0 will have wrong
permissions. This also removes the possible problem of not resetting the
umask if exception is raised.

Fixes: #239
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-31 10:10:10 +02:00
Dennis Gilmore 4ec8ad5de8 Merge #240 `Filter variants and architectures` 2016-03-29 15:36:49 +00:00
Lubomír Sedlář d383e6c5c0 Filter variants and architectures
There already were config options tree_arches and tree_variants, but the
filtering was done at the compose level and there was not interaction
between the two options. This led to problems when a variant would have
all its arches filtered out.

This patch moves the filtering to the variant loader. It adds better
logging, so whenever a variant is filtered (for any reason), it will be
explicitly stated in the logs.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-29 16:15:30 +02:00
Lubomír Sedlář 98f7ef739e Refactor checking for failable deliverables
This uses a new common function that will ensure consistent logging
without duplicating the functionality all over the place.

A couple tests are updated to verify that correct data is logged.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-24 10:12:20 +01:00
Lubomír Sedlář bb0267bc7c [buildinstall] Do not crash on failure
When the koji tasks fails but produces some output (e.g. .discinfo),
copying the artifacts would crash the compose. That should not happen if
the variant/arch is marked as failable.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-24 09:17:38 +01:00
Lubomír Sedlář 8d224b206b [atomic] Add atomic_installer phase
This phase runs lorax with extra templates in Koji runroot task, links
the boot.iso to proper location in compose directory and adds the
installer iso to image manifest. This phase runs concurrently with live
media etc.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-23 12:00:06 +01:00
Lubomír Sedlář 536c6c85b7 [ostree] Add ostree phase
This phase runs the script to make ostree repository in koji runroot
task. It runs right after regular yum repos are created.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-23 10:58:35 +01:00
Lubomír Sedlář 282058dafe [atomic] Add a script to create ostree repo
This is a wrapper over ostree and rpm-ostree. It is intended to be run
in either Koji or Mock chroot.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-23 10:28:08 +01:00
Dennis Gilmore 6230b0ff3e Merge #232 `Improve logging by adding subvariants` 2016-03-22 14:15:26 +00:00
Lubomír Sedlář ecbf08c6f8 Add compose type to release for images
Move getting of the precomputed value to a single place in Compose
class. The value now has format `date[.type_suffix].respin`.

Resolves: rhbz#1319924
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-22 08:57:40 +01:00
Lubomír Sedlář 1a1cfc65ce [image-build] Add traceback on failure
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-17 10:21:21 +01:00
Lubomír Sedlář ea7f98ef4e [image-build] Use subvariants in logging output
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-17 10:19:28 +01:00
Lubomír Sedlář f1974d3f03 [live-media] Use subvariants in logging
Print the subvariant together with variant UID and arches. This should
make the global log easier to understand.

The output of koji command should now be split into multiple files in
logs/{arch}/livemedia-{variant}-{subvariant}.{arch}.log instead of
having them all in one file.

The tests were updated to use more sensible value for the subvariant
field.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-17 09:04:50 +01:00
Lubomír Sedlář 4afd21952c Add tracebacks to all failable phases
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-16 18:47:12 +01:00
Peter Robinson c4baf51b98 ppc no longer needs magic bits in the iso
Signed-off-by: Peter Robinson <pbrobinson@fedoraproject.org>
2016-03-16 17:22:55 +00:00
Lubomír Sedlář 0759c7fb48 [buildinstall] Add more debugging output
When it fails, a traceback will be printed.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-16 18:16:24 +01:00
Lubomír Sedlář f5897eccbb [metadata] Stop crashing on empty path from .treeinfo
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-16 15:24:37 +01:00
Lubomír Sedlář aab22b6f9f [checksums] Add label to file name
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-16 08:49:44 +01:00
Lubomír Sedlář aa38eb1fd7 [buildinstall] Use customized dvd disc type
This should generate the same volume id in buildinstall and createiso
phases, with isolinux.cfg being consistent as well.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-14 08:20:43 +01:00
Adam Williamson c321bca8ef image_build: fix subvariant handling
Dennis added a 'subvariant' property to the Docker image config,
but we weren't using it, we were just hard-coding the variant
as the subvariant...and doing it wrong, as well, using the
variant object rather than its uid property.

This fixes both problems: we'll now use the explicitly set
image config 'subvariant' property if there is one, otherwise
we use the variant.uid as the subvariant.

Note this is a high priority fix, as it broke F24 compose today.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2016-03-13 09:18:08 -07:00
Lubomír Sedlář be8605ac91 Remove check for disc type
This will get validated in productmd anyway, no need to duplicate the
check in Pungi itself.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-11 08:55:21 +01:00
Adam Williamson 254bfb8ca4 add 'subvariant' image property, create live/appliance names
This adds the new 'subvariant' property to all images produced by Pungi.
For most image types this is the same as the variant, for now. For
live_images and livemedia_phase, the image config may specify
'subvariant' and the value will be used if present, otherwise the
variant name will be used.

We also now synthesize the Koji image 'name' for live and appliance
images if the image config doesn't specify it, and use a name that
complies better with the naming policy for ARM disk images (partially
resolving https://pagure.io/pungi-fedora/issue/7 ).

This is completely untested as yet, just bashing stuff out on a Sunday,
will work more on it tomorrow.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2016-03-10 16:59:34 -06:00
Lubomír Sedlář 2fd117367e Simplify koji pkgset
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 19:13:51 +01:00
Lubomír Sedlář 07f5da5d4f [checks] Fix tests to never use real real arch
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 18:54:14 +01:00
Lubomír Sedlář 619e5323d6 [init] Iterate over arches just once
We can create the repos in one loop together with writing the comps
files.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 15:30:05 +01:00
Lubomír Sedlář 1efd4a9873 [init] Remove duplicated checks for comps
Check once before iterating through the variants. This greatly
simplifies the tests as each function now has one less code path.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 15:30:05 +01:00
Lubomír Sedlář 1c84dc6ea0 [init] Break long lines
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 15:30:03 +01:00
Lubomír Sedlář 41cdf54c05 [init] Don't overwrite the same log file
When creating the comps repo, use a separate log file for each variant
instead of overwriting the same global file again and again.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 15:29:40 +01:00
Lubomír Sedlář 2ca002d602 [init] Add config option for keeping original comps
The configuration can specify a list of variants for which the original
comps file will be copied without any modification.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 15:22:21 +01:00
Lubomír Sedlář 19468dda77 [checks] Reduce code duplication
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 12:35:08 +01:00
Lubomír Sedlář 0f3bfbbddf [checks] Relax check for genisoimage
The rules are similar to isohybrid, but there are no checks for
architecture.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 11:23:45 +01:00
Lubomír Sedlář d8f685000d [checks] Remove duplicate msgfmt line
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 11:20:10 +01:00
Lubomír Sedlář 2d9dd0e535 [checks] Relax check for isohybrid command
It is used only in createiso and productimg phases.

For productimg, it needs to be present only when the compose is bootable
and productimg phase is explicitly enabled.

For createiso, it is only needed if runroot is not enabled.

Additionally, if we detect pungi running on arch for which syslinux is
not available, a warning is printed, but the compose is allowed to
continue (and possibly crash later).

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 11:20:10 +01:00
Lubomír Sedlář 337d2a999c [checks] Don't always require jigdo
If the configuration specifically requests no jigdos, there is no point
in checking for the binary existence.

This is not 100% reliable. The jigdo option defaults to True, so if the
option is not specified the binary is required even if there are no
images configured.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 09:08:19 +01:00
Lubomír Sedlář d909adf26c [pkgset] Respect inherit setting
It's logged, but not really used...

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-09 19:23:37 +01:00
Lubomír Sedlář 7e2cd28fb8 [live-media] Support release set to None globally
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-09 13:08:22 +01:00
Dennis Gilmore 0e7ea91d9d Merge #206 `Add option to customize disc type` 2016-03-08 13:40:43 +00:00
Dennis Gilmore 182c39669d Merge #204 `[paths] Document and test translate_path` 2016-03-08 13:38:53 +00:00
Dennis Gilmore f898c7ca7d Merge #203 `Simplify common live media options ` 2016-03-08 13:38:39 +00:00
Lubomír Sedlář 72f9819779 [createiso] Add customizing disc type
Relates: #105
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-08 13:04:34 +01:00
Lubomír Sedlář 44d7b31a80 [live-images] Add customizing disc type
Relates: #105
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-08 13:04:34 +01:00
Lubomír Sedlář 0c9ad96a31 [buildinstall] Add customizing disc type
This patch adds configuration option to change disc type used in file
name. So far this can only be changed for link to images/boot.iso.

Resolves: #109
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-08 13:04:28 +01:00
Lubomír Sedlář ad104f994a [buildinstall] Rename method to not mention symlinks
It is either hardlinking or copying, so the name is quite misleading.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-08 11:26:14 +01:00
Lubomír Sedlář 8e20f216f1 [paths] Document and test translate_path
The documentation was inaccurate.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-07 15:18:57 +01:00
Lubomír Sedlář 27375788c2 [createrepo] Compute delta RPMS against old compose
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-07 14:49:17 +01:00
Lubomír Sedlář 19c3707aee [util] Add function to search for old composes
This was already implemented as part of pkgset phase. It is now moved to
the util module and covered with tests.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-07 14:49:17 +01:00
Lubomír Sedlář 86bb816417 [live-media] Add global settings
These can be overriden for a particular image, but in general case they
can simplify the config.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-04 08:15:25 +01:00
Dennis Gilmore f202d24961 Limit the variants with config option 'tree_variants'
'tree_variants' in configuration should be able to limit the tree
variants, just like the config option 'tree_arches' which is used to
limited the arches.

For example, if there is configuration (refer to doc/configuration.rst)
go with:

        tree_variants = ["Server"]

then only "Server" variants will be composed, and any other variants in
variants.xml will be ignored.

Signed-off-by: Qixiang Wan <qwan@redhat.com>

Rebased on master

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2016-03-03 13:00:52 -06:00
Lubomír Sedlář 9aed3364a6 [createrepo] Refactor code
This patch tries to simplify the code by:

 * breaking up too long lines
 * simplifying the loop to start createrepo jobs
 * removing duplication
 * general clean up

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-02 16:11:25 +01:00
Lubomír Sedlář 055b5e431b [paths] Use variant.uid explicitly
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-02 16:11:25 +01:00
Lubomír Sedlář 6ae48e2bf5 [createrepo-wrapper] Refactor code
Simplify the code a bit by removing conditions that don't help in any
way: executing a loop zero times is the same as not executing it at all.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-02 16:11:25 +01:00
Lubomír Sedlář d619f14dbf [createrepo-wrapper] Fix --deltas argument
There is no value, the flag is there or it is not there.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-02 16:11:25 +01:00
Lubomír Sedlář a813e926dc [koji-wrapper] Retry watching on connection errors
With this patch Pungi should be more tolerant of network failures when
running a blocking command (creating live media or live images).

If the connection drops and the output indicates network problems, Pungi
will try to watch the task with `koji watch-task`. This will be retried
until it finishes (successfully or with some other failure). There is an
increasing timeout after each retry. Currently the maximum number of
retries is not limited.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-02 14:01:17 +01:00
Lubomír Sedlář 44c4ef5c41 [testphase] Don't run repoclosure for empty variants
As a side effect, the non-existing repositories are no longer passed to
global repoclosure.

Fixes: #196
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-01 12:44:07 +01:00
Lubomír Sedlář 4a4ef23e3c [image-build] Fix resolving git urls
After config was modified to work with sections, the resolving broke.
This patch fixes it and adds a test to catch this problem in the future.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-29 08:23:26 +01:00
Lubomír Sedlář 73a560d63c [live-images] No manifest for appliances
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-26 19:48:52 +01:00
Dennis Gilmore e6596d818c Merge #190 `[live-images] Rename log file` 2016-02-26 13:54:01 +00:00
Dennis Gilmore 8670452b6b Merge #189 `[buildinstall] Use -dvd- in volume ids instead of -boot-` 2016-02-26 13:53:43 +00:00
Lubomír Sedlář abb27ac7d7 [live-images] Rename log file
The log file started with createiso-, which is utterly confusing. With
this patch, the logs are named with liveimage- prefix.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-26 12:05:58 +01:00
Lubomír Sedlář 452da86649 [buildinstall] Use -dvd- in volume ids instead of -boot-
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-26 11:42:41 +01:00
Lubomír Sedlář 636ac79186 [buildinstall] Hardlink boot isos
Instead of creating a symlink, try to hardlink the image, and copy it if
hardlinking fails.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-26 10:58:03 +01:00
Lubomír Sedlář 60d820d4fd [util] Resolve branches in git urls
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-25 08:39:01 +01:00
Lubomír Sedlář 6e8970e648 [live-images] Fix crash when repo_from is not a list
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-24 19:33:28 +01:00
Lubomír Sedlář 98a9e02b1b [buildinstall] Don't copy files for empty variants
They are not there in the first place.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-24 07:31:13 +01:00
Lubomír Sedlář ca7c78d98c [live-images] Set type to raw-xz for appliances
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-23 09:41:03 +01:00
Lubomír Sedlář 456fbb8812 [live-images] Correctly create format
Extracting extensions from the file name is not reliable as there is no
way to determine where extensions start. There can very well be a
version.release separated by dot. To bypass this, just use hardcoded
list of possible formats.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-23 09:35:50 +01:00
Lubomír Sedlář 90954ddf0e [tests] Use real paths module in testing
This avoids problems of mock paths having different API that the real
ones.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 19:11:04 +01:00
Lubomír Sedlář 75b57ac25a [live-images] Create image dir if needed
We can't copy an image to a non-existing directory.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 18:59:31 +01:00
Lubomír Sedlář 7734ddf57e [live-images] Add images to manifest
The type is either "live" or "appliance", the format is set based on
filename extension.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 14:27:51 +01:00
Lubomír Sedlář f80c97e3ec [live-images] Fix path processing
* Add option to keep filenames generated by Koji.
 * Put results of spin-appliance into image dir
 * On failure images are no longer deleted.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 14:27:26 +01:00
Lubomír Sedlář 4a1e029c1d [live-images] Move repo calculation to separate method
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 12:27:26 +01:00
Lubomír Sedlář 9b748f752e [koji-wrapper] Fix getting results from spin-appliance
Also don't create new client proxy when one already exists.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 12:27:22 +01:00
Lubomír Sedlář ab44f3539e [live-images] Filter non-image results
Only keep results that have known extension.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 12:27:17 +01:00
Lubomír Sedlář 1044fb01f8 [live-images] Rename repos_from to repo_from
It should be consistent with live media and image build.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 08:48:12 +01:00
Lubomír Sedlář 7c81c5aa9c [live-images] Automatically populate release with date and respin
This is the same feature that is already available for image-build and
live-media.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 08:38:19 +01:00
Lubomír Sedlář ec03a8685a [live-media] Respect release set in configuration
Apparently just processing the config is not sufficient we don't pass
the value to Koji.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 08:32:27 +01:00
Lubomír Sedlář 32a966fc91 [live-images] Build all images specified in config
Not just the first one.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-22 08:21:51 +01:00
Lubomír Sedlář 8ed44dd153 [live-media] Don't create $basedir arch
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-19 09:01:45 +01:00
Dennis Gilmore b4a008f86a do not ad to image build and live tasks the variant if it is empty
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2016-02-19 08:51:03 +01:00
Dennis Gilmore 466a0eb24f when a variant is empty do not add it to the repolist for livemedia
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2016-02-19 08:47:05 +01:00
Lubomír Sedlář 1b6688d22c [buildinstall] Don't run lorax for empty variants
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-18 16:12:44 +01:00
Lubomír Sedlář 71369c7690 Merge #159 `use $basearch not $arch in livemedia tasks` 2016-02-18 13:56:15 +00:00
Lubomír Sedlář 921664c3b5 Merge #158 `do not uses pipes.quotes in livemedia tasks` 2016-02-18 13:55:14 +00:00
Tomas Mlcoch 5bffca5037 Support signing of rpm wrapped live images
With this patch, you can specify a command for
signing of koji builds. For example:

    signing_key_password_file = '~/file_with_password_for_key_fedora-24'
    signing_key_id = '81b46521'
    signing_command = '~/git/releng/scripts/sigulsign_unsigned.py -vv --password=%(signing_key_password)s fedora-24'

'signing_key_password_file' is a path to a file which contains
a password that will be formatted into 'signing_command' string
via '%(signing_key_password)s' string format syntax (if used).
Because pungi config is usualy stored in git and part of compose
logs we don't want password to be included directly in the config.
Note: If '-' is used instead of a filename, then you will be asked
for the password interactivelly right after pungi starts.

'signing_key_id' is ID of the key that will be used for the signing.
This ID will be used when crafting koji paths to signed files
(kojipkgs.fedoraproject.org/packages/NAME/VER/REL/data/signed/KEYID/..).

'signing_command' a command that will be run with a build as a single
argument. This command mustn't require any user interaction.
If you need to pass a password for a signing key to the command,
do this via command line option of the command with use of string
formatting syntax '%(signing_key_password)s' (see details
about 'signing_key_password_file').

Signed-off-by: Tomáš Mlčoch <tmlcoch@redhat.com>
2016-02-18 13:36:38 +01:00
Tomas Mlcoch be4d596c36 Fix terminology - Koji uses sigkey not level
Signed-off-by: Tomáš Mlčoch <tmlcoch@redhat.com>
2016-02-18 13:35:27 +01:00
Dennis Gilmore 1616de1e1e use $basearch not $arch in livemedia tasks
koji for livemedia acts different to image builds and does
not translate $arch to x86_64, i386, etc so we need to just pass
in $basearch so that yum/dnf will translate it for us

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2016-02-17 17:03:46 -06:00
Dennis Gilmore 2858b1aa54 do not uses pipes.quotes in livemedia tasks
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2016-02-17 14:39:51 -06:00
Lubomír Sedlář bf5196af4a [live-images] Don't tweak kickstarts
Instead of downloading the kickstart file in Pungi and modifying it,
just pass it to Koji.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-17 14:35:28 +01:00
Lubomír Sedlář 454363fba8 Allow specifying empty variants
The variants.xml file can list a variant with is_empty="true" and no
groups. If such variant is found, not package gathering will be run for
it, and no repos will be created.

This only makes sense for a variant that will have some other
deliverables like live media or images.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-16 15:08:15 +01:00
Lubomír Sedlář adbc772fd0 [createrepo] Remove dead assignments
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-16 15:08:15 +01:00
Lubomír Sedlář 826afdc162 Keep empty query string in resolved git url
Pagure: #152
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-16 10:42:59 +01:00
Lubomír Sedlář 284d3a3510 [image-build] Use dashes as arch separator in log
Since multiple images are created in a single Koji task, the path to log
file contains a list of arches. These used to be separated with comma.
For consistency with live-media they are now separated by dashes.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-15 09:04:03 +01:00
Lubomír Sedlář abcc51fb85 [buildinstall] Stop parsing task_id
KojiWrapper returns the task id as an integer already (if at all). There
is no need to parse it again.

Pagure: #148
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-12 12:39:50 +01:00
Lubomír Sedlář e1895bff26 [koji-wrapper] Get task id from failed runroot
Even when runroot task fails, it can emit task_id.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-12 12:38:45 +01:00
Lubomír Sedlář 93015d679c [live-media] Pass ksurl to koji
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 17:09:30 +01:00
Dennis Gilmore 96489a1e78 Merge #146 `[live-media] Properly calculate iso dir` 2016-02-11 13:07:30 +00:00
Lubomír Sedlář 8ef2e7e308 [live-media] Properly calculate iso dir
The method expects to be called with a arch, not just variant.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 13:58:42 +01:00
Lubomír Sedlář e9a42ad54f [image-build] Fix tests
This patch updates tests so that they pass, and fixes a couple places in
image build that did not work correctly with the nested configuration.
The documentation is reformatted so that it horizontal scrolling is less
likely.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 13:22:26 +01:00
Lubos Kocman f067f38df0 add image-build sections
allows to use factory-parameters ...

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
2016-02-11 13:22:16 +01:00
Lubomír Sedlář 5138a9b6e6 [live-images] Add support for spin-appliance
The config can specify type=appliance so that koji uses spin-appliance
instead of spin-livecd.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 12:08:48 +01:00
Lubomír Sedlář ac29bf05ee [live-media] Koji option is ksfile, not kickstart
In config, it is still called kickstart to be consistent with how
image-build calls it.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 10:40:04 +01:00
Lubomír Sedlář 6ec151cde2 [live-media] Use install tree from another variant
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 10:24:12 +01:00
Lubomír Sedlář 0c4bd42f80 [live-media] Put images into iso dir
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 10:11:38 +01:00
Lubomír Sedlář 91faa0fafe [image-build] Koji expects arches as a comma separated string
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-11 07:50:02 +01:00
Dennis Gilmore 8bf1b09641 Merge #139 `Log more details when any deliverable fails` 2016-02-10 21:03:32 +00:00
Lubomír Sedlář b35264cfba [live-media] Version is required argument
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-10 18:29:29 +01:00
Lubomír Sedlář aec57dc72b [koji-wrapper] Only parse output on success
If Koji fails runroot task for some reason, the output will most likely
not have the required format and will crash Pungi.

Pagure: #140
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-10 09:08:21 +01:00
Lubomír Sedlář 8e5e893e5c [koji-wrapper] Add tests for runroot wrapper
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-08 13:27:18 +01:00
Lubomír Sedlář f57665f963 [buildinstall] Improve logging
This patch fixes how logs are stored if lorax is used as buildinstall
method. The logs for each variant are in a separate file now. If failure
is allowed, the global log will now show why it failed.

A couple tests are added as well.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-08 13:17:08 +01:00
Lubomír Sedlář d661de3e73 Log more details about failed deliverable
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-08 12:07:04 +01:00