-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add macOS support #4059
Add macOS support #4059
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR almost fixes compilation of
buildkitd
on macOS.
I'm not sure what you try to "fix". Afaik there is no isolation primitives / bind mounts in the MacOS kernel. I guess we would need to shell out to some kind of mount helper.
If we can start with a proposal to discuss on a proper abstraction (pluggable) interface that would be great.
I also can't first fix moby and then fix buildkit.
This is possible:
That's a completely different story and I'd like to avoid expanding the scope of current PR to cover those aspects. It is just a small initial step that only makes the thing compile and nothing else.
I'll take a look, thanks. |
I'll add some background context here. I'm currently working on a containerd shim for macOS: https://github.com/macOScontainers/rund. While it doesn't offer the usual container level of isolation from the host due to kernel limitations, there is a highly requested containerd/containerd#5525. Even with the limited functionality of rootfs delivery + chroot, such thing would be very useful for CI needs. I'm not sure it will ever become an official containerd shim, but actually that doesn't matter much. So, the point here is that eventually I'd like to be able to get the whole containerd+buildkit+moby combo working and current PR is just a small step in that direction. |
Sorry, I'm still not understanding. I have two separate repos, with buildkit and with moby. If I try to build buildkit with changes from current PR, it fails in moby code:
If I try to build moby, it fails in buildkit code:
So, I don't see any way to fix them one by one. I suppose the procedure has to be
@akhramov could you please enlighten me, how you worked around this cycle in context of your FreeBSD changes? If I understand things properly, when moby/moby#45724 was merged, moby actually cannot be built on FreeBSD, right? |
@slonopotamus the trick is that you don't need to build moby in its entirety, but rather a few well-isolated packages. In your case you would need to fix |
Okay, makes sense. Thanks. |
Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b84373 Signed-off-by: Marat Radchenko <[email protected]>
See moby/moby#46094 for fixes on Moby side. |
Given that #2376 was merged, I'll rebase soon and add some more code unification across Darwin/FreeBSD. |
Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b84373 Signed-off-by: Marat Radchenko <[email protected]>
Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b84373 Signed-off-by: Marat Radchenko <[email protected]>
I'd like to get some feedback on buildkit changes. Vendoring update is not going to happen as it is present in current PR for obvious reasons, so I'll revert it before the actual merge. |
Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b84373 Signed-off-by: Marat Radchenko <[email protected]>
Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b84373 Signed-off-by: Marat Radchenko <[email protected]>
2d7f2cc
to
05b4434
Compare
I've restructured my branch a bit to make it clearer what changes are buildkit-related. First commit just updates containerd to a version that includes containerd/containerd#8789. That is out of discussion currently, every party agreed that there needs to be a more universal solution. Second commit is what I'd really like to land in buildkit repo. I'll rebase this branch a lot, so the link will become outdated, but look for "Add macOS support" commit message. As of now, it is this: 57cd14f I suggest we only review and merge this single commit and nothing else in current PR. UPD: Okay, it won't work this way because we want CI to pass. I'll possibly create a separate PR from a branch that only contains that single commit. |
Reorganised things again so this PR now only includes Buildkit-specific changes. CI is currently failing, will investigate tomorrow. UPD: Fixed, ready for review. CI that builds these changes + updated containerd for macOS can be seen in https://github.com/macOScontainers/buildkit |
Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b84373 Signed-off-by: Marat Radchenko <[email protected]>
86a44d1
to
d65b10c
Compare
Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b84373 Signed-off-by: Marat Radchenko <[email protected]>
Signed-off-by: Marat Radchenko <[email protected]>
This PR adds experimental support for running native macOS containers using rund.
This PR depends on
mount.All
and its developers declined PR that puts in implementation based onbindfs
. Both containerd and buildkit callmount.All
a lot. So it needs to work properly.mountinfo.PrefixFilter
containerd/containerd#9054Also, see rund macOS containerd shim.