From 4992d97937f40ce97522fda27b156c475336faa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Mon, 22 May 2017 18:07:54 +0200 Subject: [PATCH 1/4] Remove leftovers from incomplete copr fedmsg implementation --- module_build_service/scheduler/handlers/modules.py | 5 ----- module_build_service/scheduler/handlers/repos.py | 6 ------ 2 files changed, 11 deletions(-) diff --git a/module_build_service/scheduler/handlers/modules.py b/module_build_service/scheduler/handlers/modules.py index 04aeaf9a..742d7951 100644 --- a/module_build_service/scheduler/handlers/modules.py +++ b/module_build_service/scheduler/handlers/modules.py @@ -280,8 +280,3 @@ def wait(config, session, msg): # other backends need this implemented (e.g. COPR) return [module_build_service.messaging.KojiRepoChange( 'fake msg', builder.module_build_tag['name'])] - - # We don't have copr implementation finished yet, Let's fake the repo change event, - # as if copr builds finished successfully - if config.system == "copr": - return [module_build_service.messaging.KojiRepoChange('fake msg', build.koji_tag)] diff --git a/module_build_service/scheduler/handlers/repos.py b/module_build_service/scheduler/handlers/repos.py index 8090423c..7a6f7d88 100644 --- a/module_build_service/scheduler/handlers/repos.py +++ b/module_build_service/scheduler/handlers/repos.py @@ -121,12 +121,6 @@ def done(config, session, msg): further_work += start_next_batch_build( config, module_build, session, builder) - # We don't have copr implementation finished yet, Let's fake the repo change event, - # as if copr builds finished successfully - if config.system == "copr": - further_work += [module_build_service.messaging.KojiRepoChange('fake msg', module_build.koji_tag)] - return further_work - else: if has_failed_components: module_build.transition(config, state=models.BUILD_STATES['failed'], From 6bea509833bd89711eda95e9b52fd06e5788e955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Mon, 22 May 2017 18:08:51 +0200 Subject: [PATCH 2/4] Set concurrent treshold for copr same as for mock --- module_build_service/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module_build_service/utils.py b/module_build_service/utils.py index 810d24fa..d10cba7b 100644 --- a/module_build_service/utils.py +++ b/module_build_service/utils.py @@ -93,6 +93,9 @@ def at_concurrent_component_threshold(config, session): if conf.system == "mock": return False + if conf.system == "copr": + return False + import koji # Placed here to avoid py2/py3 conflicts... if config.num_consecutive_builds and config.num_consecutive_builds <= \ From 3817914963513cd5368985bcfe669e1484f273c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Mon, 22 May 2017 20:00:06 +0200 Subject: [PATCH 3/4] Revert "Set concurrent treshold for copr same as for mock" This reverts commit 6bea509833bd89711eda95e9b52fd06e5788e955. --- module_build_service/utils.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/module_build_service/utils.py b/module_build_service/utils.py index d10cba7b..810d24fa 100644 --- a/module_build_service/utils.py +++ b/module_build_service/utils.py @@ -93,9 +93,6 @@ def at_concurrent_component_threshold(config, session): if conf.system == "mock": return False - if conf.system == "copr": - return False - import koji # Placed here to avoid py2/py3 conflicts... if config.num_consecutive_builds and config.num_consecutive_builds <= \ From ae10620897f1e1b64c3af64ade3a5c23754130e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Mon, 22 May 2017 20:02:13 +0200 Subject: [PATCH 4/4] Allow to set NUM_CONSECUTIVE_BUILDS to 0 as infinite Thank you @jkaluza for this piece of code --- module_build_service/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module_build_service/utils.py b/module_build_service/utils.py index 810d24fa..020c1ed0 100644 --- a/module_build_service/utils.py +++ b/module_build_service/utils.py @@ -174,7 +174,10 @@ def continue_batch_build(config, module, session, builder, components=None): components_to_build.append(c) # Start build of components in this batch. - with concurrent.futures.ThreadPoolExecutor(max_workers=config.num_consecutive_builds) as executor: + max_workers = 1 + if config.num_consecutive_builds > 0: + max_workers = config.num_consecutive_builds + with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor: futures = {executor.submit(start_build_component, builder, c): c for c in components_to_build} concurrent.futures.wait(futures)