Date: Sat, 11 Aug 2018 19:25:41 +0000 (UTC) From: Danilo Egea Gondolfo <danilo@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r476941 - in head/sysutils: . minikube minikube/files Message-ID: <201808111925.w7BJPfQw013889@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: danilo Date: Sat Aug 11 19:25:41 2018 New Revision: 476941 URL: https://svnweb.freebsd.org/changeset/ports/476941 Log: - New port: sysutils/minikube Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day. Added: head/sysutils/minikube/ head/sysutils/minikube/Makefile (contents, props changed) head/sysutils/minikube/distinfo (contents, props changed) head/sysutils/minikube/files/ head/sysutils/minikube/files/patch-pkg_minikube_cluster_cluster__freebsd.go (contents, props changed) head/sysutils/minikube/files/patch-pkg_minikube_constants_constants__freebsd.go (contents, props changed) head/sysutils/minikube/files/patch-third__party_go9p_srv__pipe__freebsd.go (contents, props changed) head/sysutils/minikube/files/patch-third__party_go9p_ufs__freebsd.go (contents, props changed) head/sysutils/minikube/files/pkg-message.in (contents, props changed) head/sysutils/minikube/pkg-descr (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Sat Aug 11 19:01:15 2018 (r476940) +++ head/sysutils/Makefile Sat Aug 11 19:25:41 2018 (r476941) @@ -688,6 +688,7 @@ SUBDIR += metalog SUBDIR += mfid SUBDIR += mgeupsd + SUBDIR += minikube SUBDIR += minimunin SUBDIR += minirsyslogd SUBDIR += mixer Added: head/sysutils/minikube/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/Makefile Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,58 @@ +# Created by: Danilo Egea Gondolfo <danilo@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= minikube +PORTVERSION= 0.28.2 +DISTVERSIONPREFIX= v +CATEGORIES= sysutils + +MAINTAINER= danilo@FreeBSD.org +COMMENT= Run Kubernetes locally + +LICENSE= APACHE20 + +BUILD_DEPENDS= go-bindata:devel/go-bindata +RUN_DEPENDS= kubectl:sysutils/kubectl + +USES= go + +USE_GITHUB= yes +GH_ACCOUNT= kubernetes + +PLIST_FILES= bin/${PORTNAME} + +SUB_FILES= pkg-message + +post-patch: + ${LN} -s ${WRKSRC}/vendor ${WRKSRC}/src + ${MKDIR} ${WRKSRC}/src/k8s.io/${PORTNAME} + ${LN} -s ${WRKSRC}/pkg ${WRKSRC}/src/k8s.io/${PORTNAME}/pkg + ${LN} -s ${WRKSRC}/cmd ${WRKSRC}/src/k8s.io/${PORTNAME}/cmd + ${LN} -s ${WRKSRC}/third_party ${WRKSRC}/src/k8s.io/${PORTNAME}/third_party + +do-build: + (cd ${WRKSRC}; ${LOCALBASE}/bin/go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...) + cd ${WRKSRC}/cmd/${PORTNAME} && \ + GOPATH=${WRKSRC} go build \ + -ldflags="-X k8s.io/minikube/pkg/version.version=v${PORTVERSION} \ + -X k8s.io/minikube/pkg/version.isoVersion=v0.28.1 \ + -X k8s.io/minikube/pkg/version.isoPath=minikube/iso \ + -X k8s.io/kubernetes/pkg/version.gitCommit=fc32d2f3698e36b93322a3465f63a14e9f0eaead \ + -X k8s.io/kubernetes/pkg/version.gitTreeState=clean \ + -X k8s.io/kubernetes/pkg/version.gitVersion=v1.10.0 \ + -X k8s.io/kubernetes/pkg/version.gitMajor=1 \ + -X k8s.io/kubernetes/pkg/version.gitMinor=10 \ + -X k8s.io/kubernetes/pkg/version.buildDate=$$(date +'%Y-%m-%dT%H:%M:%SZ') \ + -X k8s.io/client-go/pkg/version.gitCommit=fc32d2f3698e36b93322a3465f63a14e9f0eaead \ + -X k8s.io/client-go/pkg/version.gitTreeState=clean \ + -X k8s.io/client-go/pkg/version.gitVersion=v1.10.0 \ + -X k8s.io/client-go/pkg/version.gitMajor=1 \ + -X k8s.io/client-go/pkg/version.gitMinor=10 \ + -X k8s.io/client-go/pkg/version.buildDate=$$(date +'%Y-%m-%dT%H:%M:%SZ')" + +do-install: + ${INSTALL_PROGRAM} \ + ${WRKSRC}/cmd/${PORTNAME}/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/bin/${PORTNAME} + +.include <bsd.port.mk> Added: head/sysutils/minikube/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/distinfo Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,3 @@ +TIMESTAMP = 1533746370 +SHA256 (kubernetes-minikube-v0.28.2_GH0.tar.gz) = 78647d29901e878bf9d62a3baca74277d9dc80b4437225973710d43ab869913d +SIZE (kubernetes-minikube-v0.28.2_GH0.tar.gz) = 20077130 Added: head/sysutils/minikube/files/patch-pkg_minikube_cluster_cluster__freebsd.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/files/patch-pkg_minikube_cluster_cluster__freebsd.go Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,32 @@ +--- pkg/minikube/cluster/cluster_freebsd.go.orig 2018-08-08 17:03:34 UTC ++++ pkg/minikube/cluster/cluster_freebsd.go +@@ -0,0 +1,29 @@ ++/* ++Copyright 2016 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. ++*/ ++ ++package cluster ++ ++import ( ++ "os/exec" ++) ++ ++func detectVBoxManageCmd() string { ++ cmd := "VBoxManage" ++ if path, err := exec.LookPath(cmd); err == nil { ++ return path ++ } ++ return cmd ++} Added: head/sysutils/minikube/files/patch-pkg_minikube_constants_constants__freebsd.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/files/patch-pkg_minikube_constants_constants__freebsd.go Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,26 @@ +--- pkg/minikube/constants/constants_freebsd.go.orig 2018-08-08 17:13:39 UTC ++++ pkg/minikube/constants/constants_freebsd.go +@@ -0,0 +1,23 @@ ++/* ++Copyright 2016 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. ++*/ ++ ++package constants ++ ++import ( ++ "k8s.io/client-go/util/homedir" ++) ++ ++var DefaultMountDir = homedir.HomeDir() Added: head/sysutils/minikube/files/patch-third__party_go9p_srv__pipe__freebsd.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/files/patch-third__party_go9p_srv__pipe__freebsd.go Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,44 @@ +--- third_party/go9p/srv_pipe_freebsd.go.orig 2018-08-08 16:59:53 UTC ++++ third_party/go9p/srv_pipe_freebsd.go +@@ -0,0 +1,41 @@ ++// Copyright 2009 The go9p Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++package go9p ++ ++import ( ++ "fmt" ++ "os" ++ "syscall" ++) ++ ++func (dir *pipeDir) dotu(path string, d os.FileInfo, upool Users, sysMode *syscall.Stat_t) { ++ u := upool.Uid2User(int(sysMode.Uid)) ++ g := upool.Gid2Group(int(sysMode.Gid)) ++ dir.Uid = u.Name() ++ if dir.Uid == "" { ++ dir.Uid = "none" ++ } ++ ++ dir.Gid = g.Name() ++ if dir.Gid == "" { ++ dir.Gid = "none" ++ } ++ dir.Muid = "none" ++ dir.Ext = "" ++ dir.Uidnum = uint32(u.Id()) ++ dir.Gidnum = uint32(g.Id()) ++ dir.Muidnum = NOUID ++ if d.Mode()&os.ModeSymlink != 0 { ++ var err error ++ dir.Ext, err = os.Readlink(path) ++ if err != nil { ++ dir.Ext = "" ++ } ++ } else if isBlock(d) { ++ dir.Ext = fmt.Sprintf("b %d %d", sysMode.Rdev>>24, sysMode.Rdev&0xFFFFFF) ++ } else if isChar(d) { ++ dir.Ext = fmt.Sprintf("c %d %d", sysMode.Rdev>>24, sysMode.Rdev&0xFFFFFF) ++ } ++} Added: head/sysutils/minikube/files/patch-third__party_go9p_ufs__freebsd.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/files/patch-third__party_go9p_ufs__freebsd.go Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,238 @@ +--- third_party/go9p/ufs_freebsd.go.orig 2018-08-08 17:01:39 UTC ++++ third_party/go9p/ufs_freebsd.go +@@ -0,0 +1,235 @@ ++package go9p ++ ++import ( ++ "fmt" ++ "os" ++ "os/user" ++ "path" ++ "strconv" ++ "strings" ++ "syscall" ++ "time" ++) ++ ++func atime(stat *syscall.Stat_t) time.Time { ++ return time.Unix(stat.Atimespec.Unix()) ++} ++ ++// IsBlock reports if the file is a block device ++func isBlock(d os.FileInfo) bool { ++ stat := d.Sys().(*syscall.Stat_t) ++ return (stat.Mode & syscall.S_IFMT) == syscall.S_IFBLK ++ return true ++} ++ ++// IsChar reports if the file is a character device ++func isChar(d os.FileInfo) bool { ++ stat := d.Sys().(*syscall.Stat_t) ++ return (stat.Mode & syscall.S_IFMT) == syscall.S_IFCHR ++ return true ++} ++ ++func dir2Qid(d os.FileInfo) *Qid { ++ var qid Qid ++ ++ qid.Path = uint64(d.Sys().(*syscall.Stat_t).Ino) ++ qid.Version = uint32(d.ModTime().UnixNano() / 1000000) ++ qid.Type = dir2QidType(d) ++ ++ return &qid ++} ++ ++func dir2Dir(path string, d os.FileInfo, dotu bool, upool Users) (*Dir, error) { ++ if r := recover(); r != nil { ++ fmt.Print("stat failed: ", r) ++ return nil, &os.PathError{"dir2Dir", path, nil} ++ } ++ sysif := d.Sys() ++ if sysif == nil { ++ return nil, &os.PathError{"dir2Dir: sysif is nil", path, nil} ++ } ++ sysMode := sysif.(*syscall.Stat_t) ++ ++ dir := new(ufsDir) ++ dir.Qid = *dir2Qid(d) ++ dir.Mode = dir2Npmode(d, dotu) ++ dir.Atime = uint32(0 /*atime(sysMode).Unix()*/) ++ dir.Mtime = uint32(d.ModTime().Unix()) ++ dir.Length = uint64(d.Size()) ++ dir.Name = path[strings.LastIndex(path, "/")+1:] ++ ++ if dotu { ++ dir.dotu(path, d, upool, sysMode) ++ return &dir.Dir, nil ++ } ++ ++ unixUid := int(sysMode.Uid) ++ unixGid := int(sysMode.Gid) ++ dir.Uid = strconv.Itoa(unixUid) ++ dir.Gid = strconv.Itoa(unixGid) ++ ++ // BUG(akumar): LookupId will never find names for ++ // groups, as it only operates on user ids. ++ u, err := user.LookupId(dir.Uid) ++ if err == nil { ++ dir.Uid = u.Username ++ } ++ g, err := user.LookupId(dir.Gid) ++ if err == nil { ++ dir.Gid = g.Username ++ } ++ ++ /* For Akaros, we use the Muid as the link value. */ ++ if *Akaros && (d.Mode()&os.ModeSymlink != 0) { ++ dir.Muid, err = os.Readlink(path) ++ if err == nil { ++ dir.Mode |= DMSYMLINK ++ } ++ } ++ return &dir.Dir, nil ++} ++ ++func (dir *ufsDir) dotu(path string, d os.FileInfo, upool Users, sysMode *syscall.Stat_t) { ++ u := upool.Uid2User(int(sysMode.Uid)) ++ g := upool.Gid2Group(int(sysMode.Gid)) ++ dir.Uid = u.Name() ++ if dir.Uid == "" { ++ dir.Uid = "none" ++ } ++ ++ dir.Gid = g.Name() ++ if dir.Gid == "" { ++ dir.Gid = "none" ++ } ++ dir.Muid = "none" ++ dir.Ext = "" ++ dir.Uidnum = uint32(u.Id()) ++ dir.Gidnum = uint32(g.Id()) ++ dir.Muidnum = NOUID ++ if d.Mode()&os.ModeSymlink != 0 { ++ var err error ++ dir.Ext, err = os.Readlink(path) ++ if err != nil { ++ dir.Ext = "" ++ } ++ } else if isBlock(d) { ++ dir.Ext = fmt.Sprintf("b %d %d", sysMode.Rdev>>24, sysMode.Rdev&0xFFFFFF) ++ } else if isChar(d) { ++ dir.Ext = fmt.Sprintf("c %d %d", sysMode.Rdev>>24, sysMode.Rdev&0xFFFFFF) ++ } ++} ++ ++func (u *Ufs) Wstat(req *SrvReq) { ++ fid := req.Fid.Aux.(*ufsFid) ++ err := fid.stat() ++ if err != nil { ++ req.RespondError(err) ++ return ++ } ++ ++ dir := &req.Tc.Dir ++ if dir.Mode != 0xFFFFFFFF { ++ mode := dir.Mode & 0777 ++ if req.Conn.Dotu { ++ if dir.Mode&DMSETUID > 0 { ++ mode |= syscall.S_ISUID ++ } ++ if dir.Mode&DMSETGID > 0 { ++ mode |= syscall.S_ISGID ++ } ++ } ++ e := os.Chmod(fid.path, os.FileMode(mode)) ++ if e != nil { ++ req.RespondError(toError(e)) ++ return ++ } ++ } ++ ++ uid, gid := NOUID, NOUID ++ if req.Conn.Dotu { ++ uid = dir.Uidnum ++ gid = dir.Gidnum ++ } ++ ++ // Try to find local uid, gid by name. ++ if (dir.Uid != "" || dir.Gid != "") && !req.Conn.Dotu { ++ uid, err = lookup(dir.Uid, false) ++ if err != nil { ++ req.RespondError(err) ++ return ++ } ++ ++ // BUG(akumar): Lookup will never find gids ++ // corresponding to group names, because ++ // it only operates on user names. ++ gid, err = lookup(dir.Gid, true) ++ if err != nil { ++ req.RespondError(err) ++ return ++ } ++ } ++ ++ if uid != NOUID || gid != NOUID { ++ e := os.Chown(fid.path, int(uid), int(gid)) ++ if e != nil { ++ req.RespondError(toError(e)) ++ return ++ } ++ } ++ ++ if dir.Name != "" { ++ fmt.Printf("Rename %s to %s\n", fid.path, dir.Name) ++ // if first char is / it is relative to root, else relative to ++ // cwd. ++ var destpath string ++ if dir.Name[0] == '/' { ++ destpath = path.Join(u.Root, dir.Name) ++ fmt.Printf("/ results in %s\n", destpath) ++ } else { ++ fiddir, _ := path.Split(fid.path) ++ destpath = path.Join(fiddir, dir.Name) ++ fmt.Printf("rel results in %s\n", destpath) ++ } ++ err := syscall.Rename(fid.path, destpath) ++ fmt.Printf("rename %s to %s gets %v\n", fid.path, destpath, err) ++ if err != nil { ++ req.RespondError(toError(err)) ++ return ++ } ++ fid.path = destpath ++ } ++ ++ if dir.Length != 0xFFFFFFFFFFFFFFFF { ++ e := os.Truncate(fid.path, int64(dir.Length)) ++ if e != nil { ++ req.RespondError(toError(e)) ++ return ++ } ++ } ++ ++ // If either mtime or atime need to be changed, then ++ // we must change both. ++ if dir.Mtime != ^uint32(0) || dir.Atime != ^uint32(0) { ++ mt, at := time.Unix(int64(dir.Mtime), 0), time.Unix(int64(dir.Atime), 0) ++ if cmt, cat := (dir.Mtime == ^uint32(0)), (dir.Atime == ^uint32(0)); cmt || cat { ++ st, e := os.Stat(fid.path) ++ if e != nil { ++ req.RespondError(toError(e)) ++ return ++ } ++ switch cmt { ++ case true: ++ mt = st.ModTime() ++ default: ++ //at = time.Time(0)//atime(st.Sys().(*syscall.Stat_t)) ++ } ++ } ++ e := os.Chtimes(fid.path, at, mt) ++ if e != nil { ++ req.RespondError(toError(e)) ++ return ++ } ++ } ++ ++ req.RespondRwstat() ++} Added: head/sysutils/minikube/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/files/pkg-message.in Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,3 @@ +To use Minikube you need to install emulators/virtualbox-ose or emulators/virtualbox-ose-nox11. + +Just VirtualBox is supported on FreeBSD (--vm-driver=virtualbox). Added: head/sysutils/minikube/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/minikube/pkg-descr Sat Aug 11 19:25:41 2018 (r476941) @@ -0,0 +1,5 @@ +Minikube is a tool that makes it easy to run Kubernetes locally. +Minikube runs a single-node Kubernetes cluster inside a VM on your laptop +for users looking to try out Kubernetes or develop with it day-to-day. + +WWW: https://github.com/kubernetes/minikube
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808111925.w7BJPfQw013889>