80 Commits

Author SHA1 Message Date
Ian Wienand
90c53a8ded diskimage-builder element cleanups for dib-lint
Since I6c5a962260741dcf6f89da9a33b96372a719b7b0 dib has had a
standardised method for ensuring consistency of tracing and error
detection.  Bring the tracing for these elements up to that standard,
but maintain the status-quo of flags such as "-e" and "pipefail" by
adding ignore flags where appropriate (we can update these separately
to avoid breakage)

Other minor changes are alphabetical-ordering in the element-deps
files and permissions on prepare-node script

With this, "tox -edib" passes

Change-Id: Ibba1dadb9e819f94294c9d583b83ff698252f93f
2015-10-08 11:33:03 +11:00
Ian Wienand
32dcd6af92 Skip caching for dnf (Fedora 22) builds
We are still working on the caching story for dnf-based builds
(i.e. Fedora 22). There are a couple of options which we will work
through on the linked page.  We will sort this out before we move the
devstack job (yet to be created, because the nodes aren't there yet)
out of experimental.

In the mean time, disable the caching in these elements so we can get
Fedora 22 image builds (currently they're in a big looping failure
[1]).

[1] http://nodepool.openstack.org/image.log

Change-Id: I3a435889fc5109d7365240068047aac98abc605e
2015-10-01 15:35:16 +10:00
Jenkins
5cda264308 Merge "Use restorecon over chcon for unbound selinux" 2015-08-27 11:50:30 +00:00
Paul Belanger
f30d863496 Use restorecon over chcon for unbound selinux
Rather then explicitly forcing a security context for unbound, we
should restore the default selinux contexts defined by the OS.

Change-Id: I4bb21dcbbcbcff6a5458ebf9478f58d95ad7240a
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-08-19 10:15:13 -04:00
Matthew Treinish
76d164b1ba
Create an os-testr venv for running subunit2html
This commit creates a venv for installing os-testr which will enable
all test jobs to have access to the subunit2html utility which has
been moved to live inside the os-testr package instead of as a slave
script.

Change-Id: I2050b54eb2def10438764f3eeb55ecf9caa874dc
2015-08-14 12:37:22 -04:00
Paul Belanger
ebdd2553d0 Remove color output from puppet apply
This help when reading log files from nodepool. Otherwise we see the
following in the log files:

  [1;31mWarning: Config file /etc/puppet/hiera.yaml not found, using
  Hiera defaults[0m

Change-Id: I3a865e5107e2749ed44c144539af49e311e0125f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-08-06 15:38:35 -04:00
Jenkins
78d105a8a4 Merge "Express nodepool base's dependency on puppet" 2015-07-15 13:12:01 +00:00
Monty Taylor
e3ad2d85d2 Express nodepool base's dependency on puppet
The nodepool base element really needs the puppet element, but we didn't
express that in the element deps. That makes a later reorg of elements
more difficult than it needs to be, because our consumption element list
is expressing internal dependency chains.

Change-Id: Ib2296bed1d7f289e7aa2720a38555275de1b6402
2015-07-15 08:34:13 -04:00
Jenkins
4d5bc96fa0 Merge "nodepool: describe nodepool-base env variables" 2015-07-14 16:06:26 +00:00
Jenkins
e998bfcabf Merge "Add dependency on nodepool-base to node-devstack" 2015-07-14 13:50:55 +00:00
Antoine Musso
9f5c63b0d3 nodepool: describe nodepool-base env variables
The nodepool-base element relies on a couple environement variables.
Describe NODEPOOL_SCRIPTDIR and NODEPOOL_STATIC_NAMESERVER in the
README.rst file.

Change-Id: I56f2aab095a0504e19598d7296d072e7a51b07c2
2015-07-03 21:28:08 +02:00
Jeremy Stanley
ff8a9f590e Clean up bindep invocation in cache-bindep element
Invoke bindep from the bindir for its virtualenv in /usr/bindep-env,
and guard its exit code with true since its normal behavior is to
return zero only when all needed packages are already present.

While here, replace calls to tempfile with mktemp since the former
is not readily available on CentOS 6.x.

Change-Id: I926e73f305b1b54f6855cc4acf3407e91b88213a
2015-07-03 01:31:40 +00:00
Jeremy Stanley
43e8e90cbf Don't fail to build cache on missing bindep lists
While git show is being used to build up a list of candidate
packages to cache, it can cause the cache hook to abort if it
returns nonzero because of a nonexistent bindep list file. Guard
that with a fallback to true so that the loop can continue
normally.

Change-Id: Ic3b773ad2e8efa2c450d37a0115355c0e95da853
2015-07-03 00:13:17 +00:00
Jeremy Stanley
0e079c607f Backward-compatible branch list for bindep element
The version of git on CentOS 6.x is too ancient to support git
branch --list which is necessary to disambiguate -r with a name
pattern. Instead just list all remote branches and filter with grep
like a good Neanderthal.

Change-Id: I4e673e86acb70c205d159e22b5864cf60ae831df
2015-07-02 23:41:52 +00:00
Jeremy Stanley
e700bd2820 Rename bindep package caching element for conflict
A quirk of diskimage-builder is that no two elements you compose are
allowed to have parts with the same filename. Rename cache-bindep's
install.d/50-download-pkgs so that it doesn't conflict with the one
of the same name in the cache-devstack element.

Change-Id: I5709147fc5bd4c06fb1bba8ea0e068c0eda7d010
2015-07-02 23:03:45 +00:00
Jenkins
bb486b5ebb Merge "Pre-cache distro packages from bindep lists" 2015-07-02 21:02:04 +00:00
Jeremy Stanley
a1f1ce370d Fetch all heads and tags when caching source repos
Passing a source-repositories ref of "*" signals fetching all heads
and tags rather than just a specific refname. This is desirable for
the warm cache on our job workers, since jobs may run against
arbitrary branches (or possibly even tags). The point is to have a
reasonably complete mirror of each repo, rather than a fairly
minimal clone.

Change-Id: I624ed1e259e007d4246afb45c3a0560598bfbe3f
Depends-On: I4562c9689a8d235ebe09b2f7178aa5890dbc85f1
2015-06-25 15:54:11 +00:00
Jeremy Stanley
fc39aea6d0 Pre-cache distro packages from bindep lists
We intend to use bindep to tell us what distro packages should be
installed at job run-time, so need to similarly identify those in
such a way that they can be cached on our worker images.

Install the latest bindep release from PyPI into /usr/bindep-env
(consistent with the way we provide virtualenvs for access to
zuul-cloner and libraries used by our log uploads to swift).
Concatenate bindep lists from all branches of every hosted Git repo
along with our fallback list in project-config. Run bindep to render
them into a platform-specific manifest of package names and feed
that to the relevant package management tool for the platform to
download this set into the package cache.

Note that similar tooling is not applied to snapshot nodes, since we
only intend to run jobs which use bindep on diskimage-builder
created nodes.

Change-Id: I0c408fee35dfe9b4f700c51565bfaae0a3d03beb
2015-06-24 18:56:09 +00:00
Jens Rosenboom
abbe9c6093 Add dependency on nodepool-base to node-devstack
The build for node-devstack will fail because of missing scripts unless
nodepool-base is executed before, so add this as dependency.

Change-Id: Iabc06a542529500ad248ae067beed9639d24e506
2015-06-11 10:22:08 +02:00
Steve Kowalik
85a0f4f44f Switch to using $() for subshells, part 1
Cleanup every use of `` for subshells in the nodepool and tools
directory , replacing them with $(), and finally making the scripts
consistent.

Change-Id: I2b05cd20f9c9a30ab88f8db235aa81da93b1fad3
2015-06-04 15:30:55 +10:00
Jenkins
38ec65bd48 Merge "Deal with yum --downloadonly CentOS 6.x quirks" 2015-05-12 21:38:26 +00:00
Jeremy Stanley
3d5b04ed19 Deal with yum --downloadonly CentOS 6.x quirks
Some packages may depend on python-setuptools, which is not
installed and cannot be reinstalled on CentOS 6.x once yum has
erased them, so use --skip-broken to avoid aborting. Also on this
platform --downloadonly causes yum to return nonzero even when it
succeeds, so ignore its exit code.

Change-Id: Iaada39ae81e1e47fe9d0bedba80fd19e4e0e6f38
2015-05-12 15:25:01 +00:00
Monty Taylor
449d432feb Don't disable cloud-init if it is not installed
When we're building nodepool images on top of minimal elements, there
will be no cloud-init, and therefore no need to disable cloud-init
datasources. In fact, trying to do so will be an error.

Change-Id: I98887c43566e07f2be9d2dc5fae6538078c7348e
2015-05-10 12:58:08 -04:00
Monty Taylor
e60dc2a3c1 Don't require NODEPOOL_SCRIPTDIR to be set
If someone is building an image locally and don't want to do anything
special with nodepool scripts, they should not need to set an env var.
The env var obviously still needs to be honored for nodepool operation
and for override.

Change-Id: I08076a8eafe7019e715b1b46633e8f603031a1ea
2015-05-10 12:41:53 -04:00
Jenkins
47532ee5c3 Merge "Install yum-plugin-downloadonly on nodes" 2015-05-07 16:11:27 +00:00
Jeremy Stanley
0137c25b46 Install yum-plugin-downloadonly on nodes
The --downloadonly option to yum is provided by the
yum-plugin-downloadonly package. This is merely a virtual package
satisfied by yum itself in newer releases, but an optional package
in older ones such as CentOS/RHEL 6.x. Install it just to be sure it
will work, since we use this to pre-cache RPMs on nodepool images.

Change-Id: I9e2e1605f3721c410180aa46a81b7b731d08503a
2015-05-07 13:33:12 +00:00
Jeremy Stanley
572c35a827 Look for yum instead of rpm in elements too
On CentOS 6.x the rpm executable is in /bin instead of /usr/bin, but
the cache-devstack element ends up running yum if it wants to
download RPM packages anyway. Look for yum instead of rpm as an
indication of which packages to install.

Commit fa18656 fixed this in cache_devstack.py for snapshot images,
but missed that it was affecting diskimage-builder elements as well.

Change-Id: I4b76a48564cd5d703d79cfda88bbbfe97216a70a
2015-05-07 01:56:52 +00:00
Jeremy Stanley
6a8f64190d Do a better job of identifying CentOS 6
Since DIB creates a chroot but doesn't actually chroot in an
extra-data script, look for /etc/redhat-release relative to the
temporary chroot base path. Also given that the centos element
leaves DIB_RELEASE exported as am empty string in the calling
environment rather than unset, place it first in the conditional
list.

Change-Id: I0a51f88ff5ea71b6aa6e6406b656cefb0e135e88
2015-05-04 04:22:05 +00:00
Jeremy Stanley
08dc5cf613 Import subprocess in cache devstack element
Change fd9c80208c00021a49df6907973bbbb3fa242069 inadvertently
removed the subprocess import from 55-cache-devstack-repos even
though it was used in a function defined within that element, unlike
in its snapshot prep script counterpart. Readd it so that this
element works again.

Change-Id: I954a1e7e99af96b08e0a59e99e513902731fd773
2015-05-04 03:24:56 +00:00
Jeremy Stanley
fd9c80208c Replace subprocess with run_local in _find_images
In the DevStack caching script/element for Nodepool images, use
run_local instead of subprocess.check_output in the _find_images
function. The latter wasn't introduced until Python 2.7 and so won't
work on CentOS 6. The script called from this function returns
quickly and doesn't benefit from non-blocking I/O anyway.

Change-Id: I3129f1f5b3fece321ae132ea1a52b0e156e58365
2015-05-02 12:17:56 +00:00
Jeremy Stanley
1023e20f41 Determine CentOS 6 platform in cache-devstack
The centos element (which is CentOS 6.x specific) doesn't provide
DIB_RELEASE so we have to identify it another way.

Change-Id: Ibf3b25b99f03c6077538dec6c3770dc0f690e3f5
2015-05-01 20:57:05 +00:00
Monty Taylor
fc554ab821 Disable metadata in cloud-init config
Rather than deleting cloud-init, which is going to take longer, just
disable ec2 metadata service. This will be a no-op on rackspace, which
already does this.

Change-Id: I5e8baee50800f7aae474288a914333c21466855a
2015-03-20 14:13:16 -04:00
Monty Taylor
6113b274e4 Revert "Remove ssh host keys during image build"
This reverts commit 1c04bff0d66b85cbdb74fa9ceaec6f1fa9f7ead4.

Change-Id: I097b1cbeed3beedec3f64260676641244b22a2ea
2015-03-20 12:47:10 -04:00
Monty Taylor
c9966cee0b Revert "Regenerate ssh host key on boot"
This reverts commit e60eb73a5d17b19a4beb53d67f7ef680f542a78b.

Change-Id: Iae667506e9878928f39f1518a26800f18f30a3eb
2015-03-20 12:47:05 -04:00
Monty Taylor
e60eb73a5d Regenerate ssh host key on boot
Ubuntu does not do this naturally, so we have to do it for it.

Change-Id: I27635a78ebd7154096ee9c89d7d2b9f4e01e2406
2015-03-19 16:35:36 -04:00
Monty Taylor
1c04bff0d6 Remove ssh host keys during image build
If we're going to remove cloud-init, then we need to make sure we don't
bake in ssh host keys.

Change-Id: Id67934924053cce77b440ddb521112fe1f96e76a
2015-03-19 13:13:30 -04:00
Matthew Treinish
8f7a206987 Revert "Cap the subunit2sql version in the nodepool scripts"
Once the migration has been run manually we need to use
subunit2sql>=0.4.0 because that is the version of the DB schema running
on the infra db.

This reverts commit aa87c57ca7fe95f9785719acb6b626f12171e240.

Change-Id: I747083bc15ecda7e1926a87c2adcdaf29e565e23
2015-03-16 15:13:05 +00:00
Matthew Treinish
aa87c57ca7 Cap the subunit2sql version in the nodepool scripts
Subunit2sql 0.4.0 was recently released which included a schema change
however the infra db migration takes too long and can't be automated.
(yet?) Until we run the migration we can't use 0.4.0 on any of the
tooling. This caps the version to be less than 0.4.0

Change-Id: I08f113fa904fa962e8f2dc04187ff44e764de47e
2015-03-13 20:48:27 -04:00
Jenkins
27d86a3953 Merge "Update dib script usage" 2015-03-13 07:55:19 +00:00
Clark Boylan
c1a8b3e76e Revert "Build wheel house during nodepool devstack caching"
This reverts commit 1f84dbb2ce2ae7ed50401299db499adb6e836ec0.

Reverting because this runs a significant portion of devstack during
image builds installing packages necessary to build the wheels. Instead
we should be building wheels and hosting them on our mirror. Then image
builds and jobs themselves can both use this mirror to either cache
wheels or install wheels.

Conflicts:
	nodepool/scripts/cache_devstack.py

Change-Id: I70ebc57076845995c539a42e4f87e241569211b4
2015-03-12 17:07:41 -07:00
Ramy Asselin
da4f071588 Ignore missing packages
There are some cases where packages (or its dependencies) are missing.
Cache them on a best-effort basis, and ignore any that are missing.
They will be downloaded and installed if and when they are needed.

Change-Id: I5cd7f5f35b4fef6002c6cc3d66543a33a6972ef8
2015-03-12 14:53:34 -07:00
Jenkins
971251414b Merge "Build wheel house during nodepool devstack caching" 2015-03-11 19:37:13 +00:00
Jenkins
bae9ecaccc Merge "Support custom static nameserver during build" 2015-03-11 19:02:23 +00:00
Ramy Asselin
0d5c572d52 Update dib script usage
Update manual dib mounting instructions to match changes made in the
tools/mount-image.sh script (I0deba1907f390f0d308ae6c8ed5448afbbf7688a)
and add a reference to the script itself in the documentation.

Change-Id: Ic72bf05f21cecb8bdff36956f3635c2f504c4dff
2015-03-10 15:58:32 -07:00
Matthew Treinish
1f84dbb2ce Build wheel house during nodepool devstack caching
This commit adds calling tools/build_wheels.sh to the cache devstack
step in the nodepool scripts. This will generate and cache the wheels
before the devstack run, which is a length process normally involving C
compilations.

Change-Id: I9064d7d9b9b879a05d665c3b002a631fcc953f52
2015-03-06 18:27:51 -05:00
Ramy Asselin
2433522020 DIB project-config scripts requires DIB_RELEASE
Also add a helpful hint to run in offline mode to speed things up
while debugging.

Change-Id: I4727ff8f0199b4b190339409f8417566286d944e
2015-03-05 17:53:29 -08:00
Jenkins
1c716e0449 Merge "zuul-swift-upload support recursive globs" 2015-03-06 01:19:24 +00:00
Ramy Asselin
4a5e37d3ed Use GIT_BASE environment variable
Use GIT_BASE variable to be consistent with:
nodepool/elements/openstack-repos/extra-data.d/50-create-repo-list

Change-Id: I2ae933aef62cb1f9009483406bb15405efaf4001
2015-03-04 17:28:25 -08:00
Joe Gordon
fb74bd0d38 Fix pkgs-to-install path
pkgs-to-install is written to /tmp/pkgs-to-install not
~/tmp/pkgs-to-install/.

From nodepool logs:
2015-02-26 14:24:11,465 INFO nodepool.image.build.devstack-trusty:
/tmp/in_target.d/install.d/50-download-pkgs:
 line 28: /root/tmp/pkgs-to-install: No such file or directory

Change-Id: If367be96bbc2761faa9bd4b4bb173a3ecbe9b406
2015-03-04 15:16:15 -08:00
Joshua Hesketh
3691476925 zuul-swift-upload support recursive globs
Allow supplying filename and paths with '**' recursive glob matches
to zuul-swift-upload. Since bash (or shell etc) will expand on any
filenames provided to the program this needs to be used in quotes.

Usage example:
./zuul_swift_upload.py my_results.txt '**/sdist/*.zip' output.log

The hierarchy is always flattened meaning the supplied list is
placed in the topmost generated index.html. Sub-folders still keep
their hierarchy.

Change-Id: I9ba04f7e46b579dcf3f8ad0bd188f41fa5dbcad9
2015-03-04 09:33:17 +11:00