Skip to content

Fix #68: make the S3 bucket optional and fall back to Braket's default bucket - #100

Open
corgab wants to merge 2 commits into
mainfrom
fix/68-optional-s3-bucket
Open

Fix #68: make the S3 bucket optional and fall back to Braket's default bucket#100
corgab wants to merge 2 commits into
mainfrom
fix/68-optional-s3-bucket

Conversation

@corgab

@corgab corgab commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

The aws driver refused to run without a bucket: AwsBraketDriver::requiredConfig() listed it and providers/aws.py::run_options() raised ValueError when it was empty. The Braket SDK does not need it: AwsDevice.run() and run_batch() default s3_destination_folder to (aws_session.default_bucket(), "tasks"), the amazon-braket-<region>-<account> bucket the SDK creates on demand. A first Quantum::circuit('aws')->run() against the free SV1 simulator therefore failed with InvalidDriverConfigException until the user created a bucket by hand and wired an env var.

Plan

Treat the bucket as an optional override, the way a Laravel package treats any setting the underlying SDK already has a sensible default for: keep AETHER_S3_BUCKET as the way to route results to a bucket of your own, and let the SDK pick its default when it is unset or blank. Say what the default costs in permissions.

Changes

  • AwsBraketDriver::requiredConfig(): ['region', 'device_arn']; docblock explains the SDK default and the s3:CreateBucket it needs.
  • bin/python/providers/aws.py::run_options(): trims the configured bucket; returns {"s3_destination_folder": (bucket, "results")} when one is left and {} otherwise (unset, null, empty or whitespace-only), so device.run() and run_batch() apply their own default. No more ValueError.
  • config/aether.php: comment on bucket describing both cases and the IAM requirement. README "Configuration": the env example leaves the bucket blank with a comment, and the paragraph now says which keys are required, what happens with and without a bucket, and that the default bucket needs s3:CreateBucket on the calling credentials.

No new dependencies. Behaviour change for existing installs: a configured bucket keeps working unchanged; a previously failing empty bucket now runs against the SDK default bucket instead of throwing.

Tests

  • tests/python/test_providers.py: run_options returns {} for a missing, blank, null or whitespace-only bucket (the old "raises" test is replaced), trims a padded name, and still returns the destination folder when a bucket is set.
  • AwsBraketDriverTest: the missing-keys message no longer names bucket; a driver configured without a bucket key, with null (unset env var) and with '' (blank env line) runs executeCircuit() through to the bridge.
  • The new PHP dataset and the Python {} assertions fail on main.

Local: pint passed, pest 794 tests passed, pytest 53 passed.

Closes #68

…ucket

The aws driver refused to run without a bucket, on the PHP side through
requiredConfig() and on the Python side through run_options(), even though
AwsDevice.run() and run_batch() default the S3 destination to the SDK's
own amazon-braket-<region>-<account> bucket, created on demand. A first
run against the free SV1 simulator therefore failed until the user created
a bucket by hand. The bucket is now an optional override: when set, results
go to s3://<bucket>/results as before; when unset, run_options() returns no
destination and the SDK applies its default. Config comment, README and
both test suites describe and cover the two branches.

Closes #68
…IAM need

A bucket made of whitespace slipped past both sides once the PHP required
key check was gone, so run_options() now strips the value and treats an
empty result as "use the SDK default"; the PHP tests cover the null and
empty-string shapes config/aether.php actually produces. The README, the
config comment and the driver docblock say that the default bucket is
created on first use and therefore needs s3:CreateBucket.
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.

[drivers/aws] Make the S3 bucket optional and fall back to Braket's default bucket

1 participant