def __init__(self, args): """ args must be a config.YamlConfig object """ self.args = args self.name = self.make_run_name() if self.args.ceph_repo: config.ceph_git_url = self.args.ceph_repo if self.args.suite_repo: config.ceph_qa_suite_git_url = self.args.suite_repo self.base_config = self.create_initial_config() # caches package versions to minimize requests to gbs self.package_versions = dict() if self.args.suite_dir: self.suite_repo_path = self.args.suite_dir else: self.suite_repo_path = util.fetch_repos( self.base_config.suite_branch, test_name=self.name) # Interpret any relative paths as being relative to ceph-qa-suite # (absolute paths are unchanged by this) self.base_yaml_paths = [os.path.join(self.suite_repo_path, b) for b in self.args.base_yaml_paths]
def create_initial_config(self): """ Put together the config file used as the basis for each job in the run. Grabs hashes for the latest ceph, kernel and teuthology versions in the branches specified and specifies them so we know exactly what we're testing. :returns: A JobConfig object """ self.kernel_dict = self.choose_kernel() ceph_hash = self.choose_ceph_hash() # We don't store ceph_version because we don't use it yet outside of # logging. self.choose_ceph_version(ceph_hash) suite_branch = self.choose_suite_branch() suite_hash = self.choose_suite_hash(suite_branch) if self.args.suite_dir: self.suite_repo_path = self.args.suite_dir else: self.suite_repo_path = util.fetch_repos(suite_branch, test_name=self.name) teuthology_branch, teuthology_sha1 = self.choose_teuthology_branch() if self.args.distro_version: self.args.distro_version, _ = \ OS.version_codename(self.args.distro, self.args.distro_version) self.config_input = dict( suite=self.args.suite, suite_branch=suite_branch, suite_hash=suite_hash, ceph_branch=self.args.ceph_branch, ceph_hash=ceph_hash, ceph_repo=config.get_ceph_git_url(), teuthology_branch=teuthology_branch, teuthology_sha1=teuthology_sha1, machine_type=self.args.machine_type, distro=self.args.distro, distro_version=self.args.distro_version, archive_upload=config.archive_upload, archive_upload_key=config.archive_upload_key, suite_repo=config.get_ceph_qa_suite_git_url(), suite_relpath=self.args.suite_relpath, flavor=self.args.flavor, ) return self.build_base_config()