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

Feat/s3 delete files #1127

Merged

Conversation

lbeckman314
Copy link
Contributor

@lbeckman314 lbeckman314 commented Dec 7, 2023

New Features

  • Adds support for deleting files from non-AWS S3-compatible endpoints (e.g. MinIO, Wasabi, Ceph).

Breaking Changes

  • None

Bug Fixes

  • Fixes the "The AWS Access Key Id you provided does not exist" error when attempting to delete a file from a non-AWS bucket.

Improvements

  • Allows for Gen3 administrators to have greater flexibility in choosing their preferred data storage, while keeping the AWS S3 endpoint as the "default" storage option.

Dependency updates

  • None

Deployment changes

  • None

Initial Bug Report

Issue

When attempting to delete an indexd record using the delete_file_locations() method in the Gen3 SDK, we encounter a “The AWS Access Key Id you provided does not exist” error. The indexd record is in non-AWS S3 bucket (MinIO endpoint), which is specified by the endpoint_url of the bucket in the Fence config.

Expected Behavior

The delete_file_locations() method should delete both the file and the indexd record for both AWS and non-AWS S3-compatible buckets.

Error Message

[2023-11-17 21:33:45,499][fence.blueprints.data.blueprint][   INFO] Deleting record and files for <EXAMPLE>

[2023-11-17 21:33:45,504][fence.blueprints.data.indexd][   INFO] Attempting to delete file named <EXAMPLE> from bucket example-production.

[2023-11-17 21:33:45,803][fence.blueprints.data.indexd][  ERROR] An error occurred (InvalidAccessKeyId) when calling the ListObjectsV2 operation: The AWS Access Key Id you provided does not exist in our records.  <--- AWS Access Key Error

Possible Cause

It might be possible the the endpoint_url of the bucket isn’t being passed to the Boto client in the Fence code?

fence-config.yaml:

      example-bucket:
        cred: 'EXAMPLE-USER'
        programs:
        - example_program
        endpoint_url: https://minio-storage.example.edu/  <-- Endpoint URL of the MinIO S3 Bucket

lbeckman314 added a commit to lbeckman314/gen3_util that referenced this pull request Dec 7, 2023
- Related to this [Fence PR](uc-cdis/fence#1127) for deleting files from a non-AWS S3 endpoint
@lbeckman314 lbeckman314 marked this pull request as ready for review December 15, 2023 19:00
@lbeckman314
Copy link
Contributor Author

Working on running all unit tests associated with this PR.

@lbeckman314
Copy link
Contributor Author

lbeckman314 commented Jan 25, 2024

Hi @BinamB Thank you for your patience with this PR on non-AWS S3 file deletion. Unit tests are now all passing, and we are finishing up the documentation of our integration test (tested against AWS and MinIO Buckets).

Not sure what’s blocking the Jenkins CI run, happy to take a look at any potential issues there.

Let us know if we can provide anything to help with any reviews, thanks again!

Copy link
Contributor

@BinamB BinamB left a comment

Choose a reason for hiding this comment

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

Everything looks good to me. Could you add a unit test for delete_data_file such that it can test the new get_s3_client and a separate test for create_s3_clients? @lbeckman314

@BinamB BinamB merged commit df45be4 into uc-cdis:feat/multi_part_bucket_param Mar 4, 2024
4 of 5 checks passed
@lbeckman314 lbeckman314 deleted the feat/s3-delete-files branch March 6, 2024 21:21
@lbeckman314 lbeckman314 restored the feat/s3-delete-files branch April 11, 2024 20:59
@lbeckman314 lbeckman314 deleted the feat/s3-delete-files branch July 18, 2024 23:26
@lbeckman314 lbeckman314 restored the feat/s3-delete-files branch July 18, 2024 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants