Skip to content

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

Description

@corgab

Summary

The aws driver refuses to run without a bucket: AwsBraketDriver::requiredConfig() lists it, and providers/aws.py::run_options() raises ValueError when it is empty. The Braket SDK does not need it. AwsDevice.run() and AwsDevice.run_batch() default s3_destination_folder to (aws_session.default_bucket(), "tasks"), i.e. the amazon-braket-<region>-<account> bucket the SDK creates on demand (see aws_device.py, the or (self._aws_session.default_bucket(), "tasks") fallback in both methods).

Where

  • src/Drivers/AwsBraketDriver.php:29-32 (requiredConfig() returns ['region', 'device_arn', 'bucket'])
  • bin/python/providers/aws.py:44-54 (run_options() raises without a bucket)
  • config/aether.php:132 ('bucket' => env('AETHER_S3_BUCKET'))
  • README.md, "Configuration" ("AETHER_S3_BUCKET is required by the aws driver ... a missing or empty value throws")

Why it is a problem

Laravel packages work out of the box with sensible defaults and let configuration override them, not the other way round. Today a first Quantum::circuit('aws')->run() against the free-tier SV1 simulator fails with InvalidDriverConfigException until the user creates an S3 bucket by hand and wires an env var, even though the SDK would have handled it. It also makes the aws unit tests carry a fake bucket in every config fixture for a value the code never inspects.

Suggested fix

Drop bucket from requiredConfig(). In providers/aws.py::run_options() return {"s3_destination_folder": (bucket, "results")} only when a bucket is configured and {} otherwise, letting the SDK apply its default. Keep AETHER_S3_BUCKET as an optional override, update the README paragraph to say the default bucket is used when unset, and add a test for both branches on the Python side (tests/python/test_providers.py already covers run_options).

Severity: low

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions