Skip to content

HDDS-15087. S3 Gateway and Local S3 UX - #10759

Open
henrybear327 wants to merge 2 commits into
apache:masterfrom
henrybear327:HDDS-15087
Open

HDDS-15087. S3 Gateway and Local S3 UX#10759
henrybear327 wants to merge 2 commits into
apache:masterfrom
henrybear327:HDDS-15087

Conversation

@henrybear327

@henrybear327 henrybear327 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • optional S3G startup
  • stable recommended local creds
  • startup output with AWS_* settings and endpoint
  • --without-s3g
  • integration test that S3G is reachable
  • unit tests for summary output and S3-related config
  • negative tests for bad S3G config

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15087

How was this patch tested?

https://github.com/apache/ozone/actions/runs/29327794616

@henrybear327
henrybear327 marked this pull request as draft July 14, 2026 11:07
@henrybear327
henrybear327 force-pushed the HDDS-15087 branch 2 times, most recently from 6df13aa to d2a6ff8 Compare July 14, 2026 22:15
@adoroszlai adoroszlai added the ozone-local HDDS-14893 label Jul 15, 2026
@henrybear327
henrybear327 force-pushed the HDDS-15087 branch 6 times, most recently from 4314efb to 0a904d9 Compare July 22, 2026 11:55
@henrybear327
henrybear327 marked this pull request as ready for review July 22, 2026 11:57
@henrybear327
henrybear327 marked this pull request as draft July 22, 2026 11:58
@henrybear327
henrybear327 force-pushed the HDDS-15087 branch 4 times, most recently from ebcf543 to dc433dc Compare August 5, 2026 07:51
@henrybear327
henrybear327 marked this pull request as ready for review August 5, 2026 07:52
@henrybear327

henrybear327 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@chungen0126 PTAL, thanks


conf.set(OZONE_S3G_HTTP_ADDRESS_KEY,
address(config.getHost(), s3gHttpPort));
conf.set(OZONE_S3G_HTTP_BIND_HOST_KEY, config.getBindHost());

@rich7420 rich7420 Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Binds to config.getBindHost(), 0.0.0.0 by default. With S3G on by default + the fixed admin/admin123, ozone local run ends up serving a writable S3 endpoint on all interfaces (checked locally: reachable from a non-loopback IP, createBucket works with the default creds, though the summary says 127.0.0.1). Default to loopback and make 0.0.0.0 opt-in via --bind-host?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Attempted the implementation. Can you see if this is what you are expecting?

Thank you!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@henrybear327 thanks for the update!

@henrybear327

Copy link
Copy Markdown
Contributor Author

@peterxcli please also take a look, thank you!

@chungen0126 chungen0126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @henrybear327 for working on this.

Comment on lines +753 to +763
/**
* Stores the recommended local credentials in OM so S3 clients can sign requests without a
* separate {@code ozone s3 getsecret} bootstrap step. The write goes to the secret store
* directly rather than through the OM request pipeline: the local runtime is single-node and
* non-HA, the same fixed credentials are re-provisioned on every start, and a dev-only
* bootstrap credential needs neither Ratis replication nor an audit trail.
*/
private void provisionS3Credentials() throws IOException {
om.getS3SecretManager().storeSecret(config.getS3AccessKey(),
S3SecretValue.of(config.getS3AccessKey(), config.getS3SecretKey()));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Currently, ozone local is not yet secure. At this stage, we should first design for the default Ozone scenario. In this non-secure mode, authentication is bypassed, meaning any access key and secret key combination will be accepted. Therefore, I don't think we need to explicitly specify the access/secret keys here.

Comment on lines 183 to 191
@Option(names = "--s3-access-key",
defaultValue = DEFAULT_S3_ACCESS_KEY_VALUE,
description = "Suggested local AWS access key to print on startup")
private String s3AccessKey;

@Option(names = "--s3-secret-key",
defaultValue = DEFAULT_S3_SECRET_KEY_VALUE,
description = "Suggested local AWS secret key to print on startup")
private String s3SecretKey;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For S3-related configurations, we should directly use the standard AWS environment variables, such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

@chungen0126
chungen0126 requested review from peterxcli and removed request for rich7420 August 6, 2026 02:48
`ozone local run` swallowed every failure it hit: shutdown and start()
rollback errors went to IOUtils.closeQuietly with a null logger, the
readiness wait collapsed its conditions into a single boolean, and the
CLI converters rejected a value without naming it.

The launcher sets OZONE_LOGLEVEL=OFF for ozone-tools, so logging on its
own would stay invisible. A failed start now reports a message the user
can act on, pointing at `ozone --loglevel INFO local run` for the
service logs and --verbose for the stack trace.

Local defaults that replace a user-configured value are now recorded
and repeated on stderr by the CLI, so a discarded override stays
visible even when it is the very setting the user is debugging. The
datanode-count limit is checked before the format step so that format
mode ALWAYS cannot delete the data dir for a run that can never start.

Naming the unmet safe mode rules reads them as commons-lang3 Pair
values, a use that leaves no import behind, so ozone-tools declares
commons-lang3 for the dependency analyzer.
`ozone local run` starts an in-process S3 Gateway next to SCM, OM, and
the datanodes, so S3 clients can target a local cluster without a
separate gateway process or credential bootstrap. The runtime reserves
and persists ports for the gateway's HTTP, HTTPS, and web-admin
endpoints, provisions the fixed local credentials in OM (no `ozone s3
getsecret` step), and prints the endpoint plus the AWS settings a
local client needs, including path-style addressing. --no-s3g turns
the gateway off.

Listeners bind loopback by default. The provisioned credentials are
fixed and well known, so the previous wildcard default served a
remotely writable S3 endpoint on every interface while the summary
printed 127.0.0.1. --bind-host 0.0.0.0 is the opt-in for wider
exposure.

The gateway starts through call() rather than execute(): GenericCli's
execution-exception handler reduces a startup failure to a bare exit
code and can System.exit the JVM. call() returns only once Jetty
serves requests, so no readiness poll follows; the call runs under the
configured startup timeout so a hung startup rolls the cluster back
instead of blocking forever. A timed-out attempt can ignore the
interrupt and still finish late, so its cleanup is queued behind it on
the startup thread as that attempt's only stopper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ozone-local HDDS-14893

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants