Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support accessing OSS with proxy #18139

Merged
merged 2 commits into from
Sep 13, 2023
Merged

Conversation

Jackson-Wang-7
Copy link
Contributor

@Jackson-Wang-7 Jackson-Wang-7 commented Sep 13, 2023

What changes are proposed in this pull request?

Support accessing OSS through proxy by configuring alluxio properties or system properties.

Why are the changes needed?

When accessing OSS through a proxy, the OSS client cannot recognize the proxy configuration in system property and environment variables. So it has to proactively set proxy-related configurations in the configuration.

Does this PR introduce any user facing changes?

Please list the user-facing changes introduced by your change, including

  1. change in user-facing APIs
  2. addition or removal of property keys
  3. webui

@alluxio-bot
Copy link
Contributor

Automated checks report:

  • PR title follows the conventions: FAIL
    • The title of the PR does not pass all the checks. Please fix the following issues:
      • First word must be capitalized
  • Commits associated with Github account: PASS

Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks.

@Jackson-Wang-7 Jackson-Wang-7 changed the title support accessing OSS with proxy Support accessing OSS with proxy Sep 13, 2023
@alluxio-bot
Copy link
Contributor

Automated checks report:

  • PR title follows the conventions: PASS
  • Commits associated with Github account: PASS

All checks passed!

Copy link
Contributor

@jiacheliu3 jiacheliu3 left a comment

Choose a reason for hiding this comment

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

LGTM with comments, you may choose to resolve by your judgement :) Thanks for the work!

public static final PropertyKey UNDERFS_OSS_PROXY_PORT =
intBuilder(Name.UNDERFS_OSS_PROXY_PORT)
.setAlias("alluxio.underfs.oss.proxy.port")
.setDefaultValue(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

does it need a default? port 0 means assign dynamically right? So I'm afraid it's not the best default to use? I think you will need to configure this anyway (there's an existing port the proxy uses, instead of for the alluxio proc to allocate). So maybe no need for a default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if the port is 0(or not > 0), we think the proxy configuration is not enabled, so we don't set proxy in the oss config.

if (isProxyEnabled(alluxioConf)) {
ossClientConf.setProxyHost(getProxyHost(alluxioConf));
ossClientConf.setProxyPort(getProxyPort(alluxioConf));
ossClientConf.setProtocol(getProtocol());
Copy link
Contributor

Choose a reason for hiding this comment

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

add a log here if proxy is used (so you know)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, done

* returns value of http.proxyPort. Defaults to {@link this.proxyPort}
* if the system property is not set with a valid port number.
*/
private static int getProxyPortProperty() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static int getProxyPortProperty() {
private static int getProxyPortFromSystemProperty() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Jackson-Wang-7
Copy link
Contributor Author

@jiacheliu3 thanks for your comment, I have fixed the description of the properties and added the log if proxy is enabled.

@Jackson-Wang-7 Jackson-Wang-7 added the type-feature This issue is a feature request label Sep 13, 2023
@Jackson-Wang-7
Copy link
Contributor Author

alluxio-bot, merge this please

@alluxio-bot alluxio-bot merged commit 6c97d6f into Alluxio:main Sep 13, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature This issue is a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants