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

[inferno-ml-server-types] Split Model and ModelVersion #107

Merged
merged 9 commits into from
Mar 21, 2024

Conversation

ngua
Copy link
Contributor

@ngua ngua commented Mar 21, 2024

Splits the Model type into two parts:

  • Model, which now just contains metadata that should not change between versions (name, user, permissions)
  • ModelVersion, which contains other version-specific metadata as well as the actual model contents

Splitting the type like this helps prevent certain undesirable scenarios. For example, all model versions previously had their own permissions. This meant that it would be possible for a user to have access to (or even own) one version of a model, but not others. That's not what we want.

Also, previously the different versions of a model were only linked together by their name field. This wasn't really structured into the database in any way. Now it is possible to get all versions of a model directly by a foreign key lookup.

I've integrated these changes on branches for the other Inferno ML projects but this will need to be merged first.

The DB tables now look like this:

,------------------------.
| Model                  |
|------------------------|
| id : serial            |
| --                     |
| * name : text          |
| * permissions : jsonb  |
| user : User (id)       |
|                        |
`------------------------'
          \|/
           o
           |           
           |           
           _
           -
,------------------------. 
| ModelVersion           | 
|------------------------| 
| id : serial            | 
| --                     | 
| * model : Model (id)   | 
| * card : jsonb         | 
| * contents : oid       | 
| * version : text       | 
|                        |
`------------------------' 

@ngua ngua merged commit c2bee8a into main Mar 21, 2024
1 check passed
@ngua ngua deleted the rory-inferno-ml-server-types branch March 21, 2024 13:02
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

Successfully merging this pull request may close these issues.

2 participants