agent

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentHomeStateRoot added in v1.20.0

func AgentHomeStateRoot(origin, contextName, workspaceID string) (string, error)

AgentHomeStateRoot derives the agent home from a workspace origin created by a container-side agent invocation.

func CanonicalStateRoot added in v1.20.0

func CanonicalStateRoot(origin, contextName, workspaceID string) (string, error)

CanonicalStateRoot derives the canonical data root from a persisted workspace origin while validating every structural component.

func DiagnosticsReaderIdentity added in v1.20.0

func DiagnosticsReaderIdentity() machinediagnostics.ReaderIdentity

DiagnosticsReaderIdentity captures the invoking user before systemd starts the daemon as root. SUDO_UID/GID identify the original user on sudo paths.

func GetEncodedWorkspaceDaemonConfig

func GetEncodedWorkspaceDaemonConfig(
	platformOptions devsy.PlatformOptions,
	workspaceConfig *provider2.Workspace,
	substitutionContext *config.SubstitutionContext,
	mergedConfig *config.MergedDevContainerConfig,
) (string, error)

func InstallDaemon

func InstallDaemon(
	opts InstallOptions,
) error

func RemoveDaemon

func RemoveDaemon() error

func RunProcessReaper

func RunProcessReaper(ctx context.Context)

RunProcessReaper reaps zombie child processes until ctx is cancelled. This is needed when running as PID 1 (e.g. in a container).

Types

type DaemonConfig

type DaemonConfig struct {
	Platform       devsy.PlatformOptions `json:"platform"`
	Ssh            SshConfig             `json:"ssh"`
	Timeout        string                `json:"timeout"`
	ShutdownAction string                `json:"shutdownAction,omitempty"`
}

func BuildWorkspaceDaemonConfig

func BuildWorkspaceDaemonConfig(
	platformOptions devsy.PlatformOptions,
	workspaceConfig *provider2.Workspace,
	substitutionContext *config.SubstitutionContext,
	mergedConfig *config.MergedDevContainerConfig,
) (*DaemonConfig, error)

type InstallOptions added in v1.20.0

type InstallOptions struct {
	StateLocation     StateLocation
	Interval          string
	ShutdownAction    string
	DiagnosticsReader machinediagnostics.ReaderIdentity
}

type ResolveStateLocationOptions added in v1.20.0

type ResolveStateLocationOptions struct {
	AgentDataPath string
	Origin        string
	Context       string
	WorkspaceID   string
}

type SshConfig

type SshConfig struct {
	Workdir string `json:"workdir,omitempty"`
	User    string `json:"user,omitempty"`
}

type StateLayout added in v1.20.0

type StateLayout string

StateLayout describes how machine workspace state is stored beneath Root.

const (
	StateLayoutCanonical StateLayout = "canonical"
	StateLayoutAgentHome StateLayout = "agent-home"
)

type StateLocation added in v1.20.0

type StateLocation struct {
	Root   string
	Layout StateLayout
}

StateLocation identifies the workspace state that an inactivity daemon owns.

func ResolveStateLocation added in v1.20.0

func ResolveStateLocation(opts ResolveStateLocationOptions) (StateLocation, error)

ResolveStateLocation captures the persisted state root at installation time, before the daemon is started by systemd under a potentially different user.

func (StateLocation) Validate added in v1.20.0

func (l StateLocation) Validate() error

func (StateLocation) WorkspaceConfigPattern added in v1.20.0

func (l StateLocation) WorkspaceConfigPattern() (string, error)

Jump to

Keyboard shortcuts

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