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

Add AWS kfctl(golang) support and 0.6 support #3695

Merged
merged 13 commits into from
Jul 26, 2019

Conversation

Jeffwan
Copy link
Member

@Jeffwan Jeffwan commented Jul 19, 2019

Part of the work of #3151


This change is Reviewable

@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 19, 2019

/cc @kkasravi

@jlewi
Copy link
Contributor

jlewi commented Jul 22, 2019

/assign @jlewi

HI @Jeffwan moving forward I'd like to try to get away from adding more command line flags. The desired experience will be closer to something like

kfctl init --config=<path to config file>

So rather than define new config flags; you should define an AWSPlugin

type GcpPluginSpec struct {

And then any AWS fields (e.g. region) should be provided as part of that plugin and set in the KFDef file.
In kfctl you could add logic to try to intelligently set those defaults based on the user's locally configured preferences.

namespace: kubeflow
spec:
platform: aws
componentParams:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fields packages, components, componentParams are the deprecated fields that were there for ksonnet.

If you want you can still use these fields but since its a new config I might suggest using the new field

Spec.applications

Each application is just a pointer to a kustomize package.

kfctl will automatically update kfdef.spec.applications based on packages, components,componentParams

so if you run kfctl and then look at app.yaml you can copy the value of KfDef.Spec.Applications from there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I will make some clean ups as you suggest.

  1. Define a plugin to avoid bring in more options
  2. Use Applications instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

@jlewi jlewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 15 files reviewed, 5 unresolved discussions (waiting on @Jeffwan, @kkasravi, @kunmingg, and @mameshini)


bootstrap/cmd/kfctl/cmd/apply.go, line 19 at r2 (raw file):

import (
	"fmt"

nit: can we revert this file just to get rid of spurious changes?


bootstrap/config/overlays/aws/kfctl_default.yaml, line 1 at r2 (raw file):

apiVersion: kfdef.apps.kubeflow.org/v1alpha1

I don't think you need these files.

kfctl used to be using kustomize to generate a KFDef in a YAML file
but now

kfctl takes a single parameter --config=

where the YAML file should fully specify KFDef

So if you want to have multiple configurations you what have multiple independent YAML files.

If you wanted to use kustomize to reduce boilerplate across those configs you could but the pattern would be to run kustomize and then check in the results.


bootstrap/pkg/apis/apps/kfdef/v1alpha1/application_types.go, line 37 at r2 (raw file):

	SkipInitProject        bool   `json:"skipInitProject,omitempty"`
	UseIstio               bool   `json:"useIstio"`
	ServerVersion          string `json:"serverVersion,omitempty"`

Did you mean to make this change? Maybe you just need to sync and pull in the latest changes?


bootstrap/pkg/kfapp/aws/aws.go, line 82 at r2 (raw file):

	// use aws to call sts get-caller-identity to verify aws credential works.
	if err := utils.CheckAwsStsCallerIdentity(sess); err != nil {

I think you would want to move this code to Generate and/or Apply

if err := gcp.initGcpClient(); err != nil {

Copy link
Contributor

@kkasravi kkasravi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 15 files reviewed, 5 unresolved discussions (waiting on @Jeffwan, @jlewi, @kkasravi, @kunmingg, and @mameshini)


bootstrap/config/overlays/aws/kfctl_default.yaml, line 1 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

I don't think you need these files.

kfctl used to be using kustomize to generate a KFDef in a YAML file
but now

kfctl takes a single parameter --config=

where the YAML file should fully specify KFDef

So if you want to have multiple configurations you what have multiple independent YAML files.

If you wanted to use kustomize to reduce boilerplate across those configs you could but the pattern would be to run kustomize and then check in the results.

I think keeping them would be ok since bootstrap/config/{base,overlays} will be moved into manifests and a tool can generate the file used for kfctl init --config=...

@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 24, 2019

/hold

@Jeffwan Jeffwan changed the title Add AWS kfctl(golang) support and 0.6 support [WIP] Add AWS kfctl(golang) support and 0.6 support Jul 24, 2019
@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 24, 2019

Changes are not ready yet. Still working on it. I will address above comments.

Copy link
Member Author

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 15 files reviewed, 5 unresolved discussions (waiting on @Jeffwan, @jlewi, @kunmingg, and @mameshini)


bootstrap/cmd/kfctl/cmd/apply.go, line 19 at r2 (raw file):

nit: can we revert this file just to get rid of spurious changes?
Looks like my editor auto format this fine and add one empty line. Revert it.


bootstrap/config/overlays/aws/kfctl_default.yaml, line 1 at r2 (raw file):

Previously, kkasravi (Kam Kasravi) wrote…

I think keeping them would be ok since bootstrap/config/{base,overlays} will be moved into manifests and a tool can generate the file used for kfctl init --config=...

Notice we need kfctl init {app_name} --config=.. since init.go check args.

bootstrap/config/{base,overlays} will give some template like this, if we want to use --config, where should we keep the preconfigured templates?


bootstrap/pkg/apis/apps/kfdef/v1alpha1/application_types.go, line 37 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

Did you mean to make this change? Maybe you just need to sync and pull in the latest changes?

I will have a check. I may carelessly delete it in rebase.


bootstrap/pkg/kfapp/aws/aws.go, line 82 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

I think you would want to move this code to Generate and/or Apply

if err := gcp.initGcpClient(); err != nil {

Move to Generate/Apply/Delete

@Jeffwan Jeffwan changed the title [WIP] Add AWS kfctl(golang) support and 0.6 support Add AWS kfctl(golang) support and 0.6 support Jul 25, 2019
@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 25, 2019

/hold cancel

@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 25, 2019

@jlewi @kkasravi Changes are ready and I address the feedbacks you left and please have a check. Only confusion part is what's the best practice if we have different config patterns? Should we create different kfctl_aws_**.yaml template for users?

  1. Use kustomize manner in config file. User should install kubeflow using command like this `kfctl init ${clusterName} --config=.
  2. Extract aws options to aws plugin.
  3. Revert some of unrelated changes.

@kkasravi
Copy link
Contributor

Thanks @Jeffwan

@jlewi @kkasravi Changes are ready and I address the feedbacks you left and please have a check. Only confusion part is what's the best practice if we have different config patterns? Should we create different kfctl_aws_**.yaml template for users?

Could you explain a bit more on the different config patterns or point me to the relevanant part(s), or paste several kfctl_aws_*.yaml's you had in mind?

Copy link
Contributor

@jlewi jlewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 18 files at r1, 4 of 12 files at r2, 9 of 9 files at r3.
Reviewable status: 14 of 16 files reviewed, 4 unresolved discussions (waiting on @Jeffwan, @jlewi, @kkasravi, @kunmingg, and @mameshini)


bootstrap/config/kfctl_aws.yaml, line 1 at r3 (raw file):

apiVersion: kfdef.apps.kubeflow.org/v1alpha1

Maybe add a comment explaining what this config is for?


bootstrap/config/kfctl_aws_cognito.yaml, line 1 at r3 (raw file):

apiVersion: kfdef.apps.kubeflow.org/v1alpha1

Maybe add a comment at the top of this file explaining what its for?


bootstrap/config/overlays/aws/kfctl_default.yaml, line 1 at r2 (raw file):

Previously, Jeffwan (Jiaxin Shan) wrote…

Notice we need kfctl init {app_name} --config=.. since init.go check args.

bootstrap/config/{base,overlays} will give some template like this, if we want to use --config, where should we keep the preconfigured templates?

I think the current location is fine. Lets follow up in
kubeflow/manifests#241

Did you mean to retain this now that you have kfctl_aws.yaml?

Looks like this is still using old style components, packages, componentParams


bootstrap/pkg/kfapp/aws/aws.go, line 82 at r2 (raw file):

Previously, Jeffwan (Jiaxin Shan) wrote…

Move to Generate/Apply/Delete

It looks like you are still initiating the clients and session here?

@jlewi
Copy link
Contributor

jlewi commented Jul 26, 2019

/lgtm
/approve

@Jeffwan I left a couple comments but in the interest of trying to get this into the next RC I'm LGTM.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlewi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 32b7443 into kubeflow:master Jul 26, 2019
Copy link
Member Author

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 14 of 16 files reviewed, 4 unresolved discussions (waiting on @Jeffwan, @jlewi, @kunmingg, and @mameshini)


bootstrap/config/overlays/aws/kfctl_default.yaml, line 1 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

I think the current location is fine. Lets follow up in
kubeflow/manifests#241

Did you mean to retain this now that you have kfctl_aws.yaml?

Looks like this is still using old style components, packages, componentParams

Yes. I used it in overlay kfctl_default.yaml. After I generate config and kustomize config are backfilled, I delete all components and packages in final template. Technically, this one is unnecessary now. I will check #241 for updates.


bootstrap/pkg/kfapp/aws/aws.go, line 82 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

It looks like you are still initiating the clients and session here?

Will move entire client initiation to later steps in next revision.

@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 26, 2019

Thanks @Jeffwan

@jlewi @kkasravi Changes are ready and I address the feedbacks you left and please have a check. Only confusion part is what's the best practice if we have different config patterns? Should we create different kfctl_aws_**.yaml template for users?

Could you explain a bit more on the different config patterns or point me to the relevanant part(s), or paste several kfctl_aws_*.yaml's you had in mind?

I image that user want simple setups can use bootstrap/config/kfctl_aws.yaml and users want entire aws service integrations like auth, file storage should use bootstrap/config/kfctl_aws_coginito.yaml. Should I keep two config there? Or just use one kfctl_aws.yaml with basic setups and ask users to follow documentation to change yaml file like add different fields by themselves?

@Jeffwan Jeffwan deleted the aws-golang-kfctl branch July 26, 2019 19:00
k8s-ci-robot pushed a commit that referenced this pull request Jul 26, 2019
* Add AWS parameters in kfctl API

* Add aws provision implementation

* Add aws parameters in coordinator

* Clean up logs and comments

* Add config kustomization files for AWS

* Update kfctl default components for aws

* Update aws infra configs

* Update kfctl aws settings

* Clean up aws configs and boostrap process

* Refactor aws.go and add aws plugin

* Address feedbacks and refactor Generate/Apply

* Update manifest files

* Update aws kfctl config files
@@ -1,14 +0,0 @@
# privateAccess enable private access for your Amazon EKS cluster's Kubernetes API server endpoint
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Jeffwan - thanks for your work on this. Did you delete this intentionally? For v0.6.1 this broke https://github.com/kubeflow/kubeflow/blob/master/scripts/aws/util.sh - which relies on cluster_features.sh

Following https://www.kubeflow.org/docs/aws/deploy/install-kubeflow/ with export KUBEFLOW_TAG=v0.6.1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I see. Thanks for letting me know. This will be only used in 0.5.1 and 0.6 has few changes for this. I will update docs this week to give latest guidance.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - thanks!

saffaalvi pushed a commit to StatCan/kubeflow that referenced this pull request Feb 11, 2021
* Add AWS parameters in kfctl API

* Add aws provision implementation

* Add aws parameters in coordinator

* Clean up logs and comments

* Add config kustomization files for AWS

* Update kfctl default components for aws

* Update aws infra configs

* Update kfctl aws settings

* Clean up aws configs and boostrap process

* Refactor aws.go and add aws plugin

* Address feedbacks and refactor Generate/Apply

* Update manifest files

* Update aws kfctl config files
saffaalvi pushed a commit to StatCan/kubeflow that referenced this pull request Feb 12, 2021
* Add AWS parameters in kfctl API

* Add aws provision implementation

* Add aws parameters in coordinator

* Clean up logs and comments

* Add config kustomization files for AWS

* Update kfctl default components for aws

* Update aws infra configs

* Update kfctl aws settings

* Clean up aws configs and boostrap process

* Refactor aws.go and add aws plugin

* Address feedbacks and refactor Generate/Apply

* Update manifest files

* Update aws kfctl config files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants