Skip to content

[WIP] Tus Uploader#3850

Draft
innovate-invent wants to merge 7 commits intorclone:masterfrom
innovate-invent:tus
Draft

[WIP] Tus Uploader#3850
innovate-invent wants to merge 7 commits intorclone:masterfrom
innovate-invent:tus

Conversation

@innovate-invent
Copy link
Contributor

What is the purpose of this change?

Integrate the tus upload handler

Was the change discussed in an issue or in the forum before?

https://forum.rclone.org/t/http-upload-contribution/13271/35

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@innovate-invent
Copy link
Contributor Author

Hi @ncw, I noticed you are active on rclone again.
Do you have time to provide feedback so that I can move these PRs along?
https://forum.rclone.org/t/http-upload-contribution/13271/69

@ncw
Copy link
Member

ncw commented Jun 26, 2020

Hi @ncw, I noticed you are active on rclone again.
Do you have time to provide feedback so that I can move these PRs along?
https://forum.rclone.org/t/http-upload-contribution/13271/69

I'm a bit behind in PRs sorry.

What I would like to achieve most with this work is a framework for rclone copy to do resumable uploads. I think the TUS work can fit on the back of that, but I'm concerned that TUS itself will force too much policy onto rclone which will make it unsupportable by most backends.

Maybe you could start by rebasing this on master then I'll review it?

@ivandeex
Copy link
Member

ivandeex commented Nov 17, 2020

wow it's a big patch 🙈

@ivandeex
Copy link
Member

Related to #4547

Related to #87

@ivandeex
Copy link
Member

ivandeex commented Dec 3, 2020

@innovate-invent
May I help you with rebasing this on master?

@innovate-invent
Copy link
Contributor Author

@ivandeex absolutely, thanks

@ivandeex

This comment has been minimized.

@innovate-invent
Copy link
Contributor Author

PR #3842 refactors the http server code. This PR is based off of that. If you want to roll both PRs into one that is ok.

@ivandeex
Copy link
Member

ivandeex commented Jan 6, 2021

If you want to roll both PRs into one that is ok.

No. That's up to you.

@ivandeex
Copy link
Member

ivandeex commented Jan 6, 2021

@ivandeex Are named return values not allowed?

Allowed, unless shadowed by local variables. In your code you frequently name return value err and local variable err as well. You'll have to rename local variable to use pure returns.

@innovate-invent
Copy link
Contributor Author

Ah!, that was written back when I misunderstood the functionality of the := operator

@ivandeex
Copy link
Member

ivandeex commented Jan 6, 2021

Ah!, that was written back when I misunderstood the functionality of the := operator

x := expr is similar to C++'s auto x = expr;

innovate-invent and others added 7 commits May 2, 2021 13:09
- Change Dir to interface
- Add NewLazyDir()
- Rename variable in ResumeUpload to camel case
- Implement generic Uploader for Fs that implement Concatenatable
- Change ConcatUploader to store total size in file and limit
  the number of fragments per folder by putting them in subfolders
- Utilise fs.operations for fs comparison and cleanup
- Use path.Join for path building
- Add ConcatReader
- Refactor ConcatUploader into fragmentUploader for reuse in fallback uploader
- Add FallbackUploader
- Add interface checks for uploaders
- Refactor cleanDir() to generic CleanUploads()
  for use by any Fs that uses fragmentUploader
- Implement ResumableUpload and Concatenator
- Implement ResumableCleanup() for local
- Update mTime of upload paths for cleanup
- Refactor cleanDir() to generic CleanUploads()
  for use by any Fs that uses fragmentuploader
- Implement lazy dir for local
- Implement ResumableUpload and Concatenator
- Implement upload lifecycle policy
- Utilise fs.operations for fs comparison and cleanup
- Avoid calling applyUploadLifecycle on every request
- Use path.Join for path building
- Handle edge conditions while concatenating fragments
- Remove upload policy from s3 upload bucket
- Fix part count for normal upload
- Refactor cleanDir() to generic CleanUploads()
  for use by any Fs that uses fragmentuploader
@ivandeex
Copy link
Member

ivandeex commented May 3, 2021

Note: PR #4547 will introduce the Resumer interface in rclone, which is closely related to the changes here.

@innovate-invent
Copy link
Contributor Author

@ivandeex yes, this PR will compete with that one
I believe this PR provides better overall functionality

@ivandeex ivandeex marked this pull request as ready for review May 3, 2021 08:34
@innovate-invent innovate-invent marked this pull request as draft May 3, 2021 09:33
@ivandeex
Copy link
Member

This pull request was last updated 3 months ago.
Please be aware that after 6 months of no code changes pull requests become eligible for closing.

@innovate-invent
Copy link
Contributor Author

@ivandeex This is waiting on the Resumer interface. @ncw needs to respond before this can proceed. Please do not close until then.

@ivandeex
Copy link
Member

@innovate-invent @ncw
Hopefully we can sort the resume stuff in 2-3 months by 1.58 ?

@ivandeex
Copy link
Member

Hopefully we can resolve all problems around the resume code spun off from here.
After that we can take decisions on this ancient PR.

@ivandeex ivandeex modified the milestones: Known Problem, Help Wanted Nov 19, 2021
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.

3 participants