HDDS-15087. S3 Gateway and Local S3 UX - #10759
Conversation
6df13aa to
d2a6ff8
Compare
4314efb to
0a904d9
Compare
ebcf543 to
dc433dc
Compare
|
@chungen0126 PTAL, thanks |
|
|
||
| conf.set(OZONE_S3G_HTTP_ADDRESS_KEY, | ||
| address(config.getHost(), s3gHttpPort)); | ||
| conf.set(OZONE_S3G_HTTP_BIND_HOST_KEY, config.getBindHost()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Attempted the implementation. Can you see if this is what you are expecting?
Thank you!
dc433dc to
f9216c7
Compare
|
@peterxcli please also take a look, thank you! |
f9216c7 to
2b2c78d
Compare
chungen0126
left a comment
There was a problem hiding this comment.
Thanks @henrybear327 for working on this.
| /** | ||
| * 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())); | ||
| } |
There was a problem hiding this comment.
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.
| @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; |
There was a problem hiding this comment.
For S3-related configurations, we should directly use the standard AWS environment variables, such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
`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.
2b2c78d to
c463eac
Compare
What changes were proposed in this pull request?
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