From: Josh Durgin Date: Sun, 17 Jan 2021 02:16:59 +0000 (-0500) Subject: suite: pass the commit of teuthology with each job's config X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d8f51727ab206c22d613fb8f513da9b33eb1f5d2;p=teuthology.git suite: pass the commit of teuthology with each job's config We already pass the suite sha1, but do not use it yet. This is the missing piece to be able to use the same version of everything across a whole run. Signed-off-by: Josh Durgin --- diff --git a/teuthology/suite/placeholder.py b/teuthology/suite/placeholder.py index 1e5014d0a..2bfd07df8 100644 --- a/teuthology/suite/placeholder.py +++ b/teuthology/suite/placeholder.py @@ -47,6 +47,7 @@ dict_templ = { 'branch': Placeholder('ceph_branch'), 'sha1': Placeholder('ceph_hash'), 'teuthology_branch': Placeholder('teuthology_branch'), + 'teuthology_sha1': Placeholder('teuthology_sha1'), 'archive_upload': Placeholder('archive_upload'), 'archive_upload_key': Placeholder('archive_upload_key'), 'machine_type': Placeholder('machine_type'), diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 3b64185ee..4b43d0180 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -99,7 +99,7 @@ class Run(object): else: self.suite_repo_path = util.fetch_repos( suite_branch, test_name=self.name) - teuthology_branch = self.choose_teuthology_branch() + teuthology_branch, teuthology_sha1 = self.choose_teuthology_branch() if self.args.distro_version: @@ -113,6 +113,7 @@ class Run(object): 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, @@ -200,8 +201,9 @@ class Run(object): log.info('skipping ceph package verification') def choose_teuthology_branch(self): - """Select teuthology branch, check if it is present in repo and - return the branch name value. + """Select teuthology branch, check if it is present in repo and return + tuple (branch, hash) where hash is commit sha1 corresponding + to the HEAD of the branch. The branch name value is determined in the following order: @@ -220,6 +222,7 @@ class Run(object): Use ``master``. Generate exception if the branch is not present in the repo. + """ teuthology_branch = self.args.teuthology_branch if not teuthology_branch: @@ -242,15 +245,15 @@ class Run(object): if not teuthology_branch: teuthology_branch = config.get('teuthology_branch', 'master') - teuthology_hash = util.git_ls_remote( + teuthology_sha1 = util.git_ls_remote( 'teuthology', teuthology_branch ) - if not teuthology_hash: + if not teuthology_sha1: exc = BranchNotFoundError(teuthology_branch, build_git_url('teuthology')) util.schedule_fail(message=str(exc), name=self.name) - log.info("teuthology branch: %s %s", teuthology_branch, teuthology_hash) - return teuthology_branch + log.info("teuthology branch: %s %s", teuthology_branch, teuthology_sha1) + return teuthology_branch, teuthology_sha1 @property def ceph_repo_name(self): diff --git a/teuthology/suite/test/test_placeholder.py b/teuthology/suite/test/test_placeholder.py index 4b2c2fb75..3427439fd 100644 --- a/teuthology/suite/test/test_placeholder.py +++ b/teuthology/suite/test/test_placeholder.py @@ -13,6 +13,7 @@ class TestPlaceholder(object): ceph_branch='ceph_branch', ceph_hash='ceph_hash', teuthology_branch='teuthology_branch', + teuthology_sha1='teuthology_sha1', machine_type='machine_type', distro='distro', distro_version='distro_version', @@ -38,6 +39,7 @@ class TestPlaceholder(object): ceph_branch='ceph_branch', ceph_hash='ceph_hash', teuthology_branch='teuthology_branch', + teuthology_sha1='teuthology_sha1', machine_type='machine_type', archive_upload='archive_upload', archive_upload_key='archive_upload_key',