Skip to content

Commit

Permalink
fixes 'kfctl (golang) Simplify the child/parent relationships in plat…
Browse files Browse the repository at this point in the history
…forms' (kubeflow#2547)

* revert to prior version

* fixes kfctl (golang) rename 'ks' directory and app to ksonnet and ksonnet.go respectively

* fixes 'kfctl - Fetch registry automatically'

* fixes 'refactor gcp, minikube, docker-for-desktop, ack to be kfctl plugins'

* change DefaultDevRepo to point to just the repo not repo/kubeflow

* fixes 'refactor gcp, minikube, docker-for-desktop, ack to be kfctl plugins'

* plugins for all existing KfApp instances {ksonnet, minikube, foo}.

* update golang version

* fixes 'docker-for-desktop'

* delete meta-controller-cluster-role-binding

* update README.md

* remove unused var DEBUG

* remove bootstrap/cmd/plugins/foo.go

* fixes kfctl (golang) rename 'ks' directory and app to ksonnet and ksonnet.go respectively

* fixes 'add the gcp platform to kfctl (golang)'

* fix merge conflict

* cli option --project is an init flag

* fix to write out project to app.yaml

* fix for nil project check

* include fix for kubeflow#2367

* added updateDM, createSecrets to Apply

* fixes to macros

* merge changes from upstream master

* remove old files, update README.md

* fix for init app-name where app-name is not a path

* fix for gcp apply

* code to create a Gcp Secret, doesn't do correct auth right now

* snapshot

* update on downloadK8sManifests, gcpInitProject, added TODO's

* additional work on gcpInitProject

* gcpInitProject now works but requires GOOGLE_APPLICATION_CREDENTIALS env var

* initial pass on updateDeployment

* update README.md to described static vs dynamic platforms

* updates to Gcp.updateDM, added GOOGLE_APPLICATION_CREDENTIALS to the Makefile tests

* minor changes on init, generate usage

* snapshot

* additional global resources identified

* do not delete scalingpolicies

* change default platform to ksonnet

* default --version to master until 0.5.0

* remove verbose from spark-operator apply

* address comments from Jeremy

* address comments from Jeremy

* fixes kubeflow#2537, refer to no platform as 'none'

* add general test for kfctl in Makefile that also tests the plugin capability

* remove kftcl config since we now have bootstrap config, fix for DefaultPlatform="none"

* change test of platform none to create directory none, updated README

* remove reference to docker-for-desktop

* update README.md, remove --debug flag (not used)

* fixes 'kfctl (golang) Simplify the child/parent relationships in platforms'

* fix backendconfig name (kubeflow#2542)

* fix backendconfig name

* fix test

* pin to the latest verified tf-operator commit in order to enable changes in tf-operator HEAD  whcih likely break kubeflow checkout tests

* fix (kubeflow#2506)

* Added unit tests for GetUpdatedPolicy at gcpUtils.go - bootstrap/app (kubeflow#2516)

* Added tests for 'GetUpdatedPolicy' - bootstrap/app

* Fix typo - gcpUtils_test.go

* Added a windows equivalent script for the makefile for central-dashboard (kubeflow#2518)

* update katib component (kubeflow#2553)

* Refactor for Express + Webpack build stack. (kubeflow#2572)

* Refactor for Express + Webpack build stack.

- Add webpack to process front-end code in public/
- Add TS and Express for server backend
- Update Dockerfile to run the server as Node.
- Fix issue with external links.

* Updates based on feedback

* address review comments

* move tests under test directory

* Add ESLint to enforce Google JS style in public/ (kubeflow#2579)

* Add ESLint to enforce Google JS style in public/

* Switch to 4 space tabs

* Updating python package imports related to tf-operator (kubeflow#2581)

* updated tf-operator imports

* fixed a typo

* fixed a typo

* Profiles e2e test (kubeflow#2404)

* profiles e2e test

* fix

* review comment

* fix

* fix

* fix

* fix

* add retry

* fix

* Update the jupyter-web-app Image (kubeflow#2589)

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Golang profile controller  (kubeflow#2533)

* init

* create api

* wip

* fix

* fix

* fix

* fix test

* address review

* fix test

* make it cluster scope

* fix test

* fix test

* fix

* turnoff jupyter images authentication (kubeflow#2591)

* Updated Jupyter image paths for using in notebook controller (kubeflow#2552)

* updated jupyter image paths for using in notebook conroller

* removed 1.4.1 image from the list of options

* updated jupyter image tags to point to the latest verified ones

* updated jupyter images to allow any origin (kubeflow#2606)

* Removing prune for Subresource field in CRD (kubeflow#2598)

* Adding backOffLimit field to metric collector spec (kubeflow#2597)

* remove global resources by label rather than listing all and looking for the label

* mv client to coordinator

* Fixed Dashboard v0.0.1 w/ Polymer3 + Webpack (kubeflow#2576)

* Multiple issues tackled:
- Fixed webpack for windows (components/ is not a valid path in windows)
- Spacing and semicolons matched to old-codebase
- Added cross-platform support to npm run targets
- Added missing dep (babel/polyfill)
- Dashboard build version is now corrected and hover will reveal kubeflow vs Dashboard versions
- Pug fixed to match syntax for empty-value attributes
- Updated webpack for readability

* Added babel-polyfill to runtime deps rather than dev deps

* [Windows-only] Color coded all make output, Tag check added, failures now have messages, also dirty git output now has a warning during build

* Updated new dashboard reference :v20190227-v0.4.0-rc.1-176-g738de035

* Fixed Multiple changes:
- Server port fixed to 8082 which is what is needed for GKE deployment
- Refactored some code

* Final working state for new image

* TS Changes

* Build updated to match latest :v20190301-v0.4.0-rc.1-183-g07eecd2f

* Migrated dev dependency to correct location

* Uncommented linter, fixed PR comments from @prodonjs

* updated jupyter images based on postsubmit results of kubeflow@e896cd3 (kubeflow#2611)

* Adding additional printer columns to display status (kubeflow#2609)

* Adding additional printer columns to display status

* Fixing tests

* Semi-working kfctl go binary (kubeflow#2587)

* Add flag --skip-init-gcp-project

* fix gcpInitProject

* update error msg

* add deployment creation logic

* fix bugs on generateDMData

* fix bugs

* add default config to ipName and hostName

* fix bugs on app.yaml

* add Fingerprint to update deployment

* make network and gcfs as DM optional

* add todos

* add iam policy handlers

* finish patch iam policy

* adding poll op to dm api calls

* add gke api version

* temp

* change mysqlPd/nfsPd names

* remove

* temp

* add config types

* add basic auth flag

* move config to gcp

* link use basic auth flag to generate

* use basic auth to determine config path

* change to gabrielwen repo for now

* change config on the fly

* change repo path

* create new Genereate method

* add required packages

* implement NewGenerate

* clean up default config and add on-the-fly configs

* move config handling to ksonnet.go

* add ks param set

* add application as component

* fix typo

* add simple TargetConfiguration factory

* add fixed backof

* temp

* fix from merge

* make namespace in gke

* bind user as default-admin in gke

* finish createSecrets

* write oauth secret

* uncomment ks apply

* add ks show

* add ks apply logic to k8sutils

* uncomment deployment

* build rest.Config from remote

* impersonate as admin for rbac

* use remote config as REST client config

* update default.yaml path

* complete apply logic

* add retry

* add ignore

* merge

* remove temp comment

* use backoff in gcp

* remove progress as it is not updating

* use backoff

* use backoff

*  use default zone

* fix zone config

* add doc

* add doc

* update Makefile

* fix flag doc

* fix

* doc

* doc

* add doc

* sort packages and component names

* shell out to gcloud and kubectl for now

* remove some configs

* fix

* remove GkeApiVersion

* add todo

* add notebook-controller back

* change names

* updates

* add field InitRequired

* remove KsInitParams

* migrate

* Add status to notebook (kubeflow#2558)

* wip

* wip

* update test to check status condition

* fix

* Add prodonjs to OWNERS (kubeflow#2613)

* Changed sidebar tab from JupyterHub to Notebooks (kubeflow#2619)

* fix (kubeflow#2620)

* pf gcb (kubeflow#2603)

* Setting the base_url flag of Jupyter images (kubeflow#2627)

* set base_url of jupyter

* change the env base_url to NB_PREFIX to sync with kubeflow#2620

* fix (kubeflow#2631)

* resolve merge conflicts from upstream/master, fix error on master when --platform=none or not specified

* store non exist parameter differently (kubeflow#2625)

* fix (kubeflow#2632)

* update pipeline system images to 0.1.12 release (kubeflow#2637)

* updated jupyter image paths to point to the latest ones (kubeflow#2638)

* add retry around ks init (kubeflow#2643)

* add retry around ks init

* update comments

* merge errors

* Getting started card completed (kubeflow#2651)

* Getting Started card content added, and un-hidden. Windows support added in webpack to run dev builds

* Getting Started card fully implemented from mocks

* Spaced out cards a little more

* Got eslint working! And fixed eslint issues in webpack
  • Loading branch information
kkasravi authored and k8s-ci-robot committed Mar 8, 2019
1 parent 6307bc2 commit 395aadc
Show file tree
Hide file tree
Showing 37 changed files with 1,318 additions and 795 deletions.
1 change: 1 addition & 0 deletions bootstrap/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.ksonnet/registries
/app.override.yaml
/reg_tmp/**
/test
60 changes: 37 additions & 23 deletions bootstrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ vet:

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


deepcopy:
@deepcopy-gen -i github.com/kubeflow/kubeflow/bootstrap/pkg/apis/... -O zz_generated.deepcopy

build-bootstrap: generate fmt vet
$(GO) build -gcflags 'all=-N -l' -o bin/bootstrapper cmd/bootstrap/main.go
Expand Down Expand Up @@ -86,28 +88,6 @@ run-local-docker:
--mount type=bind,source=${HOME}/kf_app,target=/home/kubeflow \
--entrypoint /bin/bash $(IMG):$(TAG)

test-known-platforms-init: install build-dockerfordesktop-plugin
@rm -rf $(HOME)/dockerfordesktop && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) PLUGINS_ENVIRONMENT=$(PLUGINS_ENVIRONMENT) kfctl init $(HOME)/dockerfordesktop -V --platform docker-for-desktop && \
rm -rf $(HOME)/ksonnet && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl init $(HOME)/ksonnet -V --platform ksonnet && \
rm -rf $(HOME)/minikube && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl init $(HOME)/minikube -V --platform minikube && \
rm -rf $(HOME)/gcp && \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) kfctl init $(HOME)/gcp -V --platform gcp --project $(GCLOUD_PROJECT) && \
echo SUCCESS

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

# 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)
Expand All @@ -118,3 +98,37 @@ static:
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
50 changes: 27 additions & 23 deletions bootstrap/cmd/kfctl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (

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

- platform: **ksonnet**
- platform: **none**
- bootstrap/pkg/client/ksonnet/ksonnet.go
- platform: **minikube**
- bootstrap/pkg/client/minikube/minikube.go
- platform: **gcp**
- bootstrap/pkg/client/gcp/gcp.go
- platform: **ack** (in progress)
- bootstrap/pkg/client/ack/ack.go

kfctl can also dynamically load platforms that are not statically linked, as
described below in [Extending kfctl](#extending-kfctl).
Expand Down Expand Up @@ -116,29 +114,27 @@ kfctl apply

```
Create a kubeflow application under <[path/]name>. The <[path/]name> argument can either be a full path
or a name where the kubeflow application will be initialized in $PWD/name if <name> is not a path or in the parent
directory is name is a path.
or a <name>. If just <name> a directory <name> will be created in the current directory.
Usage:
kfctl init <[path/]name> [flags]
Flags:
--debug debug debug default is false
-h, --help help for init
-n, --namespace string namespace where kubeflow will be deployed (default "kubeflow")
-p, --platform string one of 'gcp|minikube|ksonnet' (default=ksonnet)
-p, --platform string one of 'gcp|minikube' (default "none")
--project string name of the gcp project if --platform gcp
-r, --repo string local github kubeflow repo
-V, --verbose verbose output default is false
-v, --version string desired version Kubeflow or latest tag if not provided by user (default "v0.4.1")
-v, --version string desired version Kubeflow or latest tag if not provided by user (default "master")
```

### **generate**

(kubeflow/bootstrap/cmd/kfctl/cmd/generate.go)

```
Generate a kubeflow application where resources is one of 'platform | k8s | all'.
Generate a kubeflow application where resources is one of 'platform|k8s|all'.
platform: non kubernetes resources (eg --platform gcp)
k8s: kubernetes resources
Expand All @@ -150,11 +146,13 @@ Usage:
kfctl generate [all(=default)|k8s|platform] [flags]
Flags:
--email string email if '--platform gcp'
-h, --help help for generate
--ipName string ipName if '--platform gcp'
--mount-local mount-local if '--platform minikube || --platform docker-for-desktop'
-V, --verbose verbose output default is false
--email string email if '--platform gcp'
-h, --help help for generate
--hostname string hostname if '--platform gcp'
--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")
```

### **apply**
Expand Down Expand Up @@ -205,7 +203,7 @@ where the return type implements the [KfApp Interface](#kfapp-interface).
In this sample, running

```
kfctl init ~/dockerfordesktop --platform dockerfordesktop
kfctl init ~/dockerfordesktop --platform docker-for-desktop
```

will result in kfctl loading $PLUGINS_ENVIRONMENT/dockerfordesktop.so and calling its methods that
Expand All @@ -219,13 +217,19 @@ make build-dockerfordesktop-plugin

## Testing

### Testing init for all platforms including the `dockerfordesktop` platform plugin
### Testing kfctl (tests plugin functionality, `kfctl init`, `kfctl generate`)

```
make test-kfctl
```

### Testing `kfctl init` for all platforms

```
make test-known-platforms-init
```

### Testing generate for all platforms including the `dockerfordesktop` platform plugin
### Testing `kfctl generate` for all platforms

```
make test-known-platforms-generate
Expand Down Expand Up @@ -289,19 +293,19 @@ type KsonnetSpec struct {
}
```

#### app.yaml example for --platform ksonnet
#### app.yaml example for --platform minikube

```
apiVersion: ksonnet.apps.kubeflow.org/v1alpha1
kind: Ksonnet
metadata:
creationTimestamp: null
name: ksonnet
name: minikube
namespace: kubeflow
spec:
appdir: /Users/kdkasrav/ksonnet
platform: ksonnet
repo: /Users/kdkasrav/ksonnet/.cache/master/kubeflow
appdir: /Users/kdkasrav/go/src/github.com/kubeflow/kubeflow/bootstrap/ksonnet
platform: minikube
repo: /Users/kdkasrav/go/src/github.com/kubeflow/kubeflow/bootstrap/ksonnet/.cache/master/kubeflow
version: master
status: {}
```
Expand Down
3 changes: 2 additions & 1 deletion bootstrap/cmd/kfctl/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package cmd

import (
kftypes "github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps"
"github.com/kubeflow/kubeflow/bootstrap/pkg/client/coordinator"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -45,7 +46,7 @@ var applyCmd = &cobra.Command{
string(kftypes.OAUTH_ID): applyCfg.GetString(string(kftypes.OAUTH_ID)),
string(kftypes.OAUTH_SECRET): applyCfg.GetString(string(kftypes.OAUTH_SECRET)),
}
kfApp, kfAppErr := loadKfApp(options)
kfApp, kfAppErr := coordinator.LoadKfApp(options)
if kfAppErr != nil {
log.Errorf("couldn't load KfApp: %v", kfAppErr)
return
Expand Down
3 changes: 2 additions & 1 deletion bootstrap/cmd/kfctl/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package cmd

import (
kftypes "github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps"
"github.com/kubeflow/kubeflow/bootstrap/pkg/client/coordinator"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -42,7 +43,7 @@ var deleteCmd = &cobra.Command{
return
}
options := map[string]interface{}{}
kfApp, kfAppErr := loadKfApp(options)
kfApp, kfAppErr := coordinator.LoadKfApp(options)
if kfAppErr != nil {
log.Errorf("couldn't load KfApp: %v", kfAppErr)
return
Expand Down
12 changes: 3 additions & 9 deletions bootstrap/cmd/kfctl/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package cmd

import (
kftypes "github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps"
"github.com/kubeflow/kubeflow/bootstrap/pkg/client/coordinator"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -36,7 +37,6 @@ var generateCmd = &cobra.Command{
The default is 'all' for any selected platform.`,
Run: func(cmd *cobra.Command, args []string) {
log.SetLevel(log.InfoLevel)
log.Info("generating kubeflow application")
if generateCfg.GetBool(string(kftypes.VERBOSE)) == true {
log.SetLevel(log.InfoLevel)
} else {
Expand All @@ -59,13 +59,7 @@ The default is 'all' for any selected platform.`,
string(kftypes.ZONE): zone,
string(kftypes.MOUNT_LOCAL): mountLocal,
}
if ipName != "" {
options[string(kftypes.IPNAME)] = ipName
}
if hostName != "" {
options[string(kftypes.HOSTNAME)] = hostName
}
kfApp, kfAppErr := loadKfApp(options)
kfApp, kfAppErr := coordinator.LoadKfApp(options)
if kfAppErr != nil {
log.Errorf("couldn't load KfApp: %v", kfAppErr)
return
Expand Down Expand Up @@ -122,7 +116,7 @@ func init() {

// platforms minikube, docker-for-desktop
generateCmd.Flags().Bool(string(kftypes.MOUNT_LOCAL), false,
string(kftypes.MOUNT_LOCAL)+" if '--platform minikube || --platform docker-for-desktop'")
string(kftypes.MOUNT_LOCAL)+" if '--platform minikube'")
bindErr = generateCfg.BindPFlag(string(kftypes.MOUNT_LOCAL), generateCmd.Flags().Lookup(string(kftypes.MOUNT_LOCAL)))
if bindErr != nil {
log.Errorf("couldn't set flag --%v: %v", string(kftypes.MOUNT_LOCAL), bindErr)
Expand Down
23 changes: 6 additions & 17 deletions bootstrap/cmd/kfctl/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
package cmd

import (
"github.com/spf13/viper"

kftypes "github.com/kubeflow/kubeflow/bootstrap/pkg/apis/apps"
"github.com/kubeflow/kubeflow/bootstrap/pkg/client/coordinator"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

var initCfg = viper.New()
Expand All @@ -29,10 +29,9 @@ var initCmd = &cobra.Command{
Use: "init <[path/]name>",
Short: "Create a kubeflow application under <[path/]name>",
Long: `Create a kubeflow application under <[path/]name>. The <[path/]name> argument can either be a full path
or a name where the kubeflow application will be initialized in the current directory.`,
or a <name>. If just <name> a directory <name> will be created in the current directory.`,
Run: func(cmd *cobra.Command, args []string) {
log.SetLevel(log.InfoLevel)
log.Info("initializing kubeflow application")
if initCfg.GetBool(string(kftypes.VERBOSE)) == true {
log.SetLevel(log.InfoLevel)
} else {
Expand All @@ -47,7 +46,6 @@ or a name where the kubeflow application will be initialized in the current dire
namespace := initCfg.GetString(string(kftypes.NAMESPACE))
version := initCfg.GetString(string(kftypes.VERSION))
repo := initCfg.GetString(string(kftypes.REPO))
debug := initCfg.GetBool(string(kftypes.DEBUG))
project := initCfg.GetString(string(kftypes.PROJECT))
init_gcp := initCfg.GetBool(string(kftypes.SKIP_INIT_GCP_PROJECT))
basic_auth := initCfg.GetBool(string(kftypes.USE_BASIC_AUTH))
Expand All @@ -57,17 +55,16 @@ or a name where the kubeflow application will be initialized in the current dire
string(kftypes.VERSION): version,
string(kftypes.APPNAME): appName,
string(kftypes.REPO): repo,
string(kftypes.DEBUG): debug,
string(kftypes.PROJECT): project,
string(kftypes.SKIP_INIT_GCP_PROJECT): init_gcp,
string(kftypes.USE_BASIC_AUTH): basic_auth,
}
kfApp, kfAppErr := newKfApp(options)
kfApp, kfAppErr := coordinator.NewKfApp(options)
if kfAppErr != nil || kfApp == nil {
log.Errorf("couldn't create KfApp: %v", kfAppErr)
return
}
initErr := kfApp.Init(options)
initErr := kfApp.Init(kftypes.ALL, options)
if initErr != nil {
log.Errorf("KfApp initialization failed: %v", initErr)
return
Expand All @@ -82,7 +79,7 @@ func init() {
initCfg.SetConfigType("yaml")

initCmd.Flags().StringP(string(kftypes.PLATFORM), "p", kftypes.DefaultPlatform,
"one of 'gcp|minikube|ksonnet'")
"one of 'gcp|minikube'")
bindErr := initCfg.BindPFlag(string(kftypes.PLATFORM), initCmd.Flags().Lookup(string(kftypes.PLATFORM)))
if bindErr != nil {
log.Errorf("couldn't set flag --%v: %v", string(kftypes.PLATFORM), bindErr)
Expand Down Expand Up @@ -148,12 +145,4 @@ func init() {
log.Errorf("couldn't set flag --%v: %v", string(kftypes.USE_BASIC_AUTH), bindErr)
return
}

// debug output
initCmd.Flags().Bool(string(kftypes.DEBUG), false, string(kftypes.DEBUG)+" debug default is false")
bindErr = initCfg.BindPFlag(string(kftypes.DEBUG), initCmd.Flags().Lookup(string(kftypes.DEBUG)))
if bindErr != nil {
log.Errorf("couldn't set flag --%v: %v", string(kftypes.DEBUG), bindErr)
return
}
}
Loading

0 comments on commit 395aadc

Please sign in to comment.