Commit Graph

1608 Commits

Author SHA1 Message Date
Brian C. Lane
f1814ce35f List individual package install failures
Previously it was impossible to know which package in a blueprint caused
a failure, if it was just one of them, or all of them, etc. This catches
the error when calling yb.install and lists all the failures in the
error message that is raised.
2018-07-11 15:35:04 -07:00
Brian C. Lane
2c81a4c1db lorax-composer: Update documentation
This updates the documentation to include composer-cli instead of curl,
warnings about SELinux and needing the RHEL 7 Optional package repo, as
well as other documentation improvements from the master branch.
2018-06-29 13:35:19 -07:00
Chris Lumens
954f330ace Add help output to each subcommand.
This is the same as the output at the top level, just trimmed down to
only the options for a single subcommand.  It's trigged by providing
"help" or "--help" as a subcommand option.
2018-06-28 14:38:05 -04:00
Chris Lumens
70e4211ad1 Split the help output into its own module.
This means I can reuse it for help output for individual subcommands.
2018-06-28 14:38:05 -04:00
Chris Lumens
3743d6d208 If the help subcommand is given, print the help output.
This isn't a real subcommand like the others.  The option processing
just intercepts it and prints the output.  Given that we're subcommand
based, it makes sense to support this in addition to --help.
2018-06-28 14:38:05 -04:00
Brian C. Lane
db2ce9b073 Automatic commit of package [lorax-composer] release [19.7.18-1].
Created by command:

/usr/bin/tito tag
2018-06-27 09:22:30 -07:00
Brian C. Lane
5a7b30699b Only include some of the test blueprints 2018-06-27 09:11:26 -07:00
Brian C. Lane
c01e1e0486 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.
2018-06-26 14:53:11 -07:00
Brian C. Lane
4c466d4620 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
2018-06-25 14:01:36 -07:00
Brian C. Lane
adc91a4ce0 Automatic commit of package [lorax-composer] release [19.7.17-1].
Created by command:

/usr/bin/tito tag
2018-06-20 12:33:58 -07:00
Brian C. Lane
80a2267283 version.py doesn't depend on the .spec 2018-06-19 14:35:43 -07:00
Brian C. Lane
e56e55bb3b Fix Sphinx read_version code
It needs to look for ../lorax.spec OR ../lorax-composer.spec
2018-06-19 14:35:43 -07:00
Brian C. Lane
cc4ae5d19b Build lorax-composer and composer-cli without lorax files
lorax is built from rhel7-branch

This also changes the lorax Requires to 19.7.16

The lorax package will change at a slower rate than lorax-composer, so
making it require the exact same version doesn't make sense.
2018-06-19 14:35:43 -07:00
Brian C. Lane
9fff793dff Automatic commit of package [lorax] release [19.7.17-1].
Created by command:

/usr/bin/tito tag
2018-06-19 14:09:05 -07:00
Brian C. Lane
c4417470da Exclude lorax-composer and composer-cli code from the lorax build
These will be built in Extras from the rhel7-extras branch using the
lorax-composer package name.

Resolves: rhbz#1547759
2018-06-19 11:56:40 -07:00
Brian C. Lane
bb8c7851d2 Fix composer-cli command help text
sources shouldn't be indented
details for a compose are 'details' not 'info'
2018-06-18 10:45:36 -07:00
Brian C. Lane
2ddad4dd82 Automatic commit of package [lorax] release [19.7.16-2].
Created by command:

/usr/bin/tito tag --keep-version
2018-06-15 10:46:25 -07:00
Brian C. Lane
9eb7c0d206 Fixup the lorax.spec after rebasing on 19.6.105-1
Also correct some long running rpmlint complaints.

Resolves: rhbz#1547759
2018-06-15 10:44:31 -07:00
Brian C. Lane
ba76efba14 Automatic commit of package [lorax] release [19.7.16-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
4bfcd8fcd2 Remove SortMode from list_commits
The current version of libgit2 available (0.26.3) has different behavior
with SortMode.TIME. It works correctly when left at the default (which
is also how the rawhide version works).
2018-06-11 16:54:59 -07:00
Brian C. Lane
3cfb895054 Use yum.add_enable_repo() for new repos
Yum needs to have some other attrs setup on the YumRepository object, so
use the function provided to ensure that everything is correct. Also
switch the related functions to use a dict instead of a YumRepository
object.
2018-06-11 16:54:59 -07:00
Brian C. Lane
957def1264 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.
2018-06-11 16:54:59 -07:00
Brian C. Lane
a5eaebeefc yum repos has a delete() function. But it doesn't clear the cache.
yum also has a cache it uses for listEnabled(), but the cache isn't
invalidated when a repo is deleted it any following metadata update
will fail because it is still using the deleted repo.

We are forced to use the heavy hammer on a yum private variable yet
again to force the cache to be cleared so that it won't crash.
2018-06-11 16:54:59 -07:00
Brian C. Lane
2e95b56508 Fix DNF related issues with source selection
yum TumRepository.dump() function cannot be used as a .repo file 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.
2018-06-11 16:54:59 -07:00
Brian C. Lane
3f7997d7ae 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.
2018-06-11 16:54:59 -07:00
Brian C. Lane
f1000b448d Make sure new sources show up in the source/list output
Also remove an unneeded makedirs from test_server.py
2018-06-11 16:54:59 -07:00
Brian C. Lane
25bae61520 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.
2018-06-11 16:54:59 -07:00
Brian C. Lane
33c84331fe Add support for user defined package sources API
This lives under /api/v0/projects/source/*

See the documentation for details
2018-06-11 16:54:59 -07:00
Brian C. Lane
82c8c3a491 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-11 16:54:59 -07:00
Brian C. Lane
b99d8d7f6b Add support for version globs to blueprints
You can use '*' wildcards and '?' for single character matching.
2018-06-11 16:54:59 -07:00
Brian C. Lane
9e06f6e113 Automatic commit of package [lorax] release [19.7.15-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
ce715ad15f Check to make sure blueprints directory exists 2018-06-11 16:54:59 -07:00
Brian C. Lane
7745a019c0 lorax-composer also requires tar 2018-06-11 16:54:59 -07:00
Brian C. Lane
3c60f07d98 Remove temporary files after run_compose
A crash can also leave temporary lmc-* files, remove them as well.
2018-06-11 16:54:59 -07:00
Brian C. Lane
f26a6212d6 Add --proxy to lorax-composer cmdline
Overrides the [yum] proxy setting in the config file.
2018-06-11 16:54:59 -07:00
Brian C. Lane
9978503a69 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-06-11 16:54:59 -07:00
Brian C. Lane
3a38a57ae1 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-06-11 16:54:59 -07:00
Brian C. Lane
050f87168a 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.

(cherry picked from commit a363aee971)
2018-06-11 16:54:59 -07:00
Brian C. Lane
5b7b37860a Add user and group creation to blueprint
[[customizations.user]] and [[customizations.group]]
2018-06-11 16:54:59 -07:00
Brian C. Lane
ccafa76019 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-06-11 16:54:59 -07:00
Brian C. Lane
ffc3195d77 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-06-11 16:54:59 -07:00
Brian C. Lane
8eccb5d6bd Automatic commit of package [lorax] release [19.7.14-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
85f365bd73 Sort the list of supported output types 2018-06-11 16:54:59 -07:00
Brian C. Lane
1fc7cff52b Add some tests for error conditions. 2018-06-11 16:54:59 -07:00
Brian C. Lane
f40f7cc0fd Update the error responses to just return lists of strings.
This makes error handling consistent and easier than a couple layers of
fields to fetch.
2018-06-11 16:54:59 -07:00
Brian C. Lane
d44957aa95 Automatic commit of package [lorax] release [19.7.13-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
520439a7c4 Move status to /api/status
Also drops /api/v0/test, and redirects / to /api/docs/

db and schema are fixed at 0 since lorax-composer uses yum, not the bdcs
metadata.db
2018-06-11 16:54:59 -07:00
Brian C. Lane
0d7e1dacfd Update the path for the test blueprints 2018-06-11 16:54:59 -07:00
Brian C. Lane
d030209d40 Drop part command from tar kickstart template. 2018-06-11 16:54:59 -07:00
Brian C. Lane
0887bd3d95 Update the queue to use blueprint.toml
Also update the output JSON to use 'blueprint' instead of 'recipe'
2018-06-11 16:54:59 -07:00