Comment 5 for bug 2046382

Revision history for this message
Wodel Youchi (wodel) wrote :

Hi,

I am experiencing the same problem, I tried to rebuild the octavia image using the patch, but the build didn't work, could you help me with more detailed steps?

This is what I did :
1. I created a local registry
2. cloned octavia source code from git version 2023.2
3. applied the patch on this file : octavia/kolla-src/octavia/common/clients.py
4. I created a virtual venv with podman as engine
5. I created kolla-build.conf like this at first
[DEFAULT]
base = rocky
namespace = kolla
push = true
registry = 192.168.2.35:4000

[octavia] <--------------------- I used this first
type = local
location = /root/work/octavia

6. I started the build like this :
kolla-build.py --config-file ./kolla_build.conf --engine podman -d --docker-healthchecks --logs-dir /root/work/logs --openstack-release 2023.2 octavia

Result : The octavia images were built, but not from the local source code but from the Internet. And further, verifying the octavia-api image for example did show that the client.py file does contain the patch.

I modified the kolla-build.conf like this :
[DEFAULT]
base = rocky
namespace = kolla
push = true
registry = 192.168.2.35:4000

[octavia-base] <--------------------- Then I used this
type = local
location = /root/work/octavia

But this time the images did not get built correctly and I got many errors and I am not a developer
ia && mkdir -p /etc/octavia && cp -r /octavia/etc/* /etc/octavia/ && touch /usr/local/bin/kolla_octavia_extend_start && chmod 644 /usr/local/bin/kolla_extend_start /usr/loca
l/bin/kolla_octavia_extend_start
ERROR:kolla.common.utils.octavia-base:Processing /octavia
ERROR:kolla.common.utils.octavia-base:Preparing metadata (setup.py): started
ERROR:kolla.common.utils.octavia-base:Preparing metadata (setup.py): finished with status 'error'
ERROR:kolla.common.utils.octavia-base:error: subprocess-exited-with-error

 × python setup.py egg_info did not run successfully.
 │ exit code: 1
 ╰─> [19 lines of output]
     [pbr] Generating ChangeLog
     /var/lib/kolla/venv/lib64/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and othe
r standards-based tools.
       warnings.warn(
     /var/lib/kolla/venv/lib64/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards
-based tools.
       warnings.warn(
     error: Multiple top-level packages discovered in a flat-layout: ['etc', 'httpd', 'specs', 'devstack', 'elements', 'playbooks', 'releasenotes'].

     To avoid accidental inclusion of unwanted files or directories,
     setuptools will not proceed with this build.

     If you are trying to create a single distribution with multiple packages
     on purpose, you should not rely on automatic discovery.
     Instead, consider the following options:

     1. set up custom discovery (`find` directive with `include` or `exclude`)
     2. use a `src-layout`
     3. explicitly set `py_modules` or `packages` with a list of names

     To find more information, look for "package discovery" on setuptools docs.
     [end of output]

 note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR:kolla.common.utils.octavia-base:error: metadata-generation-failed

I want to learn how to patch and rebuild an image in case of a problem. Any help will be appreciated.

Regards.