merlin

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Method   string
	Endpoint string
	Status   int
	Msg      string
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, params ClientParams) (Client, error)

func (Client) ModelVersion

func (c Client) ModelVersion(ctx context.Context, modelID, versionID int64) (ModelVersion, error)

func (Client) Models

func (c Client) Models(ctx context.Context, projectID int64) ([]Model, error)

func (Client) Projects

func (c Client) Projects(ctx context.Context) ([]Project, error)

type ClientParams

type ClientParams struct {
	BaseURL            string
	ServiceAccountJSON []byte
	Timeout            time.Duration
}

type EnvVar

type EnvVar struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Label

type Label struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Model

type Model struct {
	ID                 int64           `json:"id"`
	ProjectID          int64           `json:"project_id"`
	MlflowExperimentID int64           `json:"mlflow_experiment_id"`
	Name               string          `json:"name"`
	Type               string          `json:"type"`
	MlflowURL          string          `json:"mlflow_url"`
	Endpoints          []ModelEndpoint `json:"endpoints"`
	CreatedAt          time.Time       `json:"created_at"`
	UpdatedAt          time.Time       `json:"updated_at"`
}

type ModelEndpoint

type ModelEndpoint struct {
	ID              int64             `json:"id"`
	Status          string            `json:"status"` // pending/running/serving/failed/terminated
	URL             string            `json:"url"`
	Rule            ModelEndpointRule `json:"rule"`
	EnvironmentName string            `json:"environment_name"`
	CreatedAt       time.Time         `json:"created_at"`
	UpdatedAt       time.Time         `json:"updated_at"`
}

type ModelEndpointRule

type ModelEndpointRule struct {
	Destinations []ModelEndpointRuleDestination `json:"destinations"`
}

type ModelEndpointRuleDestination

type ModelEndpointRuleDestination struct {
	VersionEndpointID string           `json:"version_endpoint_id"`
	VersionEndpoint   *VersionEndpoint `json:"version_endpoint"`
	Weight            int64            `json:"weight"`
}

type ModelVersion

type ModelVersion struct {
	ID          int64             `json:"id"`
	ModelD      int64             `json:"model_id"`
	MlflowRunID string            `json:"mlflow_run_id"`
	MlflowURL   string            `json:"mlflow_url"`
	Endpoints   []VersionEndpoint `json:"endpoints"`
	Labels      map[string]string `json:"labels"`
	CreatedAt   time.Time         `json:"created_at"`
	UpdatedAt   time.Time         `json:"updated_at"`
}

type Project

type Project struct {
	ID                int64    `json:"id"`
	Name              string   `json:"name"`
	MlflowTrackingURL string   `json:"mlflow_tracking_url"`
	Administrators    []string `json:"administrators"` // List of emails
	Readers           []string `json:"readers"`
	Team              string   `json:"team"`
	Stream            string   `json:"stream"`
	Labels            []Label  `json:"labels"`
	CreatedAt         string   `json:"created_at"`
	UpdatedAt         string   `json:"updated_at"`
}

type Transformer

type Transformer struct {
	Enabled         bool      `json:"enabled"`
	TransformerType string    `json:"transformer_type"`
	Image           string    `json:"image"`
	Command         string    `json:"command"`
	Args            string    `json:"args"`
	EnvVars         []EnvVar  `json:"env_vars"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

type VersionEndpoint

type VersionEndpoint struct {
	ID              string      `json:"id"`
	VersionID       int64       `json:"version_id"`
	Status          string      `json:"status"` // pending/running/serving/failed/terminated
	URL             string      `json:"url"`
	ServiceName     string      `json:"service_name"`
	EnvironmentName string      `json:"environment_name"`
	MonitoringURL   string      `json:"monitoring_url"`
	Message         string      `json:"message"`
	EnvVars         []EnvVar    `json:"env_vars"`
	Transformer     Transformer `json:"transformer"`
	DeploymentMode  string      `json:"deployment_mode"` // serverless/raw_deployment
	CreatedAt       time.Time   `json:"created_at"`
	UpdatedAt       time.Time   `json:"updated_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL