Documentation ¶
Index ¶
- type FirecrackerProcessManager
- func (f *FirecrackerProcessManager) EnterLameDuck() error
- func (f *FirecrackerProcessManager) ListProcesses() ([]ProcessInfo, error)
- func (f *FirecrackerProcessManager) PrepareWorkload(workloadId string, deployRequest *agentapi.AgentWorkloadInfo) error
- func (f *FirecrackerProcessManager) Start(delegate ProcessDelegate) error
- func (f *FirecrackerProcessManager) Stop() error
- func (f *FirecrackerProcessManager) StopProcess(workloadID string) error
- type ProcessDelegate
- type ProcessInfo
- type ProcessManager
- type SpawningProcessManager
- func (s *SpawningProcessManager) EnterLameDuck() error
- func (s *SpawningProcessManager) ListProcesses() ([]ProcessInfo, error)
- func (s *SpawningProcessManager) PrepareWorkload(workloadID string, deployRequest *agentapi.AgentWorkloadInfo) error
- func (s *SpawningProcessManager) Start(delegate ProcessDelegate) error
- func (s *SpawningProcessManager) Stop() error
- func (s *SpawningProcessManager) StopProcess(workloadID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirecrackerProcessManager ¶
type FirecrackerProcessManager struct {
// contains filtered or unexported fields
}
func NewFirecrackerProcessManager ¶
func NewFirecrackerProcessManager( intnats *internalnats.InternalNatsServer, log *slog.Logger, config *models.NodeConfiguration, telemetry *observability.Telemetry, ctx context.Context, ) (*FirecrackerProcessManager, error)
func (*FirecrackerProcessManager) EnterLameDuck ¶
func (f *FirecrackerProcessManager) EnterLameDuck() error
func (*FirecrackerProcessManager) ListProcesses ¶
func (f *FirecrackerProcessManager) ListProcesses() ([]ProcessInfo, error)
func (*FirecrackerProcessManager) PrepareWorkload ¶
func (f *FirecrackerProcessManager) PrepareWorkload(workloadId string, deployRequest *agentapi.AgentWorkloadInfo) error
Preparing a workload reads from the warmVMs channel
func (*FirecrackerProcessManager) Start ¶
func (f *FirecrackerProcessManager) Start(delegate ProcessDelegate) error
func (*FirecrackerProcessManager) Stop ¶
func (f *FirecrackerProcessManager) Stop() error
func (*FirecrackerProcessManager) StopProcess ¶
func (f *FirecrackerProcessManager) StopProcess(workloadID string) error
type ProcessDelegate ¶
type ProcessDelegate interface { // Indicates that an agent process with the given id has been started and is ready for workload deployment OnProcessStarted(id string) }
A process delegate is any struct that wishes to be notified when the configured agent process manager has successfully started an agent
type ProcessInfo ¶
type ProcessInfo struct { DeployRequest *agentapi.AgentWorkloadInfo ID string Name string Namespace string }
Information about an agent process without regard to the implementation of the agent process manager
type ProcessManager ¶
type ProcessManager interface { // Returns a list of agent processes in an implementation-agnostic format ListProcesses() ([]ProcessInfo, error) // Associate a deploy request with the given workload id, and perform any // just in time initialization of resources if necessary PrepareWorkload(id string, request *agentapi.AgentWorkloadInfo) error // Start the process manager and allocate a pool of agents based on an implementation-specific // strategy, delegating callbacks to the given delegate Start(delegate ProcessDelegate) error // Stop the process manager and gracefully shutdown all agents in the pool Stop() error // Terminate a running agent process with the given ID StopProcess(id string) error // Notifies the process manager that the node is in lame duck mode, so that the processes // can be treated differerently (if applicable) EnterLameDuck() error }
A process manager is responsible for stopping and starting a Nex Agent. It is entirely up to the implementation of the process manager as to whether or to what degree any kind of sandboxing (e.g. firecracker) is employed. Note that agent processes are created asynchronously -before- any workloads are deployed to them, so a workload manager can never explicitly tell a process manager to create an individual process
func NewProcessManager ¶
func NewProcessManager( intNats *internalnats.InternalNatsServer, log *slog.Logger, config *models.NodeConfiguration, telemetry *observability.Telemetry, ctx context.Context, ) (ProcessManager, error)
Initialize an appropriate agent process manager instance based on the sandbox config value
type SpawningProcessManager ¶
type SpawningProcessManager struct {
// contains filtered or unexported fields
}
A process manager that controls the creation and deletion of `nex-agent` processes, directly spawned as children of the nex node
func NewSpawningProcessManager ¶
func NewSpawningProcessManager( intNats *internalnats.InternalNatsServer, log *slog.Logger, config *models.NodeConfiguration, telemetry *observability.Telemetry, ctx context.Context, ) (*SpawningProcessManager, error)
func (*SpawningProcessManager) EnterLameDuck ¶
func (s *SpawningProcessManager) EnterLameDuck() error
func (*SpawningProcessManager) ListProcesses ¶
func (s *SpawningProcessManager) ListProcesses() ([]ProcessInfo, error)
Returns the list of processes that have been associated with a workload via deploy request
func (*SpawningProcessManager) PrepareWorkload ¶
func (s *SpawningProcessManager) PrepareWorkload(workloadID string, deployRequest *agentapi.AgentWorkloadInfo) error
Attaches a deployment request to a running process. Until a process is prepared, it's just an empty agent
func (*SpawningProcessManager) Start ¶
func (s *SpawningProcessManager) Start(delegate ProcessDelegate) error
Starts the process manager and creates the spawn loop for agent instances in the pool
func (*SpawningProcessManager) Stop ¶
func (s *SpawningProcessManager) Stop() error
Stops the entire process manager. Called by the workload manager, typically via signal capture
func (*SpawningProcessManager) StopProcess ¶
func (s *SpawningProcessManager) StopProcess(workloadID string) error
Stops a single agent process