Tuesday, 2021-08-31

opendevreviewIan Wienand proposed openstack/diskimage-builder master: [dnm] testing ubuntu builds  https://review.opendev.org/c/openstack/diskimage-builder/+/80666001:56
opendevreviewIan Wienand proposed openstack/diskimage-builder master: [dnm] testing ubuntu builds  https://review.opendev.org/c/openstack/diskimage-builder/+/80666003:16
opendevreviewIan Wienand proposed openstack/diskimage-builder master: [dnm] testing ubuntu builds  https://review.opendev.org/c/openstack/diskimage-builder/+/80666006:04
ianwmazzy: package-installs.yaml is described @ https://docs.openstack.org/diskimage-builder/2.7.0/elements/package-installs/README.html06:07
ianwit's a way to get packages installed without having to manually call apt/yum/dnf/zypper, etc06:07
ianwit works with pkg-map; see https://docs.openstack.org/diskimage-builder/latest/elements/pkg-map/README.html06:08
ianwbasically the installer will look up the package name in pkg-map, where you can install the right packages for each distro06:09
ianwit batches them and de-duplicates06:11
ianwif you want to use jq/git in your element, they should be defined in a package-install to make sure they are there06:11
ianwas for assuming the base system -- there's no one rule; it depends on what the element is trying to do.  some things are quite generic and work on basically any build environment, others are specific06:13
mazzyianw: thanks for the explanation. 06:33
mazzyDuring the testing of an element locally, how do we specify the base env?06:35
ianwmazzy: i'm not sure what you mean by the base env?08:58
mazzyianw: maybe it's me that I still did not grasp fully how dib works09:02
mazzyi meant to say when i would run diskimage builder to create an image using my element that i'm designing which will be the OS where this element will run?09:03
mazzyalso the testing of dib could be done only in linux right?09:51
mazzybecause when I run under MacOS i get09:52
mazzy❯ disk-image-create ubuntu vm                                                                                                                         11:39:2709:52
mazzy2021-08-31 09:40:02.102 | diskimage-builder version 3.13.109:52
mazzy2021-08-31 09:40:02.103 | Building elements: base a:ho:t:xucnp: -l checksum,no-tmpfs,offline,help,version,min-tmpfs:,image-size:,image-cache:,max-online-resize:,mkfs-options:,qemu-img-options:,ramdisk-element:,root-label:,install-type:,docker-target:,logfile: -n disk-image-create -- ubuntu vm block-device-efi09:52
mazzy2021-08-31 09:40:02.142 | usage: element-info.py [-h] [--env] elements [elements ...]09:52
mazzy2021-08-31 09:40:02.142 | element-info.py: error: unrecognized arguments: -l checksum,no-tmpfs,offline,help,version,min-tmpfs:,image-size:,image-cache:,max-online-resize:,mkfs-options:,qemu-img-options:,ramdisk-element:,root-label:,install-type:,docker-target:,logfile: -n disk-image-create -- ubuntu vm block-device-efi09:52
mazzyi'm now running on ubuntu and the elements starts to run10:49
mazzyianw: does the package install work during root.d?10:57
ecsantosmazzy: just to address some of your questions: 1. You need to have one "distro element", such as ubuntu, ubuntu-minimal, centos, centos-minimal, and so on, that's what'll define the image's OS (if I understood your question correctly)15:29
ecsantos2. Yes, supported host distros are listed here: https://docs.openstack.org/diskimage-builder/latest/user_guide/supported_distros.html#supported-distributions15:29
mazzyecsantos: thanks15:30
ecsantosMaybe it's possible to run it on macOS, but it's not officially supported15:30
mazzyi gave up actually. i'm running it now on ubuntu and i made some progress15:30
mazzybut i have so many blockers :-D 15:31
mazzylet's see if you might help to solve them15:31
ecsantos3. I believe the elements are applied to the image in a sequential manner, so I don't think the package-installs element is applied during the root.d phase of the distro element (say, ubuntu)15:32
mazzyah make sense. this is the reason why it does not work15:32
ecsantosI just started with dib too so take my words with a grain of salt :D15:32
mazzyanother issue i'm having is the size of 15:32
mazzytmpfs           3.9G  3.2G  786M  81% /tmp/dib_build.m4YD3Jcv15:32
mazzyi'm trying to enlarge that but w/o luck. - according the doc --image-size should work but it does not work for me15:33
ecsantosabout package-installs: I had this doubt too, where should I declare the packages I need to install? What I did was create a custom element with just a package-installs.yaml file listing the packages I wanted, and it worked15:34
ecsantosmaybe try the growroot element15:34
mazzybut package-installs does not install package in the OS where you run the command disk-image-create15:34
mazzyit installs from what i understood inside the chroot.15:34
mazzydid i get correctly?15:35
ecsantosyes exactly, it's intended to install packages in the target image15:35
mazzyah ok now it makes sense15:35
mazzyalso the other problem is how dib understand which is the target image?15:36
mazzybecause I have my target image inside the chroot env dib get in15:36
mazzyI get the following error while running dib cerate https://pastebin.com/quAtmkfp )17:25
mazzyI assume python is an hard requirement in order to complete the build process. can anyone conferm?17:25
ecsantosmazzy: dib builds an image called "image.qcow2" in the directory you run the disk-image-create command by default. you can change this by passing -o /path/to/image.qcow2 17:48
ecsantosregarding your error, if you're going to run dib directly from git master, I recommend following this: https://docs.openstack.org/diskimage-builder/latest/developer/index.html#quickstart17:49
mazzyecsantos: yes I'm aware of that. i'm running everything on virtualenv18:07
mazzythe line 18:08
mazzy> 2021-08-31 17:23:30.344 | /usr/bin/env: 'python3': No such file or directory18:08
mazzyis referred to the OS where i run the build or the target image?18:08
ecsantosto the host OS, where you run the build18:11
mazzyah ok. so in my case despite python3 is in place i have issue with the path. let's find out to solve them18:11
ecsantoshow did you install dib?18:24
mazzynothing. even running in a proper virtualenv i still get that18:24
mazzysame as the dev guide18:24
mazzy(env) ubuntu@ubuntu:~/dib/diskimage-builder$ pip list18:24
mazzyPackage           Version     Location18:24
mazzy----------------- ----------- ----------------------------------18:24
mazzydiskimage-builder 3.13.1.dev5 /home/ubuntu/dib/diskimage-builder18:24
mazzy(env) ubuntu@ubuntu:~/dib/diskimage-builder$ which python318:25
mazzydir /home/ubuntu/dib/env/bin/python318:25
mazzyThe issue is in running ~/dib/diskimage-builder/diskimage_builder/elements/package-installs/bin/package-installs-v2 which is a python and for some reasons does not find python18:37
mazzyecsantos: i think the reason is because the python exec is not inside the target image (and not the OS where i run the build) see here https://bugs.launchpad.net/diskimage-builder/+bug/157710518:41
ecsantosyou're right. that's weird, I couldn't reproduce the bug, tried building xenial and it worked fine18:55
ianwmazzy: running with "-x" will help put more info in the logs19:07
mazzyok maybe i understand but i need someone to confirm my thoughts19:11
mazzyianw: so flatcar OS does not come out with python.19:11
mazzypackage-installsv2 script needs python. so when package-installs2 runs it fails 19:11
mazzythe problem is that even if I try to install python on the flatcar image, package-installs script run before my pre-install.d  or install.d19:12
ianwyes, that would be right.  python in the chroot is probably assumed19:13
ianwthat should be done in a root.d phase19:14
mazzyyeah i think that is the only way to solve unless some dib experts can say otherwise19:14
mazzybut in the root.d i'm not inside the chroot so i need to get to it manually19:14
ianwyes most distros do some manual work like that in early phases19:15
ianwit seems you're mostly doing like what the containerfile element does19:15
ianwhttps://opendev.org/openstack/diskimage-builder/src/branch/master/diskimage_builder/elements/containerfile/root.d/08-containerfile19:15
mazzyianw: i will check that. thanks for the direction19:17
ianwhttps://opendev.org/openstack/diskimage-builder/src/branch/master/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot#L17319:18
ianwis an example of how yum-minimal installs things in the chroot in root.d19:19
ianwi don't think we have exact requirements of tools in the chroot listed19:19
ianwi imagine it's python3, python-yaml, bash (not ash)19:20
mazzyianw: that is really a nice example19:27
ianwpackage-installs is just an element, so it must be coming from element-deps19:52
mazzybut i have nothing there19:52
mazzyit comes from dib-init-system19:53
ianwthat doens't have an elements-deps either, it must be coming from somehwere else?19:53
ianwi feel like with "-x" it dumps info on the dependency chain bringing in elements.  maybe it's "-x -x"19:54
ianwthere's a line anyway "Expanded element dependencies to: "19:56
mazzyi will try and post the result19:56
ianwit comes in via base19:57
ianwdiskimage_builder/elements/base/pkg-map19:57
ianwthat is a list of default things we're installing in images19:57
mazzyyeah exactly it's base19:58
mazzybut flatar is a different os that makes different assumptions19:58
ianwhrm, still, none of those bring in package-installs19:59
mazzyok give some mins so we'll ahve the logs20:00
mazzyianw: https://pastebin.com/kEZQsfGj20:06
ianwoh, cache-url will bring it in20:07
ianwwhich i would say is more-or-less right; it needs curl in the image to download things and that's what the package-install says20:09
mazzyoh right20:17
mazzyi have it20:17
ianware you trying to make a bootable image?20:19
mazzyyes right20:19
ianwi mean, you're going to have to install grub, etc. then?  how can that happen without a package manager?20:20
mazzythe idea is to add the support for a new repo to have it in kolla20:20
mazzythe thing is quite convoluted 20:21
mazzylet me point you to the documentation20:21
mazzyhttps://kinvolk.io/docs/flatcar-container-linux/latest/reference/developer-guides/sdk-modifying-flatcar/20:21
ianwhrm20:27
ianwa *very* rough analogy seems like "cork" is like dib ... a thing that gives you a chroot and a bunch of scripts to modify it20:28
ianwprometheanfire might have some more idea of how things plug together, since it's based on gentoo20:30
mazzyyeah exactly. dib is. what cork does20:31
ianwif you have a root.d element that makes a flatcar .tar.gz with a package manager, python, bash that would seem to look like a pretty standard gentoo environment?20:31
ianwbut it does seem the point of this is to *not* make generic images20:32
ianwit is probably worth stepping back to make sure dib is the right tool here...20:33
mazzyyeah i thought about this several times20:34
mazzybut how to make flatacar available to nodepools? 20:34
mazzythe point is that the guy from kolla redirected me to dib beause in order to add support to a distro in kolla, it must be tested the distro ofc20:35
mazzyand they want to standardize that with dib. because tbh kinvolk people already distribute openstack images 20:35
mazzysee here https://kinvolk.io/docs/flatcar-container-linux/latest/installing/community-platforms/openstack/20:36
ianwnothing is impossible, but i'm not sure that flatcar fits into what we think of as a host that fits into opendev nodepool in any easy way20:43
ianwa more practical solution might be to figure out something for testing purposes is where flatcar runs virtualised 20:44
mazzywhich is your idea?20:48
ianwi would say this is probably something for openstack-discuss list, because it is the type of thing more eyes will benefit from, and also probably time to think20:51
ianwbut in theory, you could have flatcar running in a nested VM on one of our hosts and deploy kolla to it?20:52
mazzyyes that could be doable20:54
mazzyactually i'm already running kolla in flatcar on my premises20:54
ianwas in kolla makes a bunch of flatcar containers that run openstack services?21:08
mazzythe containers would not be flatcar21:10
mazzythe containers would be still ubuntu/centos/etc...21:11
mazzyonly the OS where the containers run would be flatcar21:11
ianwohh, ok21:12
opendevreviewShnaidman Sagi (Sergey) proposed openstack/diskimage-builder master: Correct path for CentOS 9 stream base image  https://review.opendev.org/c/openstack/diskimage-builder/+/80681923:24

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!