-
Notifications
You must be signed in to change notification settings - Fork 311
Add dock and controller for file share #726
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 dock and controller for file share #726
Conversation
|
@xxwjj, @wisererik, @leonwanghui, @xing-yang , @NajmudheenCT, @ kumarashit , @rhsakarpos, @himanshuvar, @skdwriting |
wisererik
left a comment
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.
LGTM
| @@ -1,4 +1,4 @@ | |||
| // Copyright (c) 2018 Huawei Technologies Co., Ltd. All Rights Reserved. | |||
| // Copyright 2019 The OpenSDS Authors | |||
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.
Missing a . here
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.
Done
abb9dee to
ddad98e
Compare
| "github.com/opensds/opensds/pkg/dock/client" | ||
| "github.com/opensds/opensds/pkg/model" | ||
| pb "github.com/opensds/opensds/pkg/model/proto" | ||
| "golang.org/x/net/context" |
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.
Please use context package
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.
Done
|
|
||
| "github.com/opensds/opensds/pkg/dock/client" | ||
| "github.com/opensds/opensds/pkg/model" | ||
| "github.com/opensds/opensds/pkg/model/proto" |
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.
Please remove this package since it's duplicate.
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.
Done
| @@ -0,0 +1,104 @@ | |||
| // Copyright 2019 The OpenSDS Authors | |||
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.
Please add . here.
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.
Done
pkg/controller/selector/selector.go
Outdated
| prf, err = db.C.GetProfile(c.NewAdminContext(), in.ProfileId) | ||
| } | ||
| if err != nil { | ||
| log.Error("Get profile failed: ", err) |
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.
Please change to lower case.
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.
Done
pkg/controller/selector/selector.go
Outdated
| } | ||
| pools, err := db.C.ListPools(c.NewAdminContext()) | ||
| if err != nil { | ||
| log.Error("When list pools in resources SelectSupportedPool: ", err) |
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.
Same here.
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.
Done in entire function
| package filesharedrivers | ||
|
|
||
| import ( | ||
| "github.com/opensds/opensds/contrib/drivers/filesharedrivers/nfsnative" |
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.
Rename "nfsnative" to "nfs".
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.
ok
| func Init(resourceType string) FileShareDriver { | ||
| var f FileShareDriver | ||
| switch resourceType { | ||
| case config.NFSNativeDriverType: |
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.
s/NFSNativeDriverType/NFSDriverType:
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.
Done
| @@ -0,0 +1,50 @@ | |||
| // Copyright 2019 The OpenSDS Authors. | |||
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.
Change to contrib/drivers/filesharedrivers/nfs/nfs.go
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.
Done
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package nfsnative |
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.
Change to "nfs"
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.
Done
|
|
||
| DRBDDriverType = "drbd" | ||
| const ( | ||
| NFSNativeDriverType = "nfsnative" |
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.
NFSDriverType = "nfs"
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.
Done
pkg/api/controllers/fileshare.go
Outdated
| return | ||
| } | ||
|
|
||
| // NOTE:It will create a file share entry into the database and initialize its status |
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.
Add a space after "NOTE:"
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.
Done
pkg/api/controllers/fileshare.go
Outdated
|
|
||
| f.SuccessHandle(StatusAccepted, body) | ||
|
|
||
| // NOTE:The real file share creation process. |
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.
Space after "NOTE:"
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.
Done
pkg/api/controllers/fileshare.go
Outdated
|
|
||
| f.SuccessHandle(StatusAccepted, nil) | ||
|
|
||
| // NOTE:The real file share deletion process. |
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.
Space after "NOTE:"
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.
Done
pkg/api/controllers/fileshare.go
Outdated
| } | ||
|
|
||
| // NOTE:It will update the the status of the volume snapshot waiting for deletion in | ||
| // NOTE:It will update the the status of the file share snapshot waiting for deletion in |
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.
space after NOTE:
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.
Done
|
Also need a rebase. |
pkg/model/proto/model.proto
Outdated
| // The locality that file share belongs to, required. | ||
| string availabilityZone = 6; | ||
| // The service level that file share belongs to, required. | ||
| string profileId = 7; |
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 should be removed.
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.
ok i will remove
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.
Done
pkg/model/proto/model.proto
Outdated
| string id = 1; | ||
| // The service level that fileshare belongs to, required. | ||
| // This item will be replace by profile | ||
| string profileId = 2; |
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.
Remove it. We already have profile below.
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.
ok i will remove
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.
Done
7b25b29 to
047e9ba
Compare
047e9ba to
732aa53
Compare
leonwanghui
left a comment
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.
LGTM
What this PR does / why we need it:
Implementation of controller and dock for file share feature - only implemented create, delete file share operation. Still driver code implementation is in progress. Integration test has to be done yet with sample driver code.
File share post code workflow is as below:
Controller workflow:
1 gRPC interface(model/fileshareproto, filesharecontroller.go)
2 Fileshare controller client(filesharecontroller/client)
3 selector to select the profiles
4 Filesharecontroller server(filesharecontroller/controller.go)
Dock workflow
1 It checks with fileshareproto to validate the dock creation
2 Client communicates to dock server(filesharedock/client)
3 Server dock.go - which registers to the dock and provision the dock so it contacts dock/discovery to discover and maps to backend drivers
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note: