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

setup cors for redirects under iap #688

Merged
merged 11 commits into from
Jul 20, 2018
Merged

Conversation

kkasravi
Copy link
Contributor

@kkasravi kkasravi commented Jun 20, 2018

fixes kubeflow/kubeflow#574


This change is Reviewable

@coveralls
Copy link

coveralls commented Jun 20, 2018

Coverage Status

Coverage decreased (-0.07%) to 56.69% when pulling 6f91650 on kkasravi:tfjobs_iap into aae8327 on kubeflow:master.

@kkasravi
Copy link
Contributor Author

Hi @swiftdiaries
Update on this PR.

I don't believe this one change will solve kubeflow/kubeflow#574 since the fetch will need to have similar options set for create and other tfjob operations.

The fetch change in services.js to get the list of jobs results in a 302 and the browser does a preflight OPTIONS on the redirect location https://accounts.google.com/o/oauth2/v2/auth?login_hint=118075057959340259429&client_id=336335541993-1m7cegck4jic23263v0gplhc46f4rmmj.apps.googleusercontent.com&response_type=code&scope=openid+email&redirect_uri=https://kamkasravi.com/_gcp_gatekeeper/authenticate&state=CihodHRwczovL2thbWthc3JhdmkuY29tL3Rmam9icy9hcGkvdGZqb2IvEjBBQWgtV1puaVV5VTVrN2FFdTg5RXRiWmtMenBPY2lnUHJnOjE1Mjk1MTM3NjE3MDY

This preflight OPTIONS check to google's accounts returns a 405. I'm going to mark this PR as WIP since I'm going to try a few other things like setting nocors on both the list and create.

@gaocegege
Copy link
Member

/assign @wbuchwalter @swiftdiaries

@kkasravi
Copy link
Contributor Author

@swiftdiaries

When I submit a new job in the UI I see the following:

time="2018-06-24T19:40:49Z" level=info msg="EnvKubeflowNamespace not set, use default namespace" filename="app/server.go:65"
time="2018-06-24T19:40:49Z" level=info msg="[API Version: v1alpha2 Version: v0.1.0-alpha Git SHA: Not provided. Go Version: go1.10.1 Go OS/Arch: linux/amd64]" filename="app/server.go:70"
W0624 19:40:49.182867       1 client_config.go:529] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I0624 19:40:49.187303       1 leaderelection.go:174] attempting to acquire leader lease...
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
time="2018-06-24T19:40:49Z" level=info msg="This pod's tfjob does not exists" filename="controller.v2/controller_pod.go:309"
E0624 19:41:29.473920       1 event.go:260] Could not construct reference to: '&v1.Endpoints{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"tf-operator", GenerateName:"", Namespace:"default", SelfLink:"/api/v1/namespaces/default/endpoints/tf-operator", UID:"7ccfef35-76f4-11e8-879b-42010a8a01ab", ResourceVersion:"326085", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63665362107, loc:(*time.Location)(0x1aded60)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string{"control-plane.alpha.kubernetes.io/leader":"{\"holderIdentity\":\"tf-job-operator-v1alpha2-5bfdc6b65d-sdqg4\",\"leaseDurationSeconds\":15,\"acquireTime\":\"2018-06-24T19:41:29Z\",\"renewTime\":\"2018-06-24T19:41:29Z\",\"leaderTransitions\":5}"}, OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Subsets:[]v1.EndpointSubset(nil)}' due to: 'no kind is registered for the type v1.Endpoints'. Will not report event: 'Normal' 'LeaderElection' 'tf-job-operator-v1alpha2-5bfdc6b65d-sdqg4 became leader'
I0624 19:41:29.474470       1 leaderelection.go:184] successfully acquired lease default/tf-operator
time="2018-06-24T19:41:29Z" level=info msg="Starting TFJob controller" filename="controller.v2/controller.go:251"
time="2018-06-24T19:41:29Z" level=info msg="Waiting for informer caches to sync" filename="controller.v2/controller.go:254"
time="2018-06-24T19:41:29Z" level=info msg="Starting 1 workers" filename="controller.v2/controller.go:267"
time="2018-06-24T19:41:29Z" level=info msg="Started workers" filename="controller.v2/controller.go:273"

It doesn't look like it's not getting the namespace. Do I need to set that in an environment variable in the Create job form?

@kkasravi
Copy link
Contributor Author

@swiftdiaries I'm going to open an issue on the above error since it's separate from the IAP work

@kkasravi
Copy link
Contributor Author

Blocked by #696
PR for 696 is available #1084

@kkasravi
Copy link
Contributor Author

/retest

@jlewi
Copy link
Contributor

jlewi commented Jul 20, 2018

@kkasravi Any update on this ?
Tests passed; do you want to just rebase this?

/assign jlewi

@kkasravi
Copy link
Contributor Author

/retest

@jlewi
Copy link
Contributor

jlewi commented Jul 20, 2018

/lgtm
/approve

@kkasravi Thank you so much for fixing this!

@k8s-ci-robot
Copy link

[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 b0e6da5 into kubeflow:master Jul 20, 2018
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.

TFJobs UI doesn't work behind IAP; React APP needs support IAP?
7 participants