-
Notifications
You must be signed in to change notification settings - Fork 50
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
FittedCloud storage driver #408
Conversation
|
||
// Check if name and size are same, and volume is encrypted | ||
assert.Equal(t, volumeName, reply.Name) | ||
fc_size := (size + fcagent.FcVolMaxCloudDisk - 1) / fcagent.FcVolMaxCloudDisk |
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.
don't use underscores in Go names; var fc_size should be fcSize
|
||
// Check if name and size are same | ||
assert.Equal(t, volumeName, reply.Name) | ||
fc_size := (size + fcagent.FcVolMaxCloudDisk - 1) / fcagent.FcVolMaxCloudDisk |
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.
don't use underscores in Go names; var fc_size should be fcSize
|
||
var ( | ||
encryption bool | ||
kmsKeyId string |
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.
var kmsKeyId should be kmsKeyID
if len(strs) == 2 { | ||
if strs[1] == "NOTFOUND" { | ||
return cmdOut, errors.New("fcvol not found") | ||
} else { |
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.
if block ends with a return statement, so drop this else and outdent its block
return string(cmdOut), err | ||
} | ||
|
||
func GetFcVolName(devName string) (string, error) { |
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.
exported function GetFcVolName should have comment or be unexported
} | ||
} | ||
|
||
func DelVol(fcVolName string) (string, error) { |
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.
exported function DelVol should have comment or be unexported
if cmdOut, err = exec.Command(cmd, args...).Output(); err != nil { | ||
log.Debug(err) | ||
return string(cmdOut), err | ||
} else { |
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.
if block ends with a return statement, so drop this else and outdent its block
) | ||
size_gb := strconv.Itoa(sizeGb) | ||
initGb := (sizeGb + FcVolMaxCloudDisk - 1) / FcVolMaxCloudDisk | ||
init_gb := strconv.Itoa(initGb) |
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.
don't use underscores in Go names; var init_gb should be initGb
err error | ||
fcVolName string | ||
) | ||
size_gb := strconv.Itoa(sizeGb) |
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.
don't use underscores in Go names; var size_gb should be sizeGb
return string(cmdOut), err | ||
} | ||
|
||
func CreateVol(tagName string, sizeGb int, encryption bool, kmsKeyId string) (string, error) { |
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.
exported function CreateVol should have comment or be unexported
func parameter kmsKeyId should be kmsKeyID
FcVolMaxCloudDisk = 6 | ||
) | ||
|
||
func IsRunning() (string, error) { |
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.
exported function IsRunning should have comment or be unexported
) | ||
|
||
const ( | ||
FcVolMaxCloudDisk = 6 |
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.
exported const FcVolMaxCloudDisk should have comment (or a comment on this block) or be unexported
Codecov Report
@@ Coverage Diff @@
## release/0.5.0 #408 +/- ##
=============================================
Coverage 31.1% 31.1%
=============================================
Files 29 29
Lines 1752 1752
=============================================
Hits 545 545
Misses 1149 1149
Partials 58 58 Continue to review full report at Codecov.
|
Thank you for this PR. I've enjoyed our chats via e-mail up this point, so I look forward to working with you and your team to get this PR merged and into an upcoming release of libStorage and REX-Ray. |
return string(cmdOut), err | ||
} | ||
|
||
// Given a disk name, returns the FittedCloud volume name. |
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.
comment on exported function GetFcVolName should be of the form "GetFcVolName ..."
return fcVolName, nil | ||
} | ||
|
||
// Delete a FittedCloud volume by name |
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.
comment on exported function DelVol should be of the form "DelVol ..."
} | ||
|
||
// Create a FittedCluod volume | ||
func CreateVol(tagName string, sizeGb int, encryption bool, kmsKeyId string) (string, error) { |
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.
func parameter kmsKeyId should be kmsKeyID
return string(cmdOut), err | ||
} | ||
|
||
// Create a FittedCluod volume |
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.
comment on exported function CreateVol should be of the form "CreateVol ..."
FcVolMaxCloudDisk = 6 | ||
) | ||
|
||
// Is FittedCloud Agent running? |
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.
comment on exported function IsRunning should be of the form "IsRunning ..."
) | ||
|
||
const ( | ||
// Max number of FittedCloud cloud disks |
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.
comment on exported const FcVolMaxCloudDisk should be of the form "FcVolMaxCloudDisk ..."
Have you validated this driver with your own internal testing? |
Hi @akutz, Yes, we have. We also ran the fittedcloud.test. |
This doc should give a better idea of how to use it: FittedCloud EBS Driver Technical Preview |
Honestly...this looks good. Want to be part of the upcoming libStorage 0.5.0 and REX-Ray 0.80 releases? We need you to rebase this onto the libStorage branch If everything is fine after that I want to merge you into |
FYI, please be aware there was one breaking change to a |
Thanks @akutz. I'll be right on it. |
Please squash this branch. |
To help you squash your branch and update it to reflect the changes I already mentioned above (since your branch still fails to build due to a lack of the aforesuggested signature refactor) I created a branch with your PR. Please just reset your PR's branch to match mine by doing the following: # add my repo as a remote
git remote add kutz https://github.com/akutz/libstorage.git
# fetch my repo
git fetch kutz
# make sure you're on the correct branch
git checkout fittedcloud
# reset the your branch to the tip of mine
git reset --hard kutz/feature/fittedcloud A few notes on which I was being a little lenient, but having rebased your PR and taken a second look I'd like to ask you to handle these items:
For more information on writing commit messages please see this page in the libStorage developer documentation. |
Hi @akutz, Sorry I shouldn't have pushed the code yesterday since I was not done. Thanks for your comments. I will work on them today. The reason I called the executor was to get the next available device name because in our case we might have multiple volumes constituting a fittedcloud optimized volume. To attach those volumes I need to find the next available device names. I can change it so that it's local to the storage driver. |
Hi Jack,
The next device name is part of the attach ops args though. It's sent via the API call.
…--
-a
On Feb 17, 2017, at 6:53 AM, jack-fittedcloud ***@***.***> wrote:
Hi @akutz,
Sorry I shouldn't have pushed the code yesterday since I was not done. Thanks for your comments. I will work on them today.
The reason I called the executor was to get the next available device name because in our case we might have multiple volumes constituting a fittedcloud optimized volume. To attach those volumes I need to find the next available device names. I can change it so that it's local to the storage driver.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
In our case, a Docker volume maps to one or more EBS volumes, depending on the used size of the Docker volume. The next device passed in to the VolumeAttach call is merely one of the constituent EBS volumes carrying the volume name in the "Name" tag. Fittedcloud storage driver then have to attach all EBS volumes carrying the same "Name" tag, as well as the "FittedCloudCreated" tag. This is currently done locally to the storage driver, which I realized means we can't support remote storage server in this version. Our plan is to support that in the next version so we can have something useful for people to start using. Does that make sense? |
RE: support. Hmm...What do you need today to support remote? The ability to pass more than one next device value or the ability to do a one-to-many mapping for Docker vols to EBS vols? |
@akutz, it's not that. The existing Docker/REX-Ray abstraction makes sense. |
I'm going to respond to you via e-mail. |
|
||
var xvdRX = regexp.MustCompile(`^xvd[a-z]$`) | ||
|
||
// Retrieve device paths currently attached and/or mounted |
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.
comment on exported function LocalDevices should be of the form "LocalDevices ..."
registry.RegisterStorageExecutor(fittedcloud.Name, NewDriver) | ||
} | ||
|
||
func NewDriver() types.StorageExecutor { |
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.
exported function NewDriver should have comment or be unexported
fittedcloud.test |
Hi @akutz, Is there a tool I can use to format the source file width to 80 chars? Also, how do I rename my PR's branch to feature/fittedcloud? Should I close this one and create a new PR? |
This patch adds support for the FittedCloud storage driver. FittedCloud provides dynamic sizing and optimization of EBS volumes. More information about FittedCloud is available at http://www.fittedcloud.com/.
There's no tool to format the width of the source files. I just do that manually by setting a gutter in Atom. As for the branch name, don't worry about it for this PR. Please keep it in mind for the future. Thank you. |
FittedCloud EBS Optimizer driver
This driver implements thin-provisioned EBS volumes.