From 78fa8dcc507e5bccda693146ac2974875bc4072e Mon Sep 17 00:00:00 2001
From: Mohan Boddu <mboddu@bhujji.com>
Date: May 18 2020 15:36:31 +0000
Subject: [PATCH 1/5] Adding pre compose koji tasks, odcs token, and running compose


Signed-off-by: Mohan Boddu <mboddu@bhujji.com>

---

diff --git a/fedora-minimal-compose.py b/fedora-minimal-compose.py
index 7d41659..639295e 100755
--- a/fedora-minimal-compose.py
+++ b/fedora-minimal-compose.py
@@ -1,13 +1,18 @@
 #!/usr/bin/python3
 
 from fedora_messaging import api, config
-from odcs.client.odcs import ODCS, AuthMech
+from odcs.client.odcs import ODCS, AuthMech, ComposeSourceRawConfig
+import koji
 import logging
+import os
+import subprocess
 
 # Set local logging
 logger = logging.getLogger(__name__)
 logger.setLevel(logging.INFO)
 compose_threshold = 10
+odcs_file = '/etc/releng-odcs-oidc-token'
+fmc_tag = 'f33-minimal-compose'
 
 def number_of_packages_in_file(file):
     return sum(1 for line in file)
@@ -15,8 +20,13 @@ def number_of_packages_in_file(file):
 def save_nvr_to_file(nvr):
     f = open('packages_to_compose', 'w+')
     if number_of_packages_in_file(f) >= compose_threshold:
-        # run compose
         logger.info('Running the compose')
+        # Pre compose koji tasks
+        run_koji_tasks(fmc_tag, nvr)
+        # Get odcs token
+        odcs_token = get_odcs_token(odcs_file)
+        # Run the compose
+        run_compose(odcs_token)
     else:
         if f.readline().rstrip('\n') is nvr:
             logger.info('Package already in the set for compose')
@@ -27,15 +37,49 @@ def save_nvr_to_file(nvr):
 
     return True
 
-def run_compose():
-#odcs = ODCS("https://odcs.stg.fedoraproject.org",
-#            auth_mech=AuthMech.OpenIDC,
-#            openidc_token="e0d6b2c3-4293-4468-8b8f-57ff42fa84c9_vUVbx6m6Rmyc8j1Ecw2QPFXi6RhM7QrT")
+def run_koji_tasks(fmc_tag, new_build):
+    # Create a koji session
+    kojisession = koji.ClientSession('https://koji.fedoraproject.org/kojihub')
 
-#source_type = "tag"
-#sources = "rawhide"
-#compose = odcs.new_compose(sources, source_type)
+    # koji key tab auth
+    koji_bin = '/usr/bin/odcs-koji'
+
+    # koji untag current builds
+    old_builds = kojisession.listTagged(fmc_tag)
+    logger.info(f'Untagging old builds from {fmc_tag} : {old_builds}')
+    for old_build in old_builds:
+        untag_build = [koji_bin, 'untag-build', '--all', fmc_tag, old_build]
+        try:
+            subprocess.check_call(untag_build)
+        except subprocess.CalledProcessError as e:
+            logger.error(f'Untagging {old_build} from {fmc_tag} failed, exception: {e}')
+
+    # tag the new build
+    logger.info(f'Tagging the koji build {new_build} to {fmc_tag} tag')
+    tag_build = [koji_bin, 'tag-build', '--nowait', fmc_tag, new_build]
+    try:
+        subprocess.check_call(tag_build)
+    except subprocess.CalledProcessError as e:
+        logger.error(f'Tagging {new_build} from {fmc_tag} failed, exception: {e}')
+
+def get_odcs_token(odcs_file):
+    if os.path.exists(odcs_file):
+        f = open(odcs_file, "r")
+        token = f.readline()
+        return token
+    else:
+        logger.error('ODCS token file is missing.')
+
+def run_compose(odcs_token):
+    odcs = ODCS("https://odcs.fedoraproject.org",
+            auth_mech=AuthMech.OpenIDC,
+            openidc_token=odcs_token)
+    source = ComposeSourceRawConfig("releng_fmc", "master")
+
+    compose = odcs.request_compose(source)
+    logger.info(compose)
     return True
