Commit Graph

19 Commits

Author SHA1 Message Date
Marcus Schäfer
d102c6af8d
Allow to configure .changes creation and bundling
Provide config option has_package_changes in the runtime config
file and set a useful default. For building outside obs the
default for the .changes creation is switched on, for building
in obs it's switched off because obs creates its own info file
2020-10-02 11:18:55 +02:00
Marcus Schäfer
bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02:00
David Cassany
3df6bb5ce1
Refactor patch_open use in builder's tests
This commit removes the use of @patch_open decorator
in favor of directly patching 'builtins.open' and use
mock.mock_open utility to mock the context manager.

Related to #1128
2019-10-07 16:49:58 +02:00
Marcus Schäfer
f8bc05fd42
Refactor use of raises in unit tests
Use raises as context manager instead of a method decorator.
This clearly identifies which code part is expected to raise
an exception. Related to Issue #1128
2019-09-29 19:42:43 +02:00
Dan Čermák
b015b91679
Stop inheriting from object
This is no longer required in Python3
2019-08-22 15:43:27 +02:00
Dan Čermák
9551402d22
Fix test breakage when /etc/kiwi.yml is present
The unit test for the RuntimeConfig class are also testing the default values in
some functions. To work around a possibly existing ~/.config/kiwi/config.yml,
several functions change the value of HOME. This is unfortunately not
sufficient if a /etc/kiwi.yml exists, as that one is taken as a fallback *if*
~/.config/kiwi/config.yml isn't present.

This issue is fixed by creating a default_runtime_config with os.path.exists
patched to return False. Thereby none of the runtime configuration files will be
taken into account.
2019-07-04 15:05:01 +02:00
Dan Čermák
c4f34cbdce
Use yaml.safe_load instead of yaml.load
yaml.load is relatively dangerous when the loaded data comes from untrusted
sources, as it can allow for arbitrary code execution, see:
https://pyyaml.org/wiki/PyYAMLDocumentation#LoadingYAML

safe_load limits the created python objects to the basic Python types like
integers and strings, which is all that we need for the runtime configuration
file.
2019-04-26 10:53:51 +02:00
Marcus Schäfer
4c9037e12e
Merge pull request #1041 from SUSE/disable_runtime_checks
Add the possibility to disable runtime checks
2019-04-02 17:03:36 +02:00
David Cassany
c21570ac7b
Add the possibility to disable runtime checks
This commit adds runtime configuration parameters to disable the runtime
checks. This is specially handy if someone does not want to use the kiwi
dracut modules and provide custom ones instead. In orde disable some
runtime check consider a runtime config yaml like:

runtime_checks:
    - disable:
        - check_dracut_module_for_oem_install_in_package_list
        - check_dracut_module_for_live_iso_in_package_list

This commit fixes #893
2019-04-02 16:00:03 +02:00
Marcus Schäfer
0296808e24
Update compression flag for qcow2 format
In case of a qcow2 format we store the result uncompressed
Since the format conversion only takes the real bytes into
account such that the sparseness of the raw disk will not
result in the output format and can be taken one by one
This Fixes bsc#1128146

In addition the commit includes a refactoring for the
evaluation of the compress flag in the runtime config.
Instead of the global overwrite, the flag gets evaluated
individually at the time the result metadata is created
2019-04-02 11:24:35 +02:00
Marcus Schäfer
dbf399a34c
Changed default value for bundler compression
If no compression is configured in the kiwi config file
the default was set to: False. However this lead to big
trouble on the obs side for images which has fixed
storage disk sizes configured, e.g Azure images which
requests 30G disk size per instance. Thus the default
for the bundler compression has changed to be: True
2019-01-31 10:28:53 +01:00
Marcus Schäfer
3346f3028f
Make result compression in the bundler optional
Calling kiwi result bundle will take the image build results
and bundle the relevant image files according to their image
type. Depending on the result configuration this could instruct
the bundler to compress one or more files from the result.
By default this compression is switched off in the bundler but
can be activated to save storage space and speedup download
of the image with the following runtime configuration:

bundle:
  - compress: true|false

If compression is activated the result image has to be
uncompressed before it can be used. This Fixes #901
2019-01-10 16:13:02 +01:00
Marcus Schäfer
e51b91cb38
Added OCI tooling interface class
An initiative to formulate industry standards around container
formats and runtime is available at https://www.opencontainers.org
Different tools to implement the specifications had been
created. The purpose of this class and its sub-classes is
to provide a common interface in kiwi to allow using all
tools such that the container support in kiwi covers every
linux distribution no matter what tooling was preferred.
Related to Issue #859
2018-10-30 09:35:58 +01:00
Marcus Schäfer
f278e8fe57
Added support for system wide config file
If there is no user specific config file we are also
looking for a system wide /etc/kiwi.yml file
2018-08-08 18:13:00 +02:00
Marcus Schäfer
e97629ba47
Make container compression a configuration option
Change the ContainerBuilder class to evaluate on the
configuration options to decide if the container archive
should be compressed or not. By default the archive will
be compressed, thus there is no change to the former behavior
but can be setup in ~/.config/kiwi/config.yml as follows:

container:
  - compress: none|xz

This Fixes #725
2018-05-15 11:18:22 +02:00
Marcus Schäfer
73fb397717
Allow to configure iso tool category
Switch to xorriso by default but allow to setup cdrtools
in the runtime configuration file
2018-03-22 11:18:54 +01:00
Marcus Schäfer
dee0a5af7f Refactor handling of obs repositories
* Delete kiwi internal ibs: and suse: types
* Delete handling for --obs-repo-internal and provide a
  compatibility message to the user
* Buildservice download server url and scope can be configured
  via ~/.config/kiwi/config.yml
* Translate obs urls to http in import_repositories_marked_as_imageinclude
* Use new Uri.is_public method in renamed runtime check
  check_image_include_repos_publicly_resolvable
2017-07-05 16:07:29 +02:00
Marcus Schäfer
403f034620
Make sure options are returned as list 2017-06-19 10:31:06 +02:00
Marcus Schäfer
6517d3b568 Added RuntimeConfig class
An instance of RuntimeConfig reads in ~/.config/kiwi/config.yml
if present and provides access methods to the expected
information of the config file
2017-06-14 18:13:50 +02:00