Hello.
First you need git clone horizon and patch it first then 
nano /etc/kolla/kolla-build.conf
[DEFAULT]
cache = false
[horizon]
type = local
location = /home/ubuntu/horizon

and 
kolla-build -b ubuntu horizon

u must push image to your repo to use it,


Nguyen Huu Khoi


On Tue, Apr 15, 2025 at 8:46 PM Franck VEDEL (UGA) <franck.vedel@univ-grenoble-alpes.fr> wrote:
Hello, and first sorry for coming back with my problem.

After 3 days of trying to resolve it  (applying a patch to fix a known bug in Horizon), it's still not working. No changes have been made to the problematic file (workflows.py).


First question:
This link discusses the topic (« Patching Customization")  https://docs.openstack.org/kolla/latest/admin/image-building.html
But not in the one for version 2024.2: https://docs.openstack.org/kolla/2024.2/admin/image-building.html

So maybe the method doesn't apply to Dalmatian.

Second question: what is wrong with what I’m doing:

The patch is a zip file
We can download it: c2cce40.diff.zip

I create the directory :  /home/user/PATCH/horizon

My /etc/kolla/kolla-build.conf file is these 2 lines

[DEFAULT]

patches_path = /home/user/PATCH

In this directory, we can list files: (I tried with the zip and the unzip file, the diff file)

(venv) user1@pc1:~$ ll /home/user/PATCH/horizon/

total 24

drwxrwxr-x 2 user1 user1 4096 avril 14 09:14 ./

drwxrwxr-x 3 user1 user1 4096 avril 11 08:24 ../

-rw-rw-r-- 1 user1 user1 1093 déc.  25 03:01 c2cce40.diff

-rw-rw-r-- 1 user1 user1  716 avril 14 09:12 c2cce40.diff.zip

-rw-rw-r-- 1 user1 user1  716 avril 14 09:12 c2cce40.zip

-rw-rw-r-- 1 user1 user1   13 avril 14 09:14 series  

The series file (the try with the zip file):

(venv) user1@pc1:~$ more /home/user1/PATCH/horizon/series 

c2cce40.zip



I also tried Without the zip extension

I modify the file:
/home/user/venv/share/kolla-ansible/ansible/roles/horizon/defaults/main.yml

####################

# Docker

####################

#horizon_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ docker_image_name_prefix }}horizon"

#horizon_tag: "{{ openstack_tag }}"

#

#horizon_image_full: "{{ horizon_image }}:{{ horizon_tag }}"

horizon_image_full: "kolla/horizon:19.4.0 »



The next  command create a new docker image (horizon:19.4.0)

Kolla-build -b ubuntu horizon

No problem… I have a new image named horizon:19.4.0. I copy the image on my second computer (2 nodes in my test cluster)

Next: kolla-ansible reconfigure -I multinode

Everything works , the new image is used to build horizon containers. But no modification in the file 

(venv) user1@pc1:~$ docker exec -it horizon bash

(horizon)[root@pc1 /]# more ./var/lib/kolla/venv/lib/python3.12/site-packages/openstack_dashboard/dashboards/project/networks/ports/workflows.py


class UpdatePortSecurityGroupAction(sg_base.BaseSecurityGroupsAction):

    def _get_initial_security_groups(self, context):

        port_id = context.get('port_id', '')

        port = api.neutron.port_get(self.request, port_id)

        return port.security_groups


No modification on the container, in the workflows.py file.


What is wrong ? 

There's something I'm not doing right, but what? Do you have any ideas? I'm definitely not managing it.

Thank you, really, if you have any ideas.


Franck