Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Plugin Architecture #1

@mitchellh

Description

@mitchellh

We need a plugin architecture in place. Because Golang doesn't support dynamic linking of any kind, we'll have to use IPC for this. To keep things as simple as possible, let's go with the net/rpc package to get this done.

Ideas:

  • Given a binary, such as packer-build, the plugin lib must execute the underlying executable using os/exec or whatever. It must then initiate and abstract the RPC stuff.
  • To most of Packer, plugins must appear just as normal implementers of interfaces such as Command or Builder. Keep it simple!
  • Multiple packer instances must be able to run at one time, so static ports for listening on RPC is not possible.

Other notes:

  • I had an idea to use stdin/stdout for the communication mechanism for net/rpc. If this gets done, can the plugin call back into Packer? There are cases where this is necessary, so it is important that is possible.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions