Skip to content

Commit

Permalink
Use python to define the E2E test workflow for kfctl. (kubeflow#4148)
Browse files Browse the repository at this point in the history
* Use python to define the E2E test workflow for kfctl.

* We need to write an E2E test for kfctl upgrade (kubeflow/kfctl#35).

  Before we do that we want to remove ksonnet from our existing E2E test.

  The E2E test for upgrades will be very similar to the kfctl E2E test
  so it makes sense to convert that test to python before writing
  the upgrade test.

* Related to kubeflow#3035 migrate e2e tests off ksonnet

* Code to setup default profile should not return an error if the secret
  already exists. This prevents us from calling apply multiple times.

  * Related to kubeflow/issues/3810; kfctl apply fails if we rerun it

* Fixing working directory of juptyer test.

* Update prow_config.yaml to use the new py_funcs for the kfctl_e2e tests

* Update kfctl_go_test.py to determine whether we are using basic_auth from
  the KFDef spec rather than the command line arguments.

* Address comments.
  • Loading branch information
jlewi authored and k8s-ci-robot committed Sep 27, 2019
1 parent fb0369b commit a47396a
Show file tree
Hide file tree
Showing 6 changed files with 688 additions and 46 deletions.
4 changes: 4 additions & 0 deletions bootstrap/pkg/kfapp/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,10 @@ func insertSecret(client *clientset.Clientset, secretName string, namespace stri
if err == nil {
return nil
} else {
if k8serrors.IsAlreadyExists(err) {
log.Infof("Secret %v.%v already exists", namespace, secretName)
return nil
}
return &kfapis.KfError{
Code: int(kfapis.INTERNAL_ERROR),
Message: err.Error(),
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/kubeflow/kubeflow

go 1.12
58 changes: 19 additions & 39 deletions prow_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# This file configures the workflows to trigger in our Prow jobs.
# see kubeflow/testing/py/run_e2e_workflow.py
python_paths:
- kubeflow/kubeflow/py
workflows:
# deploy app test runs tests on gke.
- app_dir: kubeflow/kubeflow/testing/workflows
Expand All @@ -26,8 +28,7 @@ workflows:
params:
installIstio: true
workflowName: deployapp-istio
- app_dir: kubeflow/kubeflow/testing/workflows
component: kfctl_go_test
- py_func: kubeflow.kubeflow.ci.kfctl_e2e_workflow.create_workflow
name: kfctl-go-iap-endpoint
job_types:
- postsubmit
Expand All @@ -38,15 +39,11 @@ workflows:
- dependencies/*
- kubeflow/*
- testing/*
params:
platform: gke
gkeApiVersion: v1
workflowName: kfctl-go
useBasicAuth: false
useIstio: true
testEndpoint: true
configPath: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_iap.yaml
- app_dir: kubeflow/kubeflow/testing/workflows
kwargs:
use_basic_auth: false
test_endpoint: true
config_path: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_iap.yaml
- py_func: kubeflow.kubeflow.ci.kfctl_e2e_workflow.create_workflow
component: kfctl_go_test
name: kfctl-go-iap-istio
job_types:
Expand All @@ -57,16 +54,11 @@ workflows:
- dependencies/*
- kubeflow/*
- testing/*
params:
platform: gke
gkeApiVersion: v1
workflowName: kfctl-go
useBasicAuth: false
useIstio: true
configPath: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_iap.yaml
kwargs:
use_basic_auth: false
config_path: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_iap.yaml
# Run basic auth test as part of every periodic and postsubmit run.
- app_dir: kubeflow/kubeflow/testing/workflows
component: kfctl_go_test
- py_func: kubeflow.kubeflow.ci.kfctl_e2e_workflow.create_workflow
name: kfctl-go-basic-auth
job_types:
- postsubmit
Expand All @@ -76,34 +68,22 @@ workflows:
- deployment/*
- kubeflow/*
- testing/*
params:
platform: gke
gkeApiVersion: v1
workflowName: kfctl-go
useBasicAuth: true
useIstio: true
configPath: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_basic_auth.yaml
kwargs:
use_basic_auth: true
config_path: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_basic_auth.yaml
# Only run kfctl presubmit test with basic auth if
# files related to basic auth are modified.
- app_dir: kubeflow/kubeflow/testing/workflows
component: kfctl_go_test
- py_func: kubeflow.kubeflow.ci.kfctl_e2e_workflow.create_workflow
name: kfctl-go-basic-auth
job_types:
- presubmit
include_dirs:
# If kfctl is modified make sure basic auth still works
- bootstrap/*
- kubeflow/kubeflow/common/basic-auth.libsonnet
- kubeflow/kubeflow/common/prototypes/basic-auth.jsonnet
- testing/kfctl/*
- testing/workflows/kfctl_go_test.jsonnet
params:
platform: gke
gkeApiVersion: v1
workflowName: kfctl-go
useBasicAuth: true
useIstio: true
configPath: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_basic_auth.yaml
kwargs:
use_basic_auth: true
config_path: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_gcp_basic_auth.yaml
# Run unittests
# TODO(jlewi): Need to add step to run go and python unittests
- app_dir: kubeflow/kubeflow/testing/workflows
Expand Down
Loading

0 comments on commit a47396a

Please sign in to comment.