Skip to content

Fix AWS Deployment Failures - #312

Open
rabbull wants to merge 7 commits into
spcl:masterfrom
rabbull:fix/aws-failures
Open

Fix AWS Deployment Failures#312
rabbull wants to merge 7 commits into
spcl:masterfrom
rabbull:fix/aws-failures

Conversation

@rabbull

@rabbull rabbull commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

I was running SeBS on AWS Lambda to collect invocation-level performance data across all public benchmark, language, runtime, and deployment combinations. The initial matrix exposed several independent failures in benchmark packaging, deployment, validation, permissions, and AWS log parsing.

Area Root cause Fix
120.uploader metrics Application warnings containing colons were interleaved with Lambda START and REPORT records, which confused the AWS report parser. Parse log lines and tab-separated fields defensively while tolerating application output.
130.crud-api The default Lambda execution role could access S3 and CloudWatch Logs but not the benchmark's DynamoDB table. Its Node.js implementation was also missing from the README. Add scoped DynamoDB item permissions to the default SeBS Lambda role and document Node.js support. Configured or cached roles remain unchanged.
411.image-recognition Its dependencies exceed the Lambda package deployment limit, but SeBS still attempted package deployments. Add optional platform-specific system_variants restrictions and declare this benchmark container-only on AWS.
503.graph-bfs Different igraph versions represent the BFS root parent as either the root itself or -1, causing equivalent results to fail checksum validation. Canonicalize both representations before validating the checksum.
504.dna-visualisation Python 3.10 selected dependencies that required compilation or incompatible wheels in the Lambda build image. Add Python 3.10 dependency pins with Lambda-compatible wheels.

The AWS documentation now also distinguishes the IAM identity running SeBS from the Lambda execution role and lists a broad quick-start permission bundle covering Lambda, S3, IAM, CloudWatch Logs, DynamoDB, and ECR.

I tested it through all valid configuration conbinations and now all benchmarks deploy and run on AWS Lambda.

Summary by CodeRabbit

  • New Features

    • Benchmarks can now restrict supported deployment variants by platform.
    • Added C++ support for selected benchmark documentation.
    • Added Python 3.10 dependencies for DNA visualization.
    • AWS Lambda roles now include scoped DynamoDB access.
  • Bug Fixes

    • Improved AWS log parsing with interleaved application output.
    • Normalized graph BFS results across library versions.
    • Restored configured Lambda roles from supported configuration formats.
  • Documentation

    • Expanded deployment variant, AWS permissions, API Gateway, and dependency guidance.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds platform-specific system-variant validation, updates AWS Lambda role and log handling, and adjusts benchmark metadata, dependencies, documentation, and regression tests for runtime compatibility.

Changes

Benchmark and AWS updates

Layer / File(s) Summary
System-variant configuration and validation
sebs/benchmark.py, benchmarks/400.inference/411.image-recognition/*, docs/build.md
Benchmark configurations can restrict deployment system variants. Benchmark initialization validates the selected variant before deployment.
AWS role provisioning and report parsing
sebs/aws/config.py, sebs/aws/aws.py, docs/platforms.md
Lambda roles receive scoped DynamoDB access. Configured roles are restored from both supported locations. AWS report parsing handles interleaved log fields.
Benchmark metadata and dependency compatibility
benchmarks/100.webapps/130.crud-api/README.md, benchmarks/500.scientific/503.graph-bfs/*, benchmarks/500.scientific/504.dna-visualisation/*
Documentation and dependency files record supported languages, runtime-specific packages, and BFS checksum normalization.
Regression coverage
tests/test_aws_matrix_fixes.py
Tests cover AWS parsing, IAM policies, Lambda role handling, system variants, BFS output conventions, and Python dependency pins.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the pull request's primary purpose: fixing AWS deployment and execution failures.
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 unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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 (4)
tests/test_aws_matrix_fixes.py (3)

98-110: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Test both accepted root-parent conventions.

Lines 101-105 test only the root-parent value 0. Lines 106-110 test an invalid value. Neither assertion covers the second valid igraph root-parent representation.

Add a successful validation assertion for the alternate accepted root-parent value. Keep the checksum-mismatch assertion for an invalid value.

🤖 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 `@tests/test_aws_matrix_fixes.py` around lines 98 - 110, Update
test_igraph_root_parent_conventions_validate_equally to assert successful
validation for the alternate accepted igraph root-parent value before changing
result[2][0] to an invalid value. Preserve the existing checksum-mismatch
assertion for the invalid root-parent case.

90-96: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Test rejection during benchmark initialization.

This test checks BenchmarkConfig.supports_system_variant. It does not execute the benchmark initialization path that must reject AWS package deployments.

Add a test that selects AWS package through the public initialization path and asserts the expected validation error.

🤖 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 `@tests/test_aws_matrix_fixes.py` around lines 90 - 96, Extend the tests around
test_411_is_container_only_on_aws to invoke the public benchmark initialization
path with AWS and package selected, rather than only calling
BenchmarkConfig.supports_system_variant. Assert that initialization raises the
expected validation error, while preserving the existing configuration
capability checks if still useful.

42-72: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Test the absent-role creation path.

Line 46 returns an existing role. This test does not execute create_role after NoSuchEntityException. A failure in default-role creation can pass this regression test.

Add a case where get_role raises the client exception. Assert create_role and the DynamoDB policy attachment.

🤖 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 `@tests/test_aws_matrix_fixes.py` around lines 42 - 72, Extend
test_new_default_lambda_role_receives_dynamodb_access to cover the missing-role
path by configuring iam_client.get_role to raise the AWS NoSuchEntityException,
then assert resources.lambda_role invokes create_role and attaches the
sebs-dynamodb-access policy to the created default role. Preserve the existing
assertions for policy contents and idempotent behavior where applicable.
sebs/benchmark.py (1)

638-649: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for the constructor validation path.

The current regression test calls BenchmarkConfig.supports_system_variant directly. It does not exercise the new Benchmark.__init__ guard or the SystemVariant.value conversion at Line 639. Add a focused test that rejects AWS/package and accepts AWS/container.

🤖 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 `@sebs/benchmark.py` around lines 638 - 649, Extend the regression tests to
instantiate Benchmark through its __init__ validation path rather than only
calling BenchmarkConfig.supports_system_variant. Add focused cases verifying
AWS/package is rejected and AWS/container is accepted, exercising the
SystemVariant.value conversion and the guard around supports_system_variant.
🤖 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
`@benchmarks/500.scientific/504.dna-visualisation/python/requirements.txt.3.10`:
- Line 7: Remove the unnecessary pillow==10.3.0 entry from the Python 3.10
requirements file; the Lambda handler’s imports do not require Pillow, so leave
only the dependencies needed by the handler.

---

Nitpick comments:
In `@sebs/benchmark.py`:
- Around line 638-649: Extend the regression tests to instantiate Benchmark
through its __init__ validation path rather than only calling
BenchmarkConfig.supports_system_variant. Add focused cases verifying AWS/package
is rejected and AWS/container is accepted, exercising the SystemVariant.value
conversion and the guard around supports_system_variant.

In `@tests/test_aws_matrix_fixes.py`:
- Around line 98-110: Update
test_igraph_root_parent_conventions_validate_equally to assert successful
validation for the alternate accepted igraph root-parent value before changing
result[2][0] to an invalid value. Preserve the existing checksum-mismatch
assertion for the invalid root-parent case.
- Around line 90-96: Extend the tests around test_411_is_container_only_on_aws
to invoke the public benchmark initialization path with AWS and package
selected, rather than only calling BenchmarkConfig.supports_system_variant.
Assert that initialization raises the expected validation error, while
preserving the existing configuration capability checks if still useful.
- Around line 42-72: Extend
test_new_default_lambda_role_receives_dynamodb_access to cover the missing-role
path by configuring iam_client.get_role to raise the AWS NoSuchEntityException,
then assert resources.lambda_role invokes create_role and attaches the
sebs-dynamodb-access policy to the created default role. Preserve the existing
assertions for policy contents and idempotent behavior where applicable.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 86cadfeb-d5c6-40f3-92eb-14c72d32916e

📥 Commits

Reviewing files that changed from the base of the PR and between c650942 and 9668ae6.

📒 Files selected for processing (13)
  • benchmarks/100.webapps/130.crud-api/README.md
  • benchmarks/400.inference/411.image-recognition/README.md
  • benchmarks/400.inference/411.image-recognition/config.json
  • benchmarks/500.scientific/503.graph-bfs/README.md
  • benchmarks/500.scientific/503.graph-bfs/input.py
  • benchmarks/500.scientific/504.dna-visualisation/README.md
  • benchmarks/500.scientific/504.dna-visualisation/python/requirements.txt.3.10
  • docs/build.md
  • docs/platforms.md
  • sebs/aws/aws.py
  • sebs/aws/config.py
  • sebs/benchmark.py
  • tests/test_aws_matrix_fixes.py

# we have to fix version to prevent compilation from source
numpy==2.2.6
contourpy==1.3.2
pillow==10.3.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

curl -fsSL -X POST https://api.osv.dev/v1/query \
  -H 'Content-Type: application/json' \
  --data '{"package":{"ecosystem":"PyPI","name":"Pillow"},"version":"10.3.0"}' |
  jq -r '.vulns[]? | [.id, .summary] | `@tsv`'

curl -fsSL https://pypi.org/pypi/Pillow/12.2.0/json |
  jq -r '.urls[].filename' |
  grep -iE 'pillow-12\.2\.0-cp310-cp310-manylinux.*(x86_64|aarch64)'

Repository: spcl/serverless-benchmarks

Length of output: 2985


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

FILE="benchmarks/500.scientific/504.dna-visualisation/python/requirements.txt.3.10"
echo "== requirements file =="
cat -n "$FILE" | sed -n '1,40p'

echo
echo "== references within dna-visualisation directory =="
python3 - <<'PY'
import pathlib, re
root = pathlib.Path("benchmarks/500.scientific/504.dna-visualisation")
for p in root.rglob("*"):
    if p.is_file() and not any(part in {".git", "__pycache__", ".eggs"} for part in p.parts):
        try:
            text = p.read_text(errors="ignore")
        except Exception:
            continue
        if re.search(r"\b(PIL|Pillow)\b|pillow\b|import Image|from PIL|Image\.", text, re.I):
            print(p)
PY

Repository: spcl/serverless-benchmarks

Length of output: 777


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== requirements/python files =="
for f in $(git ls-files benchmarks/500.scientific/504.dna-visualisation/python); do
  echo "--- $f"
  cat -n "$f" | sed -n '1,80p'
done

echo
echo "== python imports in benchmark source =="
python3 - <<'PY'
import pathlib, ast
root = pathlib.Path("benchmarks/500.scientific/504.dna-visualisation/python")
for p in sorted(root.glob("*.py")):
    tree = ast.parse(p.read_text())
    names = []
    for node in ast.walk(tree):
        if isinstance(node, ast.Import):
            names.extend(a.name.split(".", 1)[0] for a in node.names)
        elif isinstance(node, ast.ImportFrom):
            names.append((node.module or "").split(".", 1)[0] or "")
    print(p, sorted(n for n in names if n in {"PIL", "Pillow", "numpy", "matplotlib", "Pillow"} or n))
PY

Repository: spcl/serverless-benchmarks

Length of output: 4684


Remove the unnecessary Pillow requirement.

pillow==10.3.0 is still pinned here, but the Lambda handler imports only datetime, io, json, os, and squiggle. Remove it to avoid loading a vulnerable dependency into the runtime unless a future dependency or use case requires it.

🤖 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 `@benchmarks/500.scientific/504.dna-visualisation/python/requirements.txt.3.10`
at line 7, Remove the unnecessary pillow==10.3.0 entry from the Python 3.10
requirements file; the Lambda handler’s imports do not require Pillow, so leave
only the dependencies needed by the handler.

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