+
 class Consumer(object):
     """
     A fedora-messaging consumer that process messages
@@ -53,5 +97,4 @@ class Consumer(object):
         logger.debug(message.topic)
         logger.debug(message.body)
         package = message.body['build']['nvr']
-        save_nvr_to_file(package)
-        run_compose()        
\ No newline at end of file
+        save_nvr_to_file(package)
\ No newline at end of file

From e23aad5167bca6da5cd9ba70485a8e884098b4e2 Mon Sep 17 00:00:00 2001
From: Mohan Boddu <mboddu@bhujji.com>
Date: May 19 2020 20:14:00 +0000
Subject: [PATCH 2/5] Adding messaging config


And more changes

Signed-off-by: Mohan Boddu <mboddu@bhujji.com>

---

diff --git a/fedora-minimal-compose.py b/fedora-minimal-compose.py
index 639295e..50d3574 100755
--- a/fedora-minimal-compose.py
+++ b/fedora-minimal-compose.py
@@ -10,85 +10,72 @@ import subprocess
 # Set local logging
 logger = logging.getLogger(__name__)
 logger.setLevel(logging.INFO)
-compose_threshold = 10
+rawhide = '33'
 odcs_file = '/etc/releng-odcs-oidc-token'
-fmc_tag = 'f33-minimal-compose'
+fmc_tag = f'f{rawhide}-minimal-compose'
 
-def number_of_packages_in_file(file):
-    return sum(1 for line in file)
+class Consumer(object):
+    """
+    A fedora-messaging consumer that process messages
+    """
 
-def save_nvr_to_file(nvr):
-    f = open('packages_to_compose', 'w+')
-    if number_of_packages_in_file(f) >= compose_threshold:
-        logger.info('Running the compose')
-        # Pre compose koji tasks
-        run_koji_tasks(fmc_tag, nvr)
-        # Get odcs token
-        odcs_token = get_odcs_token(odcs_file)
-        # Run the compose
-        run_compose(odcs_token)
-    else:
-        if f.readline().rstrip('\n') is nvr:
-            logger.info('Package already in the set for compose')
-        else:
-            logger.info('Package writen to set for compose:')
-            logger.info(nvr)
-            f.write(nvr + '\n')
+    def __init__(self):
+        """
+        Configure the consumer
+        """
 
-    return True
+    def save_nvr_to_file(self, nvr):
+        f = open('builds_compose.log', 'w+')
+        logger.info(f'Build that triggered the compose:{nvr}')
+        f.write(nvr + '\n')
+        return True
 
-def run_koji_tasks(fmc_tag, new_build):
-    # Create a koji session
-    kojisession = koji.ClientSession('https://koji.fedoraproject.org/kojihub')
+    def run_koji_tasks(self, fmc_tag, new_build):
+        # Create a koji session
+        kojisession = koji.ClientSession('https://koji.fedoraproject.org/kojihub')
 
-    # koji key tab auth
-    koji_bin = '/usr/bin/odcs-koji'
+        # koji key tab auth
+        koji_bin = '/usr/bin/odcs-koji'
 
-    # koji untag current builds
-    old_builds = kojisession.listTagged(fmc_tag)
-    logger.info(f'Untagging old builds from {fmc_tag} : {old_builds}')
-    for old_build in old_builds:
-        untag_build = [koji_bin, 'untag-build', '--all', fmc_tag, old_build]
+        # koji untag current builds
+        old_builds = kojisession.listTagged(fmc_tag)
+        logger.info(f'Untagging old builds from {fmc_tag} : {old_builds}')
+        for old_build in old_builds:
+            untag_build = [koji_bin, 'untag-build', '--all', fmc_tag, old_build]
+            try:
+                subprocess.check_call(untag_build)
+            except subprocess.CalledProcessError as e:
+                logger.error(f'Untagging {old_build} from {fmc_tag} failed, exception: {e}')
+
+        # tag the new build
+        logger.info(f'Tagging the koji build {new_build} to {fmc_tag} tag')
+        tag_build = [koji_bin, 'tag-build', '--nowait', fmc_tag, new_build]
         try:
-            subprocess.check_call(untag_build)
+            subprocess.check_call(tag_build)
         except subprocess.CalledProcessError as e:
-            logger.error(f'Untagging {old_build} from {fmc_tag} failed, exception: {e}')
-
-    # tag the new build
-    logger.info(f'Tagging the koji build {new_build} to {fmc_tag} tag')
-    tag_build = [koji_bin, 'tag-build', '--nowait', fmc_tag, new_build]
-    try:
-        subprocess.check_call(tag_build)
-    except subprocess.CalledProcessError as e:
-        logger.error(f'Tagging {new_build} from {fmc_tag} failed, exception: {e}')
+            logger.error(f'Tagging {new_build} from {fmc_tag} failed, exception: {e}')
 
-def get_odcs_token(odcs_file):
-    if os.path.exists(odcs_file):
-        f = open(odcs_file, "r")
-        token = f.readline()
-        return token
-    else:
-        logger.error('ODCS token file is missing.')
-
-def run_compose(odcs_token):
-    odcs = ODCS("https://odcs.fedoraproject.org",
-            auth_mech=AuthMech.OpenIDC,
-            openidc_token=odcs_token)
-    source = ComposeSourceRawConfig("releng_fmc", "master")
+    def get_odcs_token(self, odcs_file):
+        if os.path.exists(odcs_file):
+            f = open(odcs_file, "r")
+            token = f.readline()
+            return token
+        else:
+            logger.error('ODCS token file is missing.')
 
-    compose = odcs.request_compose(source)
-    logger.info(compose)
-    return True
+    def run_compose(self, odcs_token):
+        odcs = ODCS("https://odcs.fedoraproject.org",
+                auth_mech=AuthMech.OpenIDC,
+                openidc_token=odcs_token)
+        source = ComposeSourceRawConfig("releng_fmc", "master")
 
-class Consumer(object):
-    """
-    A fedora-messaging consumer that process messages
-    """
+        compose_info = odcs.request_compose(source)
+        logger.info(compose_info)
+        return compose_info
 
-    def __init__(self):
-        """
-        Configure the consumer
-        """
+    def inject_builds_compose(self, compose_info):
+        compose_id = compose_info.get('id')
+        os.rename('builds_compose.log', f'/srv/odcs/odcs-{compose_id}/logs/builds_compose.log')
 
     def __call__(self, message: api.Message):
         """
@@ -96,5 +83,20 @@ class Consumer(object):
         """        
         logger.debug(message.topic)
         logger.debug(message.body)
-        package = message.body['build']['nvr']
-        save_nvr_to_file(package)
\ No newline at end of file
+        build = message.body['build']['nvr']
+        
+        # Check if its rawhide only build
+        # TODO: Extend it to branched.
+        # Get the dist tag of the build
+        dist_tag = build[-4:]
+        
+        if f'fc{rawhide}' in dist_tag:
+            self.save_nvr_to_file(build)
+            # Pre compose koji tasks
+            self.run_koji_tasks(fmc_tag, build)
+            # Get odcs token
+            odcs_token = self.get_odcs_token(odcs_file)
+            # Run the compose
+            compose_info = self.run_compose(odcs_token)
+            # Inject the file to into the compose log dir
+            self.inject_builds_compose(compose_info)
\ No newline at end of file
diff --git a/fedora-minimal-compose.toml b/fedora-minimal-compose.toml
new file mode 100644
index 0000000..8ac0a75
--- /dev/null
+++ b/fedora-minimal-compose.toml
@@ -0,0 +1,75 @@
+# A basic configuration for Fedora's message broker
+#
+# This file is in the TOML format.
+amqp_url = "amqps://fedora:@rabbitmq.fedoraproject.org/%2Fpublic_pubsub"
+callback = "fedora-minimal-compose:Consumer"
+
+[tls]
+ca_cert = "/etc/fedora-messaging/cacert.pem"
+keyfile = "/etc/fedora-messaging/fedora-key.pem"
+certfile = "/etc/fedora-messaging/fedora-cert.pem"
+
+[client_properties]
+app = "fmc"
+app_url = "https://pagure.io/releng/fmc"
+
+[exchanges."amq.topic"]
+type = "topic"
+durable = true
+auto_delete = false
+arguments = {}
+
+# Queue names *must* be in the normal UUID format: run "uuidgen" and use the
+# output as your queue name. If your queue is not exclusive, anyone can connect
+# and consume from it, causing you to miss messages, so do not share your queue
+# name. Any queues that are not auto-deleted on disconnect are garbage-collected
+# after approximately one hour.
+#
+# If you require a stronger guarantee about delivery, please talk to Fedora's
+# Infrastructure team.
+[queues.00000000-0000-0000-0000-000000000000]
+durable = false
+auto_delete = true
+exclusive = true
+arguments = {}
+
+[[bindings]]
+queue = "00000000-0000-0000-0000-000000000000"
+exchange = "amq.topic"
+routing_keys = ["org.fedoraproject.prod.buildsys.rpm.sign"]
+
+[qos]
+prefetch_size = 0
+prefetch_count = 25
+
+[log_config]
+level = "DEBUG"
+version = 1
+disable_existing_loggers = true
+
+[log_config.formatters.simple]
+format = "%(asctime)s %(levelname)s %(name)s - %(message)s"
+
+[log_config.handlers.console]
+class = "logging.StreamHandler"
+formatter = "simple"
+stream = "ext://sys.stdout"
+
+[log_config.loggers.fedora_messaging]
+level = "INFO"
+propagate = false
+handlers = ["console"]
+
+[log_config.loggers.twisted]
+level = "INFO"
+propagate = false
+handlers = ["console"]
+
+[log_config.loggers.pika]
+level = "WARNING"
+propagate = false
+handlers = ["console"]
+
+[log_config.root]
+level = "ERROR"
+handlers = ["console"]

From 1f70fbdd1bc0c120d483b0d0f78d86805ae06a7c Mon Sep 17 00:00:00 2001
From: Mohan Boddu <mboddu@bhujji.com>
Date: May 19 2020 20:57:54 +0000
Subject: [PATCH 3/5] Adding the ability to run compose on only certain builds


Signed-off-by: Mohan Boddu <mboddu@bhujji.com>

---

diff --git a/fedora-minimal-compose.py b/fedora-minimal-compose.py
index 50d3574..8d4190f 100755
--- a/fedora-minimal-compose.py
+++ b/fedora-minimal-compose.py
@@ -13,6 +13,9 @@ logger.setLevel(logging.INFO)
 rawhide = '33'
 odcs_file = '/etc/releng-odcs-oidc-token'
 fmc_tag = f'f{rawhide}-minimal-compose'
+packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux']
+# When we have the ability to run one compose for multiple builds, use the following list
+# packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux', 'chrony', 'fcoe-utils', 'hfsplus-tools', 'firewalld', 'realmd', 'yelp', 'libtimezonemap', 'kernel', 'systemd', 'dracut', 'plymouth', 'gtk3', 'python3']
 
 class Consumer(object):
     """
