Add host agent multi-platform binary distribution and improve host details UI

- Build host agent binaries for all platforms (linux/darwin/windows, amd64/arm64/armv7) in Docker
- Add Makefile target for building agent binaries locally
- Add startup validation to check for missing agent binaries
- Improve download endpoint error messages with troubleshooting guidance
- Enhance host details drawer layout with better organization and visual hierarchy
- Update base images to rolling versions (node:20-alpine, golang:1.24-alpine, alpine:3.20)
This commit is contained in:
rcourtman
2025-11-05 17:38:17 +00:00
parent 7dd7a0b0f9
commit fdf0977be2
5 changed files with 160 additions and 48 deletions
+46
View File
@@ -99,6 +99,9 @@ func runServer() {
log.Info().Msg("Starting Pulse monitoring server")
// Validate agent binaries are available for download
validateAgentBinaries()
// Create context that cancels on interrupt
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -345,3 +348,46 @@ func performAutoImport() error {
log.Info().Msg("Configuration auto-imported successfully")
return nil
}
// validateAgentBinaries checks if agent binaries are available for download
// and logs warnings if any are missing
func validateAgentBinaries() {
binDirs := []string{"/opt/pulse/bin", "./bin", "."}
platforms := []struct {
name string
file string
}{
{"linux-amd64", "pulse-host-agent-linux-amd64"},
{"linux-arm64", "pulse-host-agent-linux-arm64"},
{"linux-armv7", "pulse-host-agent-linux-armv7"},
{"darwin-amd64", "pulse-host-agent-darwin-amd64"},
{"darwin-arm64", "pulse-host-agent-darwin-arm64"},
{"windows-amd64", "pulse-host-agent-windows-amd64"},
}
missing := []string{}
searchedPaths := []string{}
for _, platform := range platforms {
found := false
for _, dir := range binDirs {
path := filepath.Join(dir, platform.file)
searchedPaths = append(searchedPaths, path)
if _, err := os.Stat(path); err == nil {
found = true
break
}
}
if !found {
missing = append(missing, platform.name)
}
}
if len(missing) > 0 {
log.Warn().
Strs("missing_platforms", missing).
Msg("Host agent binaries missing - install script downloads will fail. Rebuild Docker image or run build-release.sh to generate all platform binaries.")
} else {
log.Info().Msg("All host agent binaries available for download")
}
}