kolla-build.conf not found when building from local environment

Bug #1699324 reported by Kurt Taylor
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kolla
Confirmed
Wishlist
Unassigned

Bug Description

When developing and testing image builds in a local environment (using cmd/build.py) the values specified in the generated configuration file kolla-build.conf are not used because the file in not found in the default locations. These locations are documented as: "The location of the generated configuration file is etc/kolla/kolla-build.conf, it can also be copied to /etc/kolla. The default location is one of /etc/kolla/kolla-build.conf or etc/kolla/kolla-build.conf."

Passing the path at the command line with "--config-file ../../etc/kolla/kolla-build.conf" works fine and does override the default config values with the values set in the conf file. The file can also be manually passed in the conf parsing through the default_config_files parameter.

A fix needs to check the PROJECT_ROOT value (maybe also if __file__ is build.py) and then check for a conf file and if found, pass it to conf parse.

Kurt Taylor (krtaylor)
Changed in kolla:
assignee: nobody → Kurt Taylor (krtaylor)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.openstack.org/475961

Changed in kolla:
status: New → In Progress
Kurt Taylor (krtaylor)
summary: - kolla-build.conf not found in default locations when building from local
- environment
+ kolla-build.conf not found when building from local environment
Revision history for this message
Rich Wellum (richwellum) wrote :

I see the same issue. This is on x86 and ubuntu/centos.

Another work-around is to specify --config-dir and point to wherever the config file is located.

I also think as part of this fix, some additional debugs should be added to display where the source code is being picked up from.

For example:

diff --git a/kolla/image/build.py b/kolla/image/build.py
index 8cbefad..3bfcd84 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -932,9 +932,11 @@ class KollaWorker(object):
                 if image.parent_name is None:
                     LOG.debug('No source location found in section %s',
                               section)
             else:
                 installation['type'] = self.conf[section]['type']
                 installation['source'] = self.conf[section]['location']
+ print('DEBUG location=%s' % installation['source'])
                 installation['name'] = section
                 if installation['type'] == 'git':
                     installation['reference'] = self.conf[section]['reference']
@@ -1096,6 +1098,7 @@ def run_build():
     :return: A 3-tuple containing bad, good, and unmatched container image
     status dicts, or None if no images were built.

+ print('DEBUG %s' % __name__) #wellum
     conf = cfg.ConfigOpts()
     common_config.parse(conf, sys.argv[1:], prog='kolla-build')

Revision history for this message
Kurt Taylor (krtaylor) wrote :

Waiting on fix to merge.

Changed in kolla:
assignee: Kurt Taylor (krtaylor) → nobody
status: In Progress → Confirmed
Changed in kolla:
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla (master)

Change abandoned by "Mark Goddard <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/kolla/+/475961
Reason: Very old

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.