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

Add file share design #27

Merged
merged 24 commits into from
Jun 28, 2019
Merged

Conversation

PravinRanjan10
Copy link
Contributor

This pr is design about file share that will let user:

  • create and allow multiple access of a share using only one protocol(eg. NFS/CIFS)
  • create and allow multiple access of a snapshot

@xing-yang
Copy link
Collaborator

Please work with Shruthi to add profiles design into this doc.

PravinRanjan10 and others added 2 commits April 2, 2019 10:26
Edited Goals
Non Goals added
Edited Rest API impact
Added Data model impact, Rest API impact, Security impact, Other end user impact
Added Implementation of file share APIs for Profiles consolidated with block storage
4. Internally, OpenSDS File Share API talk to controllers.
5. Controllers will also maintain the File Share metadata in database.
6. Controller communicates to Dock, specific driver to create a share.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Scheduler should be mentioned in the steps.

Other than NBP, user can also use CLI or dashboard.

Copy link
Contributor

Choose a reason for hiding this comment

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

Added Scheduler tasks


### Data model impact

No
Copy link
Collaborator

Choose a reason for hiding this comment

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

New file share resources, etc. will be stored in the database so there will be data model impact.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I have updated.

@leonwanghui
Copy link
Collaborator

This design would depend on #29, please take a look thanks!

Copy link

@hirokikmr hirokikmr left a comment

Choose a reason for hiding this comment

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

Hi PravinRanjan10, I added some comments. Please take a look.

##### Response parameters
```json
“snapshotId”: “string”

Choose a reason for hiding this comment

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

“shareId” is needed for the response.

Suggested change
“shareId” : “string”

"isSpaceEfficient" : "bool"
},
"ioconnectivity" : {
"accessProtocol" : "string",

Choose a reason for hiding this comment

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

Could you tell me what "accessProtocol" is?
If it means NFS or CIFS, I think it is not needed for file share because it's same as "protocols" parameter in '3. POST /v1beta/{tenantId}/file/shares'

Copy link
Contributor

@Shruthi-1MN Shruthi-1MN Apr 10, 2019

Choose a reason for hiding this comment

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

Yes it means NFS/CIFS. Based on the create file share request parameter, there will be profiles selection. In controller profile selects dock that contacts the particular driver based on supported accessprocols. So profile should have accessprotocol information.

Choose a reason for hiding this comment

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

Thank you for your reply.
I understand that profile should have accessprotocol information.

I have an another question.
The create file share request parameter also has protocols parameter.
Could you tell me relationship between protocols parameter and accessprotocol parameter of profile?
What happens if both protocols parameter and accessprotocol parameter of profile are specified at the same time, which one has priority?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@hirokikmr Thanks for your review! That's a very good observation. I don't think we need to have a separate "protocols" parameter in Create file share request since it is already in Profiles.

@Shruthi-1MN and @PravinRanjan10, I think the Protocols in Create File share can be removed. We can just use the accessProtocol in Profiles instead. Let's make this "accessProtocol" an array ([]string).

Choose a reason for hiding this comment

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

@xing-yang Thank you for your reply. I agree with your suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xing-yang @hirokikmr, i have removed the "protocols" parameter from POST API of fileshare. And also corrected "accessProtocol" an array ([]string).

Copy link
Contributor

Choose a reason for hiding this comment

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

AccessProtocol is a string, they should choose only one accessprotocol not multiple.


“profileId”: “string”

“snapshotId” : “string”

Choose a reason for hiding this comment

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

When the file share is creating, the snapshot has not been created and ''snapshotId'' doesn't exist yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah right. In this case it will be simply blank. Do you think, we should not return the snapshotId in response, while creation of file share?

Choose a reason for hiding this comment

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

I think the snapshotId can be returned in response, While creation of file share, but it should not be a parameter in the request.

Copy link
Collaborator

Choose a reason for hiding this comment

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

"snapshotId" is optional. It is only specified when creating a file share from a snapshot.

@PravinRanjan10 can you specify what field is required and what is optional? That will be more clear.

##### 3. POST /v1beta/{tenantId}/file/shares
* Creates a share.
##### Request
```json

Choose a reason for hiding this comment

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

Whether Add Access is supported when creating file share.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, Add access will only be supported once the file is created.


##### Request
```json
body*
Copy link
Member

@himanshuvar himanshuvar Apr 14, 2019

Choose a reason for hiding this comment

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

Please correct the format for highlighting the newly added parameters text.

```json
“id” : “string”

“createdAt” : “2019-03-20T12:49:00.497Z”
Copy link
Member

Choose a reason for hiding this comment

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

Please make API specification dataType format consistent.

Please add sample API request/response as example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's ok for design doc to have json format timing detail. It's more clear way to represent.

```json
“id” : “sting”
```
##### 11. POST /v1beta/{tenantId}/file/accesses/
Copy link
Member

@himanshuvar himanshuvar Apr 15, 2019

Choose a reason for hiding this comment

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

API endpoint is confusing, acls are defined for file or fileshare. It can be POST /v1beta/{tenantId}/file/shares/{shareId}/acls/

Is it necessary that we should define API for defining acls, Can't we use the PUT fileshare API to provide acls?

PUT /v1beta/{tenantId}/file/shares/{shareId}
"accesscontrol": {
“accessCapability” : read/write/execute
other parameters etc.
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think endpoint is clear. we have to give shareId as mandatory parameter to provide acls on fileshare.

It is recommended that acl's should not set while creating the file share(It should be synchronous). And that is the reason we have separate API for that.

"datastore"" : {

""characterCodeSet" : "string",
"maxFileNameLengthBytes" : "int64",
Copy link
Member

Choose a reason for hiding this comment

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

Could it be possible to group the file share related parameters to File object?

Copy link
Contributor

Choose a reason for hiding this comment

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

It will impact the block profile APIs, so right now we are not doing it.

tenantId* : "string" //The project UUID in a multi-tenancy environment
```

##### Response
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add sample request/response as an example.

"message": "string"
}
```
##### 2. GET /v1beta/{tenantId}/profiles
Copy link
Member

Choose a reason for hiding this comment

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

Could you please sample Profile information related to Fileshare.

"message": "string"
}
```
##### 6. POST /v1beta/{tenantId}/profiles/{profileId}/customeProperties
Copy link
Member

Choose a reason for hiding this comment

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

Could you please give example custom properties for FileShare


“size” : “int64”

“userId” : “string“
Copy link
Contributor

Choose a reason for hiding this comment

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

How to use "userId"? The actual test found that "userId" in the response is an empty string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BaiHuoYu How did you test?. Have you provided dummy userId?
Can you also share your slack id, i can add you in fileshare group for more detail discussion

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference between tenantID and userID? Which should be used when there are multi-tenant scenarios?


“snapshotId” : “string”
```
##### Response parameters
Copy link
Contributor

Choose a reason for hiding this comment

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

Protocols is in FileShareSpec, why not use it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean, in the request body?
Since accessProtocols is already there in profile, we don't need here.

Copy link
Contributor

Choose a reason for hiding this comment

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

How to use Protocols in the profile? Why is there no Protoco in CreateFileShareOpts(model.pb.go)?

* Facilitating File Share Service by providing Standard API to manage multiple vendors, simplify File Share API definition
* File share across the users based on access capability
* File share facilitates with profiling
* Scope for now is to support only NFS, SMB file share protocols
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the plan for CIFS which you mentioned above?

### REST API impact

YES
Fileshare API's needs to write and Existing Profile API's needs to be changed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please notice it has some grammar errors.


### Data model impact

YES
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please elaborate the data model change here.


### Other end user impact

No
Copy link
Collaborator

Choose a reason for hiding this comment

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

I came up with an impact that with file share feature enabled, users (precisely by admin) need to create fileshare-type profile now.

}
}
]
400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

}
}
]
400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

}
}
]
400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

}
}

400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

##### Response
```json
200 OK
400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

"key3": "value3"
}

400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

"key3": "value3"
}

400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

##### Response
```json
200 OK
400 Unauthorized
Copy link
Collaborator

Choose a reason for hiding this comment

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

400 means Bad Request, Unauthorized is 401.

Copy link
Collaborator

@xing-yang xing-yang left a comment

Choose a reason for hiding this comment

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

lgtm

@xing-yang xing-yang merged commit cf5188b into sodafoundation:master Jun 28, 2019
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.

10 participants