chore(docker): refactor docker-compose topologies with Hubble - #3149
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3149 +/- ##
============================================
+ Coverage 32.69% 37.76% +5.07%
- Complexity 5517 6551 +1034
============================================
Files 789 800 +11
Lines 67750 68929 +1179
Branches 8955 9157 +202
============================================
+ Hits 22151 26034 +3883
+ Misses 42987 39838 -3149
- Partials 2612 3057 +445 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
imbajin
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: The Compose add-on has a false-green authentication check and operational failover and attachment gaps that can make a healthy-looking deployment unusable. Evidence: exact-head static review across six independent lanes; docker-entrypoint.sh:93-98 requires a 32-byte token, Hubble LiveOperationsCollector uses one pd.server, and the add-on has no data volume.
imbajin
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: The cluster quickstart currently fails after generating its own credentials, and the Hubble add-on mounts the H2 database outside the path used by Hubble; additional deployment and CI gaps can leave a false-green or state-inconsistent setup. Evidence: exact-head static review across six independent lanes plus Docker Compose render and guard checks; live container startup was unavailable.
imbajin
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: Four previously reported deployment blockers remain on this head: incompatible cached images can leave authentication false-green, PD/Store control-plane ports remain exposed without real authentication, PD-registered Server URLs are not resolvable outside Docker DNS, and CI remains render-only. Evidence: exact head 950f645; 21 GitHub checks passed; fresh Docker Compose render, credential guard, topology, and dotenv-parser checks passed locally; six independent review lanes were unavailable because the local review gateway repeatedly failed.
|
Pushed
The cluster also goes back to being authenticated by default, per your point that this is the file people copy. Running without auth is now an explicit opt-in, Tested on a clean Docker host, from zero images: 9/9 healthy, 401/200 on all three replicas, ports on loopback, three PD peers and three Stores Up, Hubble attached without recreating a single cluster container, H2 state surviving recreation across both flows, and the non-auth path returning 200 with no credentials anywhere in the container environment. Testing caught three bugs that rendering never would have, one of them a half-authenticated cluster where only |
bitflicker64
left a comment
There was a problem hiding this comment.
Reviewed the Compose files, the CI additions, and the docs end to end, and ran the render
checks and several of the README shell blocks locally.
The shape of this is good: an add-on file rather than a forked topology, an external
network so attach never recreates the cluster, and readiness that proves authentication
instead of trusting a tag. The CI render checks are unusually thorough.
I think it needs another pass before merge. Most of what I found is in the seams around
that core: teardown and the non-auth flow leave the operator without a working path, two
documented overrides cannot work as described, and one paragraph promises a safety net
across three files that only one of them has. Details inline.
One thing that has no inline anchor: the Healthcheck Endpoints table further down (Server
row) still says GET /versions -> 200 OK. The cluster Server healthcheck is now the
401/200 pair, so that row needs a separate touch; it sits outside the diff.
Minor, take or leave: the combined render's jq is a 21-clause conjunction that fails with
a bare exit 1 naming no clause, while the same function already has named-error helpers
(assert_guard, assert_props); and the token_fixture length check guards a literal
two lines above it, so it can only fire if someone edits that literal.
|
Fixed in 9616037, verified against a real cluster. The advertised-address point is the important one and you were right: Also fixed: healthcheck no longer pins to the seeded password (401-only, so password rotation cannot brick readiness), Hubble volumes are external so |
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The documented no-credentials attach flow still requires external Hubble volumes to exist in advance. Evidence: exact-head review of the Compose file and README; the attach path is actionable but approval is withheld because the required independent lanes were unavailable and a latest-head CI job is failing.
|
Pushed
Everything above was verified by running it, not by reading. On the current head: ten containers healthy, 401 unauthenticated and 200 authenticated on all three replicas, wrong password 401, three PD peers and three Stores One note on CI: |
|
@imbajin one open question before this is mergeable, on the PD-registered Server addresses. The inline thread is marked outdated (the lines it pointed at are gone), so raising it here where it is visible: #3149 (comment) Your ask was a configurable advertised address, or an external client path that resolves. I could not do either from Compose: So, which way do you want it closed? A. Accept it as a documented limitation. External clients use the published Server ports; PD discovery stays correct for anything on B. I open a Server issue for a real advertised-address option and link it here. I lean A for this PR, since B is a Server change that would hold up the add-on. Happy to file B regardless if you want it tracked. |
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The documented Hubble no-auth flow does not disable Hubble's own API authentication, and the pull-policy and volume-management instructions need correction. Evidence: exact-head static review of the Hubble configuration and README; Compose configuration rendering passed; latest ordinary CI completed with only the non-blocking codecov/project failure; required independent review lane evidence is incomplete.
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The Compose contract, the credential setup block, the non-auth override and the Hubble properties files hold up under reading — the .env parser reads values as data rather than sourcing them, the !reset blocks are spelled out per service for the reason given, the external network and volumes are created in every documented flow, and the render assertions tie the mounted properties files back to the rendered model; the two problems left are both in the new CI, where the smoke-test gate does not gate on push builds and the no-recreation assertion is placed where it cannot fail. Evidence: read of .github/workflows/server-ci.yml (:3-9 triggers, :50 fetch-depth, :143-386 render checks, :390-402 change gate, :404-502 smoke test), docker/docker-compose-3pd-3store-3server.yml, docker/docker-compose-hubble.yml, docker/docker-compose-3x3.non-auth.yml, both hugegraph-hubble-3x3 properties files and docker/README.md at d2a12bc; gh -R apache/hugegraph pr checks 3149 (all green except non-blocking codecov/project).
- run one RocksDB Server with Hubble by default - persist Server and Hubble data in named volumes - configure Hubble for direct Server discovery
- add a one PD, one Store, one Server topology - keep Hubble in the same Compose project - reduce the developer file to build overrides
- register all Server replicas through PD - share authentication settings across Server replicas - add focused render and auth-on smoke validation
- lead with the standalone topology - document authentication and persistence lifecycle - explain HStore development and focused validation
2399ee4 to
5fd400b
Compare
- bind Hubble to host loopback by default - fail fast while generating the JWT secret - add repeatable local auth-off smoke checks
- assert HStore backend and PD peers for every replica - verify the shared Store REST target - clarify first-start administrator password behavior
imbajin
left a comment
There was a problem hiding this comment.
Blocking: yes. Compose render contracts and CI pass, but five current-head deployment gaps can prevent Hubble startup, expose an unauthenticated API, or make HA and upgrade behavior unsafe. These need explicit configuration or migration coverage before merge.
- require a shared token secret for authenticated HA servers - cover HA auth-on and auth-off entrypoint behavior - bound Compose smoke requests with curl timeouts
bitflicker64
left a comment
There was a problem hiding this comment.
Reviewed at a02886c6. Mostly a simplification pass, framed as questions rather than requests: I rendered the Compose files and mutation-tested test-compose.sh to check each one, but you know the intent better than I do, so please confirm whether these actually hold.
Two are not simplifications and should be read first:
- The three per-server
healthcheckoverrides added to the HA file drop the anchor'sinterval,timeout,retriesandstart_period, because YAML merge keys are shallow.up -d --waiton HA can fail as a result, and deleting the overrides is both the fix and the smaller diff. - In the new hstore file, Server, PD and Store publish to
0.0.0.0while Hubble alone is loopback-gated.
The rest are ordinary laziness: the Hubble healthcheck collapses from 6 lines to 1 in all three files, the README repeats its lifecycle commands three times and hand rolls a render loop that test-compose.sh render already does better, and the .env block carries two lines that set -eu covers. Call it 100 lines on a PR that is already net negative.
One item is a correction rather than a finding. I expected to argue that the jq render contracts are change detectors, mutation testing said otherwise, and the details are in the comment on test-compose.sh.
- inherit complete health timing for every HA server - assert the rendered HA timing and HStore cluster - use the deterministic auth-on render command in docs
imbajin
left a comment
There was a problem hiding this comment.
submit a new issue for the individual hstore test error
|
The latest HStore failure is independent of this Compose PR: the exact base/master SHA and multiple other master SHAs fail the same |
Picks up apache#3159 (321ba4d), the REST API adaptation for Hubble and the k8s-mode enhancements that the pending confirmation pass depends on, along with apache#3140, apache#3153, apache#3173, apache#3171, apache#3177, apache#3176, apache#3178 and apache#3149. No conflicts, and no change to helm/.
apache/hugegraph#3149 reworked the docker directory and turned docker/docker-compose.dev.yml into a thin build overlay for the HStore topology. That file no longer defines environment, networks or ports on its own, so starting it alone leaves pd and store unconfigured: hg-pd | ERROR: missing required env 'HG_PD_GRPC_HOST' hg-store | ERROR: missing required env 'HG_STORE_PD_ADDRESS' Both containers exit immediately and the strict-mode job fails at "Start compose stack with local images". The scheduled latest publish has failed on master every night since that change landed. Use docker/docker-compose-hstore.yml as the base topology and layer the dev file on top when both are present. Source revisions that still ship a self-contained dev file keep working through the existing fallback. Ported from e2e52c0 on the topling-runtime-variant branch of hugegraph#28, without the hunk for the restart-persistence step, which does not exist on master. Co-authored-by: dark <jin@apache.org>
Brings the nine commits helm-dev was behind: apache#3140, apache#3149, apache#3159, apache#3171, apache#3173, apache#3176, apache#3177, apache#3178 and apache#3182. The three conflicts were early copies of apache#3159 and apache#3171 already carried on this branch (docker-build-ci.yml, Dockerfile-hstore, ApiVersion.java) and resolve to the master side, so the tree now differs from master only in the chart, its CI workflow, the README pointer to it and the tgz excludes.
What changed
Hubble is now a normal service in each supported Docker Compose topology.
The administrator password is the only authentication switch:
The redesign also:
HUBBLE_IMAGE;auth.enabledconfiguration.Validation
Local runtime validation used only the current published
latestimages./versions200; Graph API 401/200; Hubble detected authenticated mode and login succeeded; RocksDB and Hubble state survived recreation.ANONYMOUS/NON_AUTH.ANONYMOUS/NON_AUTH.Chrome UI acceptance
The non-HA matrix was also tested through the real Hubble UI in Chrome:
adminloginadminlogin through PD modeEach case used fresh Compose projects and volumes. The built-in “人物与软件 Demo 图” importer created the data, and Hubble's Gremlin JSON view read it back.
Focused checks passed locally:
bash docker/test-compose.sh renderbash docker/test-compose.sh smokebash docker/test-compose.sh smoke-auth-offdocker run --rm -v "$PWD:/src" -w /src ubuntu:24.04 bash hugegraph-server/hugegraph-dist/docker/docker-entrypoint-test.shshellcheck docker/test-compose.sh hugegraph-server/hugegraph-dist/docker/docker-entrypoint{,-test}.shactionlint -ignore 'SC2086' .github/workflows/server-ci.ymlgit diff --checkmvn editorconfig:check apache-rat:check -ntp -DskipTestsDefault PR CI renders all three topologies and runs real auth-on smoke tests for standalone and minimal HStore. It does not start HA or add an auth-off matrix. The previous head completed with all required checks green; CI for the latest review-fix commit is running.
Independent review
Five read-only review lanes covered the complete diff: two global reviews, Compose/auth/config, CI/tests/docs, and one adversarial review.
STORE_REST, the HStore backend, and all three PD peers for every Server replica..envdoes not rotate an existing administrator password.Scope
This PR intentionally does not redesign control-plane exposure, external PD-aware client addressing, image publication, or HA failover. Approval and merge are outside the validation scope.