Commit Graph

1769 Commits

Author SHA1 Message Date
Brian C. Lane
d92f2f5b04 Check the compose templates at startup
Depsolve the packages included in the templates and report any errors
using the /api/status 'msgs' field. This should help narrow down
problems with package sources not being setup correctly.
2018-07-13 09:51:36 -07:00
Brian C. Lane
6acbb0be0e Fix a couple typos in lorax-composer docs.
The description of blueprint versions was wrong, now it is
correct.

(cherry picked from commit 9e41052992)
2018-06-29 14:16:59 -07:00
Brian C. Lane
914c33ef97 Include example blueprints in the rpm
This also sets ownership of /var/lib/lorax/composer/ to root:weldr to
allow missing directories to be created at runtime.

(cherry picked from commit f38f5cc168)
2018-06-27 16:13:39 -07:00
Brian C. Lane
b7ed511554 Make sure /run/weldr has correct ownership and permissions
Normally tmpfiles.d will handle this at boot time, but if you install
lorax-composer without rebooting it was ending up with root:root
ownership instead of root:weldr

(cherry picked from commit 7adc5162fb)
2018-06-27 16:13:39 -07:00
Brian C. Lane
841e65a397 Allow more than 1 bash build in tests
It is perfectly valid to have more than one build of a package, eg. one
in the release repo and one in the updates repo.

(cherry picked from commit 86c4ef5f45)
2018-06-21 16:19:06 -07:00
Brian C. Lane
a5ddd5e3bf Add redhat.exec to s390 .treeinfo
Resolves: rhbz#1593657
(cherry picked from commit 6d9187d559)
2018-06-21 11:22:55 -07:00
Brian C. Lane
590341f735 Retry losetup if loop_attach fails
It appears that sometimes the loop device doesn't get setup properly,
this may be a race with other users of loop devices on the system, or
some other mechanism that isn't understood.

To try and prevent total failure when this happens this patch retries
the loop setup 3 times before giving up. Previously it would wait for
the loop device to appear (checking 5 times), that operation is now
executed 3 times with a new losetup attempt each time.

Resolves: rhbz#1589084
(cherry picked from commit c746e8b0c3)
2018-06-11 14:00:42 -07:00
Brian C. Lane
de73924cd3 Add reqpart to example kickstart files
This will make sure that platform specific partitions are created when
making partitioned disk images.

(cherry picked from commit 98de565979)
2018-06-11 13:55:42 -07:00
Brian C. Lane
ec8ecba9d1 Increase default ram used with lmc and virt to 2048
1024 is a bit small in some situations, double it.

Resolves: rhbz#1538747
(cherry picked from commit 594e762d63)
2018-06-11 13:47:59 -07:00
Brian C. Lane
96e132f733 Automatic commit of package [lorax] release [28.15-1].
Created by command:

/usr/bin/tito tag
2018-06-11 11:04:32 -07:00
Martin Kolman
68e850d57a Make LogRequestHandler configurable
Make it possible to manipulate the simple and regexp
tests the LogRequestHandler class uses to check error
messages for potential error states.

This is accomplished by moving the simple and regexp test
strings to class members, where they can be easily
manipulated by users of the pylorax module.

It's also now possible to set the log request handler class
for a LogMonitor.

This functionality can then be used for example like this:

customized_log_request_handler = monitor.LogRequestHandler
customized_log_request_handler.simple_tests.remove("Call Trace:")
log_monitor = monitor.LogMonitor(install_log,
                                 timeout=opts.timeout,
                                 log_request_handler_class = customized_log_request_handler)

This way installation will continue even if there was a call
trace in the logs. In a similar way additional tests and regexps can be
also added.

(cherry picked from commit d5d3dd3be3)
2018-06-11 11:04:00 -07:00
Brian C. Lane
760d70f158 Automatic commit of package [lorax] release [28.14-1].
Created by command:

/usr/bin/tito tag
2018-06-07 09:18:26 -07:00
Brian C. Lane
e1088fe6e9 New lorax documentation - 28.14 2018-06-07 09:18:10 -07:00
Brian C. Lane
a1905c3b4b Add --dracut-arg support to lorax
Use it to override the default dracut arguments (displayed as part of
the --help output). If you want to extend the default arguments they
all need to be passed in on the cmdline as well. eg.

