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

fixes 'Add kustomize support to kfctl' #2548

Closed
wants to merge 183 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
47589db
revert to prior version
Jun 29, 2018
9871589
Merge branch 'master' of github.com:kubeflow/kubeflow
Aug 3, 2018
4fbc3dd
Merge branch 'master' of github.com:kubeflow/kubeflow
Aug 24, 2018
9e3ed03
Merge branch 'master' of github.com:kubeflow/kubeflow
Aug 27, 2018
190aa45
Merge branch 'master' of github.com:kubeflow/kubeflow
Aug 30, 2018
0b3e680
Merge branch 'master' of github.com:kubeflow/kubeflow
Sep 7, 2018
271a090
Merge branch 'master' of github.com:kubeflow/kubeflow
Sep 8, 2018
7a41e5a
Merge branch 'master' of github.com:kubeflow/kubeflow
Sep 9, 2018
bcb5a70
Merge branch 'master' of github.com:kubeflow/kubeflow
Sep 10, 2018
c3695cd
Merge branch 'master' of github.com:kubeflow/kubeflow
Sep 20, 2018
689118c
Merge branch 'master' of github.com:kubeflow/kubeflow
Sep 22, 2018
59ef8a2
Merge branch 'master' of github.com:kubeflow/kubeflow
Oct 20, 2018
96cad9d
Merge branch 'master' of github.com:kubeflow/kubeflow
Oct 22, 2018
aa4ce38
Merge branch 'master' of github.com:kubeflow/kubeflow
Nov 1, 2018
4f9efbd
Merge branch 'master' of github.com:kubeflow/kubeflow
Nov 6, 2018
eeb0d95
Merge branch 'master' of github.com:kubeflow/kubeflow
Nov 15, 2018
0764065
Merge branch 'master' of github.com:kubeflow/kubeflow
Nov 21, 2018
856bdef
Merge branch 'master' of github.com:kubeflow/kubeflow
Nov 27, 2018
8992d16
Merge branch 'master' of github.com:kubeflow/kubeflow
Nov 28, 2018
1b98de6
Merge branch 'master' of github.com:kubeflow/kubeflow
Nov 30, 2018
8187167
Merge branch 'master' of github.com:kubeflow/kubeflow
Dec 12, 2018
b6a69dc
Merge branch 'master' of github.com:kubeflow/kubeflow
Dec 18, 2018
58bbef1
Merge branch 'master' of github.com:kubeflow/kubeflow
Dec 24, 2018
81599b4
fixes kfctl (golang) rename 'ks' directory and app to ksonnet and kso…
Feb 6, 2019
2977aef
fixes 'kfctl - Fetch registry automatically'
Feb 7, 2019
d090f5f
fixes 'refactor gcp, minikube, docker-for-desktop, ack to be kfctl pl…
Feb 7, 2019
150db9f
change DefaultDevRepo to point to just the repo not repo/kubeflow
Feb 7, 2019
281d7f7
fixes 'refactor gcp, minikube, docker-for-desktop, ack to be kfctl pl…
Feb 7, 2019
714c642
Merge branch 'refactor_to_plugins' of github.com:kkasravi/kubeflow in…
Feb 7, 2019
88a7a45
plugins for all existing KfApp instances {ksonnet, minikube, foo}.
Feb 7, 2019
51344ba
update golang version
Feb 7, 2019
bd66c56
fixes 'docker-for-desktop'
Feb 8, 2019
967e902
delete meta-controller-cluster-role-binding
Feb 8, 2019
072c519
Merge branch 'master' into dockerfordesktop
Feb 8, 2019
e015c17
Merge remote-tracking branch 'origin' into dockerfordesktop
Feb 8, 2019
ad052b4
update README.md
Feb 8, 2019
090df16
Merge branch 'dockerfordesktop' of github.com:kkasravi/kubeflow into …
Feb 8, 2019
72793e6
remove unused var DEBUG
Feb 8, 2019
252512d
remove bootstrap/cmd/plugins/foo.go
Feb 8, 2019
e119476
Merge branch 'master' into dockerfordesktop
Feb 9, 2019
dbf8d65
fixes kfctl (golang) rename 'ks' directory and app to ksonnet and kso…
Feb 6, 2019
f494b52
fixes 'add the gcp platform to kfctl (golang)'
Feb 9, 2019
f1047f8
fix merge conflict
Feb 9, 2019
780edbb
cli option --project is an init flag
Feb 9, 2019
cfb326c
fix to write out project to app.yaml
Feb 9, 2019
afefe74
fix for nil project check
Feb 9, 2019
33cc8ae
include fix for #2367
Feb 9, 2019
be7d158
added updateDM, createSecrets to Apply
Feb 10, 2019
4be4233
fixes to macros
Feb 12, 2019
35b988d
merge changes from upstream master
Feb 12, 2019
bcd93b0
merge changes from upstream master
Feb 12, 2019
f773c82
remove old files, update README.md
Feb 12, 2019
0d0d5a7
rebase from dockerfordesktop
Feb 13, 2019
6ab16b9
fix for init app-name where app-name is not a path
Feb 14, 2019
3440dd2
fix for gcp apply
Feb 14, 2019
1b45e57
code to create a Gcp Secret, doesn't do correct auth right now
Feb 14, 2019
67db8bf
snapshot
Feb 15, 2019
5c15605
rebase from upstream master
Feb 17, 2019
b1e8015
Merge remote-tracking branch 'upstream/master'
Feb 18, 2019
62d8fa6
update on downloadK8sManifests, gcpInitProject, added TODO's
Feb 18, 2019
dbe2fd3
additional work on gcpInitProject
Feb 19, 2019
79f7a21
gcpInitProject now works but requires GOOGLE_APPLICATION_CREDENTIALS …
Feb 20, 2019
8adf7bc
initial pass on updateDeployment
Feb 20, 2019
9d43304
update README.md to described static vs dynamic platforms
Feb 20, 2019
dbb0253
updates to Gcp.updateDM, added GOOGLE_APPLICATION_CREDENTIALS to the …
Feb 20, 2019
18b37ae
minor changes on init, generate usage
Feb 21, 2019
10d2f5f
snapshot
Feb 22, 2019
af39d2e
fixes 'kfctl (golang) delete does not delete clusterroles, clusterrol…
Feb 22, 2019
a2c7d60
additional global resources identified
Feb 22, 2019
ee6da8b
do not delete scalingpolicies
Feb 22, 2019
b9ff8b9
change default platform to ksonnet
Feb 22, 2019
7b1fc50
Merge branch 'kfctl_gcp' into kfctl_delete
Feb 22, 2019
5614c2c
default --version to master until 0.5.0
Feb 22, 2019
4b5bd97
Merge branch 'kfctl_gcp' into kfctl_delete
Feb 22, 2019
a1611f7
Merge remote-tracking branch 'upstream/master' into kfctl_delete
Feb 22, 2019
5782f10
remove verbose from spark-operator apply
Feb 22, 2019
ecf64f4
Merge remote-tracking branch 'upstream/master'
Feb 22, 2019
670d745
address comments from Jeremy
Feb 22, 2019
c2ee620
address comments from Jeremy
Feb 22, 2019
f49b03c
Merge branch 'kfctl_gcp', remote-tracking branch 'origin' into kfctl_…
Feb 22, 2019
10afd3b
fixes #2537, refer to no platform as 'none'
Feb 22, 2019
326d540
merge upstream/master
Feb 23, 2019
e40c20e
add general test for kfctl in Makefile that also tests the plugin cap…
Feb 23, 2019
2ff815a
remove kftcl config since we now have bootstrap config, fix for Defau…
Feb 23, 2019
8a419d2
change test of platform none to create directory none, updated README
Feb 23, 2019
3d66c26
remove reference to docker-for-desktop
Feb 23, 2019
21302cd
update README.md, remove --debug flag (not used)
Feb 23, 2019
777a2fb
fixes 'kfctl (golang) Simplify the child/parent relationships in plat…
Feb 25, 2019
6798817
Merge remote-tracking branch 'upstream/master' into kfctl_delete
Feb 25, 2019
0fbbad5
Merge remote-tracking branch 'origin/kfctl_delete' into kfctl_client
Feb 25, 2019
c4a5e06
fixes 'Add kustomize support to kfctl'
Feb 25, 2019
6addead
fix backendconfig name (#2542)
Feb 26, 2019
e9318a9
pin to the latest verified tf-operator commit in order to enable chan…
Feb 26, 2019
520546a
fix (#2506)
Feb 26, 2019
59bbd1c
Added unit tests for GetUpdatedPolicy at gcpUtils.go - bootstrap/app …
Feb 26, 2019
72f6ae8
Added a windows equivalent script for the makefile for central-dashbo…
Feb 26, 2019
e6e2d24
update katib component (#2553)
Feb 26, 2019
9c92861
Merge pull request #2555 from zabbasi/l_rename1
Feb 27, 2019
9358e59
some fixes in gcp and some notes in kustomize
Feb 27, 2019
4f4f0c6
fixes 'Move ksonnet, kustomize implementations out of KfApps.Children…
Feb 27, 2019
0704765
add show.go subcommand
Feb 27, 2019
c376562
reformatting, added deepcopy target to Makefile
Feb 27, 2019
e8b828c
Refactor for Express + Webpack build stack. (#2572)
Feb 28, 2019
c42c080
address review comments
Feb 28, 2019
5c8df1e
move tests under test directory
Feb 28, 2019
92ef7af
Merge remote-tracking branch 'upstream/master' into kfctl_client
Feb 28, 2019
ade3de1
merge origin/kfctl_client, upstream/master
Feb 28, 2019
a15946f
fix for client.Generate
Feb 28, 2019
2200316
Add ESLint to enforce Google JS style in public/ (#2579)
Feb 28, 2019
504f4ce
Updating python package imports related to tf-operator (#2581)
Feb 28, 2019
dfe7dd2
Profiles e2e test (#2404)
Mar 1, 2019
7af2a5e
snapshot Kustomize.Init
Mar 1, 2019
4bda791
Update the jupyter-web-app Image (#2589)
Mar 1, 2019
ada6e9a
Golang profile controller (#2533)
Mar 1, 2019
8f733c9
turnoff jupyter images authentication (#2591)
Mar 1, 2019
0e84b0e
disabled ksonnet, kustomize is generating an output.yaml
Mar 1, 2019
73df288
Updated Jupyter image paths for using in notebook controller (#2552)
Mar 1, 2019
cf6b5b9
do not write to output, fix in Makefile
Mar 1, 2019
f33e6d5
download the cache in client rather than ksonnet since gcp needs it
Mar 1, 2019
bfa77b3
updated jupyter images to allow any origin (#2606)
Mar 2, 2019
f4bab76
Removing prune for Subresource field in CRD (#2598)
Mar 3, 2019
d4fa623
Adding backOffLimit field to metric collector spec (#2597)
Mar 3, 2019
e4ede9c
remove global resources by label rather than listing all and looking …
Mar 4, 2019
fec70ec
Merge remote-tracking branch 'upstream/master' into kfctl_delete
Mar 4, 2019
14f49fa
Merge remote-tracking branch 'origin/kfctl_delete' into kfctl_client
Mar 4, 2019
3131ac4
mv client to coordinator
Mar 4, 2019
6f8e782
merge origin/kfctl_client
Mar 4, 2019
313fdab
merge origin/kfctl_delete, origin/kfctl_client, upgrade to go1.12
Mar 4, 2019
7576876
Fixed Dashboard v0.0.1 w/ Polymer3 + Webpack (#2576)
Mar 4, 2019
ce7fcb6
updated jupyter images based on postsubmit results of https://github.…
Mar 4, 2019
36a127e
Adding additional printer columns to display status (#2609)
Mar 4, 2019
c1a6b69
Semi-working kfctl go binary (#2587)
Mar 4, 2019
74d1615
Add status to notebook (#2558)
Mar 4, 2019
a24020d
Add prodonjs to OWNERS (#2613)
Mar 4, 2019
cf955fa
Changed sidebar tab from JupyterHub to Notebooks (#2619)
Mar 4, 2019
17f37c9
fix (#2620)
Mar 5, 2019
248105a
pf gcb (#2603)
Mar 5, 2019
bf61f80
allow ksonnet and kustomize to be loaded at the same time by using go…
Mar 5, 2019
8344dbb
Merge remote-tracking branch 'upstream/master' into kfctl_delete
Mar 6, 2019
bfc7498
Setting the base_url flag of Jupyter images (#2627)
Mar 6, 2019
5fa0417
fix (#2631)
Mar 6, 2019
77dabb5
resolve merge conflicts from upstream/master, fix error on master whe…
Mar 6, 2019
8f26908
Merge remote-tracking branch 'origin/kfctl_delete' into kfctl_client
Mar 6, 2019
12402ed
updates per review, rebase from PR 2530 - which includes merge from m…
Mar 6, 2019
1676f56
store non exist parameter differently (#2625)
Mar 6, 2019
28168f1
enable loading of kustomize.so and ksonnet.so using golang modules an…
Mar 6, 2019
6b42cb0
rebase from kfctl_client
Mar 6, 2019
d68c291
fix for Apply for when platform is not defined
Mar 6, 2019
085c9cc
fix (#2632)
Mar 6, 2019
a1225b9
update pipeline system images to 0.1.12 release (#2637)
Mar 6, 2019
e5a4044
updated jupyter image paths to point to the latest ones (#2638)
Mar 6, 2019
3b4bded
update README.md
Mar 6, 2019
8c50a0a
merge upstream/master
Mar 7, 2019
f790e6c
Merge remote-tracking branch 'origin/kfctl_client' into kfctl_kustomize
Mar 7, 2019
f9eda73
fixes 'kfctl allow the --version CLI to include PR's #2646', 'Error i…
Mar 7, 2019
c54e78b
always download https://github.com/kubeflow/manifests/tarball/master?…
Mar 7, 2019
fbfd7e6
always download https://github.com/kubeflow/manifests/tarball/master?…
Mar 7, 2019
d93947a
always download https://github.com/kubeflow/manifests/tarball/master?…
Mar 7, 2019
7db5fd1
always download https://github.com/kubeflow/manifests/tarball/master?…
Mar 7, 2019
4152857
always download https://github.com/kubeflow/manifests/tarball/master?…
Mar 7, 2019
e20e28c
always download https://github.com/kubeflow/manifests/tarball/master?…
Mar 7, 2019
e79b735
add retry around ks init (#2643)
Mar 7, 2019
e75c2da
fixing ksonnet.Apply error
Mar 7, 2019
a45061a
fixing ksonnet.Apply error
Mar 7, 2019
cbeb180
fixing ksonnet.Apply error
Mar 7, 2019
a800312
fixing ksonnet.Apply error
Mar 7, 2019
c465d1d
fixing ksonnet.Apply error
Mar 7, 2019
a054ebe
fix ambassador test
Mar 8, 2019
221ed13
fixes for validation errors
Mar 8, 2019
b0b5274
Merge branch 'master' into kfctl_client
Mar 8, 2019
c29327e
merge errors
Mar 8, 2019
780c0a0
Getting started card completed (#2651)
Mar 8, 2019
5ea8693
rebase from master
Mar 8, 2019
0c5326c
rebase from master
Mar 8, 2019
6772a7d
Add Azure support for kfctl.sh (#2557)
Mar 8, 2019
b4f1973
fixes 'kfctl (golang) Simplify the child/parent relationships in plat…
Mar 8, 2019
461697b
Separate front-end components and add mock activities service. (#2626)
Mar 8, 2019
91d1952
merge from kfctl_client
Mar 8, 2019
f8ca811
merge upstream/master
Mar 8, 2019
2ec5b01
merge upstream master
Mar 8, 2019
e55424b
move downloadCache and load config to NewKfApp
Mar 9, 2019
a4c1d71
fix for gcp initialization
Mar 9, 2019
e1768af
temp fix for having GCP options in ksonnet
Mar 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 50 additions & 57 deletions bootstrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,77 @@
# limitations under the License.
#
GCLOUD_PROJECT ?= kubeflow-images-public
GOLANG_VERSION ?= 1.11.5
GOLANG_VERSION ?= 1.12
GOPATH ?= $(HOME)/go
GOOGLE_APPLICATION_CREDENTIALS ?= $(HOME)/auth.json
# To build without the cache set the environment variable
# export DOCKER_BUILD_OPTS=--no-cache
IMG ?= gcr.io/$(GCLOUD_PROJECT)/bootstrapper
TAG ?= $(shell git describe --tags --always --dirty)
PORT ?= 2345
# set to -V
VERBOSE ?=
PLUGINS_ENVIRONMENT ?= $(GOPATH)/src/github.com/kubeflow/kubeflow/bootstrap/bin
export GO111MODULE = on
export GO = go

%.so:
cd cmd/plugins/$* && \
$(GO) build -i -gcflags 'all=-N -l' -o ../../../bin/$*.so -buildmode=plugin $*.go

%.init:
@echo kfctl init test/$* $(VERBOSE) --platform $* --project $(GCLOUD_PROJECT) && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) PLUGINS_ENVIRONMENT=$(PLUGINS_ENVIRONMENT) kfctl init $(PWD)/test/$* $(VERBOSE) --platform $* --project $(GCLOUD_PROJECT)

%.generate:
@echo kfctl generate all $(VERBOSE) '(--platform '$*')' && \
cd test/$* && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) PLUGINS_ENVIRONMENT=$(PLUGINS_ENVIRONMENT) kfctl generate all $(VERBOSE) --mount-local --email gcp-deploy@$(GCLOUD_PROJECT).iam.gserviceaccount.com

all: build

auth:
gcloud auth configure-docker

# Run go fmt against code
fmt:
$(GO) fmt ./pkg/... ./cmd/... ./config/...
@$(GO) fmt ./config/... ./pkg/apis/apps/client/... ./pkg/apis/apps/gcp/... ./pkg/utils/... ./pkg/client/minikube ./pkg/client/gcp/... ./cmd/kfctl/...

# Run go vet against code
vet:
$(GO) vet ./pkg/... ./cmd/... ./config/...
@$(GO) vet ./config/... ./pkg/apis/apps/client/... ./pkg/apis/apps/gcp/... ./pkg/utils/... ./pkg/client/minikube ./pkg/client/gcp/... ./cmd/kfctl/...

generate:
$(GO) generate ./pkg/... ./cmd/... ./config/...

deepcopy:
@deepcopy-gen -i github.com/kubeflow/kubeflow/bootstrap/pkg/apis/... -O zz_generated.deepcopy
@$(GO) generate ./config/... ./pkg/apis/apps/client/... ./pkg/apis/apps/gcp/... ./pkg/utils/... ./pkg/client/minikube ./pkg/client/gcp/... ./cmd/kfctl/...

/tmp/v2:
@[ ! -d /tmp/v2 ] && unzip -q -d /tmp hack/v2.zip

$(GOPATH)/bin/deepcopy-gen:
GO111MODULE=off $(GO) get k8s.io/code-generator/cmd/deepcopy-gen

config/zz_generated.deepcopy.go: config/types.go
$(GOPATH)/bin/deepcopy-gen -i github.com/kubeflow/kubeflow/bootstrap/config/... -O zz_generated.deepcopy

pkg/apis/apps/gcp/v1alpha1/zz_generated.deepcopy.go: pkg/apis/apps/gcp/v1alpha1/application_types.go
$(GOPATH)/bin/deepcopy-gen -i github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps/gcp/... -O zz_generated.deepcopy

pkg/apis/apps/ksonnet/v1alpha1/zz_generated.deepcopy.go: pkg/apis/apps/ksonnet/v1alpha1/application_types.go
$(GOPATH)/bin/deepcopy-gen -i github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps/ksonnet/... -O zz_generated.deepcopy

pkg/apis/apps/client/v1alpha1/zz_generated.deepcopy.go: pkg/apis/apps/client/v1alpha1/application_types.go
$(GOPATH)/bin/deepcopy-gen -i github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps/client/... -O zz_generated.deepcopy

v2/pkg/apis/apps/client/v1alpha1/zz_generated.deepcopy.go: v2/pkg/apis/apps/client/v1alpha1/application_types.go
$(GOPATH)/bin/deepcopy-gen -i github.com/kubeflow/kubeflow/bootstrap/v2/pkg/apis/apps/client/... -O zz_generated.deepcopy

deepcopy: $(GOPATH)/bin/deepcopy-gen config/zz_generated.deepcopy.go pkg/apis/apps/ksonnet/v1alpha1/zz_generated.deepcopy.go pkg/apis/apps/gcp/v1alpha1/zz_generated.deepcopy.go pkg/apis/apps/client/v1alpha1/zz_generated.deepcopy.go

build-bootstrap: generate fmt vet
$(GO) build -gcflags 'all=-N -l' -o bin/bootstrapper cmd/bootstrap/main.go

build-kfctl: generate fmt vet
build-kfctl: /tmp/v2 deepcopy generate fmt vet
$(GO) build -i -gcflags 'all=-N -l' -o bin/kfctl cmd/kfctl/main.go

build-dockerfordesktop-plugin: generate fmt vet
$(GO) build -i -gcflags 'all=-N -l' -o bin/dockerfordesktop.so -buildmode=plugin cmd/plugins/dockerfordesktop/dockerfordesktop.go

build-local: build-bootstrap build-kfctl

# To edit which registries to add to bootstrapper, edit config (eg. config/default.yaml)
Expand All @@ -79,7 +110,7 @@ push-latest: push
gcloud container images add-tag --quiet $(IMG):$(TAG) $(IMG):latest --verbosity=info
echo created $(IMG):latest

install: build-kfctl
install: build-kfctl dockerfordesktop.so kustomize.so ksonnet.so
@echo copying bin/kfctl to /usr/local/bin
@cp bin/kfctl /usr/local/bin

Expand All @@ -88,47 +119,9 @@ run-local-docker:
--mount type=bind,source=${HOME}/kf_app,target=/home/kubeflow \
--entrypoint /bin/bash $(IMG):$(TAG)

# static and plugins toogle whether we try and load a platform as a .so.
# There is an example plugin 'dockerfordesktop' that can be loaded as a .so.
# By default we disable loading plugins and link dockerfordesktop into the kfctl binary (static)
static:
@ex pkg/apis/apps/group.go <hack/static
@ex cmd/kfctl/cmd/root.go <hack/static || echo Plugin functionality disabled

plugins:
@ex pkg/apis/apps/group.go <hack/plugins
@ex cmd/kfctl/cmd/root.go <hack/plugins || echo Plugin functionality enabled

clean:
@rm -rf test

test-known-platforms-init: clean install build-dockerfordesktop-plugin
@mkdir test && \
echo kfctl init test/dockerfordesktop -V --platform docker-for-desktop && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) PLUGINS_ENVIRONMENT=$(PLUGINS_ENVIRONMENT) kfctl init `pwd`/test/dockerfordesktop -V --platform docker-for-desktop && \
echo kfctl init test/none -V && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl init `pwd`/test/none -V && \
echo kfctl init test/minikube -V --platform minikube && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl init $(PWD)/test/minikube -V --platform minikube && \
echo kfctl init test/gcp -V --platform gcp --project $(GCLOUD_PROJECT) && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl init $(PWD)/test/gcp -V --platform gcp --project $(GCLOUD_PROJECT) && \
echo SUCCESS

test-known-platforms-generate: test-known-platforms-init
@cd test/dockerfordesktop && \
echo 'kfctl generate all (--platform dockerfordesktop)' && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) PLUGINS_ENVIRONMENT=$(PLUGINS_ENVIRONMENT) kfctl generate all && \
cd ../none && \
echo 'kfctl generate all (--platform none)' && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl generate all && \
cd ../minikube && \
echo 'kfctl generate all (--platform minikube)' && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl generate all --mount-local && \
cd ../gcp && \
echo 'kfctl generate all (--platform gcp)' && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl generate all --email jsmith@acme.com && \
echo SUCCESS

test-plugins-static: plugins test-known-platforms-generate static test-known-platforms-generate

test-kfctl: test-plugins-static
clean:
rm -rf test && mkdir test

test-init: clean install dockerfordesktop.init minikube.init gcp.init

test-generate: test-init dockerfordesktop.generate minikube.generate gcp.generate
148 changes: 68 additions & 80 deletions bootstrap/cmd/kfctl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Note: Additional issues have been opened so this README.md will have additional

- Separate different platform implementations of the [KfApp Interface](#kfapp-interface).

- Separate different package manager implementations of the [KfApp Interface](#kfapp-interface).

- Allow new platforms to be added to kfctl without rebuilding or reshipping kfctl (see [Extending kfctl](#extending-kfctl) below).

- Do not change existing `REST` entrypoints or the `KsService` interface in `ksServer.go` at this time.
Expand All @@ -20,25 +22,9 @@ Note: Additional issues have been opened so this README.md will have additional

## API and Packaging

New directories

```sh
bootstrap/cmd/kfctl
bootstrap/cmd/kfctl/cmd
bootstrap/cmd/plugins/dockerfordesktop
bootstrap/pkg/apis/apps
bootstrap/pkg/apis/apps/ksonnet/v1alpha1
bootstrap/pkg/utils
bootstrap/pkg/client/dockerfordesktop
bootstrap/pkg/client/ksonnet
bootstrap/pkg/client/minikube
```

### KfApp Interface

Definition: github/kubeflow/kubeflow/bootstrap/pkg/client/kfapi/typed/apps/group.go

The `KfApp` golang Interface
The `KfApp` golang Interface is defined below:

```golang
type ResourceEnum string
Expand All @@ -47,12 +33,12 @@ const (
ALL ResourceEnum = "all"
K8S ResourceEnum = "k8s"
PLATFORM ResourceEnum = "platform"
NONE ResourceEnum = "none"
)

//
// KfApp is used by commands under bootstrap/cmd/{bootstrap,kfctl}. KfApp provides a common
// API for different implementations like gcp and minikube
// API for different platforms implementations like gcp and minikube.
// KfApp is also implemented by different package managers (ksonnet, kustomize).
//
type KfApp interface {
Apply(resources ResourceEnum, options map[string]interface{}) error
Expand All @@ -65,45 +51,43 @@ type KfApp interface {
kfctl will statically include platforms that implement the KfApp interface.
These include:

- platform: **none**
- bootstrap/pkg/client/ksonnet/ksonnet.go
- platform: **minikube**
- bootstrap/pkg/client/minikube/minikube.go
- platform: **gcp**
- bootstrap/pkg/client/gcp/gcp.go

kfctl can also dynamically load platforms that are not statically linked, as
kfctl can dynamically load platforms and package managers that are not statically linked, as
described below in [Extending kfctl](#extending-kfctl).

## Usage

```man
kubeflow client tool

Usage:
kfctl [command]

Available Commands:
apply Deploy a generated kubeflow application.
delete Delete a kubeflow application.
generate Generate a kubeflow application where resources is one of 'platform | k8s | all'.
help Help about any command
init Create a kubeflow application under <[path/]name>
version Prints the version of kfctl.

Flags:
-h, --help help for kfctl

Use "kfctl [command] --help" for more information about a command.
```kubeflow client tool
Usage:
kfctl [command]
Available Commands:
apply Deploy a generated kubeflow application.
delete Delete a kubeflow application.
generate Generate a kubeflow application where resources is one of 'platform|k8s|all'.
help Help about any command
init Create a kubeflow application under <[path/]name>
show Deploy a generated kubeflow application.
version Prints the version of kfctl.
Flags:
-h, --help help for kfctl
Use "kfctl [command] --help" for more information about a command.
```

Typical use-case, non-platform specific.

```sh
kfctl init ~/myapp
cd ~/myapp
kfctl generate
kfctl apply
kfctl init ~/myapp && \
cd ~/myapp && \
kfctl generate all && \
kfctl apply all
```

## Subcommands
Expand Down Expand Up @@ -152,7 +136,7 @@ Flags:
--ipName string ipName if '--platform gcp'
--mount-local mount-local if '--platform minikube'
-V, --verbose verbose output default is false
--zone string zone if '--platform gcp' (default "us-east1-d")
--zone string zone if '--platform gcp' (default "us-east1-d")```
```

### **apply**
Expand All @@ -166,9 +150,10 @@ Usage:
kfctl apply [all(=default)|k8s|platform] [flags]

Flags:
-h, --help help for apply
-V, --verbose verbose output default is false
```
-h, --help help for apply
--oauth_id string OAuth Client ID, GCP only. Required if ENV CLIENT_ID is not set. Value passed will take precedence to ENV.
--oauth_secret string OAuth Client ID, GCP only. Required if ENV CLIENT_SECRET is not set. Value passed will take precedence to ENV.
-V, --verbose verbose output default is false```

### **delete**

Expand All @@ -182,14 +167,13 @@ Usage:

Flags:
-h, --help help for delete
-V, --verbose verbose output default is false
```
-V, --verbose verbose output default is false```

---

## Extending kfctl

`kfctl` can be extended to work with new platforms without requiring recompilation.
`kfctl` can be extended to work with new platforms or package managers without requiring recompilation.
An example is under bootstrap/cmd/plugins/dockerfordesktop/dockerfordesktop.go. A particular platform
provides a shared library (.so) under the env var `PLUGINS_ENVIRONMENT`
that kfctl would load and execute. The shared library needs to define
Expand Down Expand Up @@ -235,35 +219,6 @@ make test-known-platforms-init
make test-known-platforms-generate
```

## Debugging

In order to debug in goland, the plugin code must be disabled.
See https://github.com/golang/go/issues/23733.
This is expected to be resolved with golang 1.12.X
To disable the plugin code (which will cause dockerfordesktop.go to be linked statically in kfctl)
and allow debugging in goland run:

```
make static
```

otherwise run

```
make plugins
```

Note: the default is `make static`. Do not checkin code after doing `make plugins`.

Note: static and plugins make targets result in 2 files being changed:
- pkg/apis/apps/group.go
- cmd/kfctl/cmd/root.go

These files have comments that are toggled (effectively a golang macro hack).
This will go away when the fix noted above is available and we've moved to
this version of go.


## KfApp Types used in app.yaml

### ksonnet related types (originally under bootstrap/cmd/bootstrap, moved to pkg/apis/apps/ksonnet/v1alpha1)
Expand Down Expand Up @@ -314,3 +269,36 @@ status: {}

Ksonnet types have been moved to `github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps/ksonnet/v1alpha1`

## golang modules and versioned packages

Both ksonnet and kustomize package managers are loaded as .so's.
(They will be statically linked soon see [#2635](https://github.com/kubeflow/kubeflow/issues/2635))
The complication is that ksonnet and kustomize do not have an overlap of kubernetes versions as well
as client-go, and controller-runtime.

- **ksonnet** (highest version)
- k8s.io/api kubernetes-1.10.4
- k8s.io/apimachinery kubernetes-1.10.4
- k8s.io/client-go v7.0.0
- sigs.k8s.io/controller-runtime v0.1.1

- **kustomize** (cannot downgrade to kubernetes-1.10.4, client-go v7.0.0)
- k8s.io/api kubernetes-1.13.4
- k8s.io/apimachinery kubernetes-1.13.4
- k8s.io/client-go v10.0.0
- sigs.k8s.io/controller-runtime v0.1.10

kustomize leverages golang modules by using 'v2' versions of
the above libraries.

We insert golang package versioning for these libraries despite the fact that kubernetes has yet to move to golang modules. Updating these libraries to use golang modules is straight-forward and can be done using local git clones. Background information on how this is done can be found [here](https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher).

Currently a build artifact was hand built and checked into PR #2548 as bootstrap/hack/v2.zip.
This build artifact holds versioned packages for the above libraries. This hand-built artifact needs to be removed and replaced with a golang tool such as [mod](https://github.com/marwan-at-work/mod) that can do this algorithmically and as part of building kfctl.

The [mod](https://github.com/marwan-at-work/mod) tool needs to be modified in the following ways:
1. Update literal references to versioned packages as found [here](https://github.com/kubernetes/api/blob/kubernetes-1.13.4/apps/v1/generated.pb.go#L62) and [here](https://github.com/kubernetes/api/blob/kubernetes-1.13.4/apps/v1/generated.pb.go#L63).
2. Move a subset of libraries tagged as [+incompatible](https://groups.google.com/forum/#!topic/golang-codereviews/t-xcPhCn3FI) within the go.mod file, instead of all of them.
3. Create a local archive of these versioned packages
4. Update go.mod files that reference the versioned packages with a replace directive pointing to the the local archive location.
5. Do not update the git repos or push changes back to git
2 changes: 1 addition & 1 deletion bootstrap/cmd/kfctl/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func init() {
return
}

// platforms minikube, docker-for-desktop
// platforms minikube
generateCmd.Flags().Bool(string(kftypes.MOUNT_LOCAL), false,
string(kftypes.MOUNT_LOCAL)+" if '--platform minikube'")
bindErr = generateCfg.BindPFlag(string(kftypes.MOUNT_LOCAL), generateCmd.Flags().Lookup(string(kftypes.MOUNT_LOCAL)))
Expand Down
Loading