kubeflow / pipelines

Machine Learning Pipelines for Kubeflow
https://www.kubeflow.org/docs/components/pipelines/
Apache License 2.0
3.61k stars 1.63k forks source link

Using custom DNS with Python SDK (kfp) #2888

Closed kelvins closed 4 years ago

kelvins commented 4 years ago

The _is_iap_host method is being called in the Client initialization, but it is using a regex based on the default DNS (e.g. kubeflow.endpoints.my-project.cloud.goog/pipeline):

https://github.com/kubeflow/pipelines/blob/0577fe10fdc3c57cd56ca3b65198c03636ae4520/sdk/python/kfp/_client.py#L156-L161

In this case, how can we use a custom DNS?

Ark-kun commented 4 years ago

Maybe we should add the optional use_iap parameter, so that the user can specify this explicitly.

kelvins commented 4 years ago

Sounds good, but as far as I know client_id is only used for IAP, so passing client_id and use_iap seems to be a little redundant.

Another option would be to change the regular expression to not be so restricted, for example:

def _is_iap_host(self, host, client_id):
    if host and client_id:
        if re.match(r'\S+/{0,1}$', host):
            warnings.warn('Suffix /pipeline is not ignorable for IAP host.')
        return re.match(r'\S+/pipeline', host)
    return False
Ark-kun commented 4 years ago

@numerology @hongye-sun WDYT?

Bobgy commented 4 years ago

/close Already fixed by https://github.com/kubeflow/pipelines/pull/3003

k8s-ci-robot commented 4 years ago

@Bobgy: Closing this issue.

In response to [this](https://github.com/kubeflow/pipelines/issues/2888#issuecomment-596907418): >/close >Already fixed by https://github.com/kubeflow/pipelines/pull/3003 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.