Skip to content
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

feat: enhance kubernetes driver #370

Merged
merged 1 commit into from Aug 31, 2020
Merged

feat: enhance kubernetes driver #370

merged 1 commit into from Aug 31, 2020

Conversation

morlay
Copy link
Collaborator

@morlay morlay commented Aug 28, 2020

fix #342

now we could use kubernetes driver with --append

docker buildx create --use --name=buildkit --platform=linux/amd64 --node=buildkit-amd64 --driver=kubernetes --driver-opt="nodeselector=kubernetes.io/arch=amd64"
docker buildx create --append --name=buildkit --platform=linux/arm64 --node=buildkit-arm64 --driver=kubernetes --driver-opt="nodeselector=kubernetes.io/arch=arm64"
docker buildx inspect buildkit --bootstrap

Name:   buildkit
Driver: kubernetes

Nodes:
Name:      buildkit-amd64
Endpoint:  kubernetes://buildkit/buildkit-amd64
Status:    running
Platforms: linux/amd64*, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

Name:      buildkit-arm64
Endpoint:  kubernetes://buildkit/buildkit-arm64
Status:    running
Platforms: linux/arm64*, linux/amd64, linux/riscv64, linux/ppc64le, linux/s390x, linux/arm/v7, linux/arm/v6

without binfmt

docker buildx inspect buildkit

Name:   buildkit
Driver: kubernetes

Nodes:
Name:      buildkit-amd64
Endpoint:  kubernetes://buildkit/buildkit-amd64
Status:    running
Platforms: linux/amd64*, linux/386

Name:      buildkit-arm64
Endpoint:  kubernetes://buildkit/buildkit-arm64
Status:    running
Platforms: linux/arm64*

without --append, kubernetes driver works as previous behavior

README.md Outdated Show resolved Hide resolved
commands/create.go Outdated Show resolved Hide resolved
@AkihiroSuda
Copy link
Collaborator

Should be signed with full real name

@morlay
Copy link
Collaborator Author

morlay commented Aug 28, 2020

@AkihiroSuda
seems something wrong with travis.
could you help to restart the test?

@tonistiigi
Copy link
Member

needs rebase

@morlay
Copy link
Collaborator Author

morlay commented Aug 30, 2020

Hi @tonistiigi, is there any way to re trigger the test?
image
seems have some setup issue in traivs.

Signed-off-by: Wang Jinglei <morlay.null@gmail.com>
@tonistiigi tonistiigi merged commit 1595352 into docker:master Aug 31, 2020
@morlay morlay deleted the kubernetes-driver-enhancement branch August 31, 2020 03:03
tiborvass pushed a commit to tiborvass/buildx that referenced this pull request Dec 15, 2020
Addresses docker/setup-buildx-action#45

Simple repro:
```
$ buildx create --platform linux/amd64 --use
$ buildx build - <<EOF
from scratch
EOF
```

Since docker#370 a `platform` driver-opt was automatically inserted with the value specified by `--platform` flag on regardless of the type of driver, even though it was only used in the kubernetes driver. However, because the docker-container driver is pedantic about the options being passed, it errored out.

Another side-effect I suspect is that with the kubernetes driver it was now possible to specify the platforms in two different ways: `--driver-opt platform=...` and `--platform`.

This patch reverts completely the `platform` driver-opt and instead ensures the platforms information is passed onto the kubernetes driver via variables.

Signed-off-by: Tibor Vass <tibor@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support multi-arch build with driver kubenetes.
3 participants