31 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Clark Boylan
12dc33e30c Use sudo when manipulating git for image list
When we build our images we attempt to checkout all of the valid
devstack branches so that we can list all of the images necessary to be
cached for each branch. Unfortunately this devstack repo is owned by
root during dib and snapshot image builds. This means we must use sudo
when updating the repo (either changing branches or updating the
current branch).

Change-Id: I8cd09cfed4d586648dcbd34fa04bfc030c31ee45
2015-02-26 18:19:23 -08:00
Gregory Haynes
bc3046bf01 set -x in cache-testrepository install
Were not set -x'ing here. This makes debugging failures near impossible.

Change-Id: Ib459c2897c191e10103efd3c3109c319dcc50723
2015-02-09 20:48:39 -08:00
Matthew Treinish
c6ff8a8c55 Preseed with a number of samples from db instead of aggregate
Because of the testrepository bug 1416512 using the aggregate stream
generated by sql2subunit the timing data would be ignored by the testr
scheduler. The long term fix is to address this in testrepository
eventually. But, in the short to get any utility out of the preseed
data this commit switches the preseed to not use the aggregate view
stream and instead take the 10 most recent runs and use those as
the preseed data. While this data isn't as good for performing the
optimization, but it will at least use the data.

Change-Id: Ib0e815ca1966f5b5806fb257b91ac7a25d4db18d
2015-02-04 15:01:51 -05:00
Matthew Treinish
cfaf1f9daf Set proper ownership on tempest test repository
When the testrepository directory is created by calling the preseed
script the permissions are different from the rest of the tempest
repo. When the dir is rsync'd by devstack-gate it errors out with
permission denied on the .testrepository dir. This commit fixes this
by setting the ownership to be the same as the rest of the cached
repo.

Change-Id: Ie12f3f0d824401f2ed53a77f8f307ea0f178854e
2015-01-23 16:11:26 -05:00
Joe Gordon
58cbd080bd Cache get-pip.py in dib element cache-devstack
We cache pip in cache_devstack but not in dib element cache-devstack

Fetching get-pip.py across the internet breaks surprisingly often in hp
cloud, so precache this.

Change-Id: I86d8e54b5a3129bedf7e472d4463009c139f0656
Related-Bug: #1413034
2015-01-23 12:05:19 -08:00
Clark Boylan
b8932165ba Fix DIB image cache path in DIB element
The DIB cache-devstack element's early-source-repos script was using a
hardcoded cache path rather than rooting at $DIB_IMAGE_CACHE. This meant
that for this portion of the DIB builds they insisted on writing to the
current users homedir and not the overridden cache path. Root the cache
path properly against $DIB_IMAGE_CACHE so that an overridden path is
properly used.

Change-Id: I9c84de7497bd9259b5660e78e84d2adc86f9d61c
2015-01-13 14:29:53 -08:00
Clark Boylan
87bba6b03f Use correct path for tempest in testr dib script
When seeding tempest with testrepository subunit data use the correct
path to the tempest repo in the imgae build. Because we moved to
install.d we ues a path relative to the chroot and not relative to the
mount path.

Change-Id: I8e296595945c8cfe91a88f69ae46fe33c53df2db
2015-01-12 22:08:22 -08:00
Clark Boylan
3d6303f3fc Set the executable bit on all dib element scripts
DIB needs its scripts to be executable or they are not run. Update
permissions on two files that were missing the executable bit.

Change-Id: Ie172e50de57b5168264964644cd28530f023542a
2015-01-12 16:15:27 -08:00
Jeremy Stanley
b70a27d6c4 Use PyMySQL and venv path when caching subunit2sql
Also rename the element to one which runs in the context of the
diskimage chroot rather than in the root context, and make it
executable.

Change-Id: I093d02706f2965e071e2a76ab1131ac29016d03c
2015-01-12 23:34:45 +00:00
Jeremy Stanley
05e6bfaa10 Correct tempest clone location in node prep
Change-Id: I4208637457bbf1e7562f358913ff71b9f3b0732d
2015-01-12 17:25:06 +00:00
Jenkins
1d113cbf24 Merge "Add nodepool script to preseed testrepository from subunit2sql" 2015-01-12 14:14:45 +00:00
Matthew Treinish
8fdd1ce943 Add nodepool script to preseed testrepository from subunit2sql
This commit adds a new nodepool script to use subunit2sql to preseed
testrepository with timing data to use for scheduler optimization.
This uses aggregate data from all the tests stored in the subunit2sql
db from all the test runs to generate a subunit stream with test
execute times which equal the rolling average stored in the tests
table.

This also adds a call out to the new prepare_tempest_testrepository
script in order to pre-seed tempest's testrepository with data from
the subunit2sql DB. This will enable the testr scheduler to perform
some worker balance optimization based on the average run_times from
all the previous gate runs.

Change-Id: I04404a55baf4da2745760246b8606ed3db52c03a
2015-01-07 12:25:06 -05:00
Monty Taylor
e89225e978 Support name change in devstack to debs
A short time ago, devstack change the name of its lists of debian
packages from apts to debs. In order to properly pre-cache, we should
read these.

Change-Id: Id784e2876a2cbbede650b7e101ff90f7d74ec367
2014-12-11 13:46:47 -08:00
Ian Wienand
f5c3bd5dad Initial centos7 support for build-image.sh
Add some filtering to 55-cache-devsatck-repos to handle centos7, which
actually gets setup with a DISTRO_NAME of rhel7 in devstack

Update the readme file to highlight the options for building other
images.

"DISTRO=centos7 ./tools/build-image.sh" creates a workable centos7
qcow image with this change and a d-i-b that includes
Ie24033468b78587ea87188ee1b843b26895798ff

Change-Id: Ida38cba0a303ab77432d5d354f1952e00ebfa00e
2014-10-07 10:21:00 -07:00
Anita Kuno
1d21cd635f Reorganizes project-config
This repo was created from filter branching the openstack-infra/
config repo. This process brought a lot of cruft with it in the
form of directories that we no longer need. This patch removes
that cruft so we begin with a tidier repo.

Change-Id: Ibffad1b11c0c5f84eedfb0365369f60c4961a0f3
2014-09-25 11:41:04 -04:00