Extend worker capabilities with new execution plugins and security features: - Jupyter plugin for notebook-based ML experiments - vLLM plugin for LLM inference workloads - Cross-platform process isolation (Unix/Windows) - Network policy enforcement with platform-specific implementations - Service manager integration for lifecycle management - Scheduler backend integration for queue coordination Update lifecycle management: - Enhanced runloop with state transitions - Service manager integration for plugin coordination - Improved state persistence and recovery Add test coverage: - Unit tests for Jupyter and vLLM plugins - Updated worker execution tests
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package process
|
|
|
|
import "fmt"
|
|
|
|
// applyResourceLimits is a no-op on Windows as rlimits are Unix-specific.
|
|
// Windows uses Job Objects for process limits, which is more complex.
|
|
func applyResourceLimits(cfg IsolationConfig) error {
|
|
// Windows doesn't support setrlimit - would need Job Objects
|
|
// For now, log that limits are not enforced on Windows
|
|
if cfg.MaxOpenFiles > 0 || cfg.MaxProcesses > 0 {
|
|
// Process limits not implemented on Windows yet
|
|
// TODO: Use Windows Job Objects for process limits
|
|
return fmt.Errorf("process isolation limits not implemented on Windows (max_open_files=%d, max_processes=%d)",
|
|
cfg.MaxOpenFiles, cfg.MaxProcesses)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// disableSwap is a no-op on Windows
|
|
func disableSwap() error {
|
|
// Windows doesn't support mlockall
|
|
// Would need VirtualLock API
|
|
return nil
|
|
}
|
|
|
|
// GetCurrentLimits returns empty limits on Windows
|
|
func GetCurrentLimits() (map[string]uint64, error) {
|
|
limits := make(map[string]uint64)
|
|
getPlatformLimits(limits)
|
|
return limits, nil
|
|
}
|
|
|
|
// getPlatformLimits adds Windows-specific limits (none currently)
|
|
func getPlatformLimits(limits map[string]uint64) {
|
|
// Windows doesn't have rlimit equivalent for these
|
|
// Could use GetProcessWorkingSetSize for memory limits
|
|
limits["WINDOWS"] = 1 // Marker to indicate Windows platform
|
|
}
|