Skip to content

Commit caa8a54

Browse files
authored
Merge pull request #1776 from dlorenc/hyperkit
WIP: Initial hyperkit driver implementation.
2 parents 88fef61 + a05a4fe commit caa8a54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4822
-29
lines changed

Godeps/Godeps.json

+52-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

+15-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ LOCALKUBE_LDFLAGS := "$(K8S_VERSION_LDFLAGS) $(MINIKUBE_LDFLAGS) -s -w -extldfla
5151

5252
LOCALKUBEFILES := GOPATH=$(GOPATH) go list -f '{{join .Deps "\n"}}' ./cmd/localkube/ | grep k8s.io | GOPATH=$(GOPATH) xargs go list -f '{{ range $$file := .GoFiles }} {{$$.Dir}}/{{$$file}}{{"\n"}}{{end}}'
5353
MINIKUBEFILES := GOPATH=$(GOPATH) go list -f '{{join .Deps "\n"}}' ./cmd/minikube/ | grep k8s.io | GOPATH=$(GOPATH) xargs go list -f '{{ range $$file := .GoFiles }} {{$$.Dir}}/{{$$file}}{{"\n"}}{{end}}'
54+
HYPERKIT_FILES := GOPATH=$(GOPATH) go list -f '{{join .Deps "\n"}}' k8s.io/minikube/cmd/drivers/hyperkit | grep k8s.io | GOPATH=$(GOPATH) xargs go list -f '{{ range $$file := .GoFiles }} {{$$.Dir}}/{{$$file}}{{"\n"}}{{end}}'
5455

5556
MINIKUBE_ENV_linux := CGO_ENABLED=1 GOARCH=amd64 GOOS=linux
5657
MINIKUBE_ENV_darwin := CGO_ENABLED=1 GOARCH=amd64 GOOS=darwin
@@ -162,7 +163,7 @@ $(GOPATH)/bin/go-bindata:
162163
GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...
163164

164165
.PHONY: cross
165-
cross: out/localkube out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe
166+
cross: out/localkube out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe out/docker-machine-driver-hyperkit
166167

167168
.PHONY: e2e-cross
168169
e2e-cross: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe
@@ -217,6 +218,19 @@ out/minikube-installer.exe: out/minikube-windows-amd64.exe
217218
mv out/windows_tmp/minikube-installer.exe out/minikube-installer.exe
218219
rm -rf out/windows_tmp
219220

221+
out/docker-machine-driver-hyperkit: $(shell $(HYPERKIT_FILES))
222+
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
223+
$(MINIKUBE_DOCKER_CMD) '$(MINIKUBE_ENV_darwin_DOCKER) $(MINIKUBE_ENV_darwin) go build -o $(BUILD_DIR)/docker-machine-driver-hyperkit k8s.io/minikube/cmd/drivers/hyperkit'
224+
else
225+
$(MINIKUBE_ENV_darwin) go build -o $(BUILD_DIR)/docker-machine-driver-hyperkit k8s.io/minikube/cmd/drivers/hyperkit
226+
endif
227+
228+
.PHONY: install-hyperkit-driver
229+
install-hyperkit-driver: out/docker-machine-driver-hyperkit
230+
sudo cp out/docker-machine-driver-hyperkit $(HOME)/bin/docker-machine-driver-hyperkit
231+
sudo chown root:wheel $(HOME)/bin/docker-machine-driver-hyperkit
232+
sudo chmod u+s $(HOME)/bin/docker-machine-driver-hyperkit
233+
220234
.PHONY: check-release
221235
check-release:
222236
go test -v ./deploy/minikube/release_sanity_test.go -tags=release

cmd/drivers/hyperkit/main.go

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Copyright 2016 The Kubernetes Authors All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package main
18+
19+
import (
20+
"github.com/docker/machine/libmachine/drivers/plugin"
21+
"k8s.io/minikube/pkg/minikube/drivers/hyperkit"
22+
)
23+
24+
func main() {
25+
plugin.RegisterDriver(hyperkit.NewDriver("", ""))
26+
}

hack/jenkins/common.sh

+10
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@
2727
# Copy only the files we need to this workspace
2828
mkdir -p out/ testdata/
2929
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH} out/
30+
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/
3031
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH} out/
3132
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/busybox.yaml testdata/
3233
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/pvc.yaml testdata/
3334
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/busybox-mount-test.yaml testdata/
3435

36+
# Add the out/ directory to the PATH, for using new drivers.
37+
export PATH="$(pwd)/out/":$PATH
38+
3539
# Linux cleanup
3640
virsh -c qemu:///system list --all \
3741
| sed -n '3,$ p' \
@@ -59,6 +63,12 @@ pgrep xhyve | xargs kill || true
5963
# Set the executable bit on the e2e binary and out binary
6064
chmod +x out/e2e-${OS_ARCH}
6165
chmod +x out/minikube-${OS_ARCH}
66+
chmod +x out/docker-machine-driver-*
67+
68+
if [ -e out/docker-machine-driver-hyperkit ]; then
69+
sudo chown root:wheel out/docker-machine-driver-hyperkit || true
70+
sudo chmod u+s out/docker-machine-driver-hyperkit || true
71+
fi
6272

6373
MINIKUBE_WANTREPORTERRORPROMPT=False sudo ./out/minikube-${OS_ARCH} delete \
6474
|| MINIKUBE_WANTREPORTERRORPROMPT=False ./out/minikube-${OS_ARCH} delete \

hack/jenkins/minikube_set_pending.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
set -e
2828
set +x
2929

30-
for job in "OSX-Virtualbox" "OSX-XHyve" "Linux-Virtualbox" "Linux-KVM" "Linux-KVM-Alt" "Linux-None" "Windows-HyperV"; do
30+
for job in "OSX-Virtualbox" "OSX-XHyve" "OSX-Hyperkit" "Linux-Virtualbox" "Linux-KVM" "Linux-KVM-Alt" "Linux-None" "Windows-HyperV"; do
3131
target_url="https://storage.googleapis.com/minikube-builds/logs/${ghprbPullId}/${job}.txt"
3232
curl "https://api.github.com/repos/kubernetes/minikube/statuses/${ghprbActualCommit}?access_token=$access_token" \
3333
-H "Content-Type: application/json" \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Copyright 2016 The Kubernetes Authors All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
# This script runs the integration tests on an OSX machine for the Hyperkit Driver
19+
20+
# The script expects the following env variables:
21+
# MINIKUBE_LOCATION: GIT_COMMIT from upstream build.
22+
# COMMIT: Actual commit ID from upstream build
23+
# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests
24+
# access_token: The Github API access token. Injected by the Jenkins credential provider.
25+
26+
27+
set -e
28+
29+
OS_ARCH="darwin-amd64"
30+
VM_DRIVER="hyperkit"
31+
JOB_NAME="OSX-Hyperkit"
32+
33+
34+
# Download files and set permissions
35+
source common.sh

hack/jenkins/print-debug-info.sh

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ journalctl -u localkube -n 500
3131
${SUDO_PREFIX}cat $KUBECONFIG
3232

3333
cat $HOME/.kube/config
34+
echo $PATH
3435

3536
docker ps
3637

0 commit comments

Comments
 (0)