Skip to content

improvements for s3 environements variables #1343

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

Merged
merged 3 commits into from
Mar 29, 2021

Conversation

vnghia
Copy link
Contributor

@vnghia vnghia commented Mar 28, 2021

116dc39: Now, we have to set 3 envs S3_DISABLE_MULTI_PART_DOWNLOAD, S3_MULTI_PART_UPLOAD_CHUNK_SIZE and S3_MULTI_PART_DOWNLOAD_CHUNK_SIZE before importing tensorflow-io if we want to change the default behavior. This PR defers the reading:

  • S3_DISABLE_MULTI_PART_DOWNLOAD now should be set before the first calling to s3 filesystem ( read in GetS3Client )
  • S3_MULTI_PART_UPLOAD_CHUNK_SIZE should be set before uploading something to s3 ( read in GetTransferManager in Aws::Transfer::TransferDirection::UPLOAD ).
  • S3_MULTI_PART_DOWNLOAD_CHUNK_SIZE should be set before reading something from s3 ( read in GetTransferManager in Aws::Transfer::TransferDirection::DOWNLOAD ).

6e9e86d: This commit use OverrideEndpoint of s3_client instead of forcing users to set S3_ENDPOINT and S3_USE_HTTPS. OverrideEndpoint supports both with and without uri ( in the latter case it will fallback to S3_USE_HTTPS). We could eventually remove S3_USE_HTTPS and S3_VERIFY_SSL since users might accidentally set S3_USE_HTTPS=0 in a production environment which is extremely dangerous. ( we could remove those envs in this PR I think )

@vnghia vnghia force-pushed the s3-improvement branch 2 times, most recently from 08c464a to 116dc39 Compare March 28, 2021 15:33
@vnghia vnghia changed the title lazy loading for s3 environements variables improvements for s3 environements variables Mar 28, 2021
@vnghia
Copy link
Contributor Author

vnghia commented Mar 28, 2021

In a related event, I've just sent a PR to localstack to fix the 416 status code. After this PR localstack/localstack#3797 is merged, we could enable S3_DISABLE_MULTI_PART_DOWNLOAD, testing against productions is already fine.

Copy link
Member

@yongtang yongtang left a comment

Choose a reason for hiding this comment

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

PR looks good, thanks for the improvement!

@vnghia
Copy link
Contributor Author

vnghia commented Mar 29, 2021

@yongtang should we remove these envs in this PR ?

@yongtang
Copy link
Member

@vnvo2409 I think we can remove the env in this PR. It will not impact users in product environment anyway.

@vnghia
Copy link
Contributor Author

vnghia commented Mar 29, 2021

Good news! My PR localstack/localstack#3797 is merged.

@yongtang Could you merge this PR ? Linux tests have passed.

@vnghia vnghia requested a review from yongtang March 29, 2021 19:28
@yongtang
Copy link
Member

PR localstack/localstack#3797 is merged.

@vnvo2409 Great effort!

@yongtang yongtang merged commit 8b7437a into tensorflow:master Mar 29, 2021
michaelbanfield pushed a commit to michaelbanfield/io that referenced this pull request Mar 30, 2021
* lazy loading for `s3` environements variables

* `S3_ENDPOINT` supports http/https

* remove `S3_USE_HTTPS` and `S3_VERIFY_SSL`
@fsonntag
Copy link
Contributor

fsonntag commented Apr 5, 2023

@yongtang @vnghia

We just updated our TF, and realized that S3_VERIFY_SSL is gone now. This is a breaking change and we can't use it anymore now. I.e. our dev instances of Ceph, where we connect via the S3 interface, don't have SSL setup properly. Using the http endpoint doesn't help.

Is it possible to bring this functionality back? I think it should be up to the user if/how they want to configure the S3 connection.
If you're okay with it, I can send a PR.

@yongtang
Copy link
Member

yongtang commented Apr 5, 2023

@fsonntag PR are welcomed👍

@fsonntag
Copy link
Contributor

Thanks, @yongtang . Opened one: #1790

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.

3 participants