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
This commit is contained in:
parent
1f3aea2e53
commit
1f84dbb2ce
35
nodepool/elements/cache-devstack/install.d/98-build-wheelhouse
Executable file
35
nodepool/elements/cache-devstack/install.d/98-build-wheelhouse
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
# implied.
|
||||||
|
#
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
|
||||||
|
DEVSTACK='/opt/git/openstack-dev/devstack'
|
||||||
|
|
||||||
|
export WHEELHOUSE='/home/jenkins/cache/files/wheelhouse'
|
||||||
|
|
||||||
|
pushd $DEVSTACK
|
||||||
|
for branch in $(git branch -a | grep '^\s*remotes/origin') ; do
|
||||||
|
if [[ $(echo $branch | grep '^->') || $(echo $branch | grep "^origin") || $(echo $branch | grep 'HEAD') ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
sudo git checkout $branch
|
||||||
|
if [[ -f $DEVSTACK/tools/build_wheels.sh ]] ; then
|
||||||
|
bash tools/build_wheels.sh
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
popd
|
@ -94,6 +94,15 @@ def _find_images(basedir):
|
|||||||
return images
|
return images
|
||||||
|
|
||||||
|
|
||||||
|
def _build_wheelhouse(basedir):
|
||||||
|
build_wheels_path = os.path.join(basedir, 'tools/build_wheels.sh')
|
||||||
|
if os.path.isfile(build_wheels_path):
|
||||||
|
env = os.environ
|
||||||
|
# Makes output dir for wheelhouse CACHEDIR/wheelhouse
|
||||||
|
env['WHEELHOUSE'] = os.path.join(CACHEDIR, 'wheelhouse')
|
||||||
|
run_local(['bash', 'tools/build_wheels.sh'], cwd=DEVSTACK, env=env)
|
||||||
|
|
||||||
|
|
||||||
def local_prep(distribution):
|
def local_prep(distribution):
|
||||||
branches = []
|
branches = []
|
||||||
for branch in git_branches():
|
for branch in git_branches():
|
||||||
@ -133,6 +142,7 @@ def local_prep(distribution):
|
|||||||
|
|
||||||
branch_data['images'] = images
|
branch_data['images'] = images
|
||||||
branches.append(branch_data)
|
branches.append(branch_data)
|
||||||
|
_build_wheelhouse(DEVSTACK)
|
||||||
return branches
|
return branches
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user