Solomon Hykes
0d08d36bf5
beam: new routing functions Route.KeyEquals, Route.KeyIncludes, Route.NoKey
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:23 -07:00
Solomon Hykes
30424f4e3a
beam/examples/beamsh: use beam.Router to simplify 'trace'
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:23 -07:00
Solomon Hykes
d3df4b5baf
beam/examples/beamsh: move builtins to a separate file for readability
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:23 -07:00
Solomon Hykes
0822d67b2d
beam/examples/beamsh: simplify commands by always creating and sending stdout and stderr for them
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:23 -07:00
Solomon Hykes
63fd2ec0f7
beam/examples/beamsh: use beam.Router to simplify 'logger'
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:23 -07:00
Solomon Hykes
9206b18818
beam/examples/beamsh: use beam.Router to simplify the 'stdio' command
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:23 -07:00
Solomon Hykes
8f5435e80c
beam: Router can route beam messages with a convenient set of rules and handlers
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:23 -07:00
Solomon Hykes
40b4f86eab
beam/examples/beamsh: move example scripts to scripts/
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Alexander Larsson
1fb0bf1b3b
beam: Fix double close of fds in SendUnix
...
Instead of calling syscall.Close() on the fds in sendUnix() we call
Close() on the *os.File in Send(). Otherwise the fd will be closed, but
the *os.File will continue to live, and when it is finalized the
fd will be closed (which by then may be reused and can be anything).
This also adds a note to Send() the the file is closed.
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-04-22 15:50:22 -07:00
Solomon Hykes
a88d8d678b
beam: more unit tests
...
This adds testing to SendConn.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Solomon Hykes
06df94d55b
beam/examples/beamsh: add scripts to reproduce various bugs
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Solomon Hykes
d0ca66dded
beam/examples/beamsh: fix 'print' to be pass-through
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Solomon Hykes
b97375fc29
beam/examples/beamsh: rename 'log' to 'logger' to avoid conflict with stdout/stderr
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Solomon Hykes
a2b88b4915
beam/examples/beamsh: 'prompt' asks the user for a value and sends it.
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Solomon Hykes
ed62ca5b2f
beam/examples/beamsh: commands are messages.
...
Commands in the pipeline should either implement or pass-through command messages.
This amounts to a proof-of-concept implementation of the "pipeline"
design of Docker plugins.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Solomon Hykes
2f4b8b7e8d
beam/examples/beamsh: cosmetic fix in Fatalf
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:22 -07:00
Solomon Hykes
4f92ffb500
beam: replace SendPair() with the simpler SendConn()
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Solomon Hykes
5833e78887
beam/examples/beamsh: miniserver.ds demo
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Solomon Hykes
70d3262161
beam: improve the API with Sender/Receiver interfaces and utilities: Copy/SendPipe/SendPair
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Alexander Larsson
b0228d94be
beam: Make extracted Fds CloseOnExec
...
Grab forklock to make sure no forks accidentally inherit the new fds
before they are made CLOEXEC There is a slight race condition between
ReadMsgUnix returns and when we grap the lock, so this is not
perfect. Unfortunately There is no way to pass MSG_CMSG_CLOEXEC to
recvmsg() nor any way to implement non-blocking i/o in go, so this is
hard to fix.
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-04-22 15:50:21 -07:00
Solomon Hykes
207e604bad
beam/examples/beamsh: add a few example dockerscripts
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Solomon Hykes
29ddf2be1e
beam/examples/beamsh: simplify code by using sendWPipe utility
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Solomon Hykes
1dc449e11d
beam/examples/beamsh: move code around for readability
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Solomon Hykes
3a2b31a30b
beam/examples/beamsh: 'exec' adds 'fromcmd' field to its output
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Solomon Hykes
7534f7a34b
beam/examples/beamsh: simple 'log' command tees streams to a local directory
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:21 -07:00
Solomon Hykes
4f5b94d369
beam/examples/beamsh: 'render' and 'beamsh -x'
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
4ebe7aab91
beam/examples/beamsh: run commands in an implicit context of pre-loaded 'plugins'
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
cd85af06fe
beam/examples/beamsh: convenience commands 'devnull', 'echo' and 'stdio'
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
6d9cdbf24f
beam/examples/beamsh: 'emit' supports key=value syntax to compose arbitrary objects
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
2b81fb8424
dockerscript: '=' is not a special character
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
6e0a156d90
beam/examples/beamsh: support for background commands with '&' terminator
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
08686f1d21
beam/data: Message.Parse creates a message from shell-style 'key=value' arguments
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
ffe19414b1
dockerscript: support '#' line comments
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
e1c8dbba97
beam/examples/beamsh: scripts can be passed as filenames
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
222fc87ade
beam/examples/beamsh: remote communication over beam (experimental).
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:20 -07:00
Solomon Hykes
371f6fc63d
beam/examples/beamsh: 'in' chdirs to a directory. 'pass' does simple passthrough
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
6d5c75a224
beam/examples/beamsh: 'beamsend' command serializes all messages and sends them over a network connection
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
5ddf673851
beam/examples/beamsh: 'exec' command correctly closes stdout and stderr when the process exists
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
e512fef425
beam/examples/beamsh: don't print discarded messages in Devnull
...
This avoids false alarms when process exits without printing. Devnull
doesn't require synchronization.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
34c5724b89
beam/examples/beamsh: more useful debugging
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
a5bc75d406
beam/data: expose EncodeString for convenience access to the underlying netstring primitive
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
fb1af1f0bc
beam/examples/beamsh: utility function 'fileToConn'
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
74b90c25d9
beam/examples/beamsh: 'connect' command
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
dff9854305
beam/examples/beamsh: 'exec' and 'listen' commands
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:19 -07:00
Solomon Hykes
3686d50429
beam/examples/beamsh: prettier devnull
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:18 -07:00
Solomon Hykes
c9b8e0fcac
beam/data: prettier Message.Pretty()
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:18 -07:00
Solomon Hykes
d7a2ae8e13
beam/examples/beamsh: prettier 'trace' command
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:18 -07:00
Solomon Hykes
eca6fecb59
beam/data: convenience Message.Pretty() function
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:18 -07:00
Solomon Hykes
d4920b3fff
beam/examples/beamsh: basic implementation of the pipeline design, with static handlers for now.
...
In the pipeline design, several beam commands can be run concurrently,
with their respective inputs and outputs connected in such a way that
beam messages flow from the first to last. This is similar to the way
a unix shell executes commands in a pipeline: instead of STDIN and
STDOUT, each beam command has a "BEAMIN" and "BEAMOUT".
Since beam allows for richer communication than plain byte streams, beam
pipelines can express more powerful computation, while retaining the
fundamental elegance and ease of use of unix-style composition.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:18 -07:00
Solomon Hykes
ec288895e5
beam/examples/beamsh: better debugging messages
...
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:18 -07:00