Skip to content

Commit

Permalink
breaking: rename to multikf
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinhoyeh committed Mar 16, 2022
1 parent 79a6332 commit 0997933
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 49 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ tidy:
./gomodtidy.sh

docker:
docker build -t footprintai/multikind:v1 \
docker build -t footprintai/multikf:v1 \
--no-cache -f Dockerfile .
docker push footprintai/multikind:v1
docker push footprintai/multikf:v1

windows: ## Build for Windows
env GOOS=windows GOARCH=amd64 CGO_ENABLED=0 \
go build -ldflags '-X "github.com/footprintai/multikind/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikind/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikind.windows.exe main.go
go build -ldflags '-X "github.com/footprintai/multikf/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikf/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikf.windows.exe main.go

linux: ## Build for Linux
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
go build -ldflags '-X "github.com/footprintai/multikind/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikind/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikind.linux main.go
go build -ldflags '-X "github.com/footprintai/multikf/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikf/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikf.linux main.go

darwin: ## Build for Darwin (macOS)
env GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 \
go build -ldflags '-X "github.com/footprintai/multikind/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikind/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikind.darwin main.go
go build -ldflags '-X "github.com/footprintai/multikf/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikf/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikf.darwin main.go

darwinSilicon: ## Build for Darwin Silicon (macOS M1)
env GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 \
go build -ldflags '-X "github.com/footprintai/multikind/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikind/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikind.darwin-arm64 main.go
go build -ldflags '-X "github.com/footprintai/multikf/pkg/version.BuildTime='"${BUILDTIME}"'" -X "github.com/footprintai/multikf/pkg/version.GitCommitId='"${GITCOMMITID}"'" -extldflags "-static"' -o ${BUILDDIR}/multikf.darwin-arm64 main.go


build: windows linux darwin darwinSilicon ## Build binaries
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# multikind
Multi-Kind leverages [Vagrant](https://github.com/hashicorp/vagrant) and [Kind](https://github.com/kubernetes-sigs/kind) (Kubernetes In Docker) to create multiple local clusters inside the same host machine, see the following png for simple layout
# multikf
Multi-Kind leverages [Vagrant](https://github.com/hashicorp/vagrant) and [Kind](https://github.com/kubernetes-sigs/kind) (Kubernetes In Docker) to create multiple local kubernetes and kubeflow clusters inside the same host machine, see the following png for simple layout
![flow](./images/intro.png)

#### Why we need this?
Expand All @@ -25,12 +25,12 @@ Idealy, we could just use Kind which running as a container to provide resource
##### Add a vagrant machine named test000 with 1 cpu and 1G memory.

```
./multikind add test000 --cpu 1 --memory 1
./multikf add test000 --cpu 1 --memory 1
```

##### Export a vargant machine's kubeconfig
```
./multikind export test000 --kubeconfig_path /tmp/test000.kubeconfig
./multikf export test000 --kubeconfig_path /tmp/test000.kubeconfig
run kubectl from host
Expand All @@ -41,7 +41,7 @@ run kubectl from host
##### list machines

```
./multikind list
./multikf list
+---------+------------------+---------+------+---------------+
| NAME | DIR | STATUS | CPUS | MEMORY |
Expand All @@ -53,7 +53,14 @@ run kubectl from host
##### delete a machine

```
./multikind delete test000
./multikf delete test000
```

#### connect a machine

```
./multikf connect kubeflow test000
```

Expand All @@ -77,4 +84,4 @@ docker run -it --gpus=all ubuntu:21.10 /bin/bash
```
where it relies on the host's cuda driver.
However, Kind are NOT supported this approach, see [issue](https://github.com/kubernetes-sigs/kind/pull/1886)
However, Kind are NOT supported this approach, see [issue](https://github.com/kubernetes-sigs/kind/pull/1886)
20 changes: 10 additions & 10 deletions cmd/multikind/cmd.go → cmd/multikf/cmd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multikind
package multikf

import (
"errors"
Expand All @@ -12,10 +12,10 @@ import (
"sigs.k8s.io/kind/pkg/cmd"
"sigs.k8s.io/kind/pkg/log"

"github.com/footprintai/multikind/pkg/machine"
_ "github.com/footprintai/multikind/pkg/machine/host"
_ "github.com/footprintai/multikind/pkg/machine/vagrant"
"github.com/footprintai/multikind/pkg/version"
"github.com/footprintai/multikf/pkg/machine"
_ "github.com/footprintai/multikf/pkg/machine/host"
_ "github.com/footprintai/multikf/pkg/machine/vagrant"
"github.com/footprintai/multikf/pkg/version"
)

var (
Expand All @@ -30,9 +30,9 @@ var (
kubeconfigPath string // kubeconfig path of a guest machine (default: ./.mulitkind/$machine/kubeconfig)

rootCmd = &cobra.Command{
Use: "multikind",
Short: "a multikind cli tool",
Long: `multikind is a command-line tool which use vagrant and docker to provision k8s single-node cluster.`,
Use: "multikf",
Short: "a multikf cli tool",
Long: `multikf is a command-line tool which use vagrant and docker to provision Kubernetes and kubeflow single-node cluster.`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// For cobra + glog flags. Available to all subcommands.
goflag.Parse()
Expand All @@ -41,7 +41,7 @@ var (

versionCmd = &cobra.Command{
Use: "version",
Short: "version of multikind ",
Short: "version of multikf ",
RunE: func(cmd *cobra.Command, args []string) error {
version.Print()
return nil
Expand Down Expand Up @@ -270,7 +270,7 @@ func init() {
rootCmd.AddCommand(connectCmd)
connectCmd.AddCommand(kubeflowCmd)

rootCmd.PersistentFlags().StringVar(&guestRootDir, "dir", ".multikind", "multikind root dir")
rootCmd.PersistentFlags().StringVar(&guestRootDir, "dir", ".multikfdir", "multikf root dir")
rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", true, "verbose (default: true)")
rootCmd.PersistentFlags().StringVar(&provisionerStr, "provisioner", "docker", "provisioner, possible value: docker and vagrant")
addCmd.Flags().IntVar(&cpus, "cpus", 1, "number of cpus allocated to the guest machine")
Expand Down
2 changes: 1 addition & 1 deletion cmd/multikind/output.go → cmd/multikf/output.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multikind
package multikf

import (
"encoding/csv"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/footprintai/multikind
module github.com/footprintai/multikf

go 1.17

Expand Down
Binary file modified images/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"github.com/footprintai/multikind/cmd/multikind"
"github.com/footprintai/multikf/cmd/multikf"
)

func main() {
multikind.Main()
multikf.Main()
}
2 changes: 1 addition & 1 deletion pkg/client/vagrant/vagrant_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io/ioutil"

govagrant "github.com/bmatcuk/go-vagrant"
fssh "github.com/footprintai/multikind/pkg/ssh"
fssh "github.com/footprintai/multikf/pkg/ssh"
log "github.com/golang/glog"
"golang.org/x/crypto/ssh"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/cpuinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/footprintai/multikind/pkg/machine/testdata"
"github.com/footprintai/multikf/pkg/machine/testdata"
)

func TestCpuInfo(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/gpuinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package machine
import (
"testing"

"github.com/footprintai/multikind/pkg/machine/testdata"
"github.com/footprintai/multikf/pkg/machine/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/machine/host/fs.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package host

import (
kfmanifests "github.com/footprintai/multikind/kfmanifests"
hosttemplates "github.com/footprintai/multikind/pkg/machine/host/template"
templatefs "github.com/footprintai/multikind/pkg/template/fs"
kfmanifests "github.com/footprintai/multikf/kfmanifests"
hosttemplates "github.com/footprintai/multikf/pkg/machine/host/template"
templatefs "github.com/footprintai/multikf/pkg/template/fs"
//log "github.com/golang/glog"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/machine/host/hostmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"path/filepath"

machine "github.com/footprintai/multikind/pkg/machine"
"github.com/footprintai/multikind/pkg/machine/host/template"
machine "github.com/footprintai/multikf/pkg/machine"
"github.com/footprintai/multikf/pkg/machine/host/template"
"sigs.k8s.io/kind/pkg/log"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/host/provisioner.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package host

import (
machine "github.com/footprintai/multikind/pkg/machine"
machine "github.com/footprintai/multikf/pkg/machine"
)

var docker machine.Provisioner = "docker"
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/host/template/kind_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"html/template"
"io"

pkgtemplate "github.com/footprintai/multikind/pkg/template"
pkgtemplate "github.com/footprintai/multikf/pkg/template"
)

func NewKindTemplate() *KindFileTemplate {
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/meminfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/footprintai/multikind/pkg/machine/testdata"
"github.com/footprintai/multikf/pkg/machine/testdata"
)

func TestMemInfo(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/machine/vagrant/fs.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package vagrant

import (
"github.com/footprintai/multikind/assets"
vagranttemplates "github.com/footprintai/multikind/pkg/machine/vagrant/template"
templatefs "github.com/footprintai/multikind/pkg/template/fs"
"github.com/footprintai/multikf/assets"
vagranttemplates "github.com/footprintai/multikf/pkg/machine/vagrant/template"
templatefs "github.com/footprintai/multikf/pkg/template/fs"
//log "github.com/golang/glog"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/vagrant/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"testing"

"github.com/footprintai/multikind/pkg/machine/vagrant/template"
"github.com/footprintai/multikf/pkg/machine/vagrant/template"
"github.com/spf13/afero"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/vagrant/provisioner.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package vagrant

import (
machine "github.com/footprintai/multikind/pkg/machine"
machine "github.com/footprintai/multikf/pkg/machine"
)

var vagrant machine.Provisioner = "vagrant"
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/vagrant/template/kind_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"html/template"
"io"

pkgtemplate "github.com/footprintai/multikind/pkg/template"
pkgtemplate "github.com/footprintai/multikf/pkg/template"
)

func NewKindTemplate() *KindFileTemplate {
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/vagrant/template/vagrantfile_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"html/template"
"io"

pkgtemplate "github.com/footprintai/multikind/pkg/template"
pkgtemplate "github.com/footprintai/multikf/pkg/template"
)

func NewDefaultVagrantTemplate() *DefaultVagrantFileTemplate {
Expand Down
6 changes: 3 additions & 3 deletions pkg/machine/vagrant/vagrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"os"
"path/filepath"

vagrantclient "github.com/footprintai/multikind/pkg/client/vagrant"
machine "github.com/footprintai/multikind/pkg/machine"
"github.com/footprintai/multikind/pkg/machine/vagrant/template"
vagrantclient "github.com/footprintai/multikf/pkg/client/vagrant"
machine "github.com/footprintai/multikf/pkg/machine"
"github.com/footprintai/multikf/pkg/machine/vagrant/template"
"sigs.k8s.io/kind/pkg/log"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/template/fs/memfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"io/fs"

"github.com/footprintai/multikind/pkg/template"
"github.com/footprintai/multikf/pkg/template"
//log "github.com/golang/glog"
"github.com/spf13/afero"
)
Expand Down

0 comments on commit 0997933

Please sign in to comment.