Commit Graph

71 Commits

Author SHA1 Message Date
Lubomír Sedlář d6dc269ef4 Remove FSF address from comments
The address is no longer correct. We can just as well simply point to
the web page describing the license.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-09-23 10:26:43 +02:00
Lubomír Sedlář 6fede3f395 variants: Allow multiple explicit optional variants
When a variant has optional, it is possible to explictly list it in the
XML file and add extra groups. However, the original DTD did not allow
multiple variants with `id="optional"` as `id` attribute has to be
globally unique. This patch changes its type to `CDATA`, which has less
restrictions. This also means we can no longer define `<ref>` as
`IDREF` and instead check the existence of referenced variant in parser.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-09-19 12:21:19 +02:00
Lubomír Sedlář bf46048cbf createrepo: Add option to use xz compression
This patch adds a new config option createrepo_use_xz, which when set to
true will cause createrepo to compress sqlite databases with xz. The
default setting is False.

Fixes: #387
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-09-12 11:10:43 +02:00
Jeremy Cline ee1ee0467b extra-files: Write a metadata file enumerating extra files
Introduces a new metadata file to track arbitrary files added during the
extra-files phase. This file is placed in the root of each tree and is
called ``extra_files.json``. It is a JSON file containing a single
object, which contains a "header" key with an object describing the
metadata, and a "data" key, which is an array of objects, where each
object represents a file. Each object contains the "file", "checksums",
and "size" keys. "file" is the relative path from the tree root to the
extra file. "checksums" is an object containing one or more checksums,
where the key is the digest type and the value of that key is the hex
digest. Finally, the size is the size of the file in bytes.

For example:
{
  "header": {"version": "1.0},
  "data": [
    {
      "file": "GPL",
      "checksums": {
        "sha256": "8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643"
      },
      "size": 18092
    },
    {
      "file": "release-notes/notes.html",
      "checksums": {
        "sha256": "82b1ba8db522aadf101dca6404235fba179e559b95ea24ff39ee1e5d9a53bdcb"
      },
      "size": 1120
    }
  ]
}

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
Fixes: #295
2016-09-07 13:02:48 +02:00
Lubomír Sedlář e1ab519542 [scm] Add logging for exporting local files
This will avoid confusion when the file can not be found, but previous
export from remote location worked well. In such case the log said:

    Exporting from SCM...
    Boom, no files found...

This commit changes it into:

    Exporting from SCM...
    Exporting file from current working dir...
    Boom, no files found...

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-23 08:07:23 +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
Daniel Mach f0aecf6744 Add support for top-level variant IDs with dashes.
This is for layered products that have a variant mapped
to multiple variants in a base product, for example:
 * Foo-Tools (id: FooTools, uid: Foo-Tools, name: Tools)
 * Bar-Tools (id: BarTools, uid: Bar-Tools, name: Tools)

Requires productmd >= 1.2.

Signed-off-by: Daniel Mach <dmach@redhat.com>
2016-06-02 10:16:16 -04: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
Dennis Gilmore 8615c96624 Merge #280 `[createrepo] Use more verbose output` 2016-04-29 12:26:15 +00:00
Dennis Gilmore 5c4d3a5196 [createiso] Add back running isohybrid on x86 disk images
rhbz#1331317 when we refactored how we make dvds in
df400002d8 we lost the ability to boot
the dvd as a disk image.

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2016-04-29 09:00:44 +02:00
Lubomír Sedlář 4da77c5e5d [createrepo] Use more verbose output
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-27 18:35:43 +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ář 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
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ář 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ář 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ář 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
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ář 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ář 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ář 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ář 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ář 921664c3b5 Merge #158 `do not uses pipes.quotes in livemedia tasks` 2016-02-18 13:55:14 +00: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 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ář 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
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ář 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ář a5a0f3d69f [koji-wrapper] Add support for spin-livemedia
This patch adds support for live media creator in Koji. The intended
workflow is to create a command , run it and finally collect built
artifacts.

    get_live_media_cmd()
    run_blocking_cmd()
    get_image_paths()

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-01-29 09:02:02 +01:00
Lubomír Sedlář ae30c07553 [koji-wrapper] Use more descriptive method names
The methods mentioning image build are generic and can work for other
task types.

get_image_build_paths -> get_image_paths
run_create_image_cmd -> run_blocking_cmd

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-01-29 09:02:02 +01:00
Lubomír Sedlář 6e0f6ee73e Enable identifying variants in exception traces
When pungi crashes, the logs will often contain useless description of
a variant. With this patch, the traceback will have details on the
variant.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-01-15 08:41:08 +01:00
Lubos Kocman 7ec409a236 scm.py: use git clone instead git archive for http(s)://
Signed-off-by: Lubos Kocman <lkocman@redhat.com>
2016-01-14 06:42:57 -05:00
Lubomír Sedlář 9c1418eb0a [image-build] Use single koji task per variant
Given a list of arches, koji can build multiple images in one go
(automatically starting children tasks for each one).

This causes a bunch of changes:
 * The configuration no longer allows changing config based on
   architecture, only variants are allowed. It is however possible to
   filter which arches are used for the building in the variant.
 * The configuration files for koji image-build are stored in
   work/image-build/$variant (not split based on arch).

This patch also changes the option name that is passed to koji
image-build: the repos should be specified under key `repo` (without the
trailing slash).

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-01-08 14:33:54 +01:00
Dennis Gilmore 10a90f97b4 Merge #75 `Start of development guide` 2015-12-08 17:41:00 +00:00
Lubomír Sedlář 94f519d01c Update lorax wrapper to use --installpkgs
The lorax wrapper class now understands the --installpkgs argument and
can use it to pass multiple package names to the command.

There is a simple test to make sure the commands includes all specified
options. A bug is fixed where the bug URL would not be correctly
included.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2015-12-03 15:19:12 +01:00