--dracut-arg='--xz' --dracut-arg='--install /.buildstamp' ...

Resolves: rhbz#1452220
(cherry picked from commit d8ce013a2b)
2018-06-07 09:01:42 -07:00
Brian C. Lane
b9fe90000e gevent has deprecated .wsgi, should use .pywsgi instead
https://github.com/gevent/gevent/blob/master/doc/api/gevent.wsgi.rst
(cherry picked from commit c9ca451568)
2018-06-05 16:58:25 -07:00
Brian C. Lane
fd2b5de02c Automatic commit of package [lorax] release [28.13-1].
Created by command:

/usr/bin/tito tag
2018-06-04 16:51:00 -07:00
Brian C. Lane
d272304603 New lorax documentation - 28.13 2018-06-04 16:50:39 -07:00
Brian C. Lane
d824d63b97 Override Sphinx documentation version with LORAX_VERSION
Normally you want to document the NEXT release, not the last. This
allows you to build the documentation using:

LORAX_VERSION="29.6" make docs

(cherry picked from commit d47d38e0c8)
2018-06-04 16:48:11 -07:00
Brian C. Lane
0314cbd0e8 Add support for sources to composer-cli
This adds the sources command which can be used to list, add, change,
and delete sources using the TOML formatted source file.

(cherry picked from commit 6f6ce410c0)
2018-06-04 15:48:41 -07:00
Brian C. Lane
693dc9a6f6 Fix DNF related issues with source selection
DNF Repo.dump() function cannot be used as a .repo file for dnf due to
it writing baseurl and gpgkey as a list instead of a string. Add a new
function to write this in the correct format, and limited to the fields
we use.

Add a test for the new function.

Fix /projects/source/info to return an error 400 if a nonexistant TOML
source is requested. If JSON is used the error is part of the standard
response.

Update test_server.py to check for the correct error code.

(cherry picked from commit afa89ea657)
2018-06-04 15:47:38 -07:00
Brian C. Lane
1ab33b6416 Fix handling bad source repos and add a test
When adding a source failed it wasn't being removed from the dnf object.
This fixes that, and returns an error when setting up the source fails.
Also adds a test for it.
This also includes detecting rawhide vs. non-rawhide releases and
adjusting the tests accordingly (some of the source names change).

(cherry picked from commit dd8e4d9e99)
2018-06-04 15:47:32 -07:00
Brian C. Lane
45f4d3e633 Speed up test_dnfbase.py
Calling get_base_object is no longer needed, this speeds things up by
not unnecessarily downloading metadata.

(cherry picked from commit 666d7f1e03)
2018-06-04 15:47:26 -07:00
Brian C. Lane
d9d73a128b Make sure new sources show up in the source/list output
Also remove an unneeded makedirs from test_server.py

(cherry picked from commit 1034cfd9a7)
2018-06-04 15:47:20 -07:00
Brian C. Lane
a283ec9582 Fix make_dnf_dirs
It was chopping off an extra directory level due to realpath removing
the trailing / from the paths when they are setup.

(cherry picked from commit 23f4b2a3ec)
2018-06-04 15:47:15 -07:00
Brian C. Lane
f88fbc3fca Update test_server for rawhide
The system repo is 'rawhide' and the 'fedora' and 'updates' repos are
disabled.

