aformatik / codchi

Codchi is a tool that manages your project's development environment in a reproducible and easy-to-use way. Setting up a development environment should be as easy as a `git clone`!
https://codchi.dev
MIT License
8 stars 0 forks source link

support oci runtime for easier adoption #28

Open timon-schelling opened 3 weeks ago

timon-schelling commented 3 weeks ago

Most developers have some sort of oci runtime already installed. I think codchi could use this to lower the entry barrier. (I'm not able to convince my coworkers to install another hypervisor/container runtime.) Even rootless podman etc. should be possible.

Is this something you already considered?

For my own dev environments I do somthing extremely similar to codchi, full NixOS inside a container with wayland passed to the host.

I'll properly fork this and swap lxd with youki, podman etc. or something.

I like your philosophy of achieving fully reproducible dev environments with a easy to use cli. Good work :)

htngr commented 3 weeks ago

Thanks for checking out codchi. We're at a very early stage and welcome every new user :)

Codchi in docker (at least on linux) was the original plan. The problem we've encountered was that its not possible to run systemd inside docker properly, at least I couldn't get it to run properly.

Can you share your setup? I'd really like to switch to an oci based solution on Linux. I've also considered bwrap, but the main focus currently is WSL on Windows.

timon-schelling commented 3 weeks ago

I think https://www.niels.fr/blog/rootless-container-with-systemd/ was helpful. Have you tried podman's systemd friendly mode? Or docker with manually created /tmp /run /etc

I think in the long run targeting something rootless on Linux would be ideal and I think achievable. Including a minimal runtime like youki (rust 🎉) into codchi plus some fuse magic should basically be able to do that, but I'm not sure.

I'll look into it when I'm back home and have some time. :)

htngr commented 3 weeks ago

I already tried podman's systemd mode and also docker with some hacking and NixOS did run, but not properly. For example, systemd was degraded and not everything that would run on a proper NixOS installation would run. But that was a year or two ago, so maybe things have changed? The goal for Codchi is that a machine / NixOS config must run equally well on Windows and Linux without the user having to hack around the runtime or change the config based on the host. This currently only works on WSL and LXD. Unfortunately I don't have time to look into docker right now, but I'd be happy to accept a PR.