-
Notifications
You must be signed in to change notification settings - Fork 262
Conversation
Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Please sign your commits following these rules: $ git clone -b "multiplex-instance" [email protected]:chungers/infrakit.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354749768
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
Current coverage is 65.02% (diff: 79.31%)@@ master #360 diff @@
==========================================
Files 44 45 +1
Lines 2110 2153 +43
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1375 1400 +25
- Misses 596 608 +12
- Partials 139 145 +6
|
Looks good to me. I don't think you meant to include pkg/rpc/client/client.test, though. |
Signed-off-by: David Chung <[email protected]>
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 but doc updates should probably be made as well to describe this change.
…proper plugin.Name Signed-off-by: David Chung <[email protected]>
@FrenchBen - I will add docs on this, but for now, there are no typed instance plugins and everything still works as before. I will add another PR to consider doing the same thing to Flavors too. This is because it turns out Flavor has a pretty ready example -- the swarm flavor. The current swarm flavor uses a field inside its config to decide if it's for a swarm manager or worker. If we use the same approach, then we can easily have |
Added note for diag as an AWS only feature
To better support different resource types (see #290), this PR introduces multiplexing a single RPC endpoint for instance plugin onto multiple, typed instance spi objects. This is done at the RPC server and client level so that we can preserve the current instance SPI while supporting new resource types other than compute (which up to now the instance plugin SPI implies):
/
to denote a base and a subtype:For instance, existing plugin name of
instance-vagrant
still works just fine, but it is now possible to have plugin references such asaws/subnet
andaws/vpc
. This means that there is a single RPC server namedaws
(as socket file) and it hosts multiple instance plugin spi objects, one implementing the SPI for provisioning asubnet
and one forvpc
.compute
by a plugin that can support different types of resources.rpc_multi_test.go
for example usage. In summary, you can bind multiple instance plugin spi implementations to a single RPC endpoint like so:and for client, looking up is the same. Given a JSON like
The plugin discovery now takes the name format into account and connects to the single RPC endpoint (
aws
) but routes the client's method calls to the typed / bound SPI object in the server (subnet
).switch/case
in its own implementation. Instead, theswitch/case
by type is done by the RPC transport. This simplifies the development of resource typed instance plugins and avoids near duplication of SPI just to support different resource types.