Different kernels for different worker VMs?
Hi, While looking at boo, I noticed that the kernel and initrd of the VM workers are different for different jobs. For example, for SLES, qemu uses the kernel and initrd under /var/cache/obs/worker/root_*/.mount/boot/kernel. But for CentOS, it uses kernel under /boot. It looks like the SLES worker even runs the exact kernel version of the target OS. Could some one let me know how can I set my instance to run in such way? Thanks, Kai
On Sep 23 2021, Kai Liu wrote:
For example, for SLES, qemu uses the kernel and initrd under /var/cache/obs/worker/root_*/.mount/boot/kernel. But for CentOS, it uses kernel under /boot. It looks like the SLES worker even runs the exact kernel version of the target OS.
Could some one let me know how can I set my instance to run in such way?
This isn't dependent on the build worker, but on the availability of a kernel-obs-build package in the build environment, which installs /.build.kernel.kvm in the build root. If that file is present, it is used by the build script for the qemu run. See the build-vm script in the build package. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Hello Kai, I'm not an expert, but will try my best to respond. On Thu, 2021-09-23 at 22:51 +0800, Kai Liu wrote:
Hi,
While looking at boo, I noticed that the kernel and initrd of the VM workers are different for different jobs.
For example, for SLES, qemu uses the kernel and initrd under /var/cache/obs/worker/root_*/.mount/boot/kernel. But for CentOS, it uses kernel under /boot. It looks like the SLES worker even runs the exact kernel version of the target OS.
SUSE distributions (SLES, openSUSE, etc.) use the kernel-obs-build package. I don't know the exact difference between the kernel-default and the kernel-obs- build packages, but this package is what provides the /var/cache/obs/worker/* kernel and initrd for SUSE distributions. For non-SUSE distributions, there is no kernel-obs-build package yet, as far as I'm told. OBS seems to be using some sort of a workaround to provide the kernels in the /boot/ directory of the worker host machine. If your question is related to your private OBS instance, then if you check your /etc/sysconfig/obs-server you should find an option to define your own kernel and initrd: https://github.com/openSUSE/open-build-service/blob/master/dist/sysconfig.ob... https://github.com/openSUSE/open-build-service/blob/master/dist/sysconfig.ob... Regards, Srinidhi.
On 2021/09/23 Thu 17:21, Andreas Schwab wrote:
On Sep 23 2021, Kai Liu wrote:
For example, for SLES, qemu uses the kernel and initrd under /var/cache/obs/worker/root_*/.mount/boot/kernel. But for CentOS, it uses kernel under /boot. It looks like the SLES worker even runs the exact kernel version of the target OS.
Could some one let me know how can I set my instance to run in such way?
This isn't dependent on the build worker, but on the availability of a kernel-obs-build package in the build environment, which installs /.build.kernel.kvm in the build root. If that file is present, it is used by the build script for the qemu run. See the build-vm script in the build package.
Thanks for the pointer. I got the idea. However I'm a bit confused. The "build" package seems is not a dependent of the obs-worker or other obs-* packages, thus it was not installed on my worker and server. Do I need to manually install it, then my worker script will pick it up? Regards, Kai
On 2021/09/23 Thu 15:22, Srinidhi B wrote:
Hello Kai,
I'm not an expert, but will try my best to respond.
On Thu, 2021-09-23 at 22:51 +0800, Kai Liu wrote:
Hi,
While looking at boo, I noticed that the kernel and initrd of the VM workers are different for different jobs.
For example, for SLES, qemu uses the kernel and initrd under /var/cache/obs/worker/root_*/.mount/boot/kernel. But for CentOS, it uses kernel under /boot. It looks like the SLES worker even runs the exact kernel version of the target OS.
SUSE distributions (SLES, openSUSE, etc.) use the kernel-obs-build package. I don't know the exact difference between the kernel-default and the kernel-obs- build packages, but this package is what provides the /var/cache/obs/worker/* kernel and initrd for SUSE distributions.
For non-SUSE distributions, there is no kernel-obs-build package yet, as far as I'm told. OBS seems to be using some sort of a workaround to provide the kernels in the /boot/ directory of the worker host machine.
If your question is related to your private OBS instance, then if you check your /etc/sysconfig/obs-server you should find an option to define your own kernel and initrd:
https://github.com/openSUSE/open-build-service/blob/master/dist/sysconfig.ob... https://github.com/openSUSE/open-build-service/blob/master/dist/sysconfig.ob...
Thanks. My original question was related. Here in this file the kernel and initrd can be appointed. But it's a machine-wide option, means every worker VM on this machines will use the same kernel & initrd to boot. Thus you will end up building a CentOS package with SLES kernel, for example. This is what I would like to solve, by following how it's done on boo. Regards, Kai
On Sep 23 2021, Kai Liu wrote:
However I'm a bit confused. The "build" package seems is not a dependent of the obs-worker or other obs-* packages, thus it was not installed on my worker and server. Do I need to manually install it, then my worker script will pick it up?
The worker fetches the build scripts from the OBS server when the obsworker service is started, so you don't need the build package installed on the worker. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
On Thu, 2021-09-23 at 23:42 +0800, Kai Liu wrote:
Thanks. My original question was related. Here in this file the kernel and initrd can be appointed. But it's a machine-wide option, means every worker VM on this machines will use the same kernel & initrd to boot. Thus you will end up building a CentOS package with SLES kernel, for example. This is what I would like to solve, by following how it's done on boo.
Correct. If you want to set different kernel and initrd per build, then you need to follow what Andreas recommended - check what boot-vm-kvm does. By following that script, I recently managed to configure a worker to build CentOS packages on SLES nodes: * Install kernel-obs-build on the worker node * sudo ln -s /.build.kernel.kvm /boot/kernel.obs.guest * sudo ln -s /.build.initrd.kvm /boot/initrd.obs.guest I don't know if this is the correct way of doing things or not, but this is currently working in one of our private OBS instances. This way when boot-vm-kvm does not find the kernel under the build root, it will look for /boot/*.obs.guest files. https://github.com/openSUSE/obs-build/commit/a9b7da4a3ed2ea9bdc8ea0606fca146... Regards, Srinidhi.
On 2021/09/23 Thu 17:57, Andreas Schwab wrote:
On Sep 23 2021, Kai Liu wrote:
However I'm a bit confused. The "build" package seems is not a dependent of the obs-worker or other obs-* packages, thus it was not installed on my worker and server. Do I need to manually install it, then my worker script will pick it up?
The worker fetches the build scripts from the OBS server when the obsworker service is started, so you don't need the build package installed on the worker.
Ah I see. Thanks. Kai
On Donnerstag, 23. September 2021, 17:59:48 CEST Srinidhi B wrote:
On Thu, 2021-09-23 at 23:42 +0800, Kai Liu wrote:
Thanks. My original question was related. Here in this file the kernel and initrd can be appointed. But it's a machine-wide option, means every worker VM on this machines will use the same kernel & initrd to boot. Thus you will end up building a CentOS package with SLES kernel, for example. This is what I would like to solve, by following how it's done on boo.
Correct. If you want to set different kernel and initrd per build, then you need to follow what Andreas recommended - check what boot-vm-kvm does.
By following that script, I recently managed to configure a worker to build CentOS packages on SLES nodes:
* Install kernel-obs-build on the worker node * sudo ln -s /.build.kernel.kvm /boot/kernel.obs.guest * sudo ln -s /.build.initrd.kvm /boot/initrd.obs.guest
I don't know if this is the correct way of doing things or not, but this is currently working in one of our private OBS instances.
kernel-obs-build is supposed to get installed inside of the VM. No need for using the .guest links, these are just very last resort hacks..
This way when boot-vm-kvm does not find the kernel under the build root, it will look for /boot/*.obs.guest files.
https://github.com/openSUSE/obs-build/commit/a9b7da4a3ed2ea9bdc8ea0606fca146...
Regards, Srinidhi.
--
Adrian Schroeter
On Thu, Sep 23, 2021 at 12:54 PM Adrian Schröter
On Donnerstag, 23. September 2021, 17:59:48 CEST Srinidhi B wrote:
On Thu, 2021-09-23 at 23:42 +0800, Kai Liu wrote:
Thanks. My original question was related. Here in this file the kernel and initrd can be appointed. But it's a machine-wide option, means every worker VM on this machines will use the same kernel & initrd to boot. Thus you will end up building a CentOS package with SLES kernel, for example. This is what I would like to solve, by following how it's done on boo.
Correct. If you want to set different kernel and initrd per build, then you need to follow what Andreas recommended - check what boot-vm-kvm does.
By following that script, I recently managed to configure a worker to build CentOS packages on SLES nodes:
* Install kernel-obs-build on the worker node * sudo ln -s /.build.kernel.kvm /boot/kernel.obs.guest * sudo ln -s /.build.initrd.kvm /boot/initrd.obs.guest
I don't know if this is the correct way of doing things or not, but this is currently working in one of our private OBS instances.
kernel-obs-build is supposed to get installed inside of the VM.
No need for using the .guest links, these are just very last resort hacks..
Is it possible for it to use the standard kernels instead of the kernel-obs-build stuff? I'd much rather reuse the standard kernel builds... -- 真実はいつも一つ!/ Always, there's only one truth!
On Sep 23 2021, Neal Gompa wrote:
Is it possible for it to use the standard kernels instead of the kernel-obs-build stuff? I'd much rather reuse the standard kernel builds...
kernel-obs-build _is_ the standard kernel, just repackaged and equipped with an initrd. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
On Thu, Sep 23, 2021 at 2:30 PM Andreas Schwab
On Sep 23 2021, Neal Gompa wrote:
Is it possible for it to use the standard kernels instead of the kernel-obs-build stuff? I'd much rather reuse the standard kernel builds...
kernel-obs-build _is_ the standard kernel, just repackaged and equipped with an initrd.
So we just need a package that includes a prebuilt initramfs? -- 真実はいつも一つ!/ Always, there's only one truth!
On Sep 23 2021, Neal Gompa wrote:
On Thu, Sep 23, 2021 at 2:30 PM Andreas Schwab
wrote: On Sep 23 2021, Neal Gompa wrote:
Is it possible for it to use the standard kernels instead of the kernel-obs-build stuff? I'd much rather reuse the standard kernel builds...
kernel-obs-build _is_ the standard kernel, just repackaged and equipped with an initrd.
So we just need a package that includes a prebuilt initramfs?
Yes, that's the main point of kernel-obs-build. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
On 2021/09/23 Thu 15:59, Srinidhi B wrote:
On Thu, 2021-09-23 at 23:42 +0800, Kai Liu wrote:
Thanks. My original question was related. Here in this file the kernel and initrd can be appointed. But it's a machine-wide option, means every worker VM on this machines will use the same kernel & initrd to boot. Thus you will end up building a CentOS package with SLES kernel, for example. This is what I would like to solve, by following how it's done on boo.
Correct. If you want to set different kernel and initrd per build, then you need to follow what Andreas recommended - check what boot-vm-kvm does.
By following that script, I recently managed to configure a worker to build CentOS packages on SLES nodes:
* Install kernel-obs-build on the worker node * sudo ln -s /.build.kernel.kvm /boot/kernel.obs.guest * sudo ln -s /.build.initrd.kvm /boot/initrd.obs.guest
I don't know if this is the correct way of doing things or not, but this is currently working in one of our private OBS instances.
The key is the VM worker needs to find its kernel & initrd _per build job_, so that it can use the right kernel for the right distro the job build against. Thus the kernel and initrd cannot be fixed in /etc/sysconfig/obs-server, nor can they be pointed to some file on the host. Regards, Kai
On 23.09.21 17:22, Srinidhi B wrote:
Hello Kai,
I'm not an expert, but will try my best to respond.
On Thu, 2021-09-23 at 22:51 +0800, Kai Liu wrote:
Hi,
While looking at boo, I noticed that the kernel and initrd of the VM workers are different for different jobs.
For example, for SLES, qemu uses the kernel and initrd under /var/cache/obs/worker/root_*/.mount/boot/kernel. But for CentOS, it uses kernel under /boot. It looks like the SLES worker even runs the exact kernel version of the target OS.
SUSE distributions (SLES, openSUSE, etc.) use the kernel-obs-build package. I don't know the exact difference between the kernel-default and the kernel-obs- build packages, but this package is what provides the /var/cache/obs/worker/* kernel and initrd for SUSE distributions.
For non-SUSE distributions, there is no kernel-obs-build package yet, as far as I'm told. OBS seems to be using some sort of a workaround to provide the kernels in the /boot/ directory of the worker host machine.
https://github.com/seife/kernel-obs-build https://build.opensuse.org/package/show/home:seife:kiwitest-centos/kernel-ob... Without that, building CentOS-7 images with KIWI was hard/impossible or needed crazy workarounds IIRC. I never got past building this for CentOS-7, because I fortunately did not need it for anything else ;-) -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman
participants (6)
-
Adrian Schröter
-
Andreas Schwab
-
Kai Liu
-
Neal Gompa
-
Srinidhi B
-
Stefan Seyfried