]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Don't attempt to schedule when missing packages
authorZack Cerza <zack@redhat.com>
Wed, 13 Apr 2016 19:00:05 +0000 (13:00 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 13 Apr 2016 21:34:06 +0000 (15:34 -0600)
By default, anyway. It's possible to set
config.suite_allow_missing_packages to continue stick with the old
behavior.

Signed-off-by: Zack Cerza <zack@redhat.com>
docs/siteconfig.rst
teuthology/config.py
teuthology/suite.py
teuthology/test/test_suite.py

index 214a22fe237aa57aaa2a79b746e114186ef5da95..2dfe6637f017238af97ba77b2202cba6edbf8038 100644 (file)
@@ -126,6 +126,10 @@ Here is a sample configuration with many of the options set and documented::
     # demand.
     suite_verify_ceph_hash: True
 
+    # If true, teuthology-suite will schedule jobs even if the required
+    # packages are not built.
+    suite_allow_missing_packages: False
+
     # The rsync destination to upload the job results, when --upload is
     # is provided to teuthology-suite.
     #
index bade3a93128a4b0f096735c047f4dc25e8063c53..0b16f5b2f1bc2b45bde6779ca400fce0393f7f7e 100644 (file)
@@ -155,6 +155,7 @@ class TeuthologyConfig(YamlConfig):
         'baseurl_template': 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}',
         'teuthology_path': None,
         'suite_verify_ceph_hash': True,
+        'suite_allow_missing_packages': False,
         'openstack': {
             'clone': 'git clone http://github.com/ceph/teuthology',
             'user-data': 'teuthology/openstack/openstack-{os_type}-{os_version}-user-data.txt',
index 35c19ab48d74042e3a9365c8ff1c39f583077550..28267a973d53905debca7bbf1eb2a9f7096458d9 100644 (file)
@@ -469,7 +469,10 @@ def get_distro_defaults(distro, machine_type):
     And ('x86_64', 'centos7', 'rpm') when passed anything else
     """
     arch = 'x86_64'
-    if distro in (None, 'None', 'rhel', 'centos'):
+    if distro in (None, 'None'):
+        release = 'centos7'
+        pkg_type = 'rpm'
+    elif distro in ('rhel', 'centos'):
         release = 'centos7'
         pkg_type = 'rpm'
     elif distro == 'ubuntu':
@@ -679,7 +682,7 @@ def schedule_suite(job_config,
             args=arg
         )
 
-        if dry_run and config.suite_verify_ceph_hash:
+        if config.suite_verify_ceph_hash:
             full_job_config = dict()
             deep_merge(full_job_config, job_config.to_dict())
             deep_merge(full_job_config, parsed_yaml)
@@ -698,7 +701,7 @@ def schedule_suite(job_config,
                                            package_versions):
                 m = "Packages for os_type '{os}', flavor {flavor} and " + \
                     "ceph hash '{ver}' not found"
-                log.info(m.format(os=os_type, flavor=flavor, ver=sha1))
+                log.error(m.format(os=os_type, flavor=flavor, ver=sha1))
                 jobs_missing_packages.append(job)
 
         jobs_to_schedule.append(job)
@@ -709,8 +712,13 @@ def schedule_suite(job_config,
         )
 
         log_prefix = ''
-        if dry_run and job in jobs_missing_packages:
+        if job in jobs_missing_packages:
             log_prefix = "Missing Packages: "
+            if not dry_run and not config.suite_allow_missing_packages:
+                schedule_fail(
+                    "At least one job needs packages that don't exist. "
+                    "See above."
+                )
         teuthology_schedule(
             args=job['args'],
             dry_run=dry_run,
@@ -726,9 +734,9 @@ def schedule_suite(job_config,
     log.info('Suite %s in %s scheduled %d jobs.' % (suite_name, path, count))
     log.info('Suite %s in %s -- %d jobs were filtered out.' %
              (suite_name, path, len(configs) - count))
-    if dry_run:
-        log.info('Suite %s in %s scheduled %d jobs with missing packages.' %
-                 (suite_name, path, missing_count))
+    if missing_count:
+        log.warn('Scheduled %d/%d jobs that are missing packages!',
+                 missing_count, count)
     return count
 
 
index 00be2b6d4888b59aeaa4473f8364944eb90c8d23..f09ed65b5a6c6431d579cbe2ed252eeeba68c169 100644 (file)
@@ -895,8 +895,9 @@ class TestSuiteMain(object):
                 sleep=DEFAULT,
                 get_arch=lambda x: 'x86_64',
                 git_ls_remote=lambda *args: '12345',
-                package_version_for_hash=lambda *args: 'fake-9.5',
+                package_version_for_hash=DEFAULT,
                 ) as m:
+            m['package_version_for_hash'].return_value = 'fake-9.5'
             config.suite_verify_ceph_hash = True
             main(['--suite', suite_name,
                   '--suite-dir', 'teuthology/test',