<div dir="ltr"><div>Thank you Sean,</div><div><br></div><div>What a wonderful explanation of the process. Yes I can download images from the public domain and push them to a local repository but in some cases I would like to add my own tools like monitoring agents, utilities etc for debugging so i decided to build my own images. </div><div><br></div><div>I believe <a href="https://tarballs.opendev.org/" rel="noreferrer" target="_blank">https://tarballs.opendev.org</a> is the right place to source software correctly? </div><div><br></div><div>If I want to add some tools or packages inside images then I should use Dockerfile.j2 to add and compile images. correct? </div><div><br></div><div>~S </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 31, 2023 at 7:01 AM Sean Mooney <<a href="mailto:smooney@redhat.com">smooney@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2023-03-30 at 16:49 -0400, Satish Patel wrote:<br>
> Folks,<br>
> <br>
> I am playing with kolla image building to understand how it works. I am<br>
> using the following command to build images and wanted to check with you<br>
> folks if that is the correct way to do it.<br>
> <br>
> $ kolla-build -b ubuntu -t source keystone nova neutron glance<br>
> <br>
> Does the above command compile code from source or just download images<br>
> from remote repositories and re-compile them?<br>
> <br>
openstack is mainly python so in general ther is no complie step.<br>
but to answer your question that builds the image using the source tarballs<br>
or the openstakc packages.<br>
<br>
the defaults soruce locations are rendered into a file which you can override <br>
from the data stored in <a href="https://github.com/openstack/kolla/blob/master/kolla/common/sources.py" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/blob/master/kolla/common/sources.py</a><br>
the other build config defaults are generated form this code<br>
<a href="https://github.com/openstack/kolla/blob/master/kolla/common/config.py" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/blob/master/kolla/common/config.py</a><br>
<br>
when you invoke kolla-build its executing <a href="https://github.com/openstack/kolla/blob/master/kolla/cmd/build.py" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/blob/master/kolla/cmd/build.py</a><br>
but the main build workflow is here <a href="https://github.com/openstack/kolla/blob/be15d6212f278027c257f9dd67e5b2719e9f730a/kolla/image/build.py#L95" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/blob/be15d6212f278027c257f9dd67e5b2719e9f730a/kolla/image/build.py#L95</a><br>
<br>
the tl;dr is the build worklow starts by creating build director and locating the docker file templats.<br>
in otherwords the content of the <a href="https://github.com/openstack/kolla/tree/be15d6212f278027c257f9dd67e5b2719e9f730a/docker" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/tree/be15d6212f278027c257f9dd67e5b2719e9f730a/docker</a> directory<br>
<br>
each project has a direcoty in the docker directory and then each contaienr that project has has a directory in the project directory <br>
<br>
so the aodh project has a aodh folder <a href="https://github.com/openstack/kolla/tree/be15d6212f278027c257f9dd67e5b2719e9f730a/docker/aodh" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/tree/be15d6212f278027c257f9dd67e5b2719e9f730a/docker/aodh</a><br>
the convention is to have a <project>-base contaienr which handels the depency installation and then one addtional contaienr for each binary deamon<br>
the project has i.e. aodh-api<br>
<br>
the name of the folder in teh project dir is used as the name of the contaienr <br>
<br>
if we look at the content of the docker files we will see that they are not actuly dockerfiles<br>
<a href="https://github.com/openstack/kolla/blob/be15d6212f278027c257f9dd67e5b2719e9f730a/docker/aodh/aodh-api/Dockerfile.j2" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/blob/be15d6212f278027c257f9dd67e5b2719e9f730a/docker/aodh/aodh-api/Dockerfile.j2</a><br>
<br>
they are jinja2 templates that produce docker files<br>
<br>
kolla as far as i am aware has drop support for binary images and alternitiv distos<br>
<br>
but looking at an older release we can se ehow this worked<br>
<a href="https://github.com/openstack/kolla/blob/stable/wallaby/docker/nova/nova-base/Dockerfile.j2#L13-L52" rel="noreferrer" target="_blank">https://github.com/openstack/kolla/blob/stable/wallaby/docker/nova/nova-base/Dockerfile.j2#L13-L52</a><br>
<br>
each docker file template would use the jinja2 to generate a set of concreate docker files form the template<br>
and make dession based on the parmater passed in.<br>
<br>
so when you are invokeing <br>
kolla-build -b ubuntu -t source keystone nova neutron glance<br>
<br>
what actully happening is that the -t flag is being set as teh install_type parmater in the the jinja2 environemtn when<br>
the docker file is rendered.<br>
<br>
after all the docer files are rendered into normal docker files kolla just invokes the build.<br>
<br>
in the case of a source build that inovles pre fetching the source tar from <a href="https://tarballs.opendev.org" rel="noreferrer" target="_blank">https://tarballs.opendev.org</a><br>
and puting it in the build directory so that it can be included into the contianer.<br>
<br>
kolla also used to supprot git repo as a alternitve source fromat<br>
<br>
i have glossed over a lot of the details of how this actully work but that is the essence of what that command is doing<br>
creating a build dir, downloading the source, rendering the dockerfile templates to docker files, invokeing docker build on those<br>
and then taging them with the contaienr nameand build tag<br>
<br>
<br>
<a href="https://docs.openstack.org/kolla/latest/admin/image-building.html" rel="noreferrer" target="_blank">https://docs.openstack.org/kolla/latest/admin/image-building.html</a><br>
covers this form a high level<br>
<br>
> because in command output<br>
> I've not noticed anything related to the compiling process going on.<br>
> <br>
> Here is the output of all images produced by kolla-build command. Do I need<br>
> anything else or is this enough to deploy kolla?<br>
you can deploy coll with what you have yes although since the kolla files are automaticaly<br>
built by ci kolla-ansible can just use the ones form the docker hub or quay instead you do not need to build them yourself<br>
<br>
if you do build them your self then there is basically one other stpe that you shoudl take if this si a multi node deployment<br>
you should push the iamges to an interally host docker registry although based on the hostname in the prompt below<br>
it looks like you ahve alredy done that.<br>
> <br>
> root@docker-reg:~# docker images<br>
> REPOSITORY TAG IMAGE ID CREATED<br>
> SIZE<br>
> kolla/mariadb-server 15.1.0 2a497eee8269 26 minutes<br>
> ago 595MB<br>
> kolla/cron 15.1.0 342877f26a8a 30 minutes<br>
> ago 250MB<br>
> kolla/memcached 15.1.0 0d19a4902644 31 minutes<br>
> ago 250MB<br>
> kolla/mariadb-clustercheck 15.1.0 d84427d3c639 31 minutes<br>
> ago 314MB<br>
> kolla/mariadb-base 15.1.0 34447e3e59b6 31 minutes<br>
> ago 314MB<br>
> kolla/keepalived 15.1.0 82133b09fbf0 31 minutes<br>
> ago 260MB<br>
> kolla/prometheus-memcached-exporter 15.1.0 6c2d605f70ee 31 minutes<br>
> ago 262MB<br>
> <none> <none> e66b228c2a07 31 minutes<br>
> ago 248MB<br>
> kolla/rabbitmq 15.1.0 8de5c39379d3 32 minutes<br>
> ago 309MB<br>
> kolla/fluentd 15.1.0 adfd19027862 33 minutes<br>
> ago 519MB<br>
> kolla/haproxy-ssh 15.1.0 514357ac4d36 36 minutes<br>
> ago 255MB<br>
> kolla/haproxy 15.1.0 e5b9cfdf6dfc 37 minutes<br>
> ago 257MB<br>
> kolla/prometheus-haproxy-exporter 15.1.0 a679f65fd735 37 minutes<br>
> ago 263MB<br>
> kolla/prometheus-base 15.1.0 afeff3ed5dce 37 minutes<br>
> ago 248MB<br>
> kolla/glance-api 15.1.0 a2241f68f23a 38 minutes<br>
> ago 1.04GB<br>
> kolla/glance-base 15.1.0 7286772a03a4 About an<br>
> hour ago 1.03GB<br>
> kolla/neutron-infoblox-ipam-agent 15.1.0 f90ffc1a3326 About an<br>
> hour ago 1.05GB<br>
> kolla/neutron-server 15.1.0 69c844a2e3a9 About an<br>
> hour ago 1.05GB<br>
> kolla/neutron-l3-agent 15.1.0 4d87e6963c96 About an<br>
> hour ago 1.05GB<br>
> <none> <none> 486da9a6562e About an<br>
> hour ago 1.05GB<br>
> kolla/neutron-linuxbridge-agent 15.1.0 e5b3ca7e099c About an<br>
> hour ago 1.04GB<br>
> kolla/neutron-bgp-dragent 15.1.0 ac37377820c6 About an<br>
> hour ago 1.04GB<br>
> kolla/ironic-neutron-agent 15.1.0 90993adcd74b About an<br>
> hour ago 1.04GB<br>
> kolla/neutron-metadata-agent 15.1.0 8522f147f88d About an<br>
> hour ago 1.04GB<br>
> kolla/neutron-sriov-agent 15.1.0 8a92ce7d13c0 About an<br>
> hour ago 1.04GB<br>
> kolla/neutron-dhcp-agent 15.1.0 5c214b0171f5 About an<br>
> hour ago 1.04GB<br>
> kolla/neutron-metering-agent 15.1.0 7b3b91ecd77b About an<br>
> hour ago 1.04GB<br>
> kolla/neutron-openvswitch-agent 15.1.0 1f8807308814 About an<br>
> hour ago 1.04GB<br>
> kolla/neutron-base 15.1.0 f85b6a2e2725 About an<br>
> hour ago 1.04GB<br>
> kolla/nova-libvirt 15.1.0 0f3ecefe4752 About an<br>
> hour ago 987MB<br>
> kolla/nova-compute 15.1.0 241b7e7fafbe About an<br>
> hour ago 1.47GB<br>
> kolla/nova-spicehtml5proxy 15.1.0 b740820a7ad1 About an<br>
> hour ago 1.15GB<br>
> kolla/nova-novncproxy 15.1.0 1ba2f443d5c3 About an<br>
> hour ago 1.22GB<br>
> kolla/nova-compute-ironic 15.1.0 716612107532 About an<br>
> hour ago 1.12GB<br>
> kolla/nova-ssh 15.1.0 ae2397f4e1c1 About an<br>
> hour ago 1.11GB<br>
> kolla/nova-api 15.1.0 2aef02667ff8 About an<br>
> hour ago 1.11GB<br>
> kolla/nova-conductor 15.1.0 6f1da3400901 About an<br>
> hour ago 1.11GB<br>
> kolla/nova-scheduler 15.1.0 628326776b1d About an<br>
> hour ago 1.11GB<br>
> kolla/nova-serialproxy 15.1.0 28eb7a4a13f8 About an<br>
> hour ago 1.11GB<br>
> kolla/nova-base 15.1.0 e47420013283 About an<br>
> hour ago 1.11GB<br>
> kolla/keystone 15.1.0 e5530d829d5f 2 hours ago<br>
> 947MB<br>
> kolla/keystone-ssh 15.1.0 eaa7e3f3985a 2 hours ago<br>
> 953MB<br>
> kolla/keystone-fernet 15.1.0 8a4fa24853a8 2 hours ago<br>
> 951MB<br>
> kolla/keystone-base 15.1.0 b6f9562364a9 2 hours ago<br>
> 945MB<br>
> kolla/barbican-base 15.1.0 b2fdef1afb44 2 hours ago<br>
> 915MB<br>
> kolla/barbican-keystone-listener 15.1.0 58bd59de2c63 2 hours ago<br>
> 915MB<br>
> kolla/openstack-base 15.1.0 c805b4b3b1c1 2 hours ago<br>
> 893MB<br>
> kolla/base 15.1.0 f68e9ef3dd30 2 hours ago<br>
> 248MB<br>
> registry 2 8db46f9d7550 19 hours ago<br>
> 24.2MB<br>
> ubuntu 22.04 08d22c0ceb15 3 weeks ago<br>
> 77.8MB<br>
<br>
</blockquote></div></div>