(cherry picked from commit 22070dcf42)
2018-06-04 15:47:08 -07:00
Brian C. Lane
8ac04a1521 Add support for user defined package sources API
This lives under /api/v0/projects/source/*

See the documentation for details

(cherry picked from commit 6d677b2207)
2018-06-04 15:47:00 -07:00
Brian C. Lane
5548f5f1c7 Automatic commit of package [lorax] release [28.12-1].
Created by command:

/usr/bin/tito tag
2018-05-24 09:13:16 -07:00
Colin Walters
e5ef195a3b templates: Stop using gconfset
We had only been indirectly pulling in GConf, and anyways
nothing was listening to these keys.

<kalev> I still think it's a fallout from 27a90d973f

Really in general, if we wanted to make changes like this
it'd probably be a lot simpler to do them on boot or so.

https://bugzilla.redhat.com/show_bug.cgi?id=1581838
(cherry picked from commit bb3d8edd06)
2018-05-24 09:13:05 -07:00
Brian C. Lane
1af6040143 Add support for version globs to blueprints
This uses dnf's version__glob filter to implement it. It amounts to '*'
wildcards and '?' for single character matching.

(cherry picked from commit 095829171a)
2018-05-21 15:41:45 -07:00
Brian C. Lane
13234166f5 Update atlas blueprint
(cherry picked from commit d406fbdf83)
2018-05-21 15:41:45 -07:00
Brian C. Lane
9c7446f44c Automatic commit of package [lorax] release [28.11-1].
Created by command:

/usr/bin/tito tag
2018-05-17 13:13:17 -07:00
Brian C. Lane
140a736518 Update the generated html docs 2018-05-17 10:34:35 -07:00
Brian C. Lane
dcb5c5b59a Update the README with relevant URLs
Time to point to the blog and to the online documentation.
2018-05-17 10:34:35 -07:00
Brian C. Lane
1fef566bb2 Fix documentation for enabling lorax-composer.socket
It needs to be enabled AND started for it to work.
2018-05-17 10:34:35 -07:00
Brian C. Lane
55b89d1aeb Add support for systemd socket activation
Instead of enabling lorax-composer.service enable lorax-composer.socket
and it will start lorax-composer on first access to
/run/weldr/api.socket
2018-05-17 10:34:35 -07:00
Brian C. Lane
680393de3d Add documentation for lorax-composer and composer-cli 2018-05-17 10:34:35 -07:00
Brian C. Lane
e7f9028fca Move lorax-composer and composer-cli argument parsing into modules
This allows sphinx-argparse to document them automatically.
2018-05-17 10:34:35 -07:00
Brian C. Lane
8bd028e9d0 Update composer templates for use with Fedora 2018-05-17 10:34:35 -07:00
Brian C. Lane
cd1d414e0e Add new cmdline args to compose_args settings 2018-05-17 10:34:35 -07:00
Brian C. Lane
d68429071c lorax-composer also requires tar 2018-05-17 10:34:35 -07:00
Brian C. Lane
e91aed9b10 Remove temporary files after run_compose
A crash can also leave temporary lmc-* files, remove them as well.
2018-05-17 10:34:35 -07:00
Brian C. Lane
611f5e62f3 Add --proxy to lorax-composer cmdline
Overrides the [dnf] proxy setting in the config file.
2018-05-17 10:34:35 -07:00
Brian C. Lane
d9c4a6c951 Pass the --tmp value into run_creator and cleanup after a crash
Crashing can sometimes leave directories in /var/tmp/lmc-* so clean
those up after run_creator is finished.
2018-05-17 10:34:35 -07:00
Brian C. Lane
559b66b7e3 Add --tmp to lorax-composer and set default tempdir
It was using /tmp/ which can fill up quickly when building images.
Default to /var/tmp unless the user passes --tmp /tmp/
2018-05-17 10:34:35 -07:00
Brian C. Lane
bb652368dc Set lorax_templates to the correct directory
Templates are under the share dir, so use find_templates() to find them.
2018-05-17 10:34:35 -07:00
Brian C. Lane
d6283f9540 Adjust the disk size estimates to match Anaconda
First is Anaconda uses 6k blocks per file for its estimate, and it
fudges by 10% so adjust for those with an extra 10% of headroom just in
case.

Second is an Anaconda bug that won't allow it to do a kickstart install
to a disk smaller than 3000 MB. There is a PR to fix it upstream, but
for now the minimum size has to be 3000e9
2018-05-17 10:34:35 -07:00
Brian C. Lane
5443c1cfea Skip creating groups with the same name as a user
Otherwise the user creation fails when anaconda sees there is already a
group with that name. Log a warning and continue on.
2018-05-17 10:34:35 -07:00
Brian C. Lane
cb7e4e55ba Add user and group creation to blueprint
[[customizations.user]] and [[customizations.group]]
2018-05-17 10:34:34 -07:00
Brian C. Lane
8839182f43 Add blueprint customization support for hostname and ssh key
This adds support for the optional blueprint section [customizations].

Use it like this:

[customizations]
hostname = yourhostnamehere

[[customizations.sshkey]]
user = root
key = root user key
2018-05-17 10:34:34 -07:00
Brian C. Lane
df63cfddc5 Update setup.py for lorax-composer and composer-cli 2018-05-17 10:34:34 -07:00