aboutsummaryrefslogtreecommitdiff
path: root/kolla/cmd/build.py
AgeCommit message (Collapse)AuthorFilesLines
2016-01-06Fix the kolla to find the docker image folder in virtualenvJeffrey Zhang1-25/+18
Closes-Bug:#1530256 Change-Id: I05f10d13e7ba1e2b985c2944aec71ce55630442b
2016-01-06Generate the kolla-build.conf file using oslo_configJeffrey Zhang1-151/+7
Closes-Bug: #1530122 Change-Id: I96039eade2aacf1bcd9d14d958cdddd915fc9a5c
2016-01-06Do not truncate the error messagesWanlong Gao1-1/+1
Do not truncate the error messages of build failure images. TrivialFix Change-Id: I4f2da78c57c8d919beba84a10357312bfc66e88c Closes-Bug: #1531152
2016-01-05Replace xrange() with range() in six.movesWanlong Gao1-3/+4
range maps to xrange() and range() in python2 and python3 respectively. TrivialFix Change-Id: I9b2477a17a570c3ce945badacbfa44889c0634a9
2016-01-05Use range() from six.movesWanlong Gao1-1/+1
To improve consistency, use range() from six.moves TrivialFix Change-Id: I3bb67b2bb5bedbc5b46f70d7eeeca7f8b7872250
2015-12-31Merge "use oslo.config instead of raw argparse.ArgumentParser"Jenkins1-161/+171
2015-12-30use oslo.config instead of raw argparse.ArgumentParserJeffrey Zhang1-161/+171
* Use oslo.config library * kolla-build section is deprecated in favor of DEFAULT section * Remove the deprecated `--template` option * `--no-cache` is deprecated in favor of `--cache` and `--nocache` options, which are using oslo BoolOpt inverse feature[0] [0] https://github.com/openstack/oslo.config/blob/master/oslo_config/cfg.py#L1074 Closes-Bug: #1528542 Change-Id: I62c5ca3c8e057917d2798256e9d9efc8f6578f60
2015-12-30Make the logging more safeJeffrey Zhang1-4/+4
TrivialFix Change-Id: I72c541c1846e503486b402e88d5b29364920fc83
2015-12-28Merge "Push the image as soon as it is built successfully"Jenkins1-24/+58
2015-12-28Push the image as soon as it is built successfullyJeffrey Zhang1-24/+58
Closes-Bug: #1529327 Change-Id: Iad6c1454f42d3410c82c722b60d0d305b9eec129
2015-12-25Fix logging paramsSamYaple1-1/+1
Something was missed during the logging update TrivialFix Change-Id: Ic611b7a0e2a53725b1a3a76aba56faeca5f68dfa
2015-12-24Make the yum repositories configurable in the base imageDavid Moreau Simard1-1/+49
- Removed hardcoded yum repository configuration in favor of commands dynamically generated based on repo-url and repo-file arguments. We maintain a sane default set of repositories. - Added generic rpm_setup_config parameter to add support for installing .rpm or .repo files before building containers. Co-Authored-By: Ryan Hallisey <rhallise@redhat.com> Implements: blueprint custom-repos Change-Id: I1b3a7647a9e7239de3cd162cb6f464f05632bde1
2015-12-23Use c-style string interpolation for log messages in kolla-buildMichal Rostecki1-47/+43
TrivialFix Change-Id: I4b01402f8feb029563a90d4941c8d829a05794e0
2015-12-17Add kolla version to base containerMichal Jastrzebski1-1/+2
We want to record kolla version of running containers to be able to detect whether or not we need to perform certain downtime-causing actions during upgrade. Change-Id: Ie113029da98303e6809d56edbf6d8de37be128d7 Implements: blueprint record-version
2015-12-15Alphabetically sort long list of parameters/argumentsDavid Moreau Simard1-47/+46
TrivialFix Change-Id: I39ad214d6a8e1fbdba799076d6a5371cc47824a1
2015-12-11Record version on container buildMichal Jastrzebski1-1/+9
This changes default behaviour of build.py to instad of putting latest tag on it, it puts current kolla version as found in setup.cfg Change-Id: I4d6e9a0159c6a5598abd58072594df4204427308 Partially-Implements: blueprint upgrade-nova Partially-Implements: blueprint record-version
2015-12-11Catch exception when directory creation failsMartin André1-4/+15
The build script now creates now creates a plugins directory for source builds to store plugins required for the container, and creates a tar of all plugins that is extracted at runtime. However, the creation of the 'plugins' directory is not handled correctly and generate an exception in the running thread if the directory exists. This is the case for example if the build script retries a failing image. This commit fixes the timeout issues we've experienced with the gate. Change-Id: Ic5d4fd1ddf71f01c547130518e311fded911c445 Closes-Bug: 1524897
2015-12-08Merge "Allow fetching plugins as part of the build"Jenkins1-19/+46
2015-12-03Set docker api version to autoArtur Zarzycki1-2/+7
Change-Id: I25d957a2368fa4e52b5fa9253d7ea5ec4046d830 Closes-Bug: #1521949
2015-11-30Allow fetching plugins as part of the buildPaul Bourke1-19/+46
This change allows additional archives to be fetched as part of the build and added to images. An example use case is the installation of plugins for neutron. For example, to add the networking-arista plugin to neutron-server, one would do the following in kolla-build.conf: [neutron-server-plugin-networking-arista] type = url location = http://tarballs.openstack.org/networking-arista/networking-arista-master.tar.gz The format for plugin sections is <image-name>-plugin-<plugin-name> The required Dockerfile additions will be added in the next patchset. Background to this change: https://review.openstack.org/#/c/207545/3/docker_templates/neutron/neutron-server/Dockerfile.j2 Related: blueprint neutron-third-party-plugins DocImpact Change-Id: Idec2ca9fd06163c7d820e8c4bc9ebca8d9673856
2015-11-23Remove hardcoded MAINTAINER in DockerfilesSwapnil Kulkarni (coolsvap)1-2/+5
Added new option in kolla-build.conf Change-Id: I45fe51966bcb59ea19d112281ba3d5a1ba091a56 Closes-Bug:#1514304
2015-11-22Add error handler for unknown build typeHui Kang1-1/+10
Change-Id: Ia5d9ad1ffa119c2dd3e74272df3fb6d78501ec09 closes-Bug: #1513175
2015-11-16Add Python 3.x supportMichal Rostecki1-12/+11
Implements: blueprint python3 Change-Id: I1e02568907aa38dd0efcb428235004ce47d73af8
2015-11-10Fix --retries option to kolla-buildMartin André1-1/+1
Off by one error made the --retries option control the number of tries rather than the number of retries. Closes-Bug: #1514730 backport: Liberty Change-Id: I976a8bb9e489d226f44926a6562d4d2af5de099c
2015-11-06Merge "Make RHEL build properly"Jenkins1-11/+12
2015-11-06Merge "Few improvements in Kolla tools. Added Ubuntu support."Jenkins1-7/+20
2015-11-06Few improvements in Kolla tools. Added Ubuntu support.Kirill Proskurin1-7/+20
pip install default prefix in Ubuntu is /usr/local, and Kolla tools scripts didnt respect that. So I added few OS checks in this scripts. I improve config path check in build.py. Added more verbose error if we can't find config directory. Change-Id: Ide521ed205b0dc1fc27e237a9a8f4da0168e664f Closes-Bug: #1512302
2015-11-06Make RHEL build properlySteven Dake1-11/+12
build.py -b rhel -t [rdo|rhos|source|binary] The last patch for this didn't quite fix the problem properly as it only permitted RHOS builds. backport: liberty Change-Id: I27eed202560adce450c07d043cc224e7a6c6bbf6 Closes-Bug: #1513088
2015-11-06Use the absoluate pathJeffrey Zhang1-1/+1
Use the absoluate path rather than that with `..`. This will be helpfull for end-user to see where is the folder/file. Closes-Bug: #1513726 Change-Id: I7169952d874ddf14469605444044de0163b033d3
2015-11-04Fix RHEL buildsRyan Hallisey1-0/+2
Register with RHEL on the host machine and use yum to setup the repos in the container. Change-Id: I38aaf43fffaf7a235e69b330d5d9f0f1be31fe83 Backport: Liberty Closes-Bug: #1513088
2015-10-19Add build profiles to build.pyPaul Bourke1-1/+29
Add ability to define "profiles" in kolla-build.conf, which are predefined sets of images to build at once. The supplied profiles match what Steven defined in the restructure-template bp, though others can easily be added by the user. Multiple profiles can be supplied at once, as well as supplemented by the existing regex mechanism, e.g. to build profiles infra, main, and also ironic, one can use: tools/build.py --profile infra --profile main ironic Change-Id: I0c6f450152cb23dcfc58e0969669fcedf03fab01 Implements: bp restructure-template Doc-Impact
2015-10-17add "registry" flag to "tools/build.py"Kuo-tung Kao1-2/+10
With registry flag, build image using `tools/build.py --registry 172.22.2.81:4000` the image name looks like `172.22.2.81:4000/kollaglue/data` When user use kolla-ansible, user set `docker_registry` to `172.22.2.81:4000` in `/etc/kolla/globals.yml`. Build image using `tools/build.py -n abcd` the image name looks like `abcd/data` When user use kolla-ansible, user set `docker_namespace:` to `abcd` in `/etc/kolla/globals.yml`. build image using `tools/build.py -n abcd --registry 172.22.2.81:4000` the image name looks like `abcd/data` When user use kolla-ansible, user set `docker_namespace:` to `abcd` in `/etc/kolla/globals.yml`. user set `docker_registry` to `172.22.2.81:4000` in `/etc/kolla/globals.yml`. With the feature, it will reduce user confusing and mistaking. Change-Id: I18ac7a3ccec032888e35f5e9a79fc190760cc8a0 Closes-Bug: #1505056
2015-10-05add "--template-only" flag for tools/build.pyKuo-tung Kao1-1/+8
Add "--template-only" flag for tools/build.py to generate dockerfile for read easily. Change-Id: Ic4cf43d925b5f2d3dae809c11f3f95c51b4bbce2 Closes-Bug: #1501671
2015-09-28Implement a install_type and install_metatypeSteven Dake1-8/+21
This prepares for the RHEL OSP implementation by making the build tool convert all binary-* into an install_type of binary and * into an install_metatype variable substitution inside the Dockerfiles. Further binary-* is substituted as install_name to enable proper building only. Change-Id: Ib681b29176eb79a3cab12ec824313fdecb6e7a5f Partially-Implements: blueprint rhel-based-image-support
2015-09-21Consolidate kolla-build configuration in one fileMartin André1-2/+2
The source location definition previously in build.ini was merged in etc/kolla/kolla-build.conf since it is really configuration for the kolla-build tool. Change-Id: I7531af0029bdfeabbaefb8a6aa97b70bb12c021a Closes-Bug: #1496702
2015-09-17Implement configuration file for kolla-buildMartin André1-60/+81
Kolla build script configuration now lives in /etc/kolla/kolla-build.conf. This allows overriding configuration options without the need to pass arguments on the command line. Command line arguments still get precedence. Closes-Bug: #1496185 Change-Id: I69482a11437087f19d7f76b379dca85b1f622268
2015-09-07Correct name of source archive if reference contains '/'Vladislav Belogrudov1-1/+2
If we have reference like stable/kilo name of source archive will contain only last part of reference. We should replace '/' with '-' to have full name. This is useful for correct identification of source code afterwards. Change-Id: I1ff1015e3f7926110d0fcb59504e58a5e80a75f9 Closes-Bug: #1492279
2015-09-03Allow arbitrary source archive name to be imported into DockerfileVladislav Belogrudov1-10/+8
Currently we cannot import source archives with names different than expected by hardcoded line in Dockerfiles. This worked well for Openstack services' tarballs where we expected SERVICE-* root folder after extraction or kanaka-noVNC for nova-novncproxy docker. The latter fails if one tries to clone or get tarball under other names. This fix allows any archive (tar,tgz,zip) or repo name to be imported into dockerfile. Change-Id: I869a6a19afaf0e93925572746c22b7589b6600c9 Closes-Bug: #1491415
2015-08-31Remove dest_filename from build.iniSam Yaple1-4/+2
We can, and should, figure out the filename dynamically rather than hardcode that value in build.ini since it is not actually a configurable paramater. Change-Id: I496d6555e9fa356ab09e62063fd707f43ed08121 Closes-Bug: #1490386
2015-08-28Move docker_templates to docker dirSam Yaple1-26/+8
Updated build.py to reflect this change. Deprecate --template option and make it a noop. Change-Id: I7cd98d1ee684a4c64984a49597159868152683b2 Partially-Implements: blueprint remove-docker-dir
2015-08-28Add custom footer section to final image DockefilesVladislav Belogrudov1-0/+8
This patch allows to add instructions to final images like setting runtime environment variables or deleting build time HTTP proxies Change-Id: I23ad325e0898d77804a22038ddc618e1e49afd88 Partially-Implements: blueprint add-proxy-to-dockerfiles
2015-08-27Make logging more betterSam Yaple1-26/+41
build.py logging has never done what people think it should do, this patch aims to fix that. All logs related to an image will now be printed with the image name prefixed to the message. To acheive this we have to print out the messages as we get them, even in parallel building mode. If you wish to view the logs for an single image, a grep would be advised to filter the logs. Change-Id: I15ae361892f06a47afafe73750ddd8628697cfea Implements: blueprint build-script
2015-08-27Merge "Fixes matching issue build.py"Jenkins1-1/+1
2015-08-27Fixes matching issue build.pySam Yaple1-1/+1
And issue would occur when the namespace contained a partial amount of the base distro's name causing the base and data images to assume they had parent images in Kolla instead of setting thier parent to None Change-Id: I3b39a3e232c3faa77ee78d1ebb26b7da17bd4df4 Closes-Bug: #1489021
2015-08-27Fixes any() in an if statement build-pySam Yaple1-3/+3
Change-Id: I8aa7d7b876491a79eabda878b95729e3468921cd Partially-Implements: blueprint build-script
2015-08-27Remove tiered building in build.pySam Yaple1-128/+128
Many tiers have been shed over this issue and frankly enough is enough on this tiering thing, it's tiering us apart! Now we use threading a bit better as well. No more tiers! Puns very much intended. Additionally, this refactors the function names to make inc0 happier and be consistent. We also modify the test_build.py to catch the new statuses introduced by the regex patch. Then we remove the Ubuntu Source from the Docker folder test as that will never ever be functional. Also fixed regex to properly match true regex expressions. Co-Authored-By: Michal Jastrzebski (inc0) <michal.jastrzebski@intel.com> Change-Id: I650fd6af76eddb809756762222e66aefd6fc1dca Partially-Implements: blueprint build-script
2015-08-26Add ability to make tarballs from Git clonesVladislav Belogrudov1-13/+54
This feature allows to specify added tarballs source by git repository and reference (tag/branch). Change-Id: Ie7e8a5a5852421a9d99e6371f22ad3638fe077b6 Partially-Implements: blueprint build-script
2015-08-25Fail faster when docker isn't runningrthallisey1-1/+12
In order to make build.py more friendly, have it fail faster when the script is unable to connect to Docker because it's not running. Change-Id: I6d480e601ea2511df9396fcf4e89c06c06d4c21c Closes-Bug: #1488133
2015-08-25Fix regression in build-scriptSam Yaple1-1/+1
The regex patch introduced a regression where the summary was not working due to not copying the images lists, but rather referencing it This only happens when you do not use a regex to build, but instead build all images Change-Id: Ife0ef2d459248aa73af877313140b5392c05673c Partially-Implements: blueprint build-script
2015-08-25Modified build.py to run from installed locationSuhail Syed1-5/+19
Modified build.py to run from installed location or developer environment. To run from development environment, run the command: sudo pip install -e . Additionally, remove a TODO that has been done Co-Authored-By: Sam Yaple <sam@yaple.net> Change-Id: I922696ba439da2c9747e65cddcba47203e54d220 Implements: blueprint python-package