143 Commits

Author SHA1 Message Date
TuanLAF
3772ac05f7 Fix typos in Kolla
TrivialFix

Change-Id: Id916352b419a100d1cae463031e3182bd1080776
2016-06-13 17:46:42 +07:00
Jenkins
9afb69c8de Merge "Mechanism for Dockerfile customization" 2016-06-12 23:58:54 +00:00
Jenkins
319fd3e794 Merge "Add non-intrusive ctrl-c handling" 2016-06-10 03:14:05 +00:00
Joshua Harlow
869e117b53 Add non-intrusive ctrl-c handling
Instead of trying to use a signal handler to stop
when ctrl-c is triggered use technique that cooperates
better with the threads that are running and lets
them die a happy death vs being forced to die in
unpleasant ways.

Closes-Bug: #1586476

Change-Id: I7fdb6a77a144bdd02276cca07b616bbb0c2f1957
2016-06-08 22:00:25 -07:00
Joshua Harlow
a45dc94e8c Use 'image' not 'item'
The things in self.images are images, not items so
reflect these to use the shared 'image' name vs
having a one-off that uses 'item'.

TrivalFix

Change-Id: I781514d3e116de32b4fe61a7f55455282680fec1
2016-06-08 17:50:39 -07:00
Michal (inc0) Jastrzebski
51074b0a42 Mechanism for Dockerfile customization
This patchset enables potentially full customization of Dockerfiles
provided by Kolla without having to change main Kolla code. Mechanism is
based on jinja2 block mechanism. In our dockerfiles we'll add blocks
(mostly empty) with highly standarized naming, then in override file
users will be able to fill/override contents of these blocks. Example is
shown in this patch.
To enable cutomized override file call build.py

--template-override=path-to-file Only caveat is that header {% extends
.. %} has to stay

Change-Id: I5957024e5652f9677c439fb2fcd524e467b951af
Partially-implements: blueprint third-party-plugin-support
2016-06-07 21:03:51 +00:00
Jeffrey Zhang
c31688be36 Make build.py importable lib
First step to break it down is to make it
importable lib rather than self-contained script.

Change-Id: Ibbc924c2849cc79006046f62f31a1909ce959066
Partially-implements: bp build-refactor
2016-06-07 16:40:16 +00:00
Jeffrey Zhang
9585c1be9f Remove the deprecated kolla-build section
TrivialFix

Change-Id: I3ee10efc093ed394c3af483a229dcd9dc732ec9a
2016-06-07 09:04:57 +08:00
Christian Berendt
442b4b6a94 Cleanup help string of install_type parameter
The part "The valid types are: binary, source, rdo, rhos" is already a
part of the generated kolla-build configuration file ("# Allowed values:
binary, source, rdo, rhos").

TrivialFix

Change-Id: I87b913c1b650fe54402ea643fc9c774448850f6b
2016-06-06 11:47:53 +00:00
Joshua Harlow
7c6990ccec Use an image object, recorder object and status constants
Instead of using raw dicts and passing data around via
dictionaries (which makes it really hard to figure out
what is in those dictionaries at any point) prefer to
use objects. That way people can actually understand what
the object is supposed to be, vs guessing and/or having to
decipher its usage.

The same goes for raw string constants, prefer using
named constants instead.

Closes-Bug: #1586475

Change-Id: Ide179dc6593c50696d47a2d3d4cd000f343855d4
2016-06-02 11:21:24 -07:00
Joshua Harlow
e78ae9bc61 Use a task model and dumb workers
Instead of having smart workers that need to know
about the full logic of how they operate and what
they will do which makes it hard to reuse parts of
those workers switch the model so that workers are
dumb and they just run tasks which themselves can
request additional tasks to run when succesful.

This makes it more consistent when tasks are to
be retried and also makes it easier to know which
task is running and when.

Less specialized workers == good.

Closes-Bug: #1586474

Change-Id: Ie7b7303b8bf2a80b3e26b6d4ffc27787f8c794d6
2016-06-02 11:21:09 -07:00
Jenkins
3a6a748aba Merge "Don't always unpack image build results tuple, as it may be None" 2016-06-01 08:35:53 +00:00
Jenkins
40cd7550dd Merge "Add sahara containers" 2016-06-01 05:16:17 +00:00
Jenkins
2bed574032 Merge "Pin the base distro release version" 2016-06-01 05:13:10 +00:00
Mark Goddard
b3e8ac8371 Don't always unpack image build results tuple, as it may be None
Change-Id: I21b1327da1de1bd3cc3018ba37715b0a19c1dbef
Closes-Bug: #1587501
2016-05-31 12:19:17 -05:00
Jenkins
d860c7d4ba Merge "Fix kolla-build return codes" 2016-05-31 11:08:39 +00:00
Jeffrey Zhang
4044a3475e Pin the base distro release version
Pin the base distro release version in the master branch(Newton).
Only one distro version is supported. The supported versions are:

* CentOS: 7
* RedHat: 7
* OracleLinux: 7
* Debian: 8
* Ubuntu: 14.04

NOTE: Kolla will move to Ubuntu 16.04 in the Newton cycle

DocImpact
TrivialFix

Change-Id: I32c0edbee4de14c8a0cc7c961d566e84d70f19a4
2016-05-31 01:41:48 +00:00
Daneyon Hansen
ba30579b3b Adds Neutron LBaaS Support
Previously, kolla did not support neutron lbaas functionality.
Only Lbaasv2 is supported in Mitaka. Additional information can
be found here:
http://docs.openstack.org/mitaka/networking-guide/adv-config-lbaas.html
Magnum uses Neutron Lbaas to provide high availability to COE API
and Etcd endpoints within a bay. Therefore, Neutron Lbaas is required
for Kolla to support Magnum.

Co-Authored-By: Serguei Bezverkhi <sbezverk@cisco.com>
Partial-Bug: #1551992

Change-Id: I05360b7c447c601fcb3c2b6b2a913ef5cc0f3a1b
2016-05-27 11:41:25 -04:00
Will Miller
18ae114e75 Fix kolla-build return codes
Add a main wrapper function to return 1 if any images failed to build;
otherwise, return 0. Rename the old main() to run_build(), which still
returns image statuses, to avoid interfering with unit tests.

Change-Id: I5817cc9cebb4f42dc13e0535223e5dc8931a3aab
Co-Authored-By: Mark Goddard <mgoddard@cray.com>
Closes-Bug: #1578404
2016-05-27 06:39:52 -05:00
Swapnil Kulkarni (coolsvap)
353d077e14 Add sahara containers
Added sahara container for
centos,ubuntu
binary,source

partially-implements blueprint sahara-container

Change-Id: Id6dad447cd6ec07286e7a6cab0b13a6d4d89c1a7
2016-05-26 16:52:07 +05:30
Jenkins
857d8db60c Merge "Implement non-default signal handler for SIGINT" 2016-05-26 06:38:14 +00:00
Swapnil Kulkarni (coolsvap)
e1b5b149f2 Make passwords.yml file generation configurable
partially implements blueprint multiple-clouds

Change-Id: I676c4245e6f058ffbed345970ee78d1750dd0f2f
2016-05-21 01:51:17 +00:00
Jenkins
cf3e68213e Merge "Catch all the exception in the push thread" 2016-05-10 21:02:47 +00:00
Jeffrey Zhang
070bf25835 Support a custom base image
Add a new option(base-image) to support custom base image
In default, the base-image is equal to base. When using custom
image, please use command line like:

    ./tool/build.py --base-image my-image --base centos --base-tag 0.1

DocImpact

Closes-Bug: #1573544
Change-Id: If4b9c57a2b68f6f06d3e981f30b2173064e02193
2016-05-09 07:29:19 +00:00
Jeff Peeler
75492cf82b Implement non-default signal handler for SIGINT
Pressing Ctrl-C will stop a build, but does not clean up the /tmp
directory of dockerfiles. Implement a signal handler such that clean up
does occur.

Python apparently ignores signals while calling join on a queue, so
that's why the small modification was needed there.

Change-Id: I43faf67726c154b6640d3596aea61ffc59871999
Closes-Bug: #1579242
2016-05-06 17:37:42 -04:00
Michal Rostecki
6654cb1682 Add images from profile as matched only if no regex is used
Change-Id: I053e54c54883318dfc7daa64a58276487805de66
Closes-Bug: 1578955
2016-05-06 10:19:21 +02:00
Jeff Peeler
696f0b9a06 Generate image dependencies on CLI
Using the new --list-dependencies flag, one can query dependencies for a
given filter. For example:

./build.py --list-dependencies heat swift
{'base': [{'openstack-base': [{'heat-base': ['heat-engine',
                                             'heat-api-cfn',
                                             'heat-api']},
                              {'swift-base': ['swift-object',
                                              'swift-proxy-server',
                                              'swift-container',
                                              'swift-rsyncd',
                                              'swift-account']}]}]}

Also added --list-images to list all available images.

Change-Id: I1797e32e32705182a763f53329eeb5c4a361abec
Implements: blueprint images-dependency-tree-cli
2016-05-05 00:03:31 -04:00
Davanum Srinivas
fa88ce2e4c Cleanup Mesos/Marathon related work
We got rid of the kolla-mesos repo:
http://git.openstack.org/cgit/openstack/kolla-mesos/tree/README.rst

So we don't need things in the main kolla tree
related to Mesos/Marathon

Closes-Bug: #1577951
Change-Id: Iafae63914c8a6601dc1b5b04231af8a1d2cc8642
2016-05-03 21:39:57 +00:00
Travis McPeak
cc33c103d4 Adding a few #nosec tags to prepare for Bandit usage
This commit adds a few #nosec tags for non-issues.  I've examined
the code and determined that these don't represent security issues
so we should add a #nosec tag that tells Bandit not to find these
issues in the future.

Closes-Bug: #1577498
Change-Id: Ic37216c08442c700c64118c78cfb46e6cedd237c
2016-05-02 20:58:57 -07:00
Jeffrey Zhang
e043fab3a0 Catch all the exception in the push thread
Change-Id: I1ba48cd25e529bdd846d3ded1f5923f312e5d17d
Closes-Bug: #1574931
2016-04-28 00:59:14 +00:00
Michal (inc0) Jastrzebski
e2fa75fce6 Override default latest tag on ubuntu
After 16.04 got released we can't build our images as we pull latest
(16.04 now) and our sources lists are built for 14.04. We pin ubuntu to
14.04 here.

Change-Id: Ib29a1c607c3a725cdaf2098edd1c4b80f06a5e38
Closes-Bug: #1575884
2016-04-27 20:35:25 +00:00
Jenkins
0078d9b4a1 Merge "Add iscsid/tgtd specific parameters to Kolla infrastructure" 2016-04-15 12:05:39 +00:00
Serguei Bezverkhi
c605d6ca26 Add iscsid/tgtd specific parameters to Kolla infrastructure
This partially implements iscsi and lvm2 support for cinder
in Kolla. Add integration with Kolla infrastructure.

Change-Id: I5b7d59163518080f38aec0c00617440de0763f1d
Implements: blueprint iscsi-lvm2-docker
2016-04-12 14:58:15 -04:00
Swapnil Kulkarni (coolsvap)
11c6457164 Add missing base os values to kolla-build.conf
Added centos, ubuntu, oraclelinux.
Not added other base distros are not
well maintained currently.

Change-Id: Icb1c12dde2ff005068f1b0f36693049f9ea30f52
Closes-Bug:#1569265
2016-04-12 17:01:42 +05:30
Paul Bourke
cfd806aeff Log the SHA of the Git ref for source builds
When using named refs in source builds, e.g. "reference = master", one
can't easily tell from the build output what SHA master actually pointed
to at that point and time. Update the debug output to include this.

Closes-Bug: #1566316

Change-Id: I95c1cc316ab7332fa30fa43e207a5a5512b76708
2016-04-05 13:31:03 +00:00
Jeffrey Zhang
42420830f6 Implement nova-ssh container
Add a nova-ssh container to handle the `nova migrate` and
`nova resize` case, in which the nova will use ssh to copy
files between machines.

Change-Id: Ie6675943f3aeabfbba8589d308d55b9c89d732db
Closes-Bug: #1562141
2016-04-03 07:21:17 +00:00
Steven Dake
31634c4df4 Add PBR generation of version information
Change-Id: I6391392645d8608a92c885071b26210eed3f5466
Partially-Implements: blueprint add-reno
2016-03-22 20:45:46 -07:00
Jenkins
892dc09c81 Merge "Add generate_passwords.py to generate passwords" 2016-03-21 20:25:44 +00:00
SamYaple
f03e06e09b Add generate_passwords.py to generate passwords
As with all tools, this is a first pass at the generation. Perhaps we
even want to move this into kolla/kolla/cmd and be generated with tox
itself in the future.

This tool, when run, will only populate empty fields that have no
values meaning that it is safe to run repeatedly on the same file.

Of note, there is no way to preserve comments in the file after it has
been processed by the yaml parser in python. Comments and sections
will remain in the passwords.yml template for additional documentation
if the user wishes to populate the file themselves.

Use SystemRandom and clean up the docs a bit to not use pronouns.

Co-Authored-By: Steven Dake <stdake@cisco.com>

Closes-Bug: #1559266
Change-Id: I2932d592df8871f1b7811059206d0b4d0553a687
2016-03-21 17:02:23 +00:00
SamYaple
3e7be6593c Split versions onto new line
This makes the process of updating versions _much_ easier and opens
the door to a rough automated updater

This should merge in master _BEFORE_ mitaka branch

TrivialFix

Change-Id: I90b974316c5b48fd7a31959de317cb71ae3affec
2016-03-21 12:29:10 +00:00
Jenkins
c09db422cf Merge "Mesos DNS container" 2016-03-14 12:33:18 +00:00
Jenkins
a28b246259 Merge "Add cron image and playbook" 2016-03-10 20:22:15 +00:00
Éric Lemoine
32a4cadac9 Add cron image and playbook
Add cron image and playbook for logrotate.

The "common" Ansible playbook includes configuration files for
logrotate. At this point the operator cannot customize/override the
logrotate configuration.

Closes-Bug: #1553244
Change-Id: Ic9fdda9a273c9ccd90502f0acc7614d2c7157dca
2016-03-09 13:53:55 +01:00
SamYaple
279594ab64 Add local directory or file for source build
This change allows using a local directory or tarball to build from
sources by specifying the 'local' type in your kolla-build.conf:

    [keystone-base]
    type=local
    location=/home/martin/src/keystone

    [neutron-server-plugin-networking-cisco]
    type=local
    location=/tmp/networking-cisco.tar.gz

Closes-Bug: #1509625
Co-Authored-By: Martin André <m.andre@redhat.com>
Change-Id: I3f6f68b0f44efdac653d186d2625591ad7cb3b2a
2016-03-09 18:36:13 +09:00
Artur Zarzycki
dd298fcb9e Mesos DNS container
Change-Id: I07ce1b0f6a48de2a8290fac75dcf7ef07960aaf5
Implements: blueprint mesos-dns-container
2016-03-08 21:29:19 +01:00
Swapnil Kulkarni (coolsvap)
5669f7e0ad Handle kolla-build exception
kolla-build currently does not provide information
if docker service is not running. Added exception
handling.

Change-Id: I1f167804b8b4d2ad9220281954ff7ea7162a9817
Closes-Bug:#1553912
2016-03-08 09:45:04 +05:30
Jeffrey Zhang
4e154f0018 Introduce the hacking module to kolla
Implements: blueprint add-hacking

Change-Id: Ia24a263555b9c1eb11e61b9d3fe89612a89daed6
2016-03-03 04:40:16 +00:00
Vikram Hosakote
320c1f9272 Add timeout to requests.get() in kolla/cmd/build.py
When kolla-build is running, if there are network issues or if the
source's location (like http://tarballs.openstack.org) fails to
respond due to high number of concurrent requests, kolla-build just
hangs/blocks indefinitely.

This patch set resolves this issue by adding a timeout of 120
seconds for requests.get() in kolla/cmd/build.py, adds a unit test
for it in kolla/tests/test_build.py and also the "timeout" argument
in kolla/common/config.py.

Change-Id: I7c8745a20b9bd1c3f5d6a55c72a794f16fd7e513
Closes-Bug: #1548614
2016-02-28 00:54:47 +00:00
Éric Lemoine
0417844b8d Remove Rsyslog entirely
Partially implements: blueprint heka

Change-Id: I1322d2dc870e6f8fe052926995d993e8a08a25db
2016-02-23 01:45:23 -08:00
Jenkins
c18b9c3851 Merge "fix the custom profile raise exception issue" 2016-02-20 16:36:59 +00:00