workshopstate

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// mark the last task in a taskset after which refresh becomes irreversible (i.e. the following tasks
	// will not be possible to undo, e.g. removing an old workshop copy)
	EdgeRefreshLastTaskBeforeCleanup = state.TaskSetEdge("last-before-irreversible")

	// mark the tasks that denote irreversible clean up logic for refresh (e.g.
	// removing state storage and the old workshop copy)
	EdgeRefreshFirstCleanupTask = state.TaskSetEdge("refresh-cleanup")
)

Variables

View Source
var StopLogInterval = 30 * time.Second
View Source
var StopWorkshop = (workshop.Backend).StopWorkshop

Functions

func FakeSnapshotCooldownTime

func FakeSnapshotCooldownTime(t time.Duration) (restore func())

Types

type Manifest

type Manifest struct {
	File   *workshop.File
	Format sdk.Revision
	Image  workshop.BaseImage
	Sdks   []sdk.Setup
}

Manifest lists the components needed to construct a workshop. It augments the workshop definition with specific versions of the base image and SDKs.

type WorkshopFileError

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

WorkshopFileError wraps errors related to invalid workshop definitions or file locations.

func (*WorkshopFileError) Error

func (e *WorkshopFileError) Error() string

func (*WorkshopFileError) Unwrap

func (e *WorkshopFileError) Unwrap() error

type WorkshopManager

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

func New

func New(st *state.State, runner *state.TaskRunner) *WorkshopManager

func (*WorkshopManager) Ensure

func (w *WorkshopManager) Ensure() error

func (*WorkshopManager) Exec

func (w *WorkshopManager) Exec(ctx context.Context, name, projectId string, args *workshop.ExecArgs, action bool) (*state.TaskSet, error)

func (*WorkshopManager) FormatRevision added in v0.9.3

func (w *WorkshopManager) FormatRevision() sdk.Revision

Returns the current snapshot format revision.

func (*WorkshopManager) LaunchManifests

func (w *WorkshopManager) LaunchManifests(ctx context.Context, project workshop.Project, names []string) ([]Manifest, error)

LaunchManifests reads the definitions of the given workshops and resolves the latest base image and SDKs for each of them. This information is bundled into the resulting manifests.

func (*WorkshopManager) LaunchMany

func (w *WorkshopManager) LaunchMany(ctx context.Context, project workshop.Project, manifests []Manifest) ([]*state.TaskSet, error)

func (*WorkshopManager) Project

func (w *WorkshopManager) Project(ctx context.Context, pId string) (workshop.Project, error)

Project finds an existing project with the given ID.

func (*WorkshopManager) RefreshManifests

func (w *WorkshopManager) RefreshManifests(ctx context.Context, project workshop.Project, names []string, option conflict.RefreshOption) (current, latest []Manifest, err error)

RefreshManifests reconstructs the manifests that were used to create the given workshops. For --restore, these manifests are also used to refresh the workshops. Otherwise it resolves a new manifest similar to LaunchManifests.

func (*WorkshopManager) RefreshMany

func (w *WorkshopManager) RefreshMany(ctx context.Context, project workshop.Project, current, latest []Manifest, option conflict.RefreshOption) ([]*state.TaskSet, error)

func (*WorkshopManager) Remount

func (w *WorkshopManager) Remount(ctx context.Context, st *state.State, plug sdk.PlugRef, source string) (*state.TaskSet, error)

func (*WorkshopManager) RemoveManifests

func (w *WorkshopManager) RemoveManifests(ctx context.Context, projectId string, names []string) (stashed, current []Manifest, running map[string]bool, err error)

func (*WorkshopManager) RemoveMany

func (w *WorkshopManager) RemoveMany(ctx context.Context, project workshop.Project, stashed, current []Manifest, running map[string]bool) ([]*state.TaskSet, error)

func (*WorkshopManager) StartMany

func (w *WorkshopManager) StartMany(ctx context.Context, names []string, projectId string) ([]*state.TaskSet, error)

func (*WorkshopManager) StartUp

func (m *WorkshopManager) StartUp() error

func (*WorkshopManager) StopMany

func (w *WorkshopManager) StopMany(ctx context.Context, names []string, projectId string) ([]*state.TaskSet, error)

func (*WorkshopManager) Workshop

func (w *WorkshopManager) Workshop(ctx context.Context, name, pId string) (*workshop.Workshop, error)

Loads a workshop, the state must be locked as it is used to find out the workshop state

func (*WorkshopManager) WorkshopFile

func (w *WorkshopManager) WorkshopFile(ctx context.Context, name, pId string) (*workshop.File, error)

Returns latest file for a workshop. The state must be locked, as listing projects can update project metadata.

func (*WorkshopManager) WorkshopFiles

func (w *WorkshopManager) WorkshopFiles(ctx context.Context, pId string) (map[string]string, error)

Returns all workshop files for a project. The state must be locked, as listing projects can update project metadata.

func (*WorkshopManager) Workshops

func (w *WorkshopManager) Workshops(ctx context.Context, pId string) ([]*workshop.Workshop, error)

Returns all existing workshops for a project, the state must be locked as it is used to find out the workshop state.

Jump to

Keyboard shortcuts

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