Fully Dockerized Linux kernel debugging environment
github.com
github.com
Raw gdb against vmlinux is really doing it hard though. How about crash with pykdump?
For released code, work has an internal instance of the brew build system that the Fedora Project uses.
On a embedded targets you'd have a JTAG port for full out of band debugging, but that's obviously not an option for your typical desktop scenario.
Another key element that makes this so useful to me is that I work on a macbook (gasp), and hacky stuff I have to do in that context is the first source of blame when e.g. a header gives weird type issues.
Thank you so much for putting this together.
PS: If you're using a case-insensitive APFS, Linux kernel compilation will fail. I'm already aware of that
What is the point, then, of doing all this in docker containers? If you're virtualizing with qemu anyway then why containerize?
I was expecting something like software (non-kvm) emulation in a userspace process in an unprivileged container, or perhaps UML, real brain-in-a-jar stuff.
You're exactly right. Docker does pretty much almost nothing here
For real, dockerizing stuff has become a meme lately
What it (actually) does it simplifying dependencies. But you know, most of the time if you can run docker you can install stuff locally
Docker has a significant performance penalty unless you're running Linux already
Containers solve real problems and are here to stay. Feel free not to use them, but saying they're a meme is just trying to be edgy.
Keep on containerising applications.
Sincerely, a sysadmin that has been fighting conflicting dependency requirements, deprecated packages and major distro upgrades for more than a decade.
What's a meme is creating a container for any minor thing like npm + some js project. Or to run one Go binary.
> a sysadmin
Sure, for the deployment of stuff containers are very good. But you know people were using stuff like chroots before that right?
I don't think I'm deploying this debugging system in a webserver.
I am backend engineer with a non-JS background and to me that's a a very useful thing. I really don't want to install specific node version, yarn version, etc to run some node/JS application. If I can just docker-compose up that's much easier to me and I know it does not affect anything globally. So removing it after playing around is easy and non-risky.
My biggest problem with this shift is I'm seeing is people are running their distribution updates and containers are still shipping with vulnerable versions of libraries. So a server admin updates his servers thinking he's all good, No, No he's not because $DEV hasn't updated their container dependencies and now that server gets pwned because here's yet another layer of dependencies I have to deal with on top of the ones I'm maintaining with the OS.
So no, please don't make containers on everything just because you can, because more often than not the container you never intended to be used in production WILL be used in production because someone was lazy and didn't want to deal with the dependencies.
Additionally, to your point, specific node versions? specific yarn versions? Is it really that unreasonable to demand libraries be backwards compatible with warnings on software saying a method is being depreciated? Like I can understand for major revision changes but seriously. I should be able to run the latest version of node and that code still work with warnings telling me that the code I've written will eventually stop working in later versions due to changes in the underlying setup.
My point being, don't weigh on containers as a crutch for badly coded software. Operating systems have moved towards rolling releases, it's about time libraries and programming languages followed suit.
If the server is running just for that container's application, then the server admin knows it is there and needs updating.
The admin may know what applications they are running in the container but I can bet you they don't know every library that container is shipping and I hold very little faith that these admins are going to pin a laundry list of every single container they run along with all the different versions of libraries each container is bringing and constantly checking that list for CVEs. This problem increases for every single container you bring onto that server.
Edit:
I love containers, don't get me wrong. I've seen first-hand how incredible it is to be able to set up an application inside a container and then remove that application and have no residual packages containing the libraries and dependencies that program needed. I get it. I just don't like how dependent we've become on them.
Now I'm a network engineer first, and server admin second. I don't want to spend a majority of my time pinging container maintainers to update their dependencies when an updated version of a library comes out. I expect to be able to update my local copy of that library and get on with my day and not have to worry about when this library is going to get patched in each of those containers.
And might I add, some people are shipping containers with full unoptimized Ubuntu (or other large distros) for running projects that are kilobytes in size
You couldn't have picked two more different examples.
Go apps are generally pretty clean statically-linked, native binaries and will be happy to just run from their directory without touching anything else. Containerization is usually unneeded, though if you already have a container ecosystem then they will fit in with no fuss, since the container images are basically glorified tarballs (COPY app/ . RUN foo).
Node.js apps on the other side combine an interpreted language, a messy package management ecosystem, and a fragile and persnickety toolchain that will happily leave dirty stuff in your filesystem and/or your PATH, in order to maximize the risk of dependency-related screwups. Containerization is an absolute godsend for them.
I know, that's why I put it as an example (of something that doesn't need docker)
> and a fragile and persnickety toolchain that will happily leave dirty stuff in your filesystem and/or your PATH
Docker existing shouldn't be an excuse for npm behaving like this ;)
But I agree, for deployment it is good. But you can still run npm projects without it
I don't care about the direction of causality, I just want the stupid thing to run on my computer and not pollute my home directory,and docker solves that and solves it well.
Edit: Although actually about the only time I'm touching node is to ship it in a container image for deployment on a cluster somewhere, which is even more compelling.
Nix can build many things, among them whole operating systems on the metal, virtual machine images, and container images (including Docker images).
When you use Nix to generate Docker images and deploy them in production using Docker, Nix is not functioning as an alternative to Docker, but your *.nix file is functioning as an alternative to your Dockerfile.
Defining container images in terms of Nixpkgs rather than via a Dockerfile, and assembling it via Nix rathet than `docker build` does have some advantages.
1. It moves you from mere repeatability in the direction of true reproducibility— it makes your outcomes more predictable and reliable
2. Having the benefit of knowledge of the actual dependencies on the system down to the package (or subpackage) level, Nix knows how to generate minimal images when Docker can't.
Plus there's the prospect of reuse, I guess; an environment you've defined in Nix for building Docker containers is easy to install and debug in other environments, without the extra complexity of Docker and filesystems exports/imports, port forwarding, etc. That can be nice, to be able to easily separate out what you're troubleshooting or learning as you're creating or modifying the image's environment.
But yeah that doesn't mean that pairing Dockerfiles with imperative or convergent configutation management or provisioning tools can't also sometimes work well enough in a given situation.
Ah yes, the famed Windows/macOS kernel developer... :)
(Not that it's not possible of course, I just found it chuckle-worthy within the context of this article)
I don't know how well this deals with caches and so, though.
- Minimal host system requirements as kernel tool chains can be very much a pain to set up correctly. If I want to compile different kernel versions for different architectures this seemed liked a good trade-off. - I wanted to encapsulate every major logic component into a separate instance so working on the individual components does not require building one insanely large image.
Also note this is very much an early prototype and me just experimenting. Nothing is set in stone yet. Things are likely to change along the way.
My understanding, interruptions is in essence signal processing. hard means hardware chip guartantee the reliablity. soft means signal are just memory address that can be easy wiped out.
For this project, in order to have a kernel to debug, they run a separate kernel inside the qemu virtual machine emulator. qemu is a normal userspace process, and therefore that process can run inside a Docker container. So the kernel being debugged has interrupts, but the "hardware" generating those interrupts (and all the other "hardware," including the CPU itself) is all just software emulating a PC.