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

[Feature Request] Multipart copy support #46

Open
aselder opened this issue Nov 29, 2018 · 3 comments
Open

[Feature Request] Multipart copy support #46

aselder opened this issue Nov 29, 2018 · 3 comments

Comments

@aselder
Copy link

aselder commented Nov 29, 2018

I'd love to see this library support a high level operation similar to S3.upload that would do a copy in parts transparently to the end user. The Ruby's SDKs AWS::S3::ObjectMultipartCopier.

We already have the upload_part_copy primitive, just need to do the coordination of all the parts and calculate start and end ranges and kick off a bunch of the upload_part_copy commands similar to the defimplin https://github.com/ex-aws/ex_aws_s3/blob/v2.0.1/lib/ex_aws/s3/upload.ex.

I'll try to start a PR, but I'll probably need polishing help. My plan.

  1. If user provides the size, use it; otherwise do a head_object to get the size.
  2. Create a list of {start, stop} tuples, based on given chunk size (or the standard 5MB)
  3. Use Task.async_streams to iterate through the ranges, calling upload_part_copy for each one.
@aselder
Copy link
Author

aselder commented Nov 29, 2018

Quick question for @benwilson512 or who ever else might know...

When doing a multipart copy, the Ruby library initiates an upload and passes the upload_id and a part_numberto the put upload part command. Looking at https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPartCopy.html this seems to be required, but upload_part_copy doesn't seem to support them.

@kerryjj
Copy link

kerryjj commented Jul 21, 2020

I found the same issue and ended up creating a patched version of ex_aws that supports it.

Here's my patch for it:
blendmedia@2836ec9

Just had a look at the latest upload_part_copy and it still doesn't seem to have the upload_id and part_number even though they are required by the S3 API.

@benwilson512 Am I missing something here? Or would you like me to submit this patch as a PR to add this support?

@kerryjj
Copy link

kerryjj commented Jul 21, 2020

I've been using this patch in production since Feb 2019. Looking at it again now because I'd quite like to move back to using the official version of ex_aws and this is the one thing that's stopping me.

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

No branches or pull requests

2 participants