docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

Driver RPC Interface Specification #2719

Open prologic opened 8 years ago

prologic commented 8 years ago

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?

nathanleclaire commented 8 years ago

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?

prologic commented 8 years ago

@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?

nathanleclaire commented 8 years ago

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

prologic commented 8 years ago

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

nathanleclaire commented 8 years ago

@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).

prologic commented 8 years ago

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

prologic commented 8 years ago

Bump!