-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Gordon v3 - Sub-Container Architecture with gRPC #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
aef6727
88c2b6c
3a38991
0db1fa1
e93e50f
772fe76
ce3fb44
731d3cf
1bb7020
84c36c3
a849688
2f3dd93
63a78cd
9ffb5c6
e78561e
c8f03cf
a21dd16
8ec872c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,10 +1,10 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This Makefile is used for dev purposes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Variables | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| REPO := ghcr.io/bnema/gordon | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TAG := v2-dev | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEV_TAG := v2-dev-$(shell date +%Y%m%d-%H%M%S) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TAG := v3-dev | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEV_TAG := v3-dev-$(shell date +%Y%m%d-%H%M%S) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DIST_DIR := ./dist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENGINE := podman | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENGINE ?= podman | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Version information | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VERSION := $(shell git describe --tags --always --dirty) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -22,7 +22,8 @@ ARCHS := amd64 arm64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Phony targets | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .PHONY: all build build-push clean dev-release \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test test-short test-race test-coverage \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test test-short test-race test-coverage test-integration test-integration-quick \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-integration-build test-integration-clean \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| lint fmt check mocks clean-test help | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Default target | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -46,6 +47,11 @@ mocks: ## Generate mocks using mockery | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @mockery | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Mocks generated successfully" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| proto: ## Generate Go code from protobuf definitions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Generating protobuf code..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @buf generate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Protobuf code generated successfully" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check: lint test ## Run lint and tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ##@ Testing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -77,6 +83,31 @@ test-usecase: ## Run usecase layer tests only | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-adapter: ## Run adapter layer tests only | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @go test -v ./internal/adapters/... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-integration-clean: ## Clean up leftover test containers from previous runs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Cleaning up test containers..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @-docker stop gordon-core-test gordon-secrets gordon-registry gordon-proxy 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @-docker rm -f gordon-core-test gordon-secrets gordon-registry gordon-proxy 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @-docker network rm gordon-internal 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @-docker network rm -f testcontainers 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @-docker network prune -f 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @-docker ps -a --filter "label=gordon.component" --format "{{.ID}}" | xargs -r docker rm -f 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Cleanup complete" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-integration-build: build-local ## Build Gordon test image for integration tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Building Gordon test image..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @docker build -t gordon:v3-test . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Test image built: gordon:v3-test" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-integration: test-integration-clean test-integration-build ## Run integration tests (max 10min) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Running integration tests..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @docker pull ghcr.io/bnema/go-hello-world-http:latest || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @go test -v -timeout 10m ./tests/integration/... 2>&1 | tee test-integration.log | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Integration tests complete. Log: test-integration.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-integration-quick: test-integration-clean test-integration-build ## Run quick integration tests (startup + gRPC only, ~3min) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "Running quick integration tests..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @go test -v -timeout 5m -run "Test01|Test02" ./tests/integration/... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+86
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: git ls-files | grep -i makefileRepository: bnema/gordon Length of output: 64 🏁 Script executed: cat -n Makefile | head -150Repository: bnema/gordon Length of output: 6160 Integration targets hardcode The Replace all Diff test-integration-clean: ## Clean up leftover test containers from previous runs
`@echo` "Cleaning up test containers..."
- `@-docker` stop gordon-core-test gordon-secrets gordon-registry gordon-proxy 2>/dev/null || true
- `@-docker` rm -f gordon-core-test gordon-secrets gordon-registry gordon-proxy 2>/dev/null || true
- `@-docker` network rm gordon-internal 2>/dev/null || true
- `@-docker` network rm -f testcontainers 2>/dev/null || true
- `@-docker` network prune -f 2>/dev/null || true
- `@-docker` ps -a --filter "label=gordon.component" --format "{{.ID}}" | xargs -r docker rm -f 2>/dev/null || true
+ `@-`$(ENGINE) stop gordon-core-test gordon-secrets gordon-registry gordon-proxy 2>/dev/null || true
+ `@-`$(ENGINE) rm -f gordon-core-test gordon-secrets gordon-registry gordon-proxy 2>/dev/null || true
+ `@-`$(ENGINE) network rm gordon-internal 2>/dev/null || true
+ `@-`$(ENGINE) network rm -f testcontainers 2>/dev/null || true
+ `@-`$(ENGINE) network prune -f 2>/dev/null || true
+ `@-`$(ENGINE) ps -a --filter "label=gordon.component" --format "{{.ID}}" | xargs -r $(ENGINE) rm -f 2>/dev/null || true
`@echo` "Cleanup complete"
test-integration-build: build-local ## Build Gordon test image for integration tests
`@echo` "Building Gordon test image..."
- `@docker` build -t gordon:v3-test .
+ @$(ENGINE) build -t gordon:v3-test .
`@echo` "Test image built: gordon:v3-test"
test-integration: test-integration-clean test-integration-build ## Run integration tests (max 10min)
`@echo` "Running integration tests..."
- `@docker` pull ghcr.io/bnema/go-hello-world-http:latest || true
+ @$(ENGINE) pull ghcr.io/bnema/go-hello-world-http:latest || true
`@go` test -v -timeout 10m ./tests/integration/... 2>&1 | tee test-integration.log📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ##@ Build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: ## Build binaries for linux (amd64 and arm64) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: v2 | ||
|
|
||
| managed: | ||
| enabled: true | ||
| override: | ||
| - file_option: go_package | ||
| value: github.com/bnema/gordon/internal/grpc | ||
|
|
||
| plugins: | ||
| - remote: buf.build/protocolbuffers/go:v1.36.4 | ||
| out: internal/grpc | ||
| opt: | ||
| - paths=import | ||
|
|
||
| - remote: buf.build/grpc/go:v1.5.1 | ||
| out: internal/grpc | ||
| opt: | ||
| - paths=import | ||
| - require_unimplemented_servers=false | ||
|
Comment on lines
+9
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: As of February 1, 2026, the latest upstream Go Protobuf release (the So, on Buf Schema Registry:
Sources: [1] [2] 🌐 Web query:
💡 Result: As of February 1, 2026, the latest Buf Schema Registry (BSR) remote plugin for generating gRPC-Go stubs is referenced as:
Buf’s docs note that if you omit the version, Buf will use the latest plugin version automatically. [1] If you want to pin the plugin version, the most recent upstream
The gRPC-Go library itself shows a newer overall release tag:
Typical version: v2
plugins:
- remote: buf.build/protocolbuffers/go
out: gen/go
opt: paths=source_relative
- remote: buf.build/grpc/go
out: gen/go
opt: paths=source_relative[1] Pinned form (example): - remote: buf.build/grpc/go:v1.6.0
out: gen/go
opt: paths=source_relative(version number based on the latest Sources: [1] [2] Update plugin versions to latest stable releases. The configuration uses 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| version: v2 | ||
|
|
||
| modules: | ||
| - path: api/proto | ||
| name: buf.build/bnema/gordon | ||
|
|
||
| deps: | ||
| - buf.build/googleapis/googleapis | ||
|
|
||
| lint: | ||
| use: | ||
| - DEFAULT | ||
| except: | ||
| - PACKAGE_VERSION_SUFFIX | ||
|
|
||
| breaking: | ||
| use: | ||
| - FILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
grpc-health-probe alpine linux apk package💡 Result:
grpc-health-probe(thegrpc_health_probebinary fromgrpc-ecosystem/grpc-health-probe) is not packaged as an official Alpineapk(there’s nogrpc-health-probeentry in Alpine’s package index; the closest similarly-named package isgrpc-health-check, which is a different project). [1]Recommended options on Alpine:
grpc_health_probe-linux-amd64,...-arm64, etc. [2]Example (amd64):
apk add --no-cache wget ca-certificates VER=v0.4.24 wget -qO /usr/local/bin/grpc_health_probe \ https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/$VER/grpc_health_probe-linux-amd64 chmod +x /usr/local/bin/grpc_health_probe(This is the project’s documented “install from source” path.) [2]
Note: If you specifically meant an Alpine
apkfor something that does gRPC health checks, Alpine does havegrpc-health-checkinedge/testing, but it is notgrpc-health-probe. [1]Sources: Alpine package index (
grpc-health-check) [1];grpc-health-probeupstream install/release info [2].[1] (pkgs.alpinelinux.org)
[2] (github.com)
Citations:
🏁 Script executed:
Repository: bnema/gordon
Length of output: 616
🌐 Web query:
grpc-health-probe github releases download binary latest version💡 Result:
Latest grpc-health-probe release on GitHub is v0.4.42 (published 2025-11-12). [1]
Download the latest binary (direct URL pattern)
Binaries are published as release assets named like:
grpc_health_probe-<os>-<arch>Direct download URL pattern:
Examples:
The release also includes a
checksums.txtasset for verifying downloads. [1]If you just want the “latest” release page (to pick your OS/arch asset), it’s here: Releases → v0.4.42. [1]
Sources: GitHub Releases page for grpc-ecosystem/grpc-health-probe. [1]
🏁 Script executed:
cat -n Dockerfile | head -60Repository: bnema/gordon
Length of output: 1888
Fix build break:
grpc-health-probeisn't in Alpine repos.CI reports
apk addfailing because the package doesn't exist. Download the binary instead (and respect multi-arch).🛠️ Suggested fix (download grpc-health-probe binary)
RUN apk add --no-cache \ ca-certificates \ docker-cli \ curl \ wget \ tzdata \ pass \ - gnupg \ - grpc-health-probe \ + gnupg \ && rm -rf /var/cache/apk/* + +ARG GRPC_HEALTH_PROBE_VERSION=v0.4.42 +ARG TARGETARCH +RUN wget -qO /usr/local/bin/grpc_health_probe \ + "https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH}" \ + && chmod +x /usr/local/bin/grpc_health_probe📝 Committable suggestion
🧰 Tools
🪛 GitHub Actions: CI
[error] 39-39: Docker build failed: APK package 'grpc-health-probe' not found. Command in Dockerfile RUN apk add --no-cache ca-certificates docker-cli curl wget tzdata pass gnupg grpc-health-probe failed with exit code 1.
🪛 Hadolint (2.14.0)
[warning] 39-39: Pin versions in apk add. Instead of
apk add <package>useapk add <package>=<version>(DL3018)
🤖 Prompt for AI Agents