Skip to content

feat(orchestrator): add AWS S3 seed objects to LocalStack init#47

Open
erenaslandev wants to merge 7 commits into
mainfrom
DT-838
Open

feat(orchestrator): add AWS S3 seed objects to LocalStack init#47
erenaslandev wants to merge 7 commits into
mainfrom
DT-838

Conversation

@erenaslandev

@erenaslandev erenaslandev commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added support for pre-seeding S3 objects in AWS/LocalStack, with per-object object/line counts, optional key prefixes, and per-line markers.
    • Docker collector can now sample metrics from multiple target containers in one run.
  • Bug Fixes
    • Strengthened seeded-object validation and made seeded backfill init output deterministic.
    • Improved correctness handling and metrics collection/persistence; refined over-delivery behavior.
    • Metrics aggregation now ignores stopped-container snapshots; receiver TCP receive-window timing and scan error logging improved.
  • Tests
    • Added/extended coverage for seeded objects, metrics aggregation, multi-container collection, receiver timestamping, and correctness scenarios.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b3bf92c9-d8b9-47a8-aa88-f366cab373f8

📥 Commits

Reviewing files that changed from the base of the PR and between ff5c920 and fb36f09.

📒 Files selected for processing (2)
  • containers/collector/main.go
  • containers/collector/main_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • containers/collector/main.go

Walkthrough

The change adds validated AWS S3 seed-object configuration and LocalStack uploads, multi-container metrics collection, receive-window tracking, correctness-flow updates, resource-metric persistence, and zero-snapshot aggregation filtering.

Changes

AWS seed objects

Layer / File(s) Summary
Seed object configuration and validation
internal/config/cloud.go, internal/config/cloud_test.go
Adds seed-object fields, validation rules, and table-driven tests.
LocalStack seed rendering
internal/orchestrator/awsinit.go, internal/orchestrator/compose_render_test.go
Generates and uploads configured S3 objects during initialization and verifies the rendered script.

Container metrics collection

Layer / File(s) Summary
Compose collector target wiring
internal/orchestrator/docker.go
Passes singular or cluster-wide container targets to the collector.
Multi-container collector aggregation
containers/collector/*
Aggregates Docker metrics across configured containers and tests row accumulation.
Receiver timestamping and scan errors
containers/receiver/*
Stamps receive windows on reads, reports scanner errors, and tests timestamp behavior.

Correctness runner flows

Layer / File(s) Summary
Dispatch and verdict policy
internal/runner/runner.go
Adds in-flight crash dispatch and updates over-delivery evaluation.
Generalized mid-delivery driver
internal/runner/runner.go
Shares mid-delivery execution and metric harvesting across correctness flows.
Object-storage crash flow
internal/runner/runner.go
Adds object-storage in-flight crash correctness execution.
Persistence and result metrics
internal/runner/runner.go
Persists harvested resource metrics across correctness paths.
Runner supporting updates
internal/runner/runner.go
Updates failure messages, helper signatures, returns, and formatting.

Metrics aggregation

Layer / File(s) Summary
Zero-snapshot aggregation filter
internal/results/compare.go, internal/results/compare_test.go
Skips CPU/memory zero snapshots while retaining idle rows and window filtering.

Estimated code review effort: 4 (Complex) | ~75 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Runner
  participant runInflightCrashCorrectness
  participant runMidDeliveryAction
  participant Subject
  participant MetricsCollector
  Runner->>runInflightCrashCorrectness: dispatch persistence in-flight crash
  runInflightCrashCorrectness->>runMidDeliveryAction: configure mid-delivery flow
  runMidDeliveryAction->>Subject: stop and restart during delivery
  runMidDeliveryAction->>MetricsCollector: harvest resource metrics
Loading

Possibly related PRs

Suggested reviewers: yusufozturk, namles

Poem

I hop through config, seeds in a row,
S3 gets objects all ready to go.
Metrics now gather from containers bright,
Crashes and windows are measured right.
Tests thump their paws with cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: adding AWS S3 seed objects to LocalStack initialization.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DT-838

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/runner/runner.go (1)

1596-1634: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Stale "Kafka" comment left over from generalization.

The renamed/generalized driver's doc block (Lines 1596-1634) is accurate, but the inline comment at Line 1762-1763 ("The generator produces to Kafka independently of the subject") is now stale — this code path is shared by the kafka cert-rotation, syslog Vault cert-rotation, and object-storage in-flight-crash flows too, none of which involve Kafka. Worth updating to avoid misleading future readers debugging a non-Kafka flow.

✏️ Suggested comment fix
-	// The generator produces to Kafka independently of the subject; collect
-	// its final count.
+	// The generator produces to the durable source independently of the
+	// subject; collect its final count.

Also applies to: 1762-1763

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/runner/runner.go` around lines 1596 - 1634, Update the stale inline
comment within runMidDeliveryAction to describe generator production
independently of the subject/source generically, rather than referring
specifically to Kafka. Keep the behavior and surrounding logic unchanged so the
comment accurately covers Kafka, syslog, and object-storage flows.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/runner/runner.go`:
- Around line 1919-1947: Update the midDeliveryFlow literal in
runInflightCrashCorrectness to provide an extraCleanup hook that force-removes
the fixed-name LocalStack, Azurite, and Azure-init containers, matching the
cleanup performed by Run(). Preserve the existing crash action and ensure
cleanup runs before services are started to prevent collisions from prior
interrupted runs.

---

Nitpick comments:
In `@internal/runner/runner.go`:
- Around line 1596-1634: Update the stale inline comment within
runMidDeliveryAction to describe generator production independently of the
subject/source generically, rather than referring specifically to Kafka. Keep
the behavior and surrounding logic unchanged so the comment accurately covers
Kafka, syslog, and object-storage flows.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ccc80bb9-f473-462f-8221-95c7f050425c

📥 Commits

Reviewing files that changed from the base of the PR and between 24f8a59 and 51126d6.

📒 Files selected for processing (5)
  • internal/config/cloud.go
  • internal/config/cloud_test.go
  • internal/orchestrator/awsinit.go
  • internal/orchestrator/compose_render_test.go
  • internal/runner/runner.go

Comment thread internal/runner/runner.go
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying pipebench with  Cloudflare Pages  Cloudflare Pages

Latest commit: fb36f09
Status: ✅  Deploy successful!
Preview URL: https://a7335ae7.pipebench.pages.dev
Branch Preview URL: https://dt-838.pipebench.pages.dev

View logs

@erenaslandev erenaslandev added wip and removed wip labels Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/results/compare.go`:
- Around line 288-292: Update the CPU and memory parsing in the record
comparison flow to retain both ParseFloat errors and require successful parsing
of both fields before applying the stopped-container check. Only continue when
both parses succeed and cpuV and memV are zero; preserve rows containing
malformed or blank CPU/memory values.

In `@internal/runner/runner.go`:
- Around line 1657-1672: Update harvestResourceMetrics to call
orch.StopCollector before orch.CopyMetricsCSV, preserving the existing warnings
and CSV aggregation flow. Copy and aggregate the CSV only after the collector
has stopped and flushed its final samples.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 70f83834-77dd-42cb-80b9-a34b6e689be7

📥 Commits

Reviewing files that changed from the base of the PR and between 00d90b5 and fc4fbb4.

📒 Files selected for processing (3)
  • internal/results/compare.go
  • internal/results/compare_test.go
  • internal/runner/runner.go

Comment thread internal/results/compare.go
Comment thread internal/runner/runner.go
@erenaslandev

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/orchestrator/docker.go (1)

2040-2052: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider a render test for the cluster CollectorTargets join.

The comma-joined multi-node case (Lines 2044-2051) has no test asserting the rendered COLLECTOR_TARGET_CONTAINER value for a cluster case. Given this directly determines which containers the collector samples, a small render-test case would guard against a future regression (e.g. wrong separator, wrong node naming).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/orchestrator/docker.go` around lines 2040 - 2052, Add a focused
render test covering the cluster path that builds collectorTargets from multiple
clusterNodes. Assert the rendered COLLECTOR_TARGET_CONTAINER value contains the
expected node container names joined by commas, preserving the existing
single-container behavior for non-cluster cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@containers/collector/main.go`:
- Around line 129-152: Update the aggregation around addRow and row.CpuIdl so
multi-target CPU usage cannot produce a negative idle percentage in the
persisted metrics. Prefer averaging the per-target CPU usage before calculating
idle, or otherwise clamp the calculated idle value to a minimum of zero, while
preserving single-target behavior and the dstat-compatible CpuIdl field.

---

Nitpick comments:
In `@internal/orchestrator/docker.go`:
- Around line 2040-2052: Add a focused render test covering the cluster path
that builds collectorTargets from multiple clusterNodes. Assert the rendered
COLLECTOR_TARGET_CONTAINER value contains the expected node container names
joined by commas, preserving the existing single-container behavior for
non-cluster cases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0fa16758-801d-4168-81a9-687e618d5295

📥 Commits

Reviewing files that changed from the base of the PR and between 5210813 and ff5c920.

📒 Files selected for processing (6)
  • containers/collector/main.go
  • containers/collector/main_test.go
  • containers/receiver/main.go
  • containers/receiver/main_test.go
  • internal/orchestrator/docker.go
  • internal/runner/runner.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/runner/runner.go

Comment thread containers/collector/main.go
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.

1 participant