Hi Stefan,

Le mar. 26 mars 2019 à 08:02, Stefan Hajnoczi <stefanha@redhat.com> a écrit :
On Mon, Mar 25, 2019 at 04:42:17PM +0000, Venegas Munoz, Jose Carlos wrote:
> That is a good point.
>
> Working with current kata packages (in OBS) and with Lokesh from Fedora this not a very distro friendly process.
>
> In my mind remove systemd could simplify the rootfs creation, ideally features needed by the agent would be implemented there ( I know sometimes we just prefer to use an existing binary for that).
>
> I see the following  requirements  for rootfs creation point + packaging  limitations.
>
> - rootfs creation should work without network access
> - Not need to rely on a package manager (like populate a directory with dnf)
>
> To handle this we probably have two options:
>
> - Create roots with a tool like Dracut ( If somebody has some experience with it feel free to open an issue to talk about it)
> - Remove systemd depencies, just have as rootfs dependency: agent, ipables  <name other random binaries we need in the future).
>     - The binaries need to be static as requirement: with this rootfs creation is just copy binaries to a directory.
>     - If binaries are not static we can parse ldd output and copy the right libs to the rootfs directory.
>     - See https://github.com/kata-containers/osbuilder/issues/259 for more information about this.

I have CCed Lokesh for Fedora-specific requirements for Kata images:
https://github.com/kata-containers/documentation/wiki/Kata-images

This page was originally intended simply to summarise the differences between image options. However, I'm really glad you've brought up the important and ongoing issue of distro packaging. I've tried to summarise that in [1], but maybe that too needs to be surfaced by putting it into a wiki page of its own.



Lokesh: Out of the various options for building Kata images (initramfs
vs disk image, systemd vs agent), which ones are friendliest for Fedora
packaging?

There may be an alternative solution to the ongoing issue of packaging binaries images...

- Kata needs a binary rootfs image and a binary kernel image to boot the hypervisor. Once booted, the user's chosen (binary) disk image will be made available for the workload (you might be able to see where this is going... :)
- Our OBS packaging currently packages images and kernels as a convenience to users.
- Container managers like Docker also require binary images. But those images are not packaged - they are downloaded on demand ("docker pull").
- This leads to a potential solution to the packaging blocker: Kata could be packaged without any binary assets.
- If the binaries were not packaged, an additional step would be required before a Kata container could be created, something like [2]:

    $ sudo kata-runtime pull [all-assets|image|initrd|kernel]

There are complications with this concept though, including:

- Where would we host such assets?
- How would the kernel be handled?
- How would the system determine which type of image to download?
- How would updates to these assets be handled? We need to avoid / minimise the "stale container" scenario [3].


Is anyone in touch with Debian packagers who could provide input?

As shown on [1], we're still looking for Debian volunteers, so if anyone is keen...? :)
 

Stefan

Cheers,

James

[1] - https://github.com/kata-containers/packaging/issues/6#issuecomment-453940053
[2] - If that wasn't done, the runtime would select suitable defaults when "kata-runtime create" was invoked. That would of course delay the creation of the initial Kata container but would be similar to how, say, Docker works if you "docker run" without a previous "docker pull".
[3] - https://github.com/clearcontainers/runtime/wiki/Stale-containers

---
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.