From faf17fd08f0f1bd51a6c37f593dbc2efc6eea1a9 Mon Sep 17 00:00:00 2001 From: Deepika Upadhyay Date: Tue, 14 Sep 2021 02:29:07 +0530 Subject: [PATCH] s/basic/default we no longer need mapping of basic to default finally we are substituting basic as default when tring to do URI search, we can remove this mangling and directly make use of default flavor, we do not use flavor 'basic' for determining kernel flavor now. Signed-off-by: Deepika Upadhyay --- docs/README.rst | 2 +- docs/siteconfig.rst | 2 +- scripts/suite.py | 2 +- teuthology/packaging.py | 6 +----- teuthology/suite/run.py | 4 ++-- teuthology/suite/test/test_run_.py | 12 ++++++------ teuthology/suite/test/test_util.py | 2 +- teuthology/suite/util.py | 6 +++--- teuthology/task/buildpackages.py | 4 ++-- teuthology/task/install/util.py | 2 +- teuthology/test/integration/test_suite.py | 8 ++++---- teuthology/test/task/test_install.py | 2 +- teuthology/test/test_packaging.py | 16 ++++++++-------- 13 files changed, 32 insertions(+), 36 deletions(-) diff --git a/docs/README.rst b/docs/README.rst index 1b8239db66..ea03ef4ca2 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -95,7 +95,7 @@ where: * ``ceph``: ceph branch to be used. * ``kernel``: version of the kernel to be used. * ``email``: email address to send the results to. -* ``flavor``: the kernel flavor to run against +* ``flavor``: the ceph packages shaman flavor to run against * ``teuth``: version of teuthology to run * ``mtype``: machine type of the run * ``templates``: template file used for further modifying the suite (optional) diff --git a/docs/siteconfig.rst b/docs/siteconfig.rst index 40d5bf29c3..27040cba68 100644 --- a/docs/siteconfig.rst +++ b/docs/siteconfig.rst @@ -90,7 +90,7 @@ Here is a sample configuration with many of the options set and documented:: # # {host} is 'gitbuilder_host' from .teuthology.yaml # {proj} is the value of 'project' from the job yaml file or 'ceph' - # {flavor} is the value of 'flavor' from the job yaml file or 'basic' + # {flavor} is the value of 'flavor' from the job yaml file or 'default' # {uri} is ref/tag if 'tag' is set in the job yaml file # or ref/branch if 'branch' is set in the job yaml file # or sha1/sha1 if 'sha1' is set in the job yaml file diff --git a/scripts/suite.py b/scripts/suite.py index ca3b7701f4..9ddeb0d512 100644 --- a/scripts/suite.py +++ b/scripts/suite.py @@ -51,7 +51,7 @@ Standard arguments: -f , --flavor The ceph packages shaman flavor to run with: ('default', 'crimson', 'notcmalloc', 'jaeger') - [default=default] + [default: default] -t , --teuthology-branch The teuthology branch to run against. Default value is determined in the next order. diff --git a/teuthology/packaging.py b/teuthology/packaging.py index 7700b6e335..7842339a00 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -479,7 +479,7 @@ class GitbuilderProject(object): ) # when we're initializing with a remote we most likely have # a task config, not the entire teuthology job config - self.flavor = self.job_config.get("flavor", "basic") + self.flavor = self.job_config.get("flavor", "default") self.tag = self.job_config.get("tag") def _init_from_config(self): @@ -549,10 +549,6 @@ class GitbuilderProject(object): """ The base url that points at this project on gitbuilder. - For example:: - - http://gitbuilder.ceph.com/ceph-deb-raring-x86_64-basic/ref/master - :returns: A string of the base url for this project """ return self._get_base_url() diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index e87ab31809..24a0153744 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -135,7 +135,7 @@ class Run(object): kernel_hash = None else: kernel_hash = util.get_gitbuilder_hash( - 'kernel', self.args.kernel_branch, self.args.flavor, + 'kernel', self.args.kernel_branch, 'default', self.args.machine_type, self.args.distro, self.args.distro_version, ) @@ -148,7 +148,7 @@ class Run(object): log.info("kernel sha1: {hash}".format(hash=kernel_hash)) kernel_dict = dict(kernel=dict(kdb=True, sha1=kernel_hash)) if kernel_hash != 'distro': - kernel_dict['kernel']['flavor'] = self.args.flavor + kernel_dict['kernel']['flavor'] = 'default' else: kernel_dict = dict() return kernel_dict diff --git a/teuthology/suite/test/test_run_.py b/teuthology/suite/test/test_run_.py index c47b15ed8e..f6c3cb16e7 100644 --- a/teuthology/suite/test/test_run_.py +++ b/teuthology/suite/test/test_run_.py @@ -164,7 +164,7 @@ class TestRun(object): 'base_yaml_paths': [], 'ceph_branch': 'master', 'machine_type': 'smithi', - 'flavor': 'basic', + 'flavor': 'default', 'kernel_branch': 'testing', 'suite': 'krbd', } @@ -247,7 +247,7 @@ class TestScheduleSuite(object): StringIO(frag2_read_output), contextlib.closing(BytesIO()) ] - m_get_install_task_flavor.return_value = 'basic' + m_get_install_task_flavor.return_value = 'default' m_get_package_versions.return_value = dict() m_has_packages_for_distro.return_value = True # schedule_jobs() is just neutered; check calls below @@ -260,7 +260,7 @@ class TestScheduleSuite(object): assert(count == 1) assert runobj.base_config['suite_sha1'] == 'suite_hash' m_has_packages_for_distro.assert_has_calls( - [call('ceph_sha1', 'ubuntu', '14.04', 'basic', {})], + [call('ceph_sha1', 'ubuntu', '14.04', 'default', {})], ) frags = (frag1_read_output, frag2_read_output) expected_job = dict( @@ -320,7 +320,7 @@ class TestScheduleSuite(object): ] m_build_matrix.return_value = build_matrix_output m_open.side_effect = [StringIO('field: val\n') for i in range(11)] - m_get_install_task_flavor.return_value = 'basic' + m_get_install_task_flavor.return_value = 'default' m_get_package_versions.return_value = dict() m_has_packages_for_distro.side_effect = [ False for i in range(11) @@ -383,7 +383,7 @@ class TestScheduleSuite(object): ] + [ contextlib.closing(BytesIO()) ] - m_get_install_task_flavor.return_value = 'basic' + m_get_install_task_flavor.return_value = 'default' m_get_package_versions.return_value = dict() # NUM_FAILS, then success m_has_packages_for_distro.side_effect = \ @@ -397,7 +397,7 @@ class TestScheduleSuite(object): count = runobj.schedule_suite() assert count == 1 m_has_packages_for_distro.assert_has_calls( - [call('ceph_sha1' + '^' * i, 'ubuntu', '14.04', 'basic', {}) + [call('ceph_sha1' + '^' * i, 'ubuntu', '14.04', 'default', {}) for i in range(NUM_FAILS+1)] ) m_find_git_parent.assert_has_calls( diff --git a/teuthology/suite/test/test_util.py b/teuthology/suite/test/test_util.py index 395860efb4..270245f996 100644 --- a/teuthology/suite/test/test_util.py +++ b/teuthology/suite/test/test_util.py @@ -156,7 +156,7 @@ class TestFlavor(object): ), ], ) - assert util.get_install_task_flavor(config) == 'basic' + assert util.get_install_task_flavor(config) == 'default' def test_get_install_task_flavor_simple(self): config = dict( diff --git a/teuthology/suite/util.py b/teuthology/suite/util.py index e1f4d031d7..5933f56891 100644 --- a/teuthology/suite/util.py +++ b/teuthology/suite/util.py @@ -26,7 +26,7 @@ from teuthology.task.install import get_flavor log = logging.getLogger(__name__) CONTAINER_DISTRO = 'centos/8' # the one to check for build_complete -CONTAINER_FLAVOR = 'basic' # basic maps to default on shaman +CONTAINER_FLAVOR = 'default' def fetch_repos(branch, test_name): @@ -254,7 +254,7 @@ def get_branch_info(project, branch, project_owner='ceph'): return resp.json() -def package_version_for_hash(hash, flavor='basic', distro='rhel', +def package_version_for_hash(hash, flavor='default', distro='rhel', distro_version='8.0', machine_type='smithi'): """ Does what it says on the tin. Uses gitbuilder repos. @@ -411,7 +411,7 @@ def has_packages_for_distro(sha1, os_type, os_version, flavor, :param sha1: The sha1 hash of the ceph version. :param os_type: The distro we want to get packages for, given the ceph sha1. Ex. 'ubuntu', 'rhel', etc. - :param flavor: The distro flavor + :param flavor: The ceph packages shaman flavor :param package_versions: Use this optionally to use cached results of previous calls to gitbuilder. :returns: True, if packages are found. False otherwise. diff --git a/teuthology/task/buildpackages.py b/teuthology/task/buildpackages.py index 7d83ef1ac5..ae56af01fa 100644 --- a/teuthology/task/buildpackages.py +++ b/teuthology/task/buildpackages.py @@ -53,7 +53,7 @@ def apply_overrides(ctx, config): def get_config_install(ctx, config): config = apply_overrides(ctx, config) log.debug('install config %s' % config) - return [(config.get('flavor', 'basic'), + return [(config.get('flavor', 'default'), config.get('tag', ''), config.get('branch', ''), config.get('sha1'))] @@ -69,7 +69,7 @@ def get_config_install_upgrade(ctx, config): log.debug('install.upgrade config ' + str(role_config) + ' and with overrides ' + str(o)) # for install.upgrade overrides are actually defaults - configs.append((o.get('flavor', 'basic'), + configs.append((o.get('flavor', 'default'), role_config.get('tag', o.get('tag', '')), role_config.get('branch', o.get('branch', '')), role_config.get('sha1', o.get('sha1')))) diff --git a/teuthology/task/install/util.py b/teuthology/task/install/util.py index dce71ec2b6..0fec21a613 100644 --- a/teuthology/task/install/util.py +++ b/teuthology/task/install/util.py @@ -38,7 +38,7 @@ def get_flavor(config): Determine the flavor to use. """ config = config or dict() - flavor = config.get('flavor', 'basic') + flavor = config.get('flavor', 'default') if config.get('path'): # local dir precludes any other flavors diff --git a/teuthology/test/integration/test_suite.py b/teuthology/test/integration/test_suite.py index 264400719e..02c39d17c4 100644 --- a/teuthology/test/integration/test_suite.py +++ b/teuthology/test/integration/test_suite.py @@ -19,14 +19,14 @@ class TestSuiteOnline(object): def test_kernel_hash_saya(self): # We don't currently have these packages. - assert suite.get_hash('kernel', 'master', 'basic', 'saya') is None + assert suite.get_hash('kernel', 'master', 'default', 'saya') is None def test_all_master_branches(self): # Don't attempt to send email config.results_email = None job_config = suite.create_initial_config('suite', 'master', 'master', 'master', 'testing', - 'basic', 'centos', 'plana') + 'default', 'centos', 'plana') assert ((job_config.branch, job_config.teuthology_branch, job_config.suite_branch) == ('master', 'master', 'master')) @@ -71,7 +71,7 @@ class TestSuiteOnline(object): config.results_email = None job_config = suite.create_initial_config('MY_SUITE', 'master', 'master', 'master', 'testing', - 'basic', 'centos', 'plana') + 'default', 'centos', 'plana') assert job_config['suite'] == 'MY_SUITE' def test_config_kernel_section(self): @@ -79,7 +79,7 @@ class TestSuiteOnline(object): config.results_email = None job_config = suite.create_initial_config('MY_SUITE', 'master', 'master', 'master', 'testing', - 'basic', 'centos', 'plana') + 'default', 'centos', 'plana') assert job_config['kernel']['kdb'] is True diff --git a/teuthology/test/task/test_install.py b/teuthology/test/task/test_install.py index 15b9085e18..3c5be90484 100644 --- a/teuthology/test/task/test_install.py +++ b/teuthology/test/task/test_install.py @@ -106,7 +106,7 @@ class TestInstall(object): def test_get_flavor_default(self): config = dict() - assert install.get_flavor(config) == 'basic' + assert install.get_flavor(config) == 'default' def test_get_flavor_simple(self): config = dict( diff --git a/teuthology/test/test_packaging.py b/teuthology/test/test_packaging.py index 6af0940097..2d97ac81c4 100644 --- a/teuthology/test/test_packaging.py +++ b/teuthology/test/test_packaging.py @@ -311,7 +311,7 @@ class TestBuilderProject(object): pytest.skip() def _get_remote(self, arch="x86_64", system_type="deb", distro="ubuntu", - codename="trusty", version="14.04"): + codename="focal", version="20.04"): rem = Mock() rem.system_type = system_type rem.os.name = distro @@ -342,7 +342,7 @@ class TestBuilderProject(object): assert expected is not None config = dict( os_type="ubuntu", - os_version="14.04", + os_version="20.04", sha1="sha1", ) gp = self.klass("ceph", config) @@ -353,7 +353,7 @@ class TestBuilderProject(object): def test_init_from_config_branch_ref(self): config = dict( os_type="ubuntu", - os_version="14.04", + os_version="20.04", branch='jewel', ) gp = self.klass("ceph", config) @@ -364,7 +364,7 @@ class TestBuilderProject(object): def test_init_from_config_tag_ref(self): config = dict( os_type="ubuntu", - os_version="14.04", + os_version="20.04", tag='v10.0.1', ) gp = self.klass("ceph", config) @@ -375,7 +375,7 @@ class TestBuilderProject(object): def test_init_from_config_tag_overrides_branch_ref(self, caplog): config = dict( os_type="ubuntu", - os_version="14.04", + os_version="20.04", branch='jewel', tag='v10.0.1', ) @@ -390,7 +390,7 @@ class TestBuilderProject(object): def test_init_from_config_branch_overrides_sha1(self, caplog): config = dict( os_type="ubuntu", - os_version="14.04", + os_version="20.04", branch='jewel', sha1='sha1', ) @@ -656,7 +656,7 @@ class TestShamanProject(TestBuilderProject): .test_init_from_remote_base_url( "https://shaman.ceph.com/api/search?status=ready" "&project=ceph&flavor=default" - "&distros=ubuntu%2F14.04%2Fx86_64&ref=master" + "&distros=ubuntu%2F20.04%2Fx86_64&ref=master" ) def test_init_from_remote_base_url_debian(self): @@ -690,7 +690,7 @@ class TestShamanProject(TestBuilderProject): ): super(TestShamanProject, self).test_init_from_config_base_url( "https://shaman.ceph.com/api/search?status=ready&project=ceph" \ - "&flavor=default&distros=ubuntu%2F14.04%2Fx86_64&sha1=sha1" + "&flavor=default&distros=ubuntu%2F20.04%2Fx86_64&sha1=sha1" ) @patch('teuthology.packaging.ShamanProject._get_package_sha1') -- 2.39.5