Skip to content

fix(cli): bound Blazegraph Docker logs - #2086

Open
branarakic-agent wants to merge 5 commits into
mainfrom
codex/blazegraph-4gb-log-rotation
Open

fix(cli): bound Blazegraph Docker logs#2086
branarakic-agent wants to merge 5 commits into
mainfrom
codex/blazegraph-4gb-log-rotation

Conversation

@branarakic-agent

Copy link
Copy Markdown

Summary

  • persist DKG-managed Blazegraph journals in a per-container named volume
  • use the compressed Docker local log driver with a 4 GB budget (200m × 20 files)
  • document the defaults and cover the generated docker run arguments

Why

The mainnet fleet accumulated unbounded json-file logs as large as 72 GB per Blazegraph container. Explicit per-container rotation keeps behavior independent of Docker daemon defaults, while the named volume makes journal data durable across container recreation.

Validation

  • focused Blazegraph provisioner suite: 19/19 tests passed
  • full CLI dependency graph build: passed (17 workspace packages, Node 24)
  • git diff --check: passed

Operational note

This changes newly provisioned containers. Existing mainnet containers were migrated separately with byte-size/ownership verification and health checks.

Comment thread packages/cli/test/blazegraph-docker.test.ts Outdated
Comment thread packages/cli/src/daemon/blazegraph-docker.ts Outdated
Comment thread packages/cli/test/blazegraph-docker.test.ts Outdated
Comment thread packages/cli/src/daemon/blazegraph-docker.ts Outdated
Comment thread blazegraph-image.json
Comment thread README.md
function formatBlazegraphImageMetadata(metadata) {
const parsed = parseBlazegraphImageMetadata(metadata);
return `${parsed.image}\t${parsed.containerPort}`;
return `${parsed.image}\t${parsed.containerPort}\t${parsed.dataPath}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Issue: Avoid growing the metadata contract as positional TSV

What's wrong
The underlying contract is JSON, but the shared helper flattens it into an order-dependent tab string. Adding dataPath exposes the fragility: unrelated consumers must change simply because the tuple gained a field. This makes the contract harder to evolve and hides which component actually depends on which metadata.

Example
The devnet path needs image and containerPort, while CI needs image, containerPort, and dataPath. With the current tuple ABI, adding a future field like logDriver forces every shell consumer to know the new position even if it does not use the field.

Suggested direction
Keep the metadata boundary structured. Either emit JSON for shell consumers to parse, or add an explicit field-selection mode so callers request image, containerPort, or dataPath directly instead of unpacking a positional tuple.

For Agents
Update packages/cli/blazegraph-image-metadata.cjs and the shell consumers. Preserve validation and current metadata values. Prefer JSON output or explicit field selection, then update scripts/devnet.sh, scripts/ci/verify-blazegraph-image-contract.sh, and metadata tests to prove each consumer reads only the fields it owns.

exit 1
fi

curl -fsS --max-time 10 -X POST \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Issue: Do not add another copy of the namespace XML contract

What's wrong
This diff adds a third place that knows the exact Blazegraph namespace XML. The PR is already centralizing image/container metadata, so duplicating the namespace contract in the new persistence check goes the opposite direction and increases drift risk.

Example
If the namespace policy changes, for example textIndex, axiomsClass, or quads, the CLI template can be updated while this CI persistence contract continues creating namespaces with the old XML. The persistence check would still pass while no longer matching the production namespace shape.

Suggested direction
Move namespace XML generation into a shared scriptable helper, or expose it from the existing CommonJS metadata helper, then have CI and any shell path call that instead of carrying their own copy.

For Agents
In scripts/ci/verify-blazegraph-image-contract.sh, preserve the persistence restart check but source the namespace XML from one canonical helper. A small CommonJS helper callable from shell is likely the cleanest place because the existing metadata parser is already used by both CI and devnet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants