agent

package
v1.20.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 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

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

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

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

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

type ResolveStateLocationOptions

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

type StateLayout string

StateLayout describes how machine workspace state is stored beneath Root.

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

type StateLocation

type StateLocation struct {
	Root   string
	Layout StateLayout
}

StateLocation identifies the workspace state that an inactivity daemon owns.

func ResolveStateLocation

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

func (l StateLocation) Validate() error

func (StateLocation) WorkspaceConfigPattern

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

Jump to

Keyboard shortcuts

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