Commit Graph

1335 Commits

Author SHA1 Message Date
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
Solomon Hykes 142e43a447 Use codegansta/cli for argument parsing 2014-05-01 17:27:17 -07:00
Solomon Hykes cb213c5a68 Better error messages 2014-05-01 17:26:46 -07:00
Solomon Hykes 4bdc2407b6 Sleep 1 full second at startup to workaround a race condition in api/server 2014-05-01 17:25:17 -07:00
Solomon Hykes 29df891a2d Add .gitignore 2014-05-01 16:29:39 -07:00
Solomon Hykes cd9abab36a Move call logger to a separate backend (more backends to come) 2014-05-01 16:29:16 -07:00
Solomon Hykes ca7c1fbf49 Add basic README 2014-05-01 16:21:14 -07:00
Solomon Hykes f132e3fb03 Initial commit 2014-05-01 16:13:41 -07:00
Alexander Larsson e9651077fc beam: Add simple framing system for UnixConn
This is needed for Send/Recieve to correctly handle borders between
the messages.

The framing uses a single 32bit uint32 length for each frame, of which
the high bit is used to indicate whether the message contains a file
descriptor or not. This is enough to separate out each message sent
and to decide to which message each file descriptors belongs, even
though multiple Sends may be coalesced into a single read, and/or one
Send can be split into multiple writes.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-05-01 11:06:01 -07:00
Tianon Gravi d0b1155e89 Fix various MAINTAINERS format inconsistencies
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-04-30 11:22:11 -06:00