Skip to content

feat(rds): real Oracle, SQL Server, and Db2 engines via Docker#773

Merged
vieiralucas merged 2 commits intomainfrom
worktree-batch5-rds-engines
Apr 26, 2026
Merged

feat(rds): real Oracle, SQL Server, and Db2 engines via Docker#773
vieiralucas merged 2 commits intomainfrom
worktree-batch5-rds-engines

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 26, 2026

Summary

Closes the last RDS engine gaps from the audit. Where the previous engines (Postgres/MySQL/MariaDB) start a real backing container, fakecloud now does the same for Oracle, SQL Server, and Db2 via the upstream free-tier images:

  • Oracle Database Free 23 (gvenzl/oracle-free:23-slim) -> port 1521
  • SQL Server 2022 Express (mcr.microsoft.com/mssql/server:2022-latest) -> port 1433
  • Db2 Community Edition (icr.io/db2_community/db2:latest) -> port 50000

Each engine has a log-marker readiness probe followed by a TCP probe to bridge the lag between the engine-ready log line and the listener actually binding. Db2 launches under `--privileged` because the container sets kernel params during startup; license-acceptance env vars (`ACCEPT_EULA`, `LICENSE`) are passed automatically.

Service-side wiring extended in lockstep:

  • `validate_create_request` accepts the new engines + their version lists (Oracle 19/21/23, SQL Server 2019/2022, Db2 11.5)
  • `default_port_for_engine`, `default_parameter_group`, `license_model_for_engine`, `default_db_name` map each new engine to AWS-documented defaults
  • README, llms.txt, fakecloud.dev/{rds, local-rds, faq, fake-aws-server, localstack-alternative} all updated

Test plan

  • `cargo test -p fakecloud-rds --lib` (119 tests, including 6 new unit tests covering the new engine mappings)
  • `cargo clippy --workspace --all-targets -- -D warnings`
  • `cargo fmt --all`
  • New E2E suite `rds_heavy_engines.rs` (gated on `FAKECLOUD_E2E_HEAVY_DBS=1` + Docker; soft-skips otherwise per existing pattern). Each test creates the instance, asserts the engine-specific defaults, and deletes.

Summary by cubic

Adds real Oracle, SQL Server, and Db2 engines to RDS by launching the upstream Docker images and exposing real, connectable endpoints. Aligns engine/version validation, AWS defaults, and adds E2E coverage.

  • New Features

    • Start real containers: Oracle Free 23 (gvenzl/oracle-free:23-slim, 1521), SQL Server 2022 Express (mcr.microsoft.com/mssql/server:2022-latest, 1433), Db2 Community (icr.io/db2_community/db2:latest, 50000).
    • Readiness: log-marker wait then TCP probe; auto-accept licenses (ACCEPT_EULA, LICENSE); Db2 runs with --privileged.
    • Service wiring: accept new engines/versions (Oracle 19/21/23, SQL Server 2019/2022, Db2 11.5); map default port, parameter group names, license model, and default DB name to AWS defaults.
    • Tests/docs: new gated E2E suite (FAKECLOUD_E2E_HEAVY_DBS=1) plus unit tests; docs updated across README and site.
  • Bug Fixes

    • Snapshots/read replicas for Oracle/SQL Server/Db2 now return a clear “not supported” error (no pg_dump/psql fallback).
    • Registered default parameter groups for new engine families so create works without DBParameterGroupName.
    • Heavy-DB E2E lane fails fast if FAKECLOUD_E2E_HEAVY_DBS=1 is set but Docker is unavailable; docs wording synced (Memcached references, “SQL Server” naming).

Written for commit 536b11b. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

8 issues found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="website/content/local-rds.md">

<violation number="1" location="website/content/local-rds.md:20">
P3: Use `SQL Server` instead of `Microsoft` in the driver list to keep engine/driver naming accurate and consistent.</violation>
</file>

<file name="crates/fakecloud-e2e/tests/rds_heavy_engines.rs">

<violation number="1" location="crates/fakecloud-e2e/tests/rds_heavy_engines.rs:44">
P2: Fail the heavy-DB lane when Docker is missing instead of skipping it, so CI doesn't silently omit the intended coverage.</violation>
</file>

<file name="website/content/localstack-alternative.md">

<violation number="1" location="website/content/localstack-alternative.md:30">
P3: This new claim adds Memcached support for ElastiCache, but the same page still documents ElastiCache as Redis/Valkey only. Keep the capability list consistent to avoid misleading users.</violation>
</file>

<file name="website/content/fake-aws-server.md">

<violation number="1" location="website/content/fake-aws-server.md:20">
P2: This line incorrectly states that ElastiCache runs real Memcached. Current docs specify only Redis/Valkey are Docker-backed, while Memcached does not run a real backing process.</violation>
</file>

<file name="website/static/llms.txt">

<violation number="1" location="website/static/llms.txt:11">
P3: The added ElastiCache `Memcached` claim is inconsistent with the rest of this file and likely inaccurate for this PR scope. Keep this line aligned with the supported-services section to avoid misleading capability docs.</violation>
</file>

<file name="README.md">

<violation number="1" location="README.md:42">
P2: This line overstates ElastiCache capabilities: Memcached is not backed by real Docker containers in this project. Keep this statement aligned with actual behavior to avoid misleading users.</violation>
</file>

<file name="crates/fakecloud-rds/src/runtime.rs">

<violation number="1" location="crates/fakecloud-rds/src/runtime.rs:107">
P1: Newly enabled Oracle/SQL Server/Db2 engines are not supported by dump/restore paths, so snapshot and read-replica operations will fail by running PostgreSQL tools in those containers.</violation>
</file>

<file name="crates/fakecloud-rds/src/service.rs">

