Commit Graph

844 Commits

Author SHA1 Message Date
Brendan Burns db08b61616 Added instructions for adding a new backend. 2014-05-20 16:00:48 -07:00
Solomon Hykes 74eaf8492f Merge pull request #9 from shykes/pr_out_beam_messages_can_attach_arbitrary_file_descriptors 2014-05-19 14:23:16 -07:00
Solomon Hykes c9a7897773 Beam messages can attach arbitrary file descriptors.
Each transport is responsible for implementing file passing using the
best available method.

Current state of implementation:

* inmem: full
* unix: not yet implemented
2014-05-19 14:21:45 -07:00
Solomon Hykes 6fedd8c7ab Construct messages with explicit fields to allow for new fields
This is in preparation for the new `Attachment` field.
2014-05-19 14:20:53 -07:00
Solomon Hykes 800bf713eb Merge pull request #8 from shykes/pr_out_hub_a_hub_for_self_registering_services_using_any_beam_transport 2014-05-19 13:50:00 -07:00
Solomon Hykes b0073384ac Merge pull request #7 from shykes/pr_out_placeholder_for_http2_transport 2014-05-19 13:49:42 -07:00
Solomon Hykes e7e31cf71b Hub: a hub for self-registering services using any Beam transport 2014-05-19 13:48:49 -07:00
Solomon Hykes c6f0a70141 Move utilities and interfaces out of `inmem`
* `utils.Buffer`: a Sender which stores messages in a slice
* `utils.Copy`: beam equivalent of `io.Copy`
* `utlis.NopSender`: a Sender which silently discards messages
* `utlis.NopReceiver`: a Receiver which always returns EOF
2014-05-19 13:45:33 -07:00
Solomon Hykes b49480e01f Placeholder for http2 transport 2014-05-19 13:27:55 -07:00
Solomon Hykes 0d2df42abb Merge pull request #3 from aanand/pass-through-containers-params
Pass through params to `containers` in `forward` backend
2014-05-19 07:51:27 -07:00
Solomon Hykes df3394c350 Merge pull request #5 from docker/unix
Expose the unix transport under the new interface
2014-05-18 17:48:14 -07:00
Solomon Hykes 384c505106 Test that beam/utils.StackSender works with beam/unix
[Signed-off-by: Solomon Hykes <solomon@docker.com>]
[Signed-off-by: Paul Nasrat <pnasrat@gmail.com>]
2014-05-18 16:52:37 -07:00
Solomon Hykes c4c06fb39a Add support for nested streams in beam/unix
[Signed-off-by: Solomon Hykes <solomon@docker.com>]
[Signed-off-by: Paul Nasrat <pnasrat@gmail.com>]
2014-05-18 16:42:03 -07:00
Solomon Hykes 78dcbe03d2 Start to move unix implementation to new beam interface.
Nested streams not yet supported, only supporting mode 0.

[Signed-off-by: Solomon Hykes <solomon@docker.com>]
[Signed-off-by: Paul Nasrat <pnasrat@gmail.com>]
2014-05-18 15:37:19 -07:00
Solomon Hykes c2c078952c Move unix implementation to a sub-package, promote inmem interfaces to top-level
[Signed-off-by: Solomon Hykes <solomon@docker.com>]
[Signed-off-by: Paul Nasrat <pnasrat@gmail.com>]
2014-05-18 14:40:44 -07:00
Solomon Hykes 8c645d0236 Initial README and AUTHORS file
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:28 -07:00
Solomon Hykes 165164ded0 inmem: fix StackSender
StackSender is now more solid, with the beginning of a test harness.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes 1f1de00af8 inmem: Buffer is a convenience message buffer
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes b9c316df29 inmem: complete Copy implementation
Copy can now handle arbitrary nesting of streams, without knowing the
underlying type of either the source or destination.

It does this by attempting `SendTo` and `ReceiveFrom`, then if that is
not supported, falling back to nested copies in separate goroutines.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes 1508c1d46f inmem: PipeSender and PipeReceiver return clean nil values
This is necessary because `(*PipeSender)nil` is not equal to
`(interface{})nil`.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes 048bed0cd1 inmem: a message is simply 1 opcode + an array of binary strings.
Remove redundant `Data` field. Every argument can be arbitrary data.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes 5b89b2fd83 inmem.StackSender.Add returns a reference to the previous chain
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:47:34 -07:00
Solomon Hykes 7d0ba6e26b inmem: Sender implements Close
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:24 -07:00
Solomon Hykes 655a0af862 inmem: NopReceiver and NopSender
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes 12b5459a1c inmem.StackSender: a dynamic beam forwarded with health checks
StackSender forwards beam messages to a dynamic list of backend receivers.
New backends are stacked on top. When a message is sent, each backend is
tried until one succeeds. Any failing backends encountered along the way
are removed from the queue.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes 6616f08fe0 inmem: gofmt
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes ffa47f5445 inmem: fix the tests
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes f22b8f52f3 inmem: Receiver and Sender don't need to implement Close
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes 91133d63be inmem: Fix PipeSender to implement ReceiverFrom
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes 1eb832dcbc inmem: Copy requires either SenderTo or ReceiverFrom
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes 3d03104af4 data: expose EncodeList and DecodeList
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:11 -07:00
Solomon Hykes 0feebd2320 inmem: Implement `Copy`, `ReceiveFrom` and `SendTo`
* Copy is the beam equivalent of `io.Copy`
* `ReceiveFrom` is the beam equivalent of `io.ReadFrom`
* `SendTo` is the beam equivalent of `io.WriteTo`

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:44:23 -07:00
Solomon Hykes a5cb570bfb inmem: more testing
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:44:20 -07:00
Solomon Hykes 338a7d50a8 inmem: fix nested in/out channels in each message
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:41:38 -07:00
Solomon Hykes caa6004064 inmem: use pkg/testutils
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:41:21 -07:00
Solomon Hykes a1ed1ec1fa inmem: switch to a Sender/Receiver/Pipe interface similar to io.Pipe
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:40:31 -07:00
Solomon Hykes 323ebae5f6 Add LICENSE and NOTICE 2014-05-16 17:53:39 -07:00
Solomon Hykes f887982f22 Update README to explain libswarm 2014-05-16 17:52:06 -07:00
Aanand Prasad a799e0fe20 Pass HTTP params through when forwarding `containers` job 2014-05-15 14:55:19 +01:00
Aanand Prasad f6f3cd3181 Copy env when creating job in catchall 2014-05-15 14:55:03 +01:00
Solomon Hykes c0364720db beam: no target field yet 2014-05-09 21:00:46 -07:00
Solomon Hykes 3725628467 Beam in-mem: an in-memory implementation of Beam 2014-05-09 21:00:46 -07:00
Solomon Hykes 2c9e18009f Fix stdin handling in engine.Sender and engine.Receiver
This introduces a superficial change to the Beam API:

* `beam.SendPipe` is renamed to the more accurate `beam.SendRPipe`
* `beam.SendWPipe` is introduced as a mirror to `SendRPipe`

There is no other change in the beam API.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-05-09 15:39:55 -07:00
Solomon Hykes e3cf0c416f Document backends 2014-05-02 16:18:52 -07:00
Solomon Hykes 954e5334f0 Basic forward backend 2014-05-02 12:52:44 -07:00
Solomon Hykes 3aed457ac5 Freeze dependencies with godep 2014-05-01 23:39:13 -07:00
Solomon Hykes 6a6596913a First skeleton of a simulator 2014-05-01 23:31:06 -07:00
Solomon Hykes a1b63f4b79 Pass standard streams through between frontend and backend 2014-05-01 23:30:34 -07:00
Solomon Hykes 9acaf7597f Backends can receive arguments 2014-05-01 18:32:06 -07:00
Solomon Hykes c22a80a071 Choose a single backend with `--backend`
Note: for now there is only one backend available, `debug`
2014-05-01 18:13:55 -07:00