Documentation
¶
Overview ¶
Package deploymentpg stores the sandbox deployment, its retained generations and its nodes in PostgreSQL. It seals the deployment's provider credential with the Core credential key, bound to the installation and generation.
Index ¶
- type Execution
- func (e *Execution) ClearWake(ctx context.Context, allocationID string, observed time.Time) error
- func (e *Execution) ReleaseInactivePlacements(ctx context.Context) error
- func (e *Execution) WithAllocation(ctx context.Context, key deployment.AllocationKey, ...) error
- func (e *Execution) WithAllocationCleanup(ctx context.Context, key deployment.AllocationKey, ...) error
- func (e *Execution) WithDeployment(ctx context.Context, apply func(deployment.DeploymentTx) error) error
- func (e *Execution) WithReservation(ctx context.Context, key deployment.AllocationKey, ...) error
- func (e *Execution) WithResetEnvironment(ctx context.Context, key deployment.AllocationKey, ...) error
- func (e *Execution) WithSessionArchive(ctx context.Context, tenantID, sessionID string, ...) error
- type Store
- func (s *Store) Activity(ctx context.Context, allocationID string) (deployment.Activity, error)
- func (s *Store) AddressBindings(ctx context.Context, publicURL string) (deployment.AddressBindings, error)
- func (s *Store) Allocation(ctx context.Context, ref sandbox.Reference) (deployment.AllocationRecord, error)
- func (s *Store) ConnectNode(ctx context.Context, nodeID, connectionID string, epoch uint64) (bool, error)
- func (s *Store) CredentialAllocations(ctx context.Context, after string) ([]deployment.Allocation, error)
- func (s *Store) Deployment(ctx context.Context) (deployment.Record, error)
- func (s *Store) DisconnectNode(ctx context.Context, nodeID, connectionID string, epoch uint64) error
- func (s *Store) EnvironmentAllocation(ctx context.Context, key deployment.AllocationKey) (deployment.Allocation, error)
- func (s *Store) Generations(ctx context.Context, after int64) ([]deployment.GenerationRecord, error)
- func (s *Store) LifecycleAllocations(ctx context.Context, nodeID, after string) ([]deployment.Allocation, error)
- func (s *Store) LifecycleNodes(ctx context.Context) ([]string, error)
- func (s *Store) LifecyclePlacement(ctx context.Context, key deployment.AllocationKey) (deployment.LifecyclePlacement, error)
- func (s *Store) NodeAllocations(ctx context.Context, nodeID string) ([]deployment.NodeAllocation, error)
- func (s *Store) NodeHistory(ctx context.Context, nodeID string, window coremetrics.Range) (deployment.NodeRecord, []deployment.HostHistoryPoint, error)
- func (s *Store) NodeOnline(ctx context.Context, nodeID string) (bool, error)
- func (s *Store) Nodes(ctx context.Context) ([]deployment.NodeRecord, error)
- func (s *Store) ObservationSessions(ctx context.Context, after string, limit int) (deployment.ObservationSessionPage, error)
- func (s *Store) OwnerEpoch(ctx context.Context) (uint64, error)
- func (s *Store) PlacementDemand(ctx context.Context, after deployment.PlacementDemandCursor) ([]deployment.PlacementDemand, deployment.PlacementDemandCursor, error)
- func (s *Store) ReadNodes(ctx context.Context, apply func(deployment.NodeReads) error) error
- func (s *Store) ResetSessions(ctx context.Context, after string, force bool) ([]deployment.ResetSession, error)
- func (s *Store) RetainedNativeHistory(ctx context.Context, key deployment.AllocationKey) (bool, error)
- func (s *Store) SampleHostHistory(ctx context.Context) (int64, error)
- func (s *Store) Snapshot(ctx context.Context) (deployment.Snapshot, error)
- func (s *Store) UnallocatedEnvironments(ctx context.Context, nodeID, after string) ([]deployment.UnallocatedEnvironment, error)
- func (s *Store) WithActivity(ctx context.Context, key deployment.AllocationKey, ...) error
- func (s *Store) WithNodes(ctx context.Context, apply func(deployment.NodeTx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Execution ¶
type Execution struct {
// contains filtered or unexported fields
}
Execution is the deployment storage of the execution owner: every transaction runs on the connection that holds the execution lease.
func NewExecution ¶
func NewExecution(lease *pgunit.Lease, cipher *credentialcrypto.Cipher) *Execution
NewExecution binds deployment changes to the execution lease.
func (*Execution) ReleaseInactivePlacements ¶ added in v0.0.14
func (*Execution) WithAllocation ¶
func (e *Execution) WithAllocation(ctx context.Context, key deployment.AllocationKey, apply func(deployment.AllocationTx) error) error
func (*Execution) WithAllocationCleanup ¶
func (e *Execution) WithAllocationCleanup(ctx context.Context, key deployment.AllocationKey, apply func(deployment.AllocationCleanupTx) error) error
func (*Execution) WithDeployment ¶
func (e *Execution) WithDeployment(ctx context.Context, apply func(deployment.DeploymentTx) error) error
func (*Execution) WithReservation ¶
func (e *Execution) WithReservation(ctx context.Context, key deployment.AllocationKey, apply func(sessions.LockedSession, deployment.ReservationTx) error) error
func (*Execution) WithResetEnvironment ¶ added in v0.0.14
func (e *Execution) WithResetEnvironment(ctx context.Context, key deployment.AllocationKey, apply func(deployment.ResetEnvironmentTx) error) error
func (*Execution) WithSessionArchive ¶ added in v0.0.10
func (e *Execution) WithSessionArchive(ctx context.Context, tenantID, sessionID string, apply func(context.Context, sessions.LockedSession, deployment.SessionArchiveTx) error) error
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the deployment storage and reader on pooled connections. It grants no execution authority.
func New ¶
func New(pool *pgunit.Pool, cipher *credentialcrypto.Cipher) *Store
New returns the deployment store, which seals the provider credential with cipher.
func (*Store) AddressBindings ¶
func (s *Store) AddressBindings(ctx context.Context, publicURL string) (deployment.AddressBindings, error)
func (*Store) Allocation ¶
func (s *Store) Allocation(ctx context.Context, ref sandbox.Reference) (deployment.AllocationRecord, error)
func (*Store) ConnectNode ¶
func (*Store) CredentialAllocations ¶
func (s *Store) CredentialAllocations(ctx context.Context, after string) ([]deployment.Allocation, error)
func (*Store) Deployment ¶
Deployment bounds its read by the execution deadline: the execution owner reads the setup through it before provider work.
func (*Store) DisconnectNode ¶
func (*Store) EnvironmentAllocation ¶
func (s *Store) EnvironmentAllocation(ctx context.Context, key deployment.AllocationKey) (deployment.Allocation, error)
func (*Store) Generations ¶
func (s *Store) Generations(ctx context.Context, after int64) ([]deployment.GenerationRecord, error)
func (*Store) LifecycleAllocations ¶
func (s *Store) LifecycleAllocations(ctx context.Context, nodeID, after string) ([]deployment.Allocation, error)
func (*Store) LifecycleNodes ¶
func (*Store) LifecyclePlacement ¶
func (s *Store) LifecyclePlacement(ctx context.Context, key deployment.AllocationKey) (deployment.LifecyclePlacement, error)
func (*Store) NodeAllocations ¶
func (s *Store) NodeAllocations(ctx context.Context, nodeID string) ([]deployment.NodeAllocation, error)
func (*Store) NodeHistory ¶
func (s *Store) NodeHistory(ctx context.Context, nodeID string, window coremetrics.Range) (deployment.NodeRecord, []deployment.HostHistoryPoint, error)
func (*Store) NodeOnline ¶
func (*Store) Nodes ¶
func (s *Store) Nodes(ctx context.Context) ([]deployment.NodeRecord, error)
func (*Store) ObservationSessions ¶
func (s *Store) ObservationSessions(ctx context.Context, after string, limit int) (deployment.ObservationSessionPage, error)
func (*Store) PlacementDemand ¶ added in v0.0.10
func (s *Store) PlacementDemand(ctx context.Context, after deployment.PlacementDemandCursor) ([]deployment.PlacementDemand, deployment.PlacementDemandCursor, error)
func (*Store) ResetSessions ¶
func (s *Store) ResetSessions(ctx context.Context, after string, force bool) ([]deployment.ResetSession, error)
func (*Store) RetainedNativeHistory ¶ added in v0.0.10
func (s *Store) RetainedNativeHistory(ctx context.Context, key deployment.AllocationKey) (bool, error)
func (*Store) SampleHostHistory ¶
func (*Store) UnallocatedEnvironments ¶
func (s *Store) UnallocatedEnvironments(ctx context.Context, nodeID, after string) ([]deployment.UnallocatedEnvironment, error)
func (*Store) WithActivity ¶
func (s *Store) WithActivity(ctx context.Context, key deployment.AllocationKey, apply func(sessions.LockedSession, deployment.ActivityTx) error) error