provisionerdserver

package
v0.12.7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertWorkspaceResource

func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.UUID, transition database.WorkspaceTransition, protoResource *sdkproto.Resource, snapshot *telemetry.Snapshot) error

func ProvisionerJobLogsNotifyChannel

func ProvisionerJobLogsNotifyChannel(jobID uuid.UUID) string

ProvisionerJobLogsNotifyChannel is the PostgreSQL NOTIFY channel to publish updates to job logs on.

Types

type ProvisionerJobLogsNotifyMessage

type ProvisionerJobLogsNotifyMessage struct {
	CreatedAfter int64 `json:"created_after"`
	EndOfLogs    bool  `json:"end_of_logs,omitempty"`
}

ProvisionerJobLogsNotifyMessage is the payload published on the provisioner job logs notify channel.

type Server

type Server struct {
	AccessURL      *url.URL
	ID             uuid.UUID
	Logger         slog.Logger
	Provisioners   []database.ProvisionerType
	Database       database.Store
	Pubsub         database.Pubsub
	Telemetry      telemetry.Reporter
	QuotaCommitter *atomic.Pointer[proto.QuotaCommitter]

	AcquireJobDebounce time.Duration
}

func (*Server) AcquireJob

func (server *Server) AcquireJob(ctx context.Context, _ *proto.Empty) (*proto.AcquiredJob, error)

AcquireJob queries the database to lock a job.

func (*Server) CommitQuota added in v0.12.7

func (server *Server) CommitQuota(ctx context.Context, request *proto.CommitQuotaRequest) (*proto.CommitQuotaResponse, error)

func (*Server) CompleteJob

func (server *Server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) (*proto.Empty, error)

CompleteJob is triggered by a provision daemon to mark a provisioner job as completed.

func (*Server) FailJob

func (server *Server) FailJob(ctx context.Context, failJob *proto.FailedJob) (*proto.Empty, error)

func (*Server) UpdateJob

func (server *Server) UpdateJob(ctx context.Context, request *proto.UpdateJobRequest) (*proto.UpdateJobResponse, error)

type TemplateVersionDryRunJob

type TemplateVersionDryRunJob struct {
	TemplateVersionID uuid.UUID                 `json:"template_version_id"`
	WorkspaceName     string                    `json:"workspace_name"`
	ParameterValues   []database.ParameterValue `json:"parameter_values"`
}

TemplateVersionDryRunJob is the payload for the "template_version_dry_run" job type.

type WorkspaceProvisionJob

type WorkspaceProvisionJob struct {
	WorkspaceBuildID uuid.UUID `json:"workspace_build_id"`
	DryRun           bool      `json:"dry_run"`
}

WorkspaceProvisionJob is the payload for the "workspace_provision" job type.

Jump to

Keyboard shortcuts

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