Documentation ¶
Index ¶
- Variables
- func BuildFilterTrialsQuery(filters *apiv1.TrialFilters, selectAll bool) (*bun.SelectQuery, error)
- func BuildTrialPatchQuery(payload *apiv1.TrialPatch) (*bun.UpdateQuery, error)
- func MetricsTimeSeries(trialID int32, startTime time.Time, metricName string, startBatches int, ...) (metricMeasurements []db.MetricMeasurements, err error)
- func TrialsColumnForNamespace(namespace apiv1.TrialSorter_Namespace, field string) (string, error)
- type TrialAuthZ
- type TrialAuthZBasic
- func (a *TrialAuthZBasic) AuthFilterCollectionsDeleteQuery(ctx context.Context, curUser *model.User, query *bun.DeleteQuery) (*bun.DeleteQuery, error)
- func (a *TrialAuthZBasic) AuthFilterCollectionsReadQuery(ctx context.Context, curUser *model.User, query *bun.SelectQuery) (*bun.SelectQuery, error)
- func (a *TrialAuthZBasic) AuthFilterCollectionsUpdateQuery(ctx context.Context, curUser *model.User, query *bun.UpdateQuery) (*bun.UpdateQuery, error)
- func (a *TrialAuthZBasic) AuthFilterTrialsQuery(ctx context.Context, curUser *model.User, query *bun.SelectQuery, update bool) (*bun.SelectQuery, error)
- func (a *TrialAuthZBasic) CanCreateTrialCollection(ctx context.Context, curUser *model.User, projectID int32) (canCreateTrialCollection bool, serverError error)
- type TrialsAPIServer
- func (a *TrialsAPIServer) CreateTrialsCollection(ctx context.Context, req *apiv1.CreateTrialsCollectionRequest) (*apiv1.CreateTrialsCollectionResponse, error)
- func (a *TrialsAPIServer) DeleteTrialsCollection(ctx context.Context, req *apiv1.DeleteTrialsCollectionRequest) (*apiv1.DeleteTrialsCollectionResponse, error)
- func (a *TrialsAPIServer) GetTrialsCollections(ctx context.Context, req *apiv1.GetTrialsCollectionsRequest) (*apiv1.GetTrialsCollectionsResponse, error)
- func (a *TrialsAPIServer) PatchTrialsCollection(ctx context.Context, req *apiv1.PatchTrialsCollectionRequest) (*apiv1.PatchTrialsCollectionResponse, error)
- func (a *TrialsAPIServer) QueryTrials(ctx context.Context, req *apiv1.QueryTrialsRequest) (*apiv1.QueryTrialsResponse, error)
- func (a *TrialsAPIServer) UpdateTrialTags(ctx context.Context, req *apiv1.UpdateTrialTagsRequest) (*apiv1.UpdateTrialTagsResponse, error)
- type TrialsAugmented
- type TrialsCollection
Constants ¶
This section is empty.
Variables ¶
var AuthZProvider authz.AuthZProviderType[TrialAuthZ]
AuthZProvider is the authz registry for experiments.
var QueryTrialsOrderMap = map[apiv1.OrderBy]db.SortDirection{ apiv1.OrderBy_ORDER_BY_UNSPECIFIED: db.SortDirectionAsc, apiv1.OrderBy_ORDER_BY_ASC: db.SortDirectionAsc, apiv1.OrderBy_ORDER_BY_DESC: db.SortDirectionDescNullsLast, }
QueryTrialsOrderMap is a map of OrderBy choices to Sort Choices.
Functions ¶
func BuildFilterTrialsQuery ¶
func BuildFilterTrialsQuery(filters *apiv1.TrialFilters, selectAll bool) (*bun.SelectQuery, error)
BuildFilterTrialsQuery queries for Trials matching the supplied TrialFilters.
func BuildTrialPatchQuery ¶
func BuildTrialPatchQuery(payload *apiv1.TrialPatch) (*bun.UpdateQuery, error)
BuildTrialPatchQuery creates an UpdateQuery according to the provided patch.
func MetricsTimeSeries ¶
func MetricsTimeSeries(trialID int32, startTime time.Time, metricName string, startBatches int, endBatches int, xAxisMetricLabels []string, maxDatapoints int, timeSeriesColumn string, timeSeriesFilter *commonv1.PolymorphicFilter, metricType string) ( metricMeasurements []db.MetricMeasurements, err error, )
MetricsTimeSeries returns a time-series of the specified metric in the specified trial.
func TrialsColumnForNamespace ¶
func TrialsColumnForNamespace(namespace apiv1.TrialSorter_Namespace, field string, ) (string, error)
TrialsColumnForNamespace returns the correct namespace for a TrialSorter.
Types ¶
type TrialAuthZ ¶
type TrialAuthZ interface { // POST /trial-comparison/collections CanCreateTrialCollection( ctx context.Context, curUser *model.User, projectID int32, ) (canGetCollections bool, serverError error) // POST /trial-comparison/query // POST /trial-comparison/update-trial-tags AuthFilterTrialsQuery( ctx context.Context, curUser *model.User, query *bun.SelectQuery, update bool, ) (*bun.SelectQuery, error) // GET /trial-comparison/collections AuthFilterCollectionsReadQuery( ctx context.Context, curUser *model.User, query *bun.SelectQuery, ) (*bun.SelectQuery, error) // PATCH /trial-comparison/collections AuthFilterCollectionsUpdateQuery( ctx context.Context, curUser *model.User, query *bun.UpdateQuery, ) (*bun.UpdateQuery, error) // DELETE /trial-comparison/collections AuthFilterCollectionsDeleteQuery( ctx context.Context, curUser *model.User, query *bun.DeleteQuery, ) (*bun.DeleteQuery, error) }
TrialAuthZ describes authz methods for experiments.
type TrialAuthZBasic ¶
type TrialAuthZBasic struct{}
TrialAuthZBasic is basic OSS Determined authentication.
func (*TrialAuthZBasic) AuthFilterCollectionsDeleteQuery ¶
func (a *TrialAuthZBasic) AuthFilterCollectionsDeleteQuery( ctx context.Context, curUser *model.User, query *bun.DeleteQuery, ) (*bun.DeleteQuery, error)
AuthFilterCollectionsDeleteQuery filters a trials DeleteQuery to those the user is authorized to delete.
func (*TrialAuthZBasic) AuthFilterCollectionsReadQuery ¶
func (a *TrialAuthZBasic) AuthFilterCollectionsReadQuery( ctx context.Context, curUser *model.User, query *bun.SelectQuery, ) (*bun.SelectQuery, error)
AuthFilterCollectionsReadQuery filters a trials UpdateQuery to those the user is authorized to read.
func (*TrialAuthZBasic) AuthFilterCollectionsUpdateQuery ¶
func (a *TrialAuthZBasic) AuthFilterCollectionsUpdateQuery( ctx context.Context, curUser *model.User, query *bun.UpdateQuery, ) (*bun.UpdateQuery, error)
AuthFilterCollectionsUpdateQuery filters a trials UpdateQuery to those the user is authorized to update.
func (*TrialAuthZBasic) AuthFilterTrialsQuery ¶
func (a *TrialAuthZBasic) AuthFilterTrialsQuery( ctx context.Context, curUser *model.User, query *bun.SelectQuery, update bool, ) (*bun.SelectQuery, error)
AuthFilterTrialsQuery filters a trials SelectQuery to those the user is authorized for.
func (*TrialAuthZBasic) CanCreateTrialCollection ¶
func (a *TrialAuthZBasic) CanCreateTrialCollection( ctx context.Context, curUser *model.User, projectID int32, ) (canCreateTrialCollection bool, serverError error)
CanCreateTrialCollection indicates whether a user can create a collection in a project.
type TrialsAPIServer ¶
type TrialsAPIServer struct{}
TrialsAPIServer is an embedded api server struct.
func (*TrialsAPIServer) CreateTrialsCollection ¶
func (a *TrialsAPIServer) CreateTrialsCollection( ctx context.Context, req *apiv1.CreateTrialsCollectionRequest, ) (*apiv1.CreateTrialsCollectionResponse, error)
CreateTrialsCollection creates a collection based on the provided name, filters, project, and sorter.
func (*TrialsAPIServer) DeleteTrialsCollection ¶
func (a *TrialsAPIServer) DeleteTrialsCollection( ctx context.Context, req *apiv1.DeleteTrialsCollectionRequest, ) (*apiv1.DeleteTrialsCollectionResponse, error)
DeleteTrialsCollection deletes the specified collection.
func (*TrialsAPIServer) GetTrialsCollections ¶
func (a *TrialsAPIServer) GetTrialsCollections( ctx context.Context, req *apiv1.GetTrialsCollectionsRequest, ) (*apiv1.GetTrialsCollectionsResponse, error)
GetTrialsCollections returns the list of collections for the (optionally) specified project.
func (*TrialsAPIServer) PatchTrialsCollection ¶
func (a *TrialsAPIServer) PatchTrialsCollection( ctx context.Context, req *apiv1.PatchTrialsCollectionRequest, ) (*apiv1.PatchTrialsCollectionResponse, error)
PatchTrialsCollection patches a collection based on the (optionally) provided name, filters, and sorter.
func (*TrialsAPIServer) QueryTrials ¶
func (a *TrialsAPIServer) QueryTrials(ctx context.Context, req *apiv1.QueryTrialsRequest, ) (*apiv1.QueryTrialsResponse, error)
QueryTrials returns a list of AugmentedTrials filtered according to the filters provided.
func (*TrialsAPIServer) UpdateTrialTags ¶
func (a *TrialsAPIServer) UpdateTrialTags(ctx context.Context, req *apiv1.UpdateTrialTagsRequest, ) (*apiv1.UpdateTrialTagsResponse, error)
UpdateTrialTags patches a target set of trials, specified either by a list of trial ids, or a set of filters, according to the provided patch.
type TrialsAugmented ¶
type TrialsAugmented struct { bun.BaseModel `bun:"table:trials_augmented_view,alias:trials_augmented_view"` TrialID int32 `bun:"trial_id"` State string `bun:"state"` Hparams model.JSONObj `bun:"hparams"` TrainingMetrics map[string]float64 `bun:"training_metrics,json_use_number"` ValidationMetrics map[string]float64 `bun:"validation_metrics,json_use_number"` Tags map[string]string `bun:"tags"` StartTime time.Time `bun:"start_time"` EndTime time.Time `bun:"end_time"` SearcherType string `bun:"searcher_type"` ExperimentID int32 `bun:"experiment_id"` ExperimentName string `bun:"experiment_name"` ExperimentDescription string `bun:"experiment_description"` ExperimentLabels []string `bun:"experiment_labels"` UserID int32 `bun:"user_id"` ProjectID int32 `bun:"project_id"` WorkspaceID int32 `bun:"workspace_id"` TotalBatches int32 `bun:"total_batches"` SearcherMetric string `bun:"searcher_metric"` SearcherMetricValue float64 `bun:"searcher_metric_value"` SearcherMetricLoss float64 `bun:"searcher_metric_loss"` RankWithinExp int32 `bun:"rank,scanonly"` }
TrialsAugmented shows provides information about a Trial.
func (*TrialsAugmented) Proto ¶
func (t *TrialsAugmented) Proto() *apiv1.AugmentedTrial
Proto converts an Augmented Trial to its protobuf representation.
type TrialsCollection ¶
type TrialsCollection struct { ID int32 `bun:"id,pk,autoincrement"` UserID int32 `bun:"user_id"` ProjectID int32 `bun:"project_id"` Name string `bun:"name"` Filters *apiv1.TrialFilters `bun:"filters,type:jsonb"` Sorter *apiv1.TrialSorter `bun:"sorter,type:jsonb"` }
TrialsCollection is a collection of Trials matching a set of TrialFilters.
func (*TrialsCollection) Proto ¶
func (tc *TrialsCollection) Proto() *apiv1.TrialsCollection
Proto converts TrialsCollection to proto representation.