Commit Graph

2527 Commits

Author SHA1 Message Date
Gregory Haynes
c08c65c100 Remove deprecated map-services
Map-services has been deprecated for some time. Lets remove it as part
of v2.

Change-Id: I4f8ec096ab757a210ac184fbd90636fe13c6e27e
2016-10-06 16:05:56 +00:00
Gregory Haynes
143f3414c3 Remove deprecated map-services
map-services has been deprecated for some time now, lets remove them as
part of v2.

Change-Id: I91400bf1715acc245c3a943fb5f4b46bd36e2446
2016-10-06 15:59:51 +00:00
Jenkins
aedef4f00e Merge "Add release notes for block device handling." into feature/v2 2016-10-06 01:45:40 +00:00
Jenkins
d0dbe276bd Merge "Create (md5|sha256) checksum files for images" 2016-10-06 01:45:18 +00:00
Paul Belanger
2ea5feca5c
Create (md5|sha256) checksum files for images
In shade, we use both md5 and sha256 checksums to help validate the
integrity of an image. Rather then having nodepool do this each time
for every time, have diskimage-builder create these files when we
build the image.

We've added a flag (disabled by default) to toggle this functionality.

Change-Id: I5815ba69b7d477f1e91dc8ec0c69c86168770964
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-10-05 19:34:03 -04:00
Jenkins
12a73cf204 Merge "Default to http://ftp.us.debian.org/debian for debian-minimal" 2016-10-05 12:56:07 +00:00
Markos Chandras
90536dbab3 Add opensuse-minimal element
Add a new opensuse-minimal element to build small and highly
configurable openSUSE based images using the zypper-minimal element
as the main building mechanism

Change-Id: Iebfc4ad4aff763e511b093f1607b55851ccbddcb
2016-10-05 09:39:29 +01:00
Markos Chandras
c69c6c5a84 Add zypper-minimal element
Add a new zypper-minimal element to bootstrap SUSE-based distributions

Change-Id: Id63397e412a929d61247cfd3d9f8d4e758c1248a
2016-10-05 09:27:17 +01:00
Markos Chandras
8dde310cf3 Move the opensuse mkinitrd script to the zypper element
All SUSE-based elements can benefit from the mkinitrd phase to move it
to a more generic location.

Change-Id: Ife171d462a393b6ac0bf2c5eaa48ea25eaf4d1cc
2016-10-05 09:11:00 +01:00
Jenkins
80153520ac Merge "Move opensuse utils to zypper so they can be shared by SUSE-based distros" 2016-10-05 05:10:15 +00:00
Jenkins
038c3f70e1 Merge "Fix a command in Developer Documentation" 2016-10-05 04:06:06 +00:00
Jenkins
b625783150 Merge "Updated from global requirements" 2016-10-05 04:06:00 +00:00
Jenkins
04b05f261e Merge "Fix typo in extracting root partition" 2016-10-05 04:00:39 +00:00
Hironori Shiina
30b3fc8dcc Fix a command in Developer Documentation
Fix a command for creating a new virtualenv.

Change-Id: Ia4981af390bf5218f22ea753db86a5edfbb602f2
2016-10-04 22:22:26 +09:00
Paul Belanger
7dc9465ed1
Default to http://ftp.us.debian.org/debian for debian-minimal
Since http://httpredir.debian.org is unreliable is selecting a mirror
to use, we'll now default to http://ftp.us.debian.org/debian.  In
fact, in openstack-infra we have been overriding httpredir.debian.org
for a while, now make this default in diskimage-builder.

Change-Id: I48658bc076e13a0913821197e4120c73618fef8f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-10-01 21:10:08 -04:00
OpenStack Proposal Bot
1f10f4fa35 Updated from global requirements
Change-Id: I0f152cb4160915bbcad273bca7d28f947b82eae4
2016-09-30 19:58:01 +00:00
Markos Chandras
b9e9e2091e Move opensuse utils to zypper so they can be shared by SUSE-based distros
Move the opensuse utilities to the zypper element so they can be used by
SUSE or zypper based elements. This brings the zypper element somewhat
in line with the rest of the package manager elements.

Change-Id: I8aa2849231454216cdd47629a5e2d6e45769dbbe
2016-09-29 22:56:17 +01:00
Jenkins
b0d72a3161 Merge "Create runtime-ssh-host-keys element" 2016-09-27 23:10:05 +00:00
Yolanda Robla Mota
c6b4e639b0 Disabling all previous repos registered in the system
Depending on the pool id used, so many repos are brought,
including not valid ones that cause image to crash, or repos
that include conflicting packages.
Before enabling repos, disable all previous ones, so we
can be sure that we only bring the repos specified in the
parameters.

Change-Id: Ifd4d8d1d4fa954cd2593669e516e3201f2d6f6c1
2016-09-27 11:47:05 +02:00
Yolanda Robla Mota
f6e11c91c3 Fix typo in extracting root partition
Change-Id: Ie8dfd958d57ef92988647166f2031adb8406b0d7
2016-09-27 09:41:32 +02:00
Paul Belanger
45467e4229
Create runtime-ssh-host-keys element
Move managing of SSH host keys into a dedicated element.

Because glean doesn't generate SSH host keys anymore, we need to do it
with a systemd script. This is already handled by CentOS / Fedora so
we don't want to add it there.

This was done to address the upstream bug in debian:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=500192

Change-Id: I31ad667672e08350872db21a83445fe0aa7a4a39
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-09-26 12:32:38 -04:00
Jenkins
d6794ba673 Merge "Shorten DHCP timeout in dhcp-all-interfaces" 2016-09-23 14:20:09 +00:00
Jiri Stransky
93425d14ce Fix grub installation for RHEL
Grub is first removed and then installed during RHEL image building. The
grub2 package typically requires the same version of grub2-tools, so if
we just remove and install the grub2 package, the installation can
potentially fail on being out of sync with grub2-tools version. Removing
and reinstalling both packages fixes this issue. Those packages are
already in package map for RHEL as "grub-pc", so we can use this alias.

Change-Id: Iefd9c17fffd43de3fea260510ad218b1322eecb3
Closes-Bug: #1627000
2016-09-23 14:14:49 +02:00
Jenkins
3a0f46282f Merge "elements: opensuse: Add support for openSUSE Leap" 2016-09-23 08:48:46 +00:00
Andreas Florath
19efc60ce8 Add release notes for block device handling.
Change-Id: I646447ef6d067cdc4895cedefc3fcae37986d1c7
Signed-off-by: Andreas Florath <andreas@florath.net>
2016-09-23 09:36:19 +02:00
Jenkins
e84488cad1 Merge "Allow ramdisk-create to run without $USER set" 2016-09-23 06:46:31 +00:00
Ben Nemec
2747613ca2 Shorten DHCP timeout in dhcp-all-interfaces
We are currently wasting about 10 minutes per deploy waiting for
DHCP on interfaces that will never get it.  By default, the timeout
seems to be 5 minutes (the 10 minutes is because we boot both the
IPA ramdisk and the deployed image, and each waits for 5 minutes),
which is excessively long to get a DHCP response.  This change
shortens the time to 30 seconds.  If an interface hasn't gotten a
response in 30 seconds, chances are it's not going to.  A 30
second wait should reduce our wasted time to 1 minute, which is
more reasonable.

This is being done in the systemd unit file because the -timeout
option to dhclient doesn't seem to override what is configured in
dhclient.conf, and doing it in the systemd file means that this
change will be limited to only the interfaces configured by
dhcp-all-interfaces.

Change-Id: Ia8610e3def39c937eb0c861fdc9bc571ec39f9f4
Closes-Bug: 1626673
2016-09-22 17:01:06 -05:00
Jenkins
1a8dc59871 Merge "Use temp file for du calculations" 2016-09-21 18:24:51 +00:00
Jenkins
0559818e04 Merge "don't configure 'lo' for dhcp" 2016-09-20 23:37:42 +00:00
Jenkins
4d79e5f519 Merge "Document source glean installs in simple-init" 2016-09-20 23:05:53 +00:00
Ian Wienand
18a4109713 Merge remote-tracking branch 'origin/master' into feature/v2
Change-Id: I796546f3873a0c9072215e63703aaa64753c5afd
2016-09-20 20:23:11 +10:00
Jenkins
d8a800c638 Merge "Add libselinux-python to yum-minimal" 2016-09-20 06:23:34 +00:00
Ian Wienand
ce410de834 yum-minimal: Disable excludes when installing pkg manager
Because we are using the building platform's "yum" to do the initial
install into the chroot, it is affected by the base-system's
/etc/yum.conf.

pip-and-virtaulenv in I82acb865378a0fa5903a6267bfcee0e2962eced0 added
"exclude=python-pip..." in /etc/yum.conf to stop the package manager
overwriting the installed pip.  Now our CI images have built with
this, we are now picking up this exclude on centos.  Since on F24
dnf->python->python-pip we end up failing to build the the chroot
because python-pip can not be satisifed.  In a general sense, however,
this could be caused by any configuration put into /etc/yum.conf that
is incompatible with installing into the chroot.

yum has the option to disable all excludes which is used here.  This
seems to be the best way to isolate the chroot install from any
excludes that may have been done on the base system for various
reasons.  I did consider using a completely separate yum.conf we ship
with dib ... but let's start simple.

This should fix the current gate failures on centos

Change-Id: I4e4cc8ed09a29c4057ade34ea93025139e191bf5
2016-09-20 09:31:44 +10:00
Monty Taylor
fd18cb74b2
Add libselinux-python to yum-minimal
yum-minimal installs selinux but not libselinux-python, which makes
interacting with the node from ansible hard fail. Add it.

Change-Id: I403e7806ae10d5dd96d0727832f4da20e34b94c7
2016-09-17 01:25:31 +02:00
Markos Chandras
0ddea940ad elements: opensuse: Add support for openSUSE Leap
Add support for new openSUSE Leap releases. Moreover, document
common environment variables and remove old note.

Change-Id: I8cf0b215cb4d9231e5658d49e3fd598dfbb5fd37
2016-09-16 16:13:19 +01:00
Jenkins
63a27bd0c4 Merge "Fix mellanox element required kernel modules and user space packages" 2016-09-13 06:07:27 +00:00
Jenkins
61123b0286 Merge "Spec for changing the block device handling" 2016-09-12 21:44:20 +00:00
Jenkins
668561d156 Merge "Add specs dir" 2016-09-12 21:44:13 +00:00
John Trowbridge
49baaa4114 Remove EPEL as hardcoded dependency of centos elements
The previous commit removes dkms from the base element, which
means the centos elements should no longer have a dependency on
EPEL.  Therefore, we should not hardcode the epel dependency.  It
can still be included in image builds as desired by using the epel
element explicitly.

Co-Authored-By: Ben Nemec <bnemec@redhat.com>
Change-Id: Iceff0d5bedd9816adfd2990970e7c216b67b6bd0
2016-09-12 11:42:55 -05:00
Ben Nemec
01a0dbf7c0 Remove unnecessary dkms install from base
The use of dkms in base was actually removed long ago in
Ic2c345bf9f0738dadae611194e263d3a5d424a3e and it is creating an
unnecessary dependency on EPEL for the centos elements.

Change-Id: Iae3100471e50a9c39f40b450f087192918ae54b3
2016-09-12 11:42:51 -05:00
Noam Angel
07e34f90e7 Fix mellanox element required kernel modules and user space packages
This fix add need kernel module for Infiniband and ConnectX-4+ network
cards.
Also install by default required user space packages.
Change-Id: Ia2e7b1820f197778138a23fafaccb5a4fb44369a
2016-09-11 11:40:20 +00:00
Waldemar Znoinski
bc80572061 don't configure 'lo' for dhcp
On systemd-based operating systems that don't
use /etc/sysconfig/network-scripts
dhcp-all-interfaces configures 'lo' for dhcp.
This causes errors and fails networking.target
causing system-wide issues. This change excludes
'lo' at dhcp-all-interfaces udev rules level.

Closes-bug: #1621501
Change-Id: I7563b766827bedbea7ae1de35e5bdfcbf1fc0d1e
Co-Authored-By: Jeremy Stanley <fungi@yuggoth.org>
2016-09-09 09:01:59 +00:00
Ian Wienand
91b431ce78 Move element-info to a standard entry-point
Move element-info from a wrapper script to a standard entry-point
console_script.

Update the documentation to explain how to run it for development.  I
don't think we should support the idea that you can check-out the code
and run ./bin/disk-image-create -- it has dependencies (dib-utils,
etc) and needs to be run from a virtualenv (this is what CI in the
gate does).  A follow-up can clean-up some of the path munging stuff
we have for this in disk-image-create.

Change-Id: Ic0c03995667f320a27ac30441279f3e6abb6bca8
2016-09-08 15:29:56 +10:00
Andreas Florath
3d48a528c1 Refactor: block-device handling (local loop)
Block device handling can be somewhat complex - especially
when taking things like md, lvm or encryption into account.

This patch factors out the creation and deletion of the local
loop image device handling into a python library.

The main propose of this patch is to implement the needed
infrastructure.  Based on this, more advanced functions can be added.
Example: (advanced) partitioning, LVM, handling different boot
scenarios (BIOS, UEFI, ...), possibility of handling multiple images
(local loop image, iSCSI, physical hard disk, ...), handling of
different filesystems for different partitions / LVs.

Change-Id: Ib626b36a00f8a5dc3dbde8df3e2619a2438eaaf1
Signed-off-by: Andreas Florath <andreas@florath.net>
2016-09-08 04:31:01 +00:00
Ian Wienand
412b333bda Convert pkg-map and svc-map copies to explicit variables
Using the explicit variables, these elements don't have to walk the
path to find the files in other elements; they can extract it directly

Change-Id: I0a64b45e9f2cfa28e84b2859d76b065a6c4590f0
2016-09-08 11:10:19 +10:00
Ian Wienand
37a53354ec Add IMAGE_ELEMENT_YAML and get_image_element_array
These new variables are a list of elements chosen for the build along
with their full paths.  For Python elements, IMAGE_ELEMENT_YAML is a
YAML formatted list that can be easily parsed.  For bash elements,
"get_image_element_array" will produce an associative-array of the
same (working around lack of array export in Bash).

This list is intended for consumption of elements who need to copy
files from other elements, such as pkg-map and svc-map.  As discussed
in I2a29861c67de2d25c595cb35d850e92807d26ac6, this list has already
been pruned and had overrides processed, so it is safe to simply walk
over this list with no further processing.

Since we're presenting the element list in a couple of different ways,
we combine it all into the element-info script.  It will output an
eval-able string that declares the appropriate variables.

I've added some inline documentation so they still appear in grep.
The documentation is updated with examples, and moved to a more
appropriate location as a sub-section of the element sytle guide.

To test this out, use the associative-array in generate_hooks, where
we can now find the element's directory without searching.

Change-Id: Ibbd07d082ec827441def2d3f6240df3efdc6eae3
2016-09-08 11:08:07 +10:00
Ian Wienand
274be6de55 Making element overriding explicit
This is a re-factor of element_dependencies to achieve two things --
centralising override policy and storing path names.

Firstly we want to make the override policy for elements completely
explicit.  Currently, elements that wish to copy parts of other
elements walk ELEMENTS_PATH themselves and look for elements in
IMAGE_ELEMENT.  How they handle duplicate elements can differ, leading
to inconsistent behaviour.

We introduce logic in element-info to find elements in each of the
directories in ELEMENT_PATHS in *reverse* order -- that is to say,
earlier entries in the paths will overwrite later ones.

For example

 ELEMENT_PATHS=foo:bar:baz

will mean that "foo/element" will override "baz/element", since "foo"
is first.  This should be sane to anyone familiar with $PATH.
Documentation is clarified around this point and a test-case is added.

The second thing is that we want to keep the complete path of the
elements we have chosen.  We want the aforementioned elements that
walk the element list to use these canonical paths to pickup files;
this way they don't need to make local decisions about element
overrides, but can simply iterate a list and copy/merge files if they
exist.

A follow-on change (I7092e1845942f249175933d67ab121188f3511fd) will
expose this data in a separate variable that can be parsed by elements
(a further follow-on I0a64b45e9f2cfa28e84b2859d76b065a6c4590f0
modifies the elements to use this information).  Thus this does not
change the status-quo -- elements that are walking ELEMENTS_PATH
themselves and can/will continue doing that.

Change-Id: I2a29861c67de2d25c595cb35d850e92807d26ac6
2016-09-08 10:58:19 +10:00
Jenkins
ca53af1184 Merge "fix systemd resource deadlock" 2016-09-06 23:33:03 +00:00
Jenkins
1041b5c9d5 Merge "Revert "Revert "Pre-install pip/virtualenv packages""" 2016-09-06 21:21:11 +00:00
Waldemar Znoinski
4b222b8263 fix systemd resource deadlock
Dependency to start network-pre (which
depends on network.target) before
dhcp-interface@.service collides with
Ubuntu's own network.target that suupose
to start after network-pre.

Change-Id: I9e59c970bfb1ebdaa15b4ec6b545761ede3ca056
Closes-bug: #1619816
2016-09-06 04:47:29 +00:00