# Packages
No description provided by the author
# Functions
ActiveLogPolicies returns log pattern policies for an experiment ID.
AddAllocation upserts the existence of an allocation.
AddAllocationExitStatus adds the allocation exit status to the allocations table.
AddCheckpointMetadata persists metadata for a completed checkpoint to the database.
AddExperiment adds the experiment to the database and sets its ID.
AddExperimentTx adds the experiment to the database and sets its ID.
AddJob persists the existence of a job.
AddJobTx persists the existence of a job with a transaction.
AddNonExperimentTasksContextDirectory adds a context directory for a non experiment task.
AddProjectHparams adds project hyperparams from provided runs to provided project.
AddRPWorkspaceBindings inserts new bindings between workspaceIds and poolName.
AddTask UPSERT's the existence of a task.
AddTaskTx UPSERT's the existence of a task in a tx.
AddTrial adds the trial to the database and sets its ID.
AllocationByID retrieves an allocation by its ID.
ApplyDoubleFieldFilter applies filtering on a bun query for double field.
ApplyInt32FieldFilter applies filtering on a bun query for int32 field.
ApplyPolymorphicFilter applies filtering on a bun query for a polymorphic filter.
ApplyTimestampFieldFilter applies filtering on a bun query for timestamp field.
BuildRunHParams builds hyperparameters objects to add into the `run_hparams` & `project_hparams` table.
Bun returns the singleton database connection through the bun library.
BunSelectMetricGroupNames sets up a bun select query for getting all the metric group and names.
BunSelectMetricsQuery sets up a bun select query for based on new metrics table simplifying some weirdness we set up for pg10 support.
CheckIfRPUnbound checks to make sure the specified resource pools is not bound to any workspace and returns an error if it is.
ClearClusterMessage clears the active cluster message.
CloseOpenAllocations finds all allocations that were open when the master crashed and adds an end time.
CompleteAllocation persists the end of an allocation lifetime.
CompleteAllocationTelemetry returns the analytics of an allocation for the telemetry.
CompleteGenericTask persists the completion of a task of type GENERIC.
CompleteTask persists the completion of a task.
Connect connects to the database, but doesn't run migrations & inits.
ConnectPostgres connects to a Postgres database.
DeleteAllocationSession deletes the task session with the given AllocationID.
DeleteDispatch deletes the specified dispatch and returns the number deleted.
DeleteDispatches deletes all dispatches for the specified query and returns the number deleted.
DeleteNotebookSessionByTask deletes the notebook session associated with the task.
DispatchByID retrieves a dispatch by its ID.
DoesPermissionMatch checks for the existence of a permission in a workspace.
DoesPermissionMatchAll checks for the existence of a permission in all specified workspaces.
DoPermissionsExist checks for the existence of a permission in any workspace.
EndAgentStats updates the end time of an instance.
EndAllTaskStats called at master starts, in case master previously crashed.
ExperimentBestSearcherValidation returns the best searcher validation for an experiment.
ExperimentByExternalIDTx looks up an experiment by a given external experiment id.
ExperimentByID looks up an experiment by ID in a database, returning an error if none exists.
ExperimentByTaskID looks up an experiment by a given taskID, returning an error if none exists.
ExperimentByTrialID looks up an experiment by a given trialID, returning an error if none exists.
ExperimentIDsToWorkspaceIDs returns a slice of workspaces that the given experiments belong to.
ExperimentNumSteps returns the total number of steps for all trials of the experiment.
ExperimentsByTrialID looks up an experiment by a given list of trialIDs, returning an error if none exists.
ExperimentsTrialAndTaskIDs returns the trial and task IDs for one or more experiments.
ExperimentTotalStepTime returns the total elapsed time for all allocations of the experiment with the given ID.
GenerateNotebookSessionToken generates a token for a notebook session.
GetActiveClusterMessage returns the active cluster message if one is set and active, or ErrNotFound if not.
GetAllBindings gets all valid rp-workspace bindings.
GetCheckpoint gets checkpointv1.Checkpoint from the database by UUID.
GetClusterMessage returns the cluster message even if it's not yet active, or ErrNotFound if all cluster messages have expired.
GetDefaultPoolsForWorkspace returns the default compute and aux pools for a workspace.
GetMetrics returns a subset metrics of the requested type for the given trial ID.
GetNonGlobalWorkspacesWithPermission returns all workspaces the user has permissionID on.
GetNonTerminalExperimentCount returns the number of non terminal experiments.
GetRunMetadata returns the metadata of a run from the database.
GetTokenKeys returns tokenKeys.
GetTrialProfilerAvailableSeries returns all available system profiling metric names.
GetUnboundRPs get unbound resource pools.
HackAddUser is used to prevent an import cycle in postgres_test_utils & postgres_scim (EE).
InitAuthKeys initializes auth token keypairs.
InsertDispatch persists the existence for a dispatch.
InsertModel inserts the model into the database.
InsertModelVersion inserts the model version into the database.
IsPaused returns true if given task is in paused/pausing state.
JobByID retrieves a job by ID.
KillGenericTask persists the termination of a task of type GENERIC.
ListAllDispatches lists all dispatches in the DB.
ListDispatches lists all dispatches according to the options provided.
ListDispatchesByAllocationID lists all dispatches for an allocation ID.
ListDispatchesByJobID returns a list of dispatches associated with the specified job.
MatchSentinelError checks if the error belongs to specific families of errors and ensures that the returned error has the proper type and text.
MetricBatches returns the milestones (in batches processed) at which a specific metric was recorded.
MustHaveAffectedRows checks if bun has affected rows in a table or not.
NonExperimentTasksContextDirectory returns a non experiment's context directory.
OrderByToSQL computes the SQL keyword corresponding to the given ordering type.
OverwriteRPWorkspaceBindings overwrites the bindings between workspaceIds and poolName.
PaginateBun adds sorting and pagination to the provided bun query, defaulting to certain values if they are not specified.
PaginateBunUnsafe is a version of PaginateBun that allows an arbitrary order expression like `metrics->>'loss'`.
ParseMapToProto converts sqlx/bun-scanned map to a proto object.
ProjectExperiments returns a list of experiments within a project.
ReadRPsAvailableToWorkspace returns the names of resource pools available to a workspace.
ReadWorkspacesBoundToRP get the bindings between workspaceIds and the requested resource pool.
RecordTaskEndStats record end stats for tasks.
RecordTaskStats record stats for tasks.
RegisterModel registers a model in Bun or, if theOneBun is not yet initialized, sets it up to be registered once initialized.
RemoveOutdatedProjectHparams removes outdated project hyperparams from provided project.
RemoveRPWorkspaceBindings removes the bindings between workspaceIds and poolName.
SetClause returns a SET subquery.
SetClusterMessage sets the cluster-wide message.
SetErrorState sets given task to a ERROR state.
SetPausedState sets given task to a PAUSED state.
SetTokenKeys sets tokenKeys.
Setup connects to the database and run any necessary migrations.
SingleDB returns a singleton database client.
StartAllocationSession creates a row in the allocation_sessions table.
StartNotebookSession persists a new notebook session row into the database.
TaskByID returns a task by its ID.
TaskCompleted checks if the end time exists for a task, if so, the task has completed.
TopTrialsByMetric chooses the subset of trials from an experiment that recorded the best values for the specified metric at any point during the trial.
TrialByExperimentAndRequestID looks up a trial, returning an error if none exists.
TrialByID looks up a trial by ID, returning an error if none exists.
TrialByTaskID looks up a trial by taskID, returning an error if none exists.
TrialIDsToWorkspaceIDs returns a slice of workspaces that the given trials belong to.
TrialTaskIDsByTrialID returns trial id task ids by trial ID, sorted by start time.
UpdateAllocationPorts stores the latest task state and readiness.
UpdateAllocationProxyAddress stores the proxy address.
UpdateAllocationStartTime stores the latest start time.
UpdateAllocationState stores the latest task state and readiness.
UpdateCheckpointSizeTx which updates checkpoint size and count to experiment and trial, is duplicated here.
UpdateRunMetadata updates the metadata of a run, including the metadata indexes.
UpdateTrial updates the state of an existing trial.
UpsertTrialByExternalIDTx UPSERTs the trial with respect to the external_trial_id.
ValidateDoubleFieldFilterComparison validates the min and max values in the range.
ValidateInt32FieldFilterComparison validates the min and max values in the range.
ValidatePolymorphicFilter ensures that a Polymorphic filter contains at most one valid range.
ValidateTimeStampFieldFilterComparison validates the min and max timestamps in the range.
# Constants
ClusterMessageMaxLength caps the length of a cluster-wide message.
CodeForeignKeyViolation is the error code that Postgres uses to indicate that an attempted insert/update violates a foreign key constraint.
CodeSerializationFailure is the error code that Postgres uses to indicate that a transaction failed due to a serialization failure.
CodeUniqueViolation is the error code that Postgres uses to indicate that an attempted insert/update violates a uniqueness constraint.
GenericMetric designates metrics from other sources.
InfPostgresString how we store infinity in JSONB in postgres.
MetricTypeArray is the summary metric type for array types.
MetricTypeBool is the summary metric type for boolean.
MetricTypeDate is the summary metric type for date metrics.
MetricTypeNull is the summary metric type for array types.
MetricTypeNumber is the summary metric type for floats or ints.
MetricTypeObject is the summary metric type for object types.
MetricTypeString is the summary metric type for string or mixed types.
NaNPostgresString how we store NaN in JSONB in postgres.
NegInfPostgresString how we store -infinity in JSONB in postgres.
ProfilingMetric designates metrics from profiling steps.
SortDirectionAsc represents ordering by ascending.
SortDirectionAscNullsFirst represents ordering by ascending with nulls first.
SortDirectionDesc represents ordering by descending.
SortDirectionDescNullsLast represents ordering by descending with nulls last.
TrainingMetric designates metrics from training steps.
ValidationMetric designates metrics from validation steps.
# Variables
ErrDeleteDefaultBinding is returned when trying to delete a workspace bound to its default namespace.
ErrDuplicateRecord is returned when trying to create a row that already exists.
ErrInvalidInput is returned when the data passed to a function is invalid for semantic or syntactic reasons.
ErrNotFound is returned if nothing is found.
ErrTooManyRowsAffected is returned if too many rows are affected.
# Structs
ClientStore is a store for OAuth clients.
Dispatch is the Determined-persisted representation for dispatch existence.
FilterComparison makes you wish for properties in generic structs/interfaces.
MetricMeasurements represents a metric measured by all possible independent variables.
PgDB represents a Postgres database connection.
RPWorkspaceBinding is a struct reflecting the db table rp_workspace_bindings.
StaticQueryMap caches static sql files.
TokenStore is a store for OAuth tokens.
# Interfaces
DB is an interface for _all_ the functionality packed into the DB.
# Type aliases
MetricPartitionType denotes what type the metric is.
SortDirection represents the order by in a query.