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

Load auth from kube config. #1443

Merged
merged 2 commits into from
Jun 4, 2019
Merged

Conversation

hongye-sun
Copy link
Contributor

@hongye-sun hongye-sun commented Jun 4, 2019

This PR supports:

  1. Optionally load auth config from kube config.
  2. Make namespace to be configurable.

Fix #1318
This PR can kind of fix #1104 as well, except that it doesn't go through IAP.


This change is Reviewable

@IronPan
Copy link
Member

IronPan commented Jun 4, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IronPan

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

@hongye-sun
Copy link
Contributor Author

/hold

wait until sample test pass.

@hongye-sun
Copy link
Contributor Author

/hold cancel

Both e2e and sample tests are passed.

@hongye-sun
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit f7eb0cc into kubeflow:master Jun 4, 2019
Copy link
Contributor

@kevinbache kevinbache left a comment

Choose a reason for hiding this comment

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

have you tested this in cluster?

@@ -34,9 +34,10 @@ class Client(object):
"""

# in-cluster DNS name of the pipeline service
IN_CLUSTER_DNS_NAME = 'ml-pipeline.kubeflow.svc.cluster.local:8888'
IN_CLUSTER_DNS_NAME = 'ml-pipeline.{}.svc.cluster.local:8888'
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename to IN_CLUSTER_DNS_TEMPLATE and KUBE_PROXY_PATH_TEMPLATE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do in a follow up PR.

api_client = kfp_server_api.api_client.ApiClient(config)
self._run_api = kfp_server_api.api.run_service_api.RunServiceApi(api_client)
self._experiment_api = kfp_server_api.api.experiment_service_api.ExperimentServiceApi(api_client)

def _configure_auth(self, config, token):
def _load_config(self, host, client_id, namespace):
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a @staticmethod?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sg, will do.

token = None
if host and client_id:
# fetch IAP auth token
token = get_auth_token(client_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

it's a bit out of scope for this PR but maybe this should be renamed to get_iap_auth_token

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sg, will do.

return config

if config.host:
config.host = os.path.join(config.host, Client.KUBE_PROXY_PATH.format(namespace))
Copy link
Contributor

Choose a reason for hiding this comment

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

@hongye-sun
Copy link
Contributor Author

The e2e and sample test covers in cluster use case.

magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
* update monitoring pointers

* Update README.md
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.

[SDK] - Reduce dependency on kubeflow namespace KFP SDK should support gcloud credential
4 participants