Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Internalize vendor/github.com/docker/machine #21647

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

Open
afbjorklund wants to merge 3 commits into kubernetes:master
base: master
Choose a base branch
Loading
from afbjorklund:internal-machine

Conversation

Copy link
Collaborator

@afbjorklund afbjorklund commented Sep 28, 2025
edited
Loading

Skip the host version v0-v2 migration code and os provisioners.
Also skip all the version handling, for downloading boot2docker.

Only copy the hyperv and virtualbox drivers actually being used.

  • Import github.com/Parallels/docker-machine-parallels/v2
    Drop the "version" since it is not needed anymore.

  • Import github.com/machine-drivers/docker-machine-driver-vmware
    Drop the "config" subdirectory from the module path.

This PR goes well with dropping hyperkit and internalizing kvm:


Issue #21619

Before #21637

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 28, 2025
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: afbjorklund
Once this PR has been reviewed and has the lgtm label, please assign comradeprogrammer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 28, 2025
Skip the host version v0-v2 migration code and os provisioners.
Also skip all the version handling, for downloading boot2docker.
Only copy the hyperv and virtualbox drivers actually being used.
There is an "errdriver" that is only used for internal testing.
Import github.com/Parallels/docker-machine-parallels/v2
Import github.com/machine-drivers/docker-machine-driver-vmware
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afbjorklund are we leaving out the vmware and parellles drivers ? if yes, could we import them too ?

Copy link
Collaborator Author

afbjorklund commented Sep 30, 2025
edited
Loading

are we leaving out the vmware and parellles drivers ?

In this PR, they are included (with their original LICENSE)

But in order to test them, you would probably need to get some CI licenses from the vendor?

Only the machine drivers are included, not the actual hypervisor and their control programs...

Copy link
Member

medyagh commented Oct 1, 2025

@afbjorklund we would need to fix the licenses, maybe we can slap our own boilerplate on the top of the file ? could a file have two linceses ?

afbjorklund reacted with thumbs up emoji

Copy link
Collaborator Author

afbjorklund commented Oct 1, 2025
edited
Loading

Parallells might be harder, since it is using a different license (MIT, rather than Apache-2.0)

Copyright (c) 2015-2020 Parallels IP Holdings GmbH.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

But you already have all of this under vendor, so it is only a question of reporting (or not)

vendor/github.com/Parallels/docker-machine-parallels/v2/LICENSE

vendor/github.com/machine-drivers/docker-machine-driver-vmware/LICENSE

We could do something similar:

/*
Copyright 2017 The Kubernetes Authors All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
 * Copyright 2017 VMware, Inc. All rights reserved. Licensed under the Apache v2 License.
 */

Copy link
Collaborator Author

afbjorklund commented Oct 1, 2025
edited
Loading

https://opensource.stackexchange.com/questions/7384/proper-way-of-migrating-mit-licensed-code-to-apache-2-0-license

When the project is under both the MIT and Apache license, then it is sufficient to call your project Apache 2 licensed: the terms of the Apache license are a superset of the MIT license terms. However, you still have to keep any existing MIT license notices intact.

Copyright (c) 2015-2020 Parallels IP Holdings GmbH.

Same for the Apache license notices:

Copyright 2017 VMware, Inc. All rights reserved.
Copyright 2014 Docker, Inc.

@afbjorklund afbjorklund force-pushed the internal-machine branch 2 times, most recently from 601d6d1 to 3eafd42 Compare October 1, 2025 20:35
Copy link
Member

medyagh commented Oct 15, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 15, 2025
Copy link
Member

medyagh commented Oct 16, 2025

/ok-to-test

Copy link
Member

medyagh commented Oct 16, 2025
edited
Loading

@afbjorklund the cross build fails, I think we might need to remove building the kvm drivers from the cross build script

14:42:06 Digest: sha256:a0655d9b3aea65de70e5391abe468634da3c7d32a234902661eff6fce7bbd669
14:43:33 Status: Downloaded newer image for quay.io/nirsof/xcgo:jammy-v2
14:43:33 GOOS=darwin CGO_ENABLED=1 go build \
14:43:33 	-ldflags="-X k8s.io/minikube/pkg/drivers/hyperkit.version=v1.37.0 -X k8s.io/minikube/pkg/drivers/hyperkit.gitCommitID="97234082a2b717645e4c65b81176aa798a9226b4"" \
14:43:43 	-o out/docker-machine-driver-hyperkit k8s.io/minikube/cmd/drivers/hyperkit
14:43:43 chmod +X out/docker-machine-driver-kvm2-amd64
14:43:43 chmod +X out/docker-machine-driver-kvm2-amd64
14:43:43 cp out/docker-machine-driver-kvm2-amd64 out/docker-machine-driver-kvm2
14:43:43 cp -r installers/linux/deb/kvm2_deb_template out/docker-machine-driver-kvm2_1.37.0
14:43:43 chmod 0755 out/docker-machine-driver-kvm2_1.37.0/DEBIAN
14:43:43 sed -E -i -e 's/--VERSION--/1.37.0/g' out/docker-machine-driver-kvm2_1.37.0/DEBIAN/control
14:43:43 sed -E -i -e 's/--ARCH--/'amd64'/g' out/docker-machine-driver-kvm2_1.37.0/DEBIAN/control
14:43:43 mkdir -p out/docker-machine-driver-kvm2_1.37.0/usr/bin
14:43:43 cp out/docker-machine-driver-kvm2-amd64 out/docker-machine-driver-kvm2_1.37.0/usr/bin/docker-machine-driver-kvm2
14:43:43 fakeroot dpkg-deb --build out/docker-machine-driver-kvm2_1.37.0 out/docker-machine-driver-kvm2_1.37.0-0_amd64.deb
14:43:43 dpkg-deb: building package 'docker-machine-driver-kvm2' in 'out/docker-machine-driver-kvm2_1.37.0-0_amd64.deb'.
14:43:43 rm -rf out/docker-machine-driver-kvm2_1.37.0
14:43:43 cp out/docker-machine-driver-kvm2_1.37.0-0_amd64.deb out/docker-machine-driver-kvm2_1.37.0.deb
14:43:43 make: 'out/docker-machine-driver-kvm2_1.37.0-0_amd64.deb' is up to date.
14:43:45 # k8s.io/minikube/pkg/libmachine/shell
14:43:45 pkg/libmachine/shell/shell_windows.go:68:6: Detect redeclared in this block
14:43:45 	pkg/libmachine/shell/shell.go:33:6: other declaration of Detect
14:43:46 make: *** [Makefile:280: out/minikube-windows-amd64] Error 1
14:43:46 make: *** [Makefile:277: out/minikube-windows-amd64] Error 2
14:43:46 make: *** Waiting for unfinished jobs....
14:43:46 + failed=2
14:43:46 +++ go env GOOS
14:43:48 +++ go env GOARCH
14:43:48 ++ out/minikube-linux-amd64 version
14:43:48 + BUILT_VERSION='minikube version: v1.37.0
14:43:48 commit: 97234082a2b717645e4c65b81176aa798a9226b4'
14:43:49 + echo minikube version: v1.37.0 commit: 97234082a2b717645e4c65b81176aa798a9226b4
14:43:49 minikube version: v1.37.0 commit: 97234082a2b717645e4c65b81176aa798a9226b4
14:43:49 ++ echo minikube version: v1.37.0 commit: 97234082a2b717645e4c65b81176aa798a9226b4
14:43:49 ++ grep commit:
++ awk '{print 2ドル}'
+ COMMIT=version:

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afbjorklund the script that jenkins fails on is
hack/jenkins/minikube_cross_build_and_upload.sh

I think we will need to remove these lines

out/docker-machine-driver-kvm2_$(make deb_version_base).deb \

Copy link
Collaborator Author

afbjorklund commented Oct 17, 2025
edited
Loading

I think we will need to remove these lines

out/docker-machine-driver-kvm2_$(make deb_version_base).deb

Why, they are for a different build step?

make: 'out/docker-machine-driver-kvm2_1.37.0-0_amd64.deb' is up to date.

I can't repeat the failure locally, normally.

GOOS="windows" GOARCH="amd64" go build -tags "" -a ./pkg/libmachine/shell/...

The only way is by provoking the compiler:

$ GOOS="windows" GOARCH="amd64" go build -tags "" -a ./pkg/libmachine/shell/*.go
# command-line-arguments
pkg/libmachine/shell/shell_windows.go:52:6: Detect redeclared in this block
	pkg/libmachine/shell/shell.go:17:6: other declaration of Detect

Since "shell.go" is supposed to be ignored:

// +build !windows
package shell
GOOS="windows" GOARCH="amd64" \
go build -tags "" -ldflags="-X k8s.io/minikube/pkg/version.version=v1.37.0 -X k8s.io/minikube/pkg/version.isoVersion=v1.37.0-1760609724-21757 -X k8s.io/minikube/pkg/version.gitCommitID="75d6e112bff2fff720b9eff8eb12aff9a42ec072" -X k8s.io/minikube/pkg/version.storageProvisionerVersion=v5" -a -o out/minikube-windows-amd64 k8s.io/minikube/cmd/minikube

Copy link
Collaborator Author

afbjorklund commented Oct 17, 2025
edited
Loading

Ah, it was the "boilerplate" copyright script that broke it - by adding itself before the +build line.

PASS 130c636
FAIL 3eafd42

Apparently the script only handles the new-style go:build, but not the old-style +build used here.

--- a/pkg/libmachine/shell/shell.go
+++ b/pkg/libmachine/shell/shell.go
@@ -1,3 +1,5 @@
+//go:build !windows
+
 /*
 Copyright 2022 The Kubernetes Authors All rights reserved.
 
@@ -14,8 +16,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// +build !windows
-
 package shell
 
 import (

I fixed the other places, but didn't test windows.

Copy link
Contributor

@afbjorklund: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-minikube-integration 29e463f link true /test pull-minikube-integration

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link

kvm2 driver with docker runtime
error collecting results for kvm2 driver: timing run 0 with minikube (PR 21647): timing cmd: [/home/jenkins/.minikube/minikube-binaries/21647/minikube addons enable ingress]: waiting for minikube: exit status 11
docker driver with docker runtime
error downloading artifacts: artifact download start: exit status 81docker driver with containerd runtime
error downloading artifacts: artifact download start: exit status 81

Copy link

Here are the number of top 10 failed tests in each environments with lowest flake rate.

Environment Test Name Flake Rate
Docker_Linux_containerd (2 failed) TestAddons/Setup(gopogh) 0.00% (chart)
Docker_Linux_containerd (2 failed) TestDockerEnvContainerd(gopogh) 0.00% (chart)
Docker_Linux_containerd_arm64 (2 failed) TestAddons/Setup(gopogh) 0.00% (chart)
Docker_Linux_containerd_arm64 (2 failed) TestDockerEnvContainerd(gopogh) 0.00% (chart)

Besides the following environments also have failed tests:

  • Docker_Linux: 143 failed (gopogh)

  • Docker_Linux_crio: 138 failed (gopogh)

  • Docker_Linux_crio_arm64: 138 failed (gopogh)

  • Docker_Linux_docker_arm64: 143 failed (gopogh)

  • KVM_Linux_crio: 140 failed (gopogh)

To see the flake rates of all tests by environment, click here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@prezha prezha Awaiting requested review from prezha

@nirs nirs Awaiting requested review from nirs

@medyagh medyagh Awaiting requested review from medyagh

Assignees

No one assigned

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /