h2oai / wave-ml

Automatic Machine Learning (AutoML) for Wave Apps
Apache License 2.0
32 stars 5 forks source link

Accessing MLOps project_id #61

Closed vopani closed 3 years ago

vopani commented 3 years ago

If we can access or get the project_id of a model, it becomes very convenient for a user to find a WaveModel in MLOps.

Without this, its not easy to map a model to a project (especially on the UI), when there are multiple projects.

geomodular commented 3 years ago

There are 3 ways how to obtain DAI model in properly configured WaveML:

  1. Build it using build_model().
  2. Get it using endpoint_url via get_model().
  3. Get it using model_id via get_model(). model_id here is a project_id in MLOps.

It's possible to expose Model.project_id similar to endpoint_url in the DAI model, but it's impossible for the second bullet. In this case, WaveML gets just endpoint_url, and it's, AFAIK, not desirable to use the endpoint provided and inspect it (cc @zoido).

i.e., We can create a Model.project_id but will be accessible only for 1. and 3. which is somewhat inconsistent.

geomodular commented 3 years ago
  1. Get it using endpoint_url via get_model().

This might work for a current user, tho.

We should be able to list all deployments for the current user and check project_id if endpoint_url matches the listing. We may throw a permission error for Model.project_id if endpoint_url is not owned by the current user.