]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
install: support extra_system_packages config option
authorNathan Cutler <ncutler@suse.com>
Fri, 20 Jul 2018 15:18:26 +0000 (17:18 +0200)
committerNathan Cutler <ncutler@suse.com>
Wed, 1 Aug 2018 14:53:14 +0000 (16:53 +0200)
On DEB systems, packages specified via the extra_packages option are installed
while forcing the same package version number as the version of the project
(i.e. Ceph) under test. So extra_packages can only be used to specify
additional project (Ceph) packages.

If we wanted to specify additional system (non-project, non-Ceph) packages to
install, we were out of luck. This commit implements an extra_system_packages
option for specifying extra non-project packages.

Fixes: http://tracker.ceph.com/issues/25026
Signed-off-by: Nathan Cutler <ncutler@suse.com>
teuthology/task/install/__init__.py
teuthology/task/install/deb.py
teuthology/task/install/rpm.py

index 3bb66a13c75bf195af96aa92d861e199de2dc3fa..910d4fcda32bfba9f51aac2bf0bae3de63528d99 100644 (file)
@@ -471,6 +471,9 @@ def task(ctx, config):
         extra_packages:
            deb: ['librados-dev', 'libradosstriper-dev']
            rpm: ['librados-devel', 'libradosstriper-devel']
+        extra_system_packages:
+           deb: ['libboost-system-dev']
+           rpm: ['boost-devel']
     - install:
         rhbuild: 1.3.0
         playbook: downstream_setup.yml
index 6ce9b69cc3cae716d10e2b3332eaf3e93c89385d..e259e4809f7a26aedd67a1ed65438c57d559c5df 100644 (file)
@@ -48,6 +48,13 @@ def _update_package_list_and_install(ctx, remote, debs, config):
     log.info("Installing packages: {pkglist} on remote deb {arch}".format(
         pkglist=", ".join(debs), arch=builder.arch)
     )
+    system_pkglist = config.get('extra_system_packages')
+    if system_pkglist:
+        if isinstance(system_pkglist, dict):
+            system_pkglist = system_pkglist.get('deb')
+        log.info("Installing system (non-project) packages: {pkglist} on remote deb {arch}".format(
+            pkglist=", ".join(system_pkglist), arch=builder.arch)
+        )
     # get baseurl
     log.info('Pulling from %s', builder.base_url)
 
@@ -57,15 +64,20 @@ def _update_package_list_and_install(ctx, remote, debs, config):
     builder.install_repo()
 
     remote.run(args=['sudo', 'apt-get', 'update'], check_status=False)
-    remote.run(
-        args=[
+    install_cmd = [
             'sudo', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', '-y',
             '--force-yes',
             '-o', run.Raw('Dpkg::Options::="--force-confdef"'), '-o', run.Raw(
                 'Dpkg::Options::="--force-confold"'),
             'install',
-        ] + ['%s=%s' % (d, version) for d in debs],
+        ]
+    remote.run(
+        args=install_cmd + ['%s=%s' % (d, version) for d in debs],
     )
+    if system_pkglist:
+        remote.run(
+            args=install_cmd + system_pkglist,
+        )
     ldir = _get_local_dir(config, remote)
     if ldir:
         for fyle in os.listdir(ldir):
index b84ee6041d10abedeed7b540a61a5efc599f00d6..dc7f72594d4747493ebb2a12c02e3afcd675726e 100644 (file)
@@ -93,6 +93,14 @@ def _update_package_list_and_install(ctx, remote, rpm, config):
     :param rpm: list of packages names to install
     :param config: the config dict
     """
+    # rpm does not force installation of a particular version of the project
+    # packages, so we can put extra_system_packages together with the rest
+    system_pkglist = config.get('extra_system_packages')
+    if system_pkglist:
+        if isinstance(system_pkglist, dict):
+            rpm += system_pkglist.get('rpm')
+        else:
+            rpm += system_pkglist
     rpm = _package_overrides(rpm, remote.os)
     builder = _get_builder_project(ctx, remote, config)
     log.info('Pulling from %s', builder.base_url)