Skip to content

feat(hydro_test): add example of AWS + SQS support#2746

Open
MingweiSamuel wants to merge 8 commits intomainfrom
mingwei/sqs-rebase
Open

feat(hydro_test): add example of AWS + SQS support#2746
MingweiSamuel wants to merge 8 commits intomainfrom
mingwei/sqs-rebase

Conversation

@MingweiSamuel
Copy link
Copy Markdown
Member

@MingweiSamuel MingweiSamuel commented Apr 15, 2026

Not sure if this should land in hydro_std or a new e.g. hydro_aws (or even finer grain hydro_sqs) crate

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 15, 2026

Deploying hydro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2df53f5
Status: ✅  Deploy successful!
Preview URL: https://2ebb4fa9.hydroflow.pages.dev
Branch Preview URL: https://mingwei-sqs-rebase.hydroflow.pages.dev

View logs

@MingweiSamuel MingweiSamuel force-pushed the mingwei/sqs-rebase branch 3 times, most recently from 0f2fc28 to 780922c Compare April 20, 2026 18:39
@MingweiSamuel MingweiSamuel changed the title feat(dfir_lang): sqs rebase wip feat(hydro_test): add example of AQS + SQS support Apr 20, 2026
@MingweiSamuel MingweiSamuel changed the title feat(hydro_test): add example of AQS + SQS support feat(hydro_test): add example of AWS + SQS support Apr 20, 2026
@MingweiSamuel MingweiSamuel marked this pull request as ready for review April 20, 2026 19:43
@MingweiSamuel MingweiSamuel requested review from a team and Copilot April 20, 2026 19:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an AWS + SQS integration example to hydro_test, gated behind new Cargo features, to demonstrate sourcing from and writing to SQS within Hydro flows.

Changes:

  • Introduce hydro_test::aws module with helpers to load AWS SDK config and build an SQS client.
  • Add SQS source/sink utilities and a runnable aws_sqs example.
  • Add feature flags (aws, aws_sqs) and wire the example to required-features.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
hydro_test/src/lib.rs Gate new aws module behind feature = "aws".
hydro_test/src/aws/mod.rs Add AWS SDK config source helper and stageleft rewrite mappings.
hydro_test/src/aws/sqs.rs Add SQS client/source/dest utilities.
hydro_test/examples/aws_sqs.rs Add deployment-backed example using the new SQS helpers.
hydro_test/Cargo.toml Add aws/aws_sqs features, optional AWS deps, and example feature gating.
Cargo.lock Pull in AWS SDK dependency graph.
.vscode/settings.json Enable aws_sqs feature for rust-analyzer by default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hydro_test/examples/aws_sqs.rs Outdated
Comment thread hydro_test/examples/aws_sqs.rs
Comment thread hydro_test/src/aws/sqs.rs Outdated
Comment thread hydro_test/src/aws/sqs.rs
Comment thread hydro_test/src/aws/sqs.rs
Comment thread hydro_test/src/aws/sqs.rs Outdated
Comment thread hydro_test/src/aws/sqs.rs
Comment thread hydro_test/src/aws/sqs.rs
Comment thread hydro_test/src/aws/sqs.rs
Comment thread .vscode/settings.json Outdated
MingweiSamuel added a commit that referenced this pull request Apr 21, 2026
Changes made:
- Fix typo: `chaning` → `changing` in sqs.rs comment
- Replace concrete AWS account ID/queue URL with placeholders in example
- Weaken `source_sqs_fifo` guarantees from `TotalOrder`/`ExactlyOnce` to
  `NoOrder`/`AtLeastOnce` since SQS FIFO only guarantees ordering within a
  single message group; removed `NonDet` parameter; added detailed doc comment
- Add doc comment to `dest_sqs` noting it's for standard queues only (no
  `message_group_id` set)
- Add `features = ["alloc"]` to `futures-util` dependency for stream module
- Remove `aws_sqs` from `.vscode/settings.json` cargo features
- Improve `nondet!` justification comments in example
- Remove unused `TotalOrder` import from sqs.rs

Comments dismissed as incorrect/not actionable:
- EC2 hardcoded region/AMI: acceptable for an example
- Delete-before-return: already has TODO, AtLeastOnce marker is accurate
- `?` terminates stream on empty poll: intentional design (same as resolved)
- flat_map yields Vec not Message: wrong (Option iterates over inner Vec)

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
Comment thread .vscode/settings.json
"rust-analyzer.rustfmt.extraArgs": [
"+nightly"
],
"rust-analyzer.cargo.features": [],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can be removed?

Comment thread hydro_test/src/aws/sqs.rs
.map(q!(|(message, client)| self::sqs_send(
&client, queue_url, message
)))
.resolve_futures_blocking();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should probably split out APIs for side effecting resolve vs non side effecting.

MingweiSamuel added a commit that referenced this pull request Apr 22, 2026
Changes made:
- Fix typo: `chaning` → `changing` in sqs.rs comment
- Replace concrete AWS account ID/queue URL with placeholders in example
- Weaken `source_sqs_fifo` guarantees from `TotalOrder`/`ExactlyOnce` to
  `NoOrder`/`AtLeastOnce` since SQS FIFO only guarantees ordering within a
  single message group; removed `NonDet` parameter; added detailed doc comment
- Add doc comment to `dest_sqs` noting it's for standard queues only (no
  `message_group_id` set)
- Add `features = ["alloc"]` to `futures-util` dependency for stream module
- Remove `aws_sqs` from `.vscode/settings.json` cargo features
- Improve `nondet!` justification comments in example
- Remove unused `TotalOrder` import from sqs.rs

Comments dismissed as incorrect/not actionable:
- EC2 hardcoded region/AMI: acceptable for an example
- Delete-before-return: already has TODO, AtLeastOnce marker is accurate
- `?` terminates stream on empty poll: intentional design (same as resolved)
- flat_map yields Vec not Message: wrong (Option iterates over inner Vec)

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 27, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 27, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 27, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 27, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 27, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
MingweiSamuel added a commit that referenced this pull request Apr 28, 2026
MingweiSamuel added a commit that referenced this pull request Apr 28, 2026
MingweiSamuel added a commit that referenced this pull request Apr 28, 2026
MingweiSamuel added a commit that referenced this pull request Apr 28, 2026
- hydro_test/src/aws/sqs.rs: Replace redundant closures `|vec| futures_util::stream::iter(vec)` 
  with direct function reference `futures_util::stream::iter` (lines 45 and 70)
- hydro_test/examples/aws_sqs.rs: Replace explicit auto-deref `&*args.queue_url` with 
  `&args.queue_url` (lines 63 and 80)

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2746
MingweiSamuel added a commit that referenced this pull request Apr 28, 2026
MingweiSamuel added a commit that referenced this pull request Apr 28, 2026
Changes made:
- Fix typo: `chaning` → `changing` in sqs.rs comment
- Replace concrete AWS account ID/queue URL with placeholders in example
- Weaken `source_sqs_fifo` guarantees from `TotalOrder`/`ExactlyOnce` to
  `NoOrder`/`AtLeastOnce` since SQS FIFO only guarantees ordering within a
  single message group; removed `NonDet` parameter; added detailed doc comment
- Add doc comment to `dest_sqs` noting it's for standard queues only (no
  `message_group_id` set)
- Add `features = ["alloc"]` to `futures-util` dependency for stream module
- Remove `aws_sqs` from `.vscode/settings.json` cargo features
- Improve `nondet!` justification comments in example
- Remove unused `TotalOrder` import from sqs.rs

Comments dismissed as incorrect/not actionable:
- EC2 hardcoded region/AMI: acceptable for an example
- Delete-before-return: already has TODO, AtLeastOnce marker is accurate
- `?` terminates stream on empty poll: intentional design (same as resolved)
- flat_map yields Vec not Message: wrong (Option iterates over inner Vec)

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2746
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 29, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
MingweiSamuel and others added 8 commits April 30, 2026 23:14
- hydro_test/src/aws/sqs.rs: Replace redundant closures `|vec| futures_util::stream::iter(vec)` 
  with direct function reference `futures_util::stream::iter` (lines 45 and 70)
- hydro_test/examples/aws_sqs.rs: Replace explicit auto-deref `&*args.queue_url` with 
  `&args.queue_url` (lines 63 and 80)

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2746
Changes made:
- Fix typo: `chaning` → `changing` in sqs.rs comment
- Replace concrete AWS account ID/queue URL with placeholders in example
- Weaken `source_sqs_fifo` guarantees from `TotalOrder`/`ExactlyOnce` to
  `NoOrder`/`AtLeastOnce` since SQS FIFO only guarantees ordering within a
  single message group; removed `NonDet` parameter; added detailed doc comment
- Add doc comment to `dest_sqs` noting it's for standard queues only (no
  `message_group_id` set)
- Add `features = ["alloc"]` to `futures-util` dependency for stream module
- Remove `aws_sqs` from `.vscode/settings.json` cargo features
- Improve `nondet!` justification comments in example
- Remove unused `TotalOrder` import from sqs.rs

Comments dismissed as incorrect/not actionable:
- EC2 hardcoded region/AMI: acceptable for an example
- Delete-before-return: already has TODO, AtLeastOnce marker is accurate
- `?` terminates stream on empty poll: intentional design (same as resolved)
- flat_map yields Vec not Message: wrong (Option iterates over inner Vec)

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2746
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 30, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request Apr 30, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request May 1, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request May 1, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request May 1, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request May 1, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
akainth015 added a commit to akainth015/hydro that referenced this pull request May 1, 2026
- Add hydro_test/src/kafka/mod.rs with kafka_producer, kafka_consumer,
  dest_kafka, and setup_topic helpers following the SQS PR hydro-project#2746 pattern
- Complete hydro_test/examples/kafka.rs: leader produces 1M financial
  transactions, consumer cluster computes per-account balances
- Add 'kafka' feature flag gating rdkafka and futures-util as optional
  deps
- Add llvm-tools component to rust-toolchain.toml for rust-lld
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