Add gcepd support for VolumeInspectByName #579
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement
VolumeInspectByName
for thegcepd
driver. This provides an optimized lookup when callers are wanting to lookup a volume by name instead of by ID. This prevents the framework (>= 0.6.1) or the integration driver (<= v0.6.0 and before from having to aVolumes()
call and then string match on the name.Just for fun, some simple performance numbers. This is using REX-Ray 0.9.0, 0.9.1, and 0.9.1+this patch on GCE with 10 volumes defined. Ran a loop 10 times with
docker inspect
. REX-Ray 0.9 would have calledVolumes()
, retrieving a list of all volumes and then finding the desired one to inspect. 0.9.1 Would callVolumeInspect()
with a flag that has the framework do theVolumes()
call followed by the string match instead of the integration driver (eliminating an entire API call between client and server, but it still occurs from the framework so there isn't a big different when doing all-in-one), and this patch would have the framework callVolumeInsepectByName()
directly, eliminating the call toVolumes()
entirely.This results in an average (in seconds) of:
As expected, there isn't much difference between 0.9.0 and 0.9.1 in this setup. Though I think 0.9.1 would win out if you scaled up the number of volumes and made it a distributed setup. But this patch has the biggest effect overall, because no call to
Volumes()
is needed at all. DIsparity between the two will only grow as the number of volumes increases.FWIW, this performance improvement is only realizable by Docker and
docker volume
commands right now. Some changes would have to occur in REX-Ray to take advantage of this from therexray
CLI.