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

Cannot create_registered_model or get_or_create_registered_model #2560

Closed
KyleFrisbie opened this issue Aug 16, 2021 · 3 comments
Closed

Cannot create_registered_model or get_or_create_registered_model #2560

KyleFrisbie opened this issue Aug 16, 2021 · 3 comments
Assignees

Comments

@KyleFrisbie
Copy link

KyleFrisbie commented Aug 16, 2021

Python version: Python 3.9.6
PIP version: pip 21.2.4
Environments attempted:

  1. OpenShift 4.7
  2. Docker 20.10.7

While following the documentation for Registry Quickstart I am unable to create a registered model:

Source Code for create_registered_model:

from verta import Client
client = Client("http://localhost:3000")

reg_model = client.create_registered_model("my-model-name")

Result for create_registered_model:

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
/var/folders/65/__m7nd6579d0yjzcl_r9h0qw00yrzd/T/ipykernel_24666/2890549153.py in <module>
----> 1 reg_model = client.create_registered_model("my-model-name")

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/client.py in create_registered_model(self, name, desc, labels, workspace, public_within_org, visibility)
   1090         ctx.workspace_name = workspace
   1091 
-> 1092         return RegisteredModel._create(
   1093             self._conn, self._conf, ctx,
   1094             name=name, desc=desc, tags=labels,

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/tracking/entities/_entity.py in _create(cls, conn, conf, *args, **kwargs)
    173             kwargs[VISIBILITY_KEY] = _workspace_default._WorkspaceDefault()
    174 
--> 175         msg = cls._create_proto(conn, *args, **kwargs)
    176         if msg:
    177             # pylint: disable=no-value-for-parameter

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/tracking/entities/_entity.py in _create_proto(cls, conn, *args, **kwargs)
    198             ]
    199 
--> 200         return cls._create_proto_internal(conn, *args, **kwargs)
    201 
    202     @classmethod

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/registry/entities/_model.py in _create_proto_internal(cls, conn, ctx, name, desc, tags, attrs, date_created, public_within_org, visibility)
    712                                            "/api/v1/registry/workspaces/{}/registered_models".format(ctx.workspace_name),
    713                                            body=msg)
--> 714         registered_model = conn.must_proto_response(response, _RegistryService.SetRegisteredModel.Response).registered_model
    715 
    716         if ctx.workspace_name is not None:

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/_internal_utils/_utils.py in must_proto_response(response, response_type)
    112             return response_msg
    113         else:
--> 114             raise_for_http_error(response)
    115 
    116     @staticmethod

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/_internal_utils/_utils.py in raise_for_http_error(response)
    453             message = "{} {} Error: {} for url: {}".format(response.status_code, cause, reason, response.url)
    454             message += time_str  # attach time to error message
--> 455             six.raise_from(requests.HTTPError(message, response=response), None)
    456 
    457 

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/external/six/__init__.py in raise_from(value, from_value)

HTTPError: 404 Client Error: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/v1/registry/workspaces/personal/registered_models</pre>
</body>
</html> for url: http://localhost:3000/api/v1/registry/workspaces/personal/registered_models at 2021-08-16 15:06:57.850000 UTC

Another attempt from Examples

Source Code for get_or_create_registered_model copied from examples, only relevant cells included below:

# Initial cells redacted for brevity (same as example file)
# ...
# Setup client
# From: 0.1 Verta import and setup
from verta import Client

client = Client("http://localhost:3000")

# cells redacted for brevity (same as example file)
# ...
# From: 2. Register a model
registered_model = client.get_or_create_registered_model(
    name="census-registry-example", labels=["research-purpose", "team-a"])

Result for get_or_create_registered_model:

registered_model = client.get_or_create_registered_model(
    name="census-registry-example", labels=["research-purpose", "team-a"])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/var/folders/65/__m7nd6579d0yjzcl_r9h0qw00yrzd/T/ipykernel_38736/1596712098.py in <module>
----> 1 registered_model = client.get_or_create_registered_model(
      2     name="census-registry-example", labels=["research-purpose", "team-a"])

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/client.py in get_or_create_registered_model(self, name, desc, labels, workspace, public_within_org, visibility, id)
    730                                                   param_names, params)
    731         else:
--> 732             registered_model = RegisteredModel._get_or_create_by_name(self._conn, name,
    733                                                                   lambda name: RegisteredModel._get_by_name(self._conn, self._conf, name, ctx.workspace_name),
    734                                                                   lambda name: RegisteredModel._create(self._conn, self._conf, ctx, name=name, desc=desc, tags=labels, public_within_org=public_within_org, visibility=visibility),

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/tracking/entities/_entity.py in _get_or_create_by_name(cls, conn, name, getter, creator, checker)
    130             name = cls._generate_default_name()
    131 
--> 132         obj = getter(name)
    133         if obj is None:
    134             obj = creator(name)

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/client.py in <lambda>(name)
    731         else:
    732             registered_model = RegisteredModel._get_or_create_by_name(self._conn, name,
--> 733                                                                   lambda name: RegisteredModel._get_by_name(self._conn, self._conf, name, ctx.workspace_name),
    734                                                                   lambda name: RegisteredModel._create(self._conn, self._conf, ctx, name=name, desc=desc, tags=labels, public_within_org=public_within_org, visibility=visibility),
    735                                                                   lambda: check_unnecessary_params_warning(

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/tracking/entities/_entity.py in _get_by_name(cls, conn, conf, name, parent)
    140     @classmethod
    141     def _get_by_name(cls, conn, conf, name, parent):
--> 142         msg = cls._get_proto_by_name(conn, name, parent)
    143         if msg:
    144             # pylint: disable=no-value-for-parameter

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/registry/entities/_model.py in _get_proto_by_name(cls, conn, name, workspace)
    696         response = conn.make_proto_request("GET",
    697                                            "/api/v1/registry/workspaces/{}/registered_models/{}".format(workspace, name))
--> 698         return conn.maybe_proto_response(response, Message.Response).registered_model
    699 
    700     @classmethod

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/_internal_utils/_utils.py in maybe_proto_response(response, response_type)
     97     def maybe_proto_response(response, response_type):
     98         if response.ok:
---> 99             response_msg = json_to_proto(body_to_json(response), response_type)
    100             return response_msg
    101         else:

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/_internal_utils/_utils.py in body_to_json(response)
    486         ])
    487         msg = six.ensure_str(msg)
--> 488         six.raise_from(ValueError(msg), None)
    489 
    490 

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/verta/external/six/__init__.py in raise_from(value, from_value)

ValueError: expected JSON response from http://localhost:3000/api/v1/registry/workspaces/personal/registered_models/census-registry-example, but instead got:
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Verta AI</title><link href="/static/css/2.722a1fc9.chunk.css" rel="stylesheet"><link href="/static/css/main.3a7bd0dc.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],f=r[1],i=r[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var f=t[a];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var a=this.webpackJsonpverta=this.webpackJsonpverta||[],f=a.push.bind(a);a.push=r,a=a.slice();for(var i=0;i<a.length;i++)r(a[i]);var p=f;t()}([])</script><script src="/static/js/2.2beaca20.chunk.js"></script><script src="/static/js/main.a839b027.chunk.js"></script></body></html>

Please notify the Verta development team.
@convoliution
Copy link
Contributor

Hello @KyleFrisbie, thank you for the very thorough report!

For the time being, our model registry feature set has not been made available in our open-source platform. You can contact us for information about our SaaS offering, or let us know about the usecase you have in mind so we can factor it into our roadmap!

https://www.verta.ai/contact/

@convoliution convoliution self-assigned this Aug 16, 2021
@KyleFrisbie
Copy link
Author

Understood, thank you for the response. For what it's worth, it wasn't clear to me that this was the case based on the documentation. It might be helpful to others if this was mentioned in a couple places.

Perhaps in the following pages:

  1. ModelDB Documentation as this points as the full Verta documentation, rather than at the features which are included in the open source distribution.
  2. Verta Documentation, perhaps distinguishing between which features are open source and which are "premium"
  3. Registry Quickstart as it isn't clear that this will fail in the open source version.

@convoliution
Copy link
Contributor

It is becoming apparent that this would be very useful information for us to surface!
I'll forward this feedback to the team for our docs—thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants