Development
Setup
Clone Repository
Prerequisites
- Go: 1.26.4
- GoReleaser: For building packages (install from goreleaser.com)
- For ARM64 cross-compilation (optional):
gcc-aarch64-linux-gnuandg++-aarch64-linux-gnu
Build
Project Structure
Building Packages
Packages are built using GoReleaser, which handles .deb, .rpm, and tarball creation automatically.
Install GoReleaser
Build Snapshot Packages
Build packages without a git tag (for testing):
This creates in the dist/ directory:
.debpackages for Debian/Ubuntu (amd64, arm64).rpmpackages for RHEL/Rocky/AlmaLinux 8, 9, 10 (x86_64, aarch64)- Binary tarballs for direct installation
- Checksums and metadata
Create a Release
To create an official release, tag a version and push it to GitHub. The GitHub Actions workflow will automatically build and publish the release:
The GitHub Actions workflow will:
- Build packages for all supported platforms (amd64, arm64)
- Create
.debpackages for Ubuntu - Create
.rpmpackages for RHEL/Rocky/AlmaLinux 8, 9, 10 - Generate binary tarballs
- Publish the release with all artifacts to GitHub Releases
Testing
Run Tests with Coverage
This runs all tests and generates a coverage report in coverage/coverage.html.
Run Linting
Runs golangci-lint if installed, otherwise runs basic Go formatting and vet checks.
Format Code
Vulnerability Scanning
Scans the built binary for known vulnerabilities using govulncheck.
Manual Testing
Development Workflow
- Create a branch for your changes
- Make changes and add tests
- Run tests:
make test - Format code:
make fmt - Run linting:
make lint - Build locally:
make fleetint - Test changes manually
- Build packages (optional):
make package-snapshot - Submit PR with description of changes
Code Guidelines
- Follow standard Go conventions and idioms
- Add tests for new functionality
- Update documentation for user-facing changes
- Ensure all tests pass before submitting PRs
- Use
make fmtto format code before committing - Keep commits focused and write clear commit messages
Available Make Targets
Related Projects
- leptonai/gpud: Upstream dependency providing core monitoring functionality
Contributing
See CONTRIBUTING.md for detailed contribution guidelines.