Stop caching devstack packages
After talking with clarkb, we decided it might be time to also stop caching packages for devstack. Like the cache-bindep patch before, we have a robust mirror infra in place right now, and believe we are ready to start using it more. Change-Id: I249f21a98fea3b963b7ffb8e3d0fce02cc540d46 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
240bd4f249
commit
239df85cb2
|
@ -74,19 +74,6 @@ def git_branches():
|
|||
return branches
|
||||
|
||||
|
||||
def tokenize(fn, tokens, distribution, comment=None):
|
||||
for line in open(fn):
|
||||
if 'dist:' in line and ('dist:%s' % distribution not in line):
|
||||
continue
|
||||
if 'qpid' in line:
|
||||
continue # TODO: explain why this is here
|
||||
if comment and comment in line:
|
||||
line = line[:line.find(comment)]
|
||||
line = line.strip()
|
||||
if line and line not in tokens:
|
||||
tokens.append(line)
|
||||
|
||||
|
||||
def _legacy_find_images(basedir):
|
||||
"""Divine what images we should use based on parsing stackrc."""
|
||||
images = []
|
||||
|
@ -143,34 +130,6 @@ def local_prep(distribution):
|
|||
run_local(['sudo', 'git', 'checkout', branch], cwd=DEVSTACK)
|
||||
run_local(['sudo', 'git', 'pull', '--ff-only', 'origin'], cwd=DEVSTACK)
|
||||
|
||||
if os.path.exists(os.path.join(TMP_MOUNT_PATH, 'usr/bin/apt-get')):
|
||||
debs = []
|
||||
debdir = os.path.join(DEVSTACK, 'files', 'debs')
|
||||
if not os.path.exists(debdir):
|
||||
debdir = os.path.join(DEVSTACK, 'files', 'apts')
|
||||
for fn in os.listdir(debdir):
|
||||
fn = os.path.join(debdir, fn)
|
||||
tokenize(fn, debs, distribution, comment='#')
|
||||
branch_data['debs'] = debs
|
||||
|
||||
if os.path.exists(os.path.join(TMP_MOUNT_PATH, 'usr/bin/yum')):
|
||||
rpms = []
|
||||
rpmdir = os.path.join(DEVSTACK, 'files', 'rpms')
|
||||
for fn in os.listdir(rpmdir):
|
||||
fn = os.path.join(rpmdir, fn)
|
||||
tokenize(fn, rpms, distribution, comment='#')
|
||||
branch_data['rpms'] = rpms
|
||||
|
||||
if os.path.exists(os.path.join(TMP_MOUNT_PATH, 'usr/bin/emerge')):
|
||||
ebuilds = []
|
||||
ebuilddir = os.path.join(DEVSTACK, 'files', 'ebuilds')
|
||||
if not os.path.exists(ebuilddir):
|
||||
ebuilddir = os.path.join(DEVSTACK, 'files', 'ebuilds')
|
||||
for fn in os.listdir(ebuilddir):
|
||||
fn = os.path.join(ebuilddir, fn)
|
||||
tokenize(fn, ebuilds, distribution, comment='#')
|
||||
branch_data['ebuilds'] = ebuilds
|
||||
|
||||
images = _find_images(DEVSTACK)
|
||||
if not images:
|
||||
images = _legacy_find_images(DEVSTACK)
|
||||
|
@ -184,17 +143,6 @@ def main():
|
|||
|
||||
branches = local_prep(RELEASE)
|
||||
|
||||
with open(os.path.join(CACHEDIR, 'pkgs-to-install'), 'w') as pkgs:
|
||||
for branch_data in branches:
|
||||
if branch_data.get('debs'):
|
||||
pkgs.write(" ".join(branch_data['debs']) + "\n")
|
||||
elif branch_data.get('rpms'):
|
||||
pkgs.write(" ".join(branch_data['rpms']) + "\n")
|
||||
elif branch_data.get('ebuilds'):
|
||||
pkgs.write(" ".join(branch_data['ebuilds']) + "\n")
|
||||
else:
|
||||
sys.exit('No supported package data found.')
|
||||
|
||||
image_filenames = []
|
||||
line_template = "%(name)s file %(location)s %(url)s\n"
|
||||
with open(IMAGES, 'w') as images_list:
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Copyright (C) 2011-2013 OpenStack Foundation
|
||||
#
|
||||
# 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.
|
||||
|
||||
# dib-lint: disable=setu setpipefail
|
||||
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
||||
set -x
|
||||
fi
|
||||
set -e
|
||||
|
||||
if [[ ${YUM:-yum} == "dnf" ]]; then
|
||||
echo "*** caching disabled for dnf"
|
||||
echo "*** see https://etherpad.openstack.org/p/infra-f22"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
while read line ; do
|
||||
|
||||
if [ -f /usr/bin/apt-get ] ; then
|
||||
# --ignore-missing conflicts with set -e, so force it to be ok
|
||||
apt-get -y --ignore-missing -d install $line || true
|
||||
else
|
||||
yum install -y --downloadonly $line
|
||||
fi
|
||||
|
||||
done < /tmp/pkgs-to-install
|
||||
|
||||
rm /tmp/pkgs-to-install
|
Loading…
Reference in New Issue