@@ -84,19 +87,21 @@ class Consumer(object):
         logger.debug(message.topic)
         logger.debug(message.body)
         build = message.body['build']['nvr']
-        
-        # Check if its rawhide only build
-        # TODO: Extend it to branched.
-        # Get the dist tag of the build
-        dist_tag = build[-4:]
-        
-        if f'fc{rawhide}' in dist_tag:
-            self.save_nvr_to_file(build)
-            # Pre compose koji tasks
-            self.run_koji_tasks(fmc_tag, build)
-            # Get odcs token
-            odcs_token = self.get_odcs_token(odcs_file)
-            # Run the compose
-            compose_info = self.run_compose(odcs_token)
-            # Inject the file to into the compose log dir
-            self.inject_builds_compose(compose_info)
\ No newline at end of file
+        package = message.body['build']['name']
+        # Check if the package is the one of the packages we are interested in
+        if package in packages_list:
+            # Check if its rawhide only build
+            # TODO: Extend it to branched.
+            # Get the dist tag of the build
+            dist_tag = build[-4:]
+
+            if f'fc{rawhide}' in dist_tag:
+                self.save_nvr_to_file(build)
+                # Pre compose koji tasks
+                self.run_koji_tasks(fmc_tag, build)
+                # Get odcs token
+                odcs_token = self.get_odcs_token(odcs_file)
+                # Run the compose
+                compose_info = self.run_compose(odcs_token)
+                # Inject the file to into the compose log dir
+                self.inject_builds_compose(compose_info)
\ No newline at end of file

From 3d76a9d7fba86a1dcb16622a792a719d221deb79 Mon Sep 17 00:00:00 2001
From: Mohan Boddu <mboddu@bhujji.com>
Date: May 20 2020 14:28:21 +0000
Subject: [PATCH 4/5] Changes to make it more performance


Signed-off-by: Mohan Boddu <mboddu@bhujji.com>

---

diff --git a/fedora-minimal-compose.py b/fedora-minimal-compose.py
index 8d4190f..dd870e7 100755
--- a/fedora-minimal-compose.py
+++ b/fedora-minimal-compose.py
@@ -1,7 +1,8 @@
 #!/usr/bin/python3
 
-from fedora_messaging import api, config
 from odcs.client.odcs import ODCS, AuthMech, ComposeSourceRawConfig
+import fedora_messaging.api
+import fedora_messaging.config
 import koji
 import logging
 import os
@@ -10,12 +11,7 @@ import subprocess
 # Set local logging
 logger = logging.getLogger(__name__)
 logger.setLevel(logging.INFO)
-rawhide = '33'
-odcs_file = '/etc/releng-odcs-oidc-token'
-fmc_tag = f'f{rawhide}-minimal-compose'
-packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux']
-# When we have the ability to run one compose for multiple builds, use the following list
-# packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux', 'chrony', 'fcoe-utils', 'hfsplus-tools', 'firewalld', 'realmd', 'yelp', 'libtimezonemap', 'kernel', 'systemd', 'dracut', 'plymouth', 'gtk3', 'python3']
+fedora_messaging.config.conf.load_config("fedora-minimal-compose.toml")
 
 class Consumer(object):
     """
@@ -26,50 +22,48 @@ class Consumer(object):
         """
         Configure the consumer
         """
+        self.config = fedora_messaging.config.conf["consumer_config"]
+        self.rawhide = self.config['rawhide']
+        self.fmc_tag = f'f{self.rawhide}-minimal-compose'
+        self.odcs_url = self.config['odcs_url']
+        self.odcs_token = self.config['odcs_token']
+        self.packages_list = self.config['packages']
+        #['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux']
+        # When we have the ability to run one compose for multiple builds, use the following list
+        # packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux', 'chrony', 'fcoe-utils', 'hfsplus-tools', 'firewalld', 'realmd', 'yelp', 'libtimezonemap', 'kernel', 'systemd', 'dracut', 'plymouth', 'gtk3', 'python3']
+        # Create a koji session
+        self.kojisession = koji.ClientSession(self.config['koji_url'])
+        self.kojisession.gssapi_login(self.config['principal'], self.config['keytab'])
+        self.kojisession.multicall = True
 
     def save_nvr_to_file(self, nvr):
-        f = open('builds_compose.log', 'w+')
-        logger.info(f'Build that triggered the compose:{nvr}')
-        f.write(nvr + '\n')
-        return True
-
-    def run_koji_tasks(self, fmc_tag, new_build):
-        # Create a koji session
-        kojisession = koji.ClientSession('https://koji.fedoraproject.org/kojihub')
+        with open('builds_compose.log', 'w+') as f:
+            logger.info(f'Build that triggered the compose:{nvr}')
+            f.write(nvr + '\n')
 
-        # koji key tab auth
-        koji_bin = '/usr/bin/odcs-koji'
 
+    def run_koji_tasks(self, new_build):
         # koji untag current builds
-        old_builds = kojisession.listTagged(fmc_tag)
-        logger.info(f'Untagging old builds from {fmc_tag} : {old_builds}')
+        old_builds = self.kojisession.listTagged(self.fmc_tag)
+        logger.info(f'Untagging old builds from {self.fmc_tag} : {old_builds}')
         for old_build in old_builds:
-            untag_build = [koji_bin, 'untag-build', '--all', fmc_tag, old_build]
             try:
-                subprocess.check_call(untag_build)
-            except subprocess.CalledProcessError as e:
-                logger.error(f'Untagging {old_build} from {fmc_tag} failed, exception: {e}')
-
+                self.kojisession.untagBuild(self.fmc_tag, old_build)
+            except Exception as e:
+                logger.error(f'Untagging {old_build} from {self.fmc_tag} failed, exception: {e}')
+        self.kojisession.multiCall()
         # tag the new build
-        logger.info(f'Tagging the koji build {new_build} to {fmc_tag} tag')
-        tag_build = [koji_bin, 'tag-build', '--nowait', fmc_tag, new_build]
+        logger.info(f'Tagging the koji build {new_build} to {self.fmc_tag} tag')
         try:
-            subprocess.check_call(tag_build)
-        except subprocess.CalledProcessError as e:
-            logger.error(f'Tagging {new_build} from {fmc_tag} failed, exception: {e}')
-
-    def get_odcs_token(self, odcs_file):
-        if os.path.exists(odcs_file):
-            f = open(odcs_file, "r")
-            token = f.readline()
-            return token
-        else:
-            logger.error('ODCS token file is missing.')
+            self.kojisession.tagBuild(self.fmc_tag, new_build)
+        except Exception as e:
+            logger.error(f'Tagging {new_build} from {self.fmc_tag} failed, exception: {e}')
+        self.kojisession.multiCall()
 
-    def run_compose(self, odcs_token):
-        odcs = ODCS("https://odcs.fedoraproject.org",
+    def run_compose(self):
+        odcs = ODCS(self.odcs_url,
                 auth_mech=AuthMech.OpenIDC,
-                openidc_token=odcs_token)
+                openidc_token=self.odcs_token)
         source = ComposeSourceRawConfig("releng_fmc", "master")
 
         compose_info = odcs.request_compose(source)
@@ -80,7 +74,7 @@ class Consumer(object):
         compose_id = compose_info.get('id')
         os.rename('builds_compose.log', f'/srv/odcs/odcs-{compose_id}/logs/builds_compose.log')
 
-    def __call__(self, message: api.Message):
+    def __call__(self, message: fedora_messaging.api.Message):
         """
         Invoked when a message is received by the consumer.
         """        
@@ -89,19 +83,17 @@ class Consumer(object):
         build = message.body['build']['nvr']
         package = message.body['build']['name']
         # Check if the package is the one of the packages we are interested in
-        if package in packages_list:
+        if package in self.packages_list:
             # Check if its rawhide only build
             # TODO: Extend it to branched.
             # Get the dist tag of the build
             dist_tag = build[-4:]
 
-            if f'fc{rawhide}' in dist_tag:
+            if f'fc{self.rawhide}' in dist_tag:
                 self.save_nvr_to_file(build)
                 # Pre compose koji tasks
-                self.run_koji_tasks(fmc_tag, build)
-                # Get odcs token
-                odcs_token = self.get_odcs_token(odcs_file)
+                self.run_koji_tasks(build)
                 # Run the compose
-                compose_info = self.run_compose(odcs_token)
+                compose_info = self.run_compose()
                 # Inject the file to into the compose log dir
                 self.inject_builds_compose(compose_info)
\ No newline at end of file

From fba6933ab0a623c2410c9fd49a07401d165a9348 Mon Sep 17 00:00:00 2001
From: Mohan Boddu <mboddu@bhujji.com>
Date: May 20 2020 14:38:35 +0000
Subject: [PATCH 5/5] Adding config values


Signed-off-by: Mohan Boddu <mboddu@bhujji.com>

---

diff --git a/fedora-minimal-compose.py b/fedora-minimal-compose.py
index dd870e7..4cd34f4 100755
--- a/fedora-minimal-compose.py
+++ b/fedora-minimal-compose.py
@@ -6,13 +6,13 @@ import fedora_messaging.config
 import koji
 import logging
 import os
-import subprocess
 
 # Set local logging
 logger = logging.getLogger(__name__)
 logger.setLevel(logging.INFO)
 fedora_messaging.config.conf.load_config("fedora-minimal-compose.toml")
 
+
 class Consumer(object):
     """
     A fedora-messaging consumer that process messages
@@ -28,7 +28,7 @@ class Consumer(object):
         self.odcs_url = self.config['odcs_url']
         self.odcs_token = self.config['odcs_token']
         self.packages_list = self.config['packages']
-        #['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux']
+        # ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux']
         # When we have the ability to run one compose for multiple builds, use the following list
         # packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux', 'chrony', 'fcoe-utils', 'hfsplus-tools', 'firewalld', 'realmd', 'yelp', 'libtimezonemap', 'kernel', 'systemd', 'dracut', 'plymouth', 'gtk3', 'python3']
         # Create a koji session
@@ -41,7 +41,6 @@ class Consumer(object):
             logger.info(f'Build that triggered the compose:{nvr}')
             f.write(nvr + '\n')
 
-
     def run_koji_tasks(self, new_build):
         # koji untag current builds
         old_builds = self.kojisession.listTagged(self.fmc_tag)
@@ -62,8 +61,8 @@ class Consumer(object):
 
     def run_compose(self):
         odcs = ODCS(self.odcs_url,
-                auth_mech=AuthMech.OpenIDC,
-                openidc_token=self.odcs_token)
+                    auth_mech=AuthMech.OpenIDC,
+                    openidc_token=self.odcs_token)
         source = ComposeSourceRawConfig("releng_fmc", "master")
 
         compose_info = odcs.request_compose(source)
@@ -77,7 +76,7 @@ class Consumer(object):
     def __call__(self, message: fedora_messaging.api.Message):
         """
         Invoked when a message is received by the consumer.
-        """        
+        """
         logger.debug(message.topic)
         logger.debug(message.body)
         build = message.body['build']['nvr']
@@ -96,4 +95,4 @@ class Consumer(object):
                 # Run the compose
                 compose_info = self.run_compose()
                 # Inject the file to into the compose log dir
-                self.inject_builds_compose(compose_info)
\ No newline at end of file
+                self.inject_builds_compose(compose_info)
diff --git a/fedora-minimal-compose.toml b/fedora-minimal-compose.toml
index 8ac0a75..ed528fd 100644
--- a/fedora-minimal-compose.toml
+++ b/fedora-minimal-compose.toml
@@ -38,6 +38,17 @@ queue = "00000000-0000-0000-0000-000000000000"
 exchange = "amq.topic"
 routing_keys = ["org.fedoraproject.prod.buildsys.rpm.sign"]
 
+[consumer_config]
+rawhide = '33'
+odcs_url = 'https://odcs.fedoraproject.org'
+odcs_token = {}
+packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux']
+# When we have the ability to run one compose for multiple builds, use the following list
+# packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux', 'chrony', 'fcoe-utils', 'hfsplus-tools', 'firewalld', 'realmd', 'yelp', 'libtimezonemap', 'kernel', 'systemd', 'dracut', 'plymouth', 'gtk3', 'python3']
+koji_url = 'https://koji.fedoraproject.org/kojihub'
+principal ={}
+keytab = {}
+
 [qos]
 prefetch_size = 0
 prefetch_count = 25

