-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
GET /mlflow/registered-models/get
endpoint. (#92)
Signed-off-by: Software Developer <7852635+dsuhinin@users.noreply.github.com>
- Loading branch information
Showing
14 changed files
with
185 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package entities | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/mlflow/mlflow-go/pkg/protos" | ||
"github.com/mlflow/mlflow-go/pkg/utils" | ||
) | ||
|
||
type ModelVersion struct { | ||
Name string | ||
Version int32 | ||
CreationTime int64 | ||
LastUpdatedTime int64 | ||
Description string | ||
UserID string | ||
CurrentStage string | ||
Source string | ||
RunID string | ||
Status string | ||
StatusMessage string | ||
RunLink string | ||
StorageLocation string | ||
} | ||
|
||
func (mv ModelVersion) ToProto() *protos.ModelVersion { | ||
return &protos.ModelVersion{ | ||
Version: utils.PtrTo(strconv.Itoa(int(mv.Version))), | ||
CurrentStage: utils.PtrTo(mv.CurrentStage), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package entities | ||
|
||
import ( | ||
"github.com/mlflow/mlflow-go/pkg/protos" | ||
"github.com/mlflow/mlflow-go/pkg/utils" | ||
) | ||
|
||
type RegisteredModelAlias struct { | ||
Alias string | ||
Version string | ||
} | ||
|
||
func (t RegisteredModelAlias) ToProto() *protos.RegisteredModelAlias { | ||
return &protos.RegisteredModelAlias{ | ||
Alias: utils.PtrTo(t.Alias), | ||
Version: utils.PtrTo(t.Version), | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
pkg/model_registry/store/sql/models/registered_model_aliases.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
package models | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/mlflow/mlflow-go/pkg/entities" | ||
) | ||
|
||
// RegisteredModelAlias mapped from table <registered_model_aliases>. | ||
type RegisteredModelAlias struct { | ||
Name string `db:"name" gorm:"column:name;primaryKey"` | ||
Alias string `db:"alias" gorm:"column:alias;primaryKey"` | ||
Version int32 `db:"version" gorm:"column:version;not null"` | ||
Name string `db:"name" gorm:"column:name;primaryKey"` | ||
} | ||
|
||
func (a RegisteredModelAlias) ToEntity() *entities.RegisteredModelAlias { | ||
return &entities.RegisteredModelAlias{ | ||
Alias: a.Alias, | ||
Version: strconv.Itoa(int(a.Version)), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.