coordinator: stamp build version/commit into /health via ldflags#486
coordinator: stamp build version/commit into /health via ldflags#486ethenotethan wants to merge 2 commits into
Conversation
The live coordinator /health reported build=dev / commit=unknown, so the running binary could not be traced to a git SHA (DAR-371, d-inference#485). Cloud Build already tags images with $SHORT_SHA but never threaded it into the binary. Inject api.BuildVersion/BuildCommit/BuildDate and telemetry.CoordinatorVersion via -ldflags -X: - coordinator/Dockerfile: GIT_COMMIT/GIT_VERSION build args (default unknown/dev) stamped into go build; BuildDate set to image build time. - deploy/gcp/cloudbuild.yaml: pass --build-arg GIT_COMMIT/GIT_VERSION=$SHORT_SHA. - Makefile: stamp the same ldflags from git for local/manual linux builds. Same Dockerfile is used by EigenCloud prod, so both dev and prod /health become traceable. Closes #485
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No threat-model-covered files were changed; these are build/deploy infrastructure changes that fall outside current threat model coverage. Trust boundaries touchedNone of the three changed files map to any existing TB-xxx boundary. Threat assessmentNo existing T-xxx threats are affected. New attack surface to evaluateThe changed files warrant a brief human review for two reasons that sit just outside the current threat model's explicit scope:
Suggested threat model updateIf GCP Cloud Build is now part of the production deployment path for the coordinator, consider adding 🔐 Threat model: |
|
@codex - give this a review |
ethenotethan
left a comment
There was a problem hiding this comment.
Automated Code Review — Layr-Labs/d-inference#
Verdict: COMMENT
Security — ✅ No issues found
Performance — ✅ No issues found
Type_diligence — ✅ No issues found
Additive_complexity — ✅ No issues found
✅ All four passes clean. No issues found.
🤖 Automated review by Centaur · DAR-186
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68e26437f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ARG GIT_COMMIT=unknown | ||
| ARG GIT_VERSION=dev |
There was a problem hiding this comment.
Stamp EigenCloud builds instead of defaults
The documented prod deploy path is ecloud compute app deploy d-inference against coordinator/Dockerfile (see docs/operations/coordinator-deploy.md:60-63), and it does not go through deploy/gcp/cloudbuild.yaml, the only place this PR supplies --build-arg. In that EigenCloud context these ARG defaults are what get used, so prod /health still reports version=dev and build_commit=unknown; either derive the values inside the Docker build or add build-arg wiring to the EigenCloud deploy path.
Useful? React with 👍 / 👎.
Problem
The live coordinator at
api.darkbloom.dev/healthreportedbuild=dev/commit=unknownfor 4 consecutive days (2026-06-26 → 06-29), so the running binary could not be traced to a git tag/SHA — a release-traceability and incident-triage gap. (DAR-371, closes #485)Cloud Build (
deploy/gcp/cloudbuild.yaml) already tags images with$SHORT_SHA, but that SHA was never threaded into the binary's version string, so theapi.Build*vars kept theirdev/unknowndefaults.Fix
Inject the build metadata via
-ldflags -Xat build time:coordinator/Dockerfile— newGIT_COMMIT/GIT_VERSIONbuild args (defaultunknown/devso plaindocker buildstill works) stamped intogo build;BuildDateset to image build time. Stamps bothcoordinator/api.{BuildVersion,BuildCommit,BuildDate}andcoordinator/telemetry.CoordinatorVersion.deploy/gcp/cloudbuild.yaml— pass--build-arg GIT_COMMIT=$SHORT_SHAand--build-arg GIT_VERSION=$SHORT_SHAto the docker build step.Makefile— stamp the same ldflags fromgitfor local/manualcoordinator-buildandcoordinator-build-linux.The same
coordinator/Dockerfileis the image EigenCloud prod uses, so both the GCP dev VM and EigenCloud prod/healthbecome traceable.Verification
Compiled the coordinator with the ldflags (go 1.25) — build succeeds;
go tool nmconfirms all four symbols are stamped and the short SHA is embedded in the binary:After this lands and redeploys,
GET /healthreturns the realversion/build_commit/build_dateinstead ofdev/unknown.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.