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 connection for inverse proxy #1993

Merged
merged 6 commits into from
Sep 3, 2019
Merged

add connection for inverse proxy #1993

merged 6 commits into from
Sep 3, 2019

Conversation

IronPan
Copy link
Member

@IronPan IronPan commented Aug 29, 2019

With this change, user can access the cluster through python with single command

client = kfp.client(host=[inverse-proxy-url])
client.get_run() ...

/assign @Ark-kun


This change is Reviewable

@IronPan
Copy link
Member Author

IronPan commented Aug 29, 2019

/assign @hongye-sun

@@ -96,12 +98,14 @@ def __init__(self, host=None, client_id=None, namespace='kubeflow'):

def _load_config(self, host, client_id, namespace):
config = kfp_server_api.configuration.Configuration()
host = host or os.environ.get(KF_PIPELINES_ENDPOINT_ENV)
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 env variable no longer used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you help cross check the caller. the original code looks a bit funky to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

There was a person who wanted to set entrypoints using env variables (he was probably using shell scripts for automation.).

Copy link
Member Author

Choose a reason for hiding this comment

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

that is fine. i pass in self._uihost in caller. should be equavalent.

Copy link
Member Author

Choose a reason for hiding this comment

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

the line here is contradict to how we get host in line 90 so can potentially be buggy.

Copy link
Contributor

Choose a reason for hiding this comment

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

uihost is read from KF_PIPELINES_UI_ENDPOINT_ENV while the host is read from KF_PIPELINES_ENDPOINT_ENV

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you just move the host = host or os.environ.get(KF_PIPELINES_ENDPOINT_ENV) up into __init__?

host = host or os.environ.get(KF_PIPELINES_ENDPOINT_ENV)
self._uihost = os.environ.get(KF_PIPELINES_UI_ENDPOINT_ENV, host)
config = self._load_config(host, client_id, namespace)

Copy link
Member Author

Choose a reason for hiding this comment

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

done

sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
@IronPan
Copy link
Member Author

IronPan commented Aug 30, 2019

/test kubeflow-pipeline-sample-test

2 similar comments
@IronPan
Copy link
Member Author

IronPan commented Aug 30, 2019

/test kubeflow-pipeline-sample-test

@IronPan
Copy link
Member Author

IronPan commented Aug 30, 2019

/test kubeflow-pipeline-sample-test

@IronPan
Copy link
Member Author

IronPan commented Aug 30, 2019

/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

@Ark-kun
Copy link
Contributor

Ark-kun commented Sep 3, 2019

/lgtm

@IronPan IronPan merged commit 8d5ec83 into kubeflow:master Sep 3, 2019
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.

4 participants