-
Notifications
You must be signed in to change notification settings - Fork 112
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
[WIP] Datatx initiate transfer #1759
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
This pull request introduces 1 alert when merging 3fff444 into ede4219 - view on LGTM.com new alerts:
|
3fff444
to
dc0cdff
Compare
This pull request introduces 1 alert when merging dc0cdff into ede4219 - view on LGTM.com new alerts:
|
dc0cdff
to
50f1719
Compare
50f1719
to
53593c4
Compare
@ishank011 : Some issues:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- in case the src path is a file,
gateway.ocmshareprovider.createOCMReference
creates a ref with a mount path like/home/Data-Transfers/some-file.ext
. But statting this file returnsRESOURCE_TYPE_CONTAINER
(it's always set to container). We would like to know the type so we can decide what rclone copy action to use (file or folder copy).
We can get rid of the part where we create a reference in UpdateReceivedOCMShare and call the gateway method to start the transfer instead. The resource will be created according to the source then.
Driver string `mapstructure:"driver"` | ||
Drivers map[string]map[string]interface{} `mapstructure:"drivers"` | ||
DatatxDriver string `mapstructure:"datatxdriver"` | ||
DatatxDrivers map[string]map[string]interface{} `mapstructure:"datatxdrivers"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. The CreateTransfer should be called in the gateway service
Wrong again. Gateway.UpdateOCMShare -> Gateway.CreateTransfer -> Datatx.CreateTransfer -> Rclone driver |
60250dd
to
977701e
Compare
@ishank011 : Ha, I honestly thought we were going to leave
|
@redblom you're right, that would be needed. The only way we could move to the push model is when we have notifications in OCM, and I think that needs some discussion. So we can change it now and then come back to it later. Can you please create a PR? |
@ishank011 so am I going to do it really practical for now, like eg. having the
|
We don't need the received share, right? We just need to rename grantee to creator. The rest of the info is already available from the reference. The source token would be passed as an opaque object like it currently is. |
|
||
if share.GetShare().ShareType == ocm.Share_SHARE_TYPE_TRANSFER { | ||
srcRemote := share.GetShare().GetOwner().GetIdp() | ||
// TODO do we actually know for sure the home path of the src reva instance? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at how we do it for webdav access https://github.com/cs3org/reva/blob/master/internal/grpc/services/gateway/webdavstorageprovider.go#L215
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishank011 : I need some help here, I can't figure out how to retrieve the target uri in datatx.CreateTransfer
from the cs3.storage.provider.v1beta1.Reference
. I know it's stored when de OCM reference is created but ...
@ishank011 : I'm trying to come up with a practical model. So bare with me on this. How about: When pushing a transfer you're at the src end. You want to start a transfer of a resource (under your control) to another account(grantee). This is all you know and that fits the current We, currently, on the other hand are pulling a transfer from the destination end. I see this as follows: So: |
2c512b3
to
76b7c6d
Compare
76b7c6d
to
db441d2
Compare
@redblom all the information can be stored as a URL string which can be resolved by the datatx service. Syntactically, it works but I'm not sure about the semantics
And in
Maybe we can change ref to a string called targetURI. Thoughts? |
Agree with this, but resolving the share ID won't work because
I don't think this is the right way to associate OCM shares and transfers. They're separate entities so should have different IDs. If you want to store the share associated with the transfer, you can but they shouldn't have the same ID. |
@ishank011 thanks for your comments. So, that still leaves the issue of linking the share to the transfer. I though hard about this, many questions come up for each decision. We must answer the following question:
** I'm actually not convinced about shares and transfers being different entities. OCM is currently THE initiation mechanism for both shares and transfers and we are specifying transfers as being a specific type of share. If it was up to me :) I'd say therefore they are similar beasts in the CS3MESH4EOSC world and so share ID can be a transfer ID. |
@ishank011 Your not suggesting this to be done in |
Superseded by #2052 |
No description provided.