From ed80b5b023cc3c3bf1832231de840d2af66e0e46 Mon Sep 17 00:00:00 2001 From: anonpenguin23 Date: Tue, 11 Nov 2025 06:14:05 +0200 Subject: [PATCH] feat: implement resource validation checks for production deployment - Added a new ResourceChecker type to validate system resources including disk space, RAM, and CPU cores. - Implemented CheckDiskSpace, CheckRAM, and CheckCPU methods to ensure minimum requirements are met for production deployment. - Integrated resource checks into the ProductionSetup's Phase1CheckPrerequisites method to enhance deployment reliability. - Updated systemd service generation to log output to specific log files instead of the journal for better log management. --- CHANGELOG.md | 13 +++++++++++++ Makefile | 2 +- README.md | 4 ++-- pkg/config/validate.go | 7 +------ pkg/config/validate_test.go | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 977276f..b9f697b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,19 @@ The format is based on [Keep a Changelog][keepachangelog] and adheres to [Semant ### Deprecated ### Fixed +## [0.66.1] - 2025-11-11 + +### Added +\n +### Changed +- Allow bootstrap nodes to optionally define a join address to synchronize with another bootstrap cluster. + +### Deprecated + +### Removed + +### Fixed +\n ## [0.66.0] - 2025-11-11 ### Added diff --git a/Makefile b/Makefile index 3b2c48c..6eec37b 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ test-e2e: .PHONY: build clean test run-node run-node2 run-node3 run-example deps tidy fmt vet lint clear-ports install-hooks kill -VERSION := 0.66.0 +VERSION := 0.66.1 COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ) LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)' diff --git a/README.md b/README.md index 6bb7bf0..9738c4f 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Use `make dev` for the complete stack or run binaries individually with `go run All runtime configuration lives in `~/.debros/`. -- `bootstrap.yaml`: `type: bootstrap`, blank `database.rqlite_join_address` +- `bootstrap.yaml`: `type: bootstrap`, optionally set `database.rqlite_join_address` to join another bootstrap's cluster - `node*.yaml`: `type: node`, set `database.rqlite_join_address` (e.g. `localhost:7001`) and include the bootstrap `discovery.bootstrap_peers` - `gateway.yaml`: configure `gateway.bootstrap_peers`, `gateway.namespace`, and optional auth flags @@ -75,7 +75,7 @@ Validation reminders: - HTTP and Raft ports must differ - Non-bootstrap nodes require a join address and bootstrap peers -- Bootstrap nodes cannot define a join address +- Bootstrap nodes can optionally define a join address to synchronize with another bootstrap - Multiaddrs must end with `/p2p/` Regenerate configs any time with `./bin/dbn config init --force`. diff --git a/pkg/config/validate.go b/pkg/config/validate.go index 68408ea..d8c33e6 100644 --- a/pkg/config/validate.go +++ b/pkg/config/validate.go @@ -493,12 +493,7 @@ func (c *Config) validateCrossFields() []error { } // Cross-check rqlite_join_address vs node type - if c.Node.Type == "bootstrap" && c.Database.RQLiteJoinAddress != "" { - errs = append(errs, ValidationError{ - Path: "database.rqlite_join_address", - Message: "must be empty for bootstrap node type", - }) - } + // Note: Bootstrap nodes can optionally join another bootstrap's cluster if c.Node.Type == "node" && c.Database.RQLiteJoinAddress == "" { errs = append(errs, ValidationError{ diff --git a/pkg/config/validate_test.go b/pkg/config/validate_test.go index 79a829f..38b989f 100644 --- a/pkg/config/validate_test.go +++ b/pkg/config/validate_test.go @@ -183,7 +183,7 @@ func TestValidateRQLiteJoinAddress(t *testing.T) { }{ {"node with join", "node", "localhost:5001", false}, {"node without join", "node", "", true}, - {"bootstrap with join", "bootstrap", "localhost:5001", true}, + {"bootstrap with join", "bootstrap", "localhost:5001", false}, {"bootstrap without join", "bootstrap", "", false}, {"invalid join format", "node", "localhost", true}, {"invalid join port", "node", "localhost:99999", true},