<violation number="1" location="crates/fakecloud-rds/src/service.rs:3103">
P1: New engine default parameter-group names are generated, but corresponding default groups are not present in state initialization, so CreateDBInstance can fail with DBParameterGroupNotFound when DBParameterGroupName is omitted.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread crates/fakecloud-rds/src/runtime.rs
}
"oracle-ee" | "oracle-se2" | "oracle-ee-cdb" | "oracle-se2-cdb" => {
let major = engine_version.split('.').next().unwrap_or("23");
format!("default.{engine}-{major}")
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Choose a reason for hiding this comment

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

P1: New engine default parameter-group names are generated, but corresponding default groups are not present in state initialization, so CreateDBInstance can fail with DBParameterGroupNotFound when DBParameterGroupName is omitted.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/fakecloud-rds/src/service.rs, line 3103:

<comment>New engine default parameter-group names are generated, but corresponding default groups are not present in state initialization, so CreateDBInstance can fail with DBParameterGroupNotFound when DBParameterGroupName is omitted.</comment>

<file context>
@@ -3050,6 +3098,24 @@ fn default_parameter_group(engine: &str, engine_version: &str) -> String {
         }
+        "oracle-ee" | "oracle-se2" | "oracle-ee-cdb" | "oracle-se2-cdb" => {
+            let major = engine_version.split('.').next().unwrap_or("23");
+            format!("default.{engine}-{major}")
+        }
+        "sqlserver-ee" | "sqlserver-se" | "sqlserver-ex" | "sqlserver-web" => {
</file context>
Fix with Cubic

Comment thread crates/fakecloud-e2e/tests/rds_heavy_engines.rs Outdated
- **Real HTTP server**, not an in-process mock. Your Go / Java / Kotlin / Node / Rust / PHP / Python code uses the regular AWS SDK with `endpoint_url` set to `http://localhost:4566`.
- **Speaks the AWS wire protocol** at 100% conformance per implemented service. 26 services, 1,924 operations, validated against AWS's own Smithy models on every commit (59,000+ generated test variants).
- **Real execution** for stateful services: Lambda runs your function code in Docker containers across 13 runtimes, RDS runs real PostgreSQL/MySQL/MariaDB, ElastiCache runs real Redis/Valkey.
- **Real execution** for stateful services: Lambda runs your function code in Docker containers across 13 runtimes, RDS runs real PostgreSQL/MySQL/MariaDB/Oracle/SQL Server/Db2, ElastiCache runs real Redis/Valkey/Memcached.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Choose a reason for hiding this comment

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

P2: This line incorrectly states that ElastiCache runs real Memcached. Current docs specify only Redis/Valkey are Docker-backed, while Memcached does not run a real backing process.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At website/content/fake-aws-server.md, line 20:

<comment>This line incorrectly states that ElastiCache runs real Memcached. Current docs specify only Redis/Valkey are Docker-backed, while Memcached does not run a real backing process.</comment>

<file context>
@@ -17,7 +17,7 @@ Listens on `http://localhost:4566`. Any AWS SDK in any language points at it and
 - **Real HTTP server**, not an in-process mock. Your Go / Java / Kotlin / Node / Rust / PHP / Python code uses the regular AWS SDK with `endpoint_url` set to `http://localhost:4566`.
 - **Speaks the AWS wire protocol** at 100% conformance per implemented service. 26 services, 1,924 operations, validated against AWS's own Smithy models on every commit (59,000+ generated test variants).
-- **Real execution** for stateful services: Lambda runs your function code in Docker containers across 13 runtimes, RDS runs real PostgreSQL/MySQL/MariaDB, ElastiCache runs real Redis/Valkey.
+- **Real execution** for stateful services: Lambda runs your function code in Docker containers across 13 runtimes, RDS runs real PostgreSQL/MySQL/MariaDB/Oracle/SQL Server/Db2, ElastiCache runs real Redis/Valkey/Memcached.
 - **Real cross-service wiring**: S3 -> Lambda, SQS -> Lambda, SNS fan-out, EventBridge -> Step Functions, and 15+ more integrations execute end-to-end, not as stubs.
 - **Free, open-source, AGPL-3.0.** No account, no auth token, no paid tier.
</file context>
Suggested change
- **Real execution** for stateful services: Lambda runs your function code in Docker containers across 13 runtimes, RDS runs real PostgreSQL/MySQL/MariaDB/Oracle/SQL Server/Db2, ElastiCache runs real Redis/Valkey/Memcached.
- **Real execution** for stateful services: Lambda runs your function code in Docker containers across 13 runtimes, RDS runs real PostgreSQL/MySQL/MariaDB/Oracle/SQL Server/Db2, ElastiCache runs real Redis/Valkey.
Fix with Cubic

Comment thread README.md
Comment thread website/content/local-rds.md Outdated
Comment thread website/content/localstack-alternative.md
Comment thread website/static/llms.txt
Adds three new engine families that boot a real database container,
matching the Postgres/MySQL/MariaDB pattern:

- Oracle Database Free 23 (gvenzl/oracle-free:23-slim) on port 1521
- SQL Server 2022 Express (mcr.microsoft.com/mssql/server:2022-latest)
  on port 1433
- Db2 Community Edition (icr.io/db2_community/db2:latest) on port
  50000, launched with --privileged because Db2 sets kernel params
  during startup

Each engine has a log-marker readiness probe followed by a TCP probe
to handle the lag between engine-ready logs and listener-binding.
Default ports, parameter group names, license models, and DB names are
wired through service.rs to match AWS's reported defaults.
- Reject snapshot/read-replica dump+restore for Oracle/SQL Server/Db2
  with a clear error instead of running pg_dump/psql against them
- Register default parameter groups for the new engine families so
  CreateDBInstance with omitted DBParameterGroupName succeeds
- Heavy-DB E2E lane panics on missing Docker after FAKECLOUD_E2E_HEAVY_DBS=1
  is set, instead of silently skipping
- Make ElastiCache Memcached references consistent across README,
  llms.txt, and localstack-alternative tables (matches PR #768)
- Use 'SQL Server' (not 'Microsoft') in driver list
@vieiralucas vieiralucas force-pushed the worktree-batch5-rds-engines branch from 02f71cc to 536b11b Compare April 26, 2026 05:28
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 52.59259% with 128 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/fakecloud-rds/src/runtime.rs 0.00% 128 Missing ⚠️

📢 Thoughts on this report? Let us know!

@vieiralucas vieiralucas merged commit dcbb54e into main Apr 26, 2026
47 checks passed
@vieiralucas vieiralucas deleted the worktree-batch5-rds-engines branch April 26, 2026 05:44
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