Machine: Driver RPC Interface Specification

Created on 1 Jan 2016  ·  7Comments  ·  Source: docker/machine

Is there a document/pr/issue that describes the RPC Interface for driver plugins? I found a few related issues #1626 and #1902 but I'm struggling to find something more "concrete; there isn't anything in docs that I can see?

driveall

Most helpful comment

@prologic It's built using https://golang.org/pkg/net/rpc/ and the transport codec is gob, which is the native Go blob encoding format. It _might_ be possible to communicate using gob in other languages (see https://groups.google.com/forum/#!topic/golang-nuts/xtXh0yWOens for instance), but it might be more trouble than its worth.

In order to be truly language-agnostic we'd have to use something like JSON-RPC or protobufs which is designed for that specifically. It's definitely something I'm taking into consideration for the future, but would require a version bump on the plugin API (it wouldn't be backwards or forwards compatible).

All 7 comments

Hey @prologic. No formal specification so far (unfortunately :( ) but essentially the idea is you need to implement the Driver interface and then call plugin.RegisterDriver() for your Driver in your plugin binary's main method. Have you looked at some of the linked 3rd party plugins?

@nathanleclaire Thanks for responding! I've looked at various 3rd-party (_not packaged with docker-machine_) however I was under the impression from various issues and pull-requests that the way docker-machine driver plugins worked was language agnostic? (_or at least meant to be?_)

Is this not the case?

@prologic No, it's pretty tightly coupled to Golang net/rpc.

But it's an RPC and talks over a socket no? :) What am I missing :P

@prologic It's built using https://golang.org/pkg/net/rpc/ and the transport codec is gob, which is the native Go blob encoding format. It _might_ be possible to communicate using gob in other languages (see https://groups.google.com/forum/#!topic/golang-nuts/xtXh0yWOens for instance), but it might be more trouble than its worth.

In order to be truly language-agnostic we'd have to use something like JSON-RPC or protobufs which is designed for that specifically. It's definitely something I'm taking into consideration for the future, but would require a version bump on the plugin API (it wouldn't be backwards or forwards compatible).

FWIW; I _want_ to write a driver for Proxmox VE and re-use existing libraries that already know how to talk to the Proxmox VE API9s); e.g: proxmoxer or pyproxmox

Bump!

Was this page helpful?
0 / 5 - 0 ratings