fix(docker): restore seaweedfs-init fail-fast, interpolate its bucket - #40
Merged
Merged
Conversation
Two review findings on #38. `required: false` is not scoped to "the dependency is absent". It equally downgrades a dependency that IS present but exited non-zero: compose logs a warning, starts the dependents anyway and exits 0. Measured against a dependency that exits 1: required: false -> warning, dependents start, compose exit 0 no required: false -> error, dependents do not start, compose exit 1 Putting it in compose.yml therefore deleted the fail-fast that seaweedfs-init's `s3.bucket.list` assertion exists to provide (CHA-542) for the dev and test profiles -- a failed bucket create would let the servicers boot against a nonexistent bucket and surface later as opaque NoSuchBucket errors. #38 verified the flag on the success path (waits) and the absent path (starts clean), but never the failure path. It cannot simply be dropped: with the seaweedfs profile off, the service is not in the project and compose rejects the whole thing with `depends on undefined service "seaweedfs-init": invalid compose project`. So move the relaxation into docker/compose.s3.yml, added by penca-up only for the s3 profile. The safe behavior becomes the default and the relaxation is opt-in, scoped to the one profile that cannot have the dependency; dev, test and any raw `docker compose -f docker/compose.yml` keep the hard gate. depends_on merges per key, so the fragment relaxes seaweedfs-init while postgres, bootstrap-init and write's lifecycle dependency are untouched. Second, seaweedfs-init still hardcoded `penca` for both the create and the awk assertion while the servicers moved to ${OBJECT_STORAGE_BUCKET:-penca}. Setting that variable with the seaweedfs profile on -- or leaking it as a shell export, which outranks --env-file for interpolation -- had the gateway create one bucket while the servicers opened another, which reads as an empty table rather than an error. Interpolate the same variable in the init job so the two cannot diverge. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes both review findings on #38, which were raised after it merged.
1.
required: falsedeleted CHA-542's fail-fast (Medium)required: falseis not scoped to "the dependency is absent." It equally downgrades a dependency that is present but exited non-zero. Measured against a dependency that exits 1:required: false(as merged in #38)required: falseSo in
compose.ymlit removed the fail-fast thatseaweedfs-init'ss3.bucket.listassertion exists to provide for thedevandtestprofiles. A failed bucket create would let the servicers boot against a nonexistent bucket and surface later as opaqueNoSuchBucketerrors — exactly what that assertion was written to prevent.#38 verified the flag on the success path (waits) and the absent path (starts clean), but never the failure path, and shipped a comment asserting the failure path was still a hard gate.
It cannot just be dropped. With the
seaweedfsprofile off the service isn't in the project, and compose rejects the whole thing:Fix: move the relaxation into
docker/compose.s3.yml, layered in bypenca-uponly for thes3profile. The safe behaviour becomes the default and the relaxation is opt-in, scoped to the one profile that genuinely cannot have the dependency.dev,test, and any rawdocker compose -f docker/compose.ymlinvocation keep the hard gate.Verified
depends_onmerges per key, so the fragment relaxesseaweedfs-initwhilepostgres,bootstrap-initandwrite'slifecycledependency are untouched.2.
seaweedfs-inithardcoded the bucket name (Medium)The init job still did
s3.bucket.create -name pencaand asserted$1 == "penca"while the servicers had moved to${OBJECT_STORAGE_BUCKET:-penca}. Set that variable with theseaweedfsprofile on — or leak it as a shell export, which outranks--env-filefor interpolation — and the gateway creates one bucket while the servicers open another. That divergence reads as an empty table rather than an error, the same failure mode the anchor was introduced to eliminate.Fix: interpolate the same variable in both the create and the
awkassertion.Testing
just lint/format-check/static-testjust cargo-checkdevprofileseaweedfs-initback torequired: trues3.bucket.create -name renamed-bucket+ matching assertion$1survives interpolations3profileNo
didn't complete successfullywarnings anywhere in the suite log, confirming the restored dependency is satisfied rather than downgraded.🤖 Generated with Claude Code