Skip to content

Parse port from base url in ModelRegistryClient #227

@jonburdo

Description

@jonburdo

What you would like to be added?

Support parsing port from base_url in ModelRegistryClient. This should be added to the internal client from the model-registry library as described in this issue: kubeflow/model-registry#2110

Then we will have it for free here for newer versions of model-registry (kubeflow[hub]). We should try to avoid doing the implementation in this repo as that would mean we doing url parsing in ModelRegistryClient and then again in ModelRegistry - this would be complicated and more bug-prone.

The criteria for this issue can be:

  • handle model-registry version differences
    • preferably just update the minimum version of model-registry to a version that has this feature one the issue above is done
    • alternatively include warnings in code and docs about older version of model-registry missing this feature
  • add examples to README/docs of ways to handle port
    ModelRegistryClient("https://example.org", port=456)  # port kwarg
    ModelRegistryClient("https://example.org:456")        # base_url
    ModelRegistryClient("https://example.org")            # default (`443` for https, `8080` for http)
  • document in ModelRegistryClient.__init__ docstring
  • add test cases for this

Why is this needed?

If I have model_registry_url = "https://example.org:456" (port in the url), then currently I have to separate this out to do:

ModelRegistryClient(base_url="https://example.org", port=456)

Ideally I would like to be able to simply do:

ModelRegistryClient(base_url=model_registry_url)

Love this feature?

Give it a 👍 We prioritize the features with most 👍

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions