-
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 stub implementations to make buildkitd buildable for Darwin #5276
Conversation
Dockerfile
Outdated
@@ -175,6 +175,7 @@ COPY --link --from=buildctl /usr/bin/buildctl / | |||
COPY --link --from=buildkitd /usr/bin/buildkitd / | |||
|
|||
FROM scratch AS binaries-darwin | |||
COPY --link --from=buildkitd /usr/bin/buildkitd / |
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.
We do not want to ship stub buildkitd binary for macos users.
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.
Okay, will remove from here. Do you want me to add another job that would check that it compiles?
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.
You can add it to this matrix:
buildkit/.github/workflows/test-os.yml
Lines 33 to 35 in ea6f91e
platform: | |
- windows/amd64 | |
- freebsd/amd64 |
matrix:
platform:
- windows/amd64
- freebsd/amd64
- darwin/amd64
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.
If I read things properly, that job goes through the same Dockerfile target (binaries-darwin
), so it won't build buildkitd
.
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.
Hum right it will build binaries-for-test
target:
buildkit/.github/workflows/test-os.yml
Line 57 in ea6f91e
targets: binaries-for-test |
Lines 102 to 106 in ea6f91e
target "binaries-for-test" { | |
inherits = ["_common"] | |
target = "binaries-for-test" | |
output = [bindir("build")] | |
} |
Lines 367 to 371 in ea6f91e
FROM scratch AS binaries-for-test | |
COPY --link --from=gotestsum /out / | |
COPY --link --from=registry /out / | |
COPY --link --from=containerd /out / | |
COPY --link --from=binaries / / |
We would just want buildctl
and buildkitd
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.
Soo... Do you want me to add COPY --link --from=buildkitd /usr/bin/buildkitd /
to binaries-for-test
? It will do redundant work for other platforms, but I don't see any other good way.
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.
I guess we can create a dedicated job in test-os
workflow to build buildkitd
target for darwin/amd64
platform. I can push these changes to your branch if you want.
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.
I can push these changes to your branch if you want.
That would be cool!
98a8fdd
to
fdd356a
Compare
.github/workflows/test-os.yml
Outdated
steps: | ||
- | ||
name: Prepare | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | ||
if [ "${platform}" = "darwin/amd64" ]; then | ||
echo "BUILD_TARGET=buildkitd" >> $GITHUB_ENV |
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.
@crazy-max It looks like you stopped building buildctl
this way. I have no experience with docker/bake-action
, is it possible to ask it to build multiple targets?
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.
I changed the workflow to create a dedicated job instead to just build buildkitd. buildctl
is already built here:
buildkit/.github/workflows/buildkit.yml
Line 69 in b60d621
binaries: |
e.g., https://github.com/moby/buildkit/actions/runs/10665890596/job/29560219583
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.
Looks good, thanks for help
e187bc8
to
aeb1014
Compare
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.
So what's the benefit of this? I would get if some packages are useful for darwin and we want to make sure that they are buildable. But why build a broken buildkitd
. Why make executor
"buildable" when there really is no implementation. Why make source/git
"buildable" while with this PR it would just fail on runtime as soon as it would get called?
We have no intention of actually supporting macos as target via some non-container execution mechanism https://github.com/moby/buildkit/blob/master/PROJECT.md#project-scope .
WRT WRT executor: I do not agree that there is no implementation. Everything that buildkit needs is to call containerd (and current PR enables containerd worker). There are multiple containerd runtimes that work on Darwin, for example https://github.com/ukontainer/runu/ I do not expect any significant Darwin-specific changes to buildkit besides current PR. |
aeb1014
to
d836200
Compare
Signed-off-by: Marat Radchenko <[email protected]>
d836200
to
64f4631
Compare
Looks like CI failed on |
These changes are extracted from #4059. Other half was already merged in #5271.
localmounter_darwin.go
is fully identical tolocalmounter_freebsd.go
except that it usesbind
mount type instead of FreeBSD-specificnullfs
.Not sure whether you want to enable CI job for Darwin
buildkitd
, I'm absolutely OK if that will be omitted from current PR.