Commit Graph

105 Commits

Author SHA1 Message Date
24c85b9176 Merge pull request #5706 from vieux/remove_add_string
Upstream-commit: 8d213e91b3ef0ed77d43ec20d378be01dfe7ed5c
Component: engine
2014-05-14 17:31:52 -07:00
69200e5e03 Engine: Receiver and Sender preserve Job.Env
When sending a new job to a `engine.Sender`, the corresponding
`engine.Receiver` will receive that job with its environment preserved.
Previously the job name, arguments and streams were preserved but the
env was lost.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: a1754c7e46b321c2a079fc5186984a847aa50218
Component: engine
2014-05-09 17:10:33 -07:00
371479ab9f Engine: Env.MultiMap, Env.InitMultiMap: import/export to other formats
* `Env.MultiMap` returns the contents of an Env as `map[string][]string`
* `Env.InitMultiMap` initializes the contents of an Env from a `map[string][]string`

This makes it easier to import and export an Env to other formats
(specifically `beam/data` messages)

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: c7978c98097b92b659e2ea1763cd134b0695407e
Component: engine
2014-05-09 17:06:32 -07:00
9cb18397df Engine: ensure all pipes are properly closed by Receiver and Sender
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)

[michael@docker.com: fix stdin closing in engine.Job.Run]
[michael@docker.com: fix fd leak in engine.Receiver.Run]
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)

Docker-Tested-By: Solomon Hykes <solomon@docker.com>
Docker-Tested-by: Michael Crosby <michael@docker.com>
Upstream-commit: d61190169de27bc58f1fe4a8f49b37bd2294d489
Component: engine
2014-05-09 16:12:21 -07:00
1b604a326b Engine: slightly more stress-testing of Receiver/Sender to reproduce the hang problem
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: bf25951837440286fb185f97f7c9cfda11962cab
Component: engine
2014-05-09 15:49:44 -07:00
4cfcc681e6 Engine: fix a timeout bug in Sender/Receiver
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: dfdc03b061d5bd5a7557f077b500304d4da26d2e
Component: engine
2014-05-09 15:49:44 -07:00
c3352a3b6c 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)
Upstream-commit: 0aeff69e5900a15e3872494ac0009600f6c1c372
Component: engine
2014-05-09 15:39:55 -07:00
1e0b101a68 Merge pull request #5686 from crosbymichael/cast-to-closer
Cast Input and Output to io.Closer
Upstream-commit: 0f6fe22833213cc09ffc39f9584dcd3ce10ac9fa
Component: engine
2014-05-09 11:17:53 -07:00
cc0e75c911 remove addString and replace Tail
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: e304e3a6624e740159e99e83d6d13f0a3cdfeb49
Component: engine
2014-05-09 18:09:59 +00:00
0d11cb3ece Cast Input and Output to closer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 170e4d2e19258c4e45b975177618640cb554c32b
Component: engine
2014-05-08 12:57:19 -07:00
e6d82972c8 move Table to a separate file and add additional unit tests
Docker-DCO-1.1-Signed-off-by: Bryan Murphy <bmurphy1976@gmail.com> (github: bmurphy1976)
Upstream-commit: fdccfaf72a614872aeeb79e9cee7f42abcaacf6d
Component: engine
2014-05-08 02:31:23 +00:00
e8fbf35f7c Engine: empty job names are illegal, catchall or not
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 3b73c26194836c1e2b737146a5b0c840226c65d2
Component: engine
2014-05-02 15:25:33 -07:00
8727b434c7 engine: catchall handler is shadowed by specific handlers
This allows using `Engine.Register` and `Engine.RegisterCatchall` on the
same engine without the catchall hiding all other handlers.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: de75af9fe2d91df7297e498d320b496addfb52f4
Component: engine
2014-05-02 15:25:32 -07:00
bde45636d6 Fix various MAINTAINERS format inconsistencies
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: defecac2799ca0c72532b7e6ed6005cc54ee2e25
Component: engine
2014-04-30 11:22:11 -06:00
760aa19df4 Merge pull request #5320 from JackDanger/jackdanger/typo-doc-fix
Upstream-commit: 20e9f61971a858baef1c8035f5f08ceefdc7c92d
Component: engine
2014-04-29 17:41:16 -07:00
6f6b2c01f3 Merge pull request #5422 from shykes/engine-spawn
engine/spawn: run an engine in a subprocess, remote-controlled by Beam
Upstream-commit: d8332f433f667971e84d5ecfb30348797f50e83c
Component: engine
2014-04-28 12:56:02 -07:00
cdda6fcada engine.Len returns the number of keys in an env
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 9b23178f585f65b9dc9558694d6de4207c479801
Component: engine
2014-04-28 00:37:42 -07:00
da3f4afb39 engine/spawn: run an engine in a subprocess, remote-controlled by Beam
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: b4b83ef8ae788cb7e016fbf90f0c1b890af7b23d
Component: engine
2014-04-27 14:11:46 -07:00
823835353e Fix bug in engine.Sender
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 9236e088eb5a9a6d662b08ef7983dbecf01e6ef0
Component: engine
2014-04-27 14:11:45 -07:00
c5be0fd91f Merge pull request #5374 from shykes/beam-engine
Remote communication between engines using beam
Upstream-commit: 62f4c884439044475eeaf7a18cd8a260df08a880
Component: engine
2014-04-27 14:10:59 -07:00
c0ccb32841 Merge pull request #5365 from crosbymichael/job-status
Add exported status code from a job
Upstream-commit: 4701f8ee60db9af11f35d24f8d4b163490722d60
Component: engine
2014-04-25 17:27:07 -07:00
e77e02d78a engine: 'rengine' is a small command-line utility to debug remote engine
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 7e3624a498b8b96a4e8a0f1d59fc2c50bf48efb3
Component: engine
2014-04-25 17:23:47 -07:00
bceccfa5cf engine.Sender and engine.Receiver support stdin
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: b63b98ee2766321e2ca6f3b159c2bfb303870105
Component: engine
2014-04-25 17:23:47 -07:00
2e9c0c6ca2 Remote communication between engines using beam
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 3c1d5ca33ecbd644d4e8d864ff59b389f4a4a555
Component: engine
2014-04-25 17:23:47 -07:00
35fee9d895 engine: allow registering a "catchall" handler which receives all commands
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 68d3e757503fab422fc96a00d511336a3fdfd619
Component: engine
2014-04-25 17:23:16 -07:00
8fdb34e01b engine.Installer: a standard interface for "installable" services
Installer is a standard interface for objects which can "install"
themselves an engine by registering handlers.

This can be used as an entrypoint for external plugins etc.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 9422451ac3f541a17daba0d5f6dc8b40a6edc9e9
Component: engine
2014-04-25 17:23:16 -07:00
f06dbcb7ce Merge pull request #5345 from shykes/engine-installer
engine.Installer: a standard interface for "installable" services
Upstream-commit: 0fe48b0e5914fa1384d061546970e23fb348b53f
Component: engine
2014-04-23 16:16:55 -07:00
4ac9260833 Add exported status code from a job
This allows the job's status code to be consumed externally so that we
can use it as an exit code or saving to a state file.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f90029611fec082a41b5629e43a88a39f0674fe2
Component: engine
2014-04-23 13:47:56 -07:00
d8eb119f29 Remove error from engine.New()
Without creating a root there is no way for the engine to return an
error from the new function.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 7100ace42bda2660d1eaecb2ec096ba6753688ea
Component: engine
2014-04-23 11:54:35 -07:00
5c5b3c1ca6 Remove the concept of a root dir out of engine
This makes the engine more general purpose so that we can
use it and the job routing functionality for reexec'ing our binary
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Conflicts:
	integration/runtime_test.go
Upstream-commit: 672edfe807c597a1c245bce996a150dfdf273a3c
Component: engine
2014-04-22 19:04:03 -07:00
bea68ba524 engine.Installer: a standard interface for "installable" services
Installer is a standard interface for objects which can "install"
themselves an engine by registering handlers.

This can be used as an entrypoint for external plugins etc.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 4353f25e10d19f414bdd5b20488824fb2b834d6e
Component: engine
2014-04-22 16:51:06 -07:00
44ed49fbeb Clean up MAINTAINERS files
* Remove out of date "vacation mode"
* Fix my email address
* Remove infrastructure maintainers to reflect reality (core maintainers
are currently maintaining their own infrastructure).

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 19e6614eeb31d6a986ef61486e15aeb09cc952b8
Component: engine
2014-04-21 18:17:13 -07:00
66881af057 typo fix: 'methid' -> 'method'
Upstream-commit: 611a1d711bc382fb0dafafbdea5a5091383de972
Component: engine
2014-04-19 23:25:48 -07:00
e5168686ec Engine: optional Logging field to disable custom logging in engine.
* The default behavior is preserved
* This disables the use of the `TEST` environment variable in engine.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: ea2fba5ce04d3eb2a8959b8f5116604faae1e88a
Component: engine
2014-04-07 21:41:25 +00:00
76c76ce8f5 Revert "engine: fix engine.Env.Encode() to stop auto-guessing types."
This reverts commit 76057addb255e6f14dd03c276317abc759a15a80.

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 95e6fd819bbef09032bf680e0f7dadd7fbf44559
Component: engine
2014-04-04 11:29:56 -07:00
53e20d9286 engine: fix engine.Env.Encode() to stop auto-guessing types.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 76057addb255e6f14dd03c276317abc759a15a80
Component: engine
2014-04-03 23:53:42 +00:00
04d68b69ad handle symlinks for Docker's root dir & TMPDIR
This removes the incomplete symlink handling from engine.go and it adds
it one place in docker.go.

It also enables handling symlinks for TMPDIR.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 611acf7a7c1c3a6796e862fb94143890a9aa4573
Component: engine
2014-03-03 23:00:53 +02:00
764f9b0016 Merge pull request #4314 from shykes/engine-commands
Engine: builtin command 'commands' returns a list of registered commands
Upstream-commit: 56584a92f43f7f05789b345970d672bcbbdd32b0
Component: engine
2014-02-25 09:59:26 -08:00
c924c9e051 Merge pull request #4315 from shykes/engine-parsejob-test
Engine: add tests for ParseJob() 
Upstream-commit: ad88d0be83fa317010fbeabe09471948256b1207
Component: engine
2014-02-24 14:27:19 -08:00
102c3daac9 Merge pull request #4312 from shykes/engine-error-reporting
Engine: clearer job error reporting
Upstream-commit: 4a4915c8eef8d49f9d68a85f01435301a203acb4
Component: engine
2014-02-24 13:58:12 -08:00
1560c87c83 Engine: tiny cosmetic fix
To make @creack happy :)

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 0469e7d0622add573f2f9c357564ff0076db9346
Component: engine
2014-02-24 12:31:39 -08:00
0070aebcd1 Engine: add tests for ParseJob()
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: d985fd49843b31b227b46d5ed71914002e2e0de9
Component: engine
2014-02-24 12:31:39 -08:00
171ee11139 Engine: builtin command 'commands' returns a list of registered commands
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: cd846ecb60ad936d58d70762ed91cffa906cef93
Component: engine
2014-02-24 12:29:49 -08:00
32c3efbd4e Engine: cleanup side effects between tests
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 62b21daded2ea9b703a6e5fa0479e007016b1edb
Component: engine
2014-02-24 12:29:39 -08:00
e69a84baec Engine: clearer job error reporting
* Job.Error and Job.Errorf always print a newline.
* Avoid redundant prefixing of error messages.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 8a1778301bffaf46abbce5cb76c1add47bd241a0
Component: engine
2014-02-24 11:53:56 -08:00
f14c0fd180 Engine.ParseJob: create a new job from a shell-like text command.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 2019a73f0387af273be3b6e085fdae0e5a67ba3b
Component: engine
2014-02-24 11:38:13 -08:00
d029fb179f Fix engine tests on systems where temp directories are symlinked.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 353cc8c2a5d9ae4c02dc94e14cd2ad6d3393992d
Component: engine
2014-02-15 14:39:51 -08:00
9365dcaac9 add setSubEnv and getSubEnv
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 8fbdb7b59eba078bf24546686e005cc86a60e493
Component: engine
2014-01-31 04:01:46 +00:00
b237b19a08 job.error\* now return engine.StatusErr
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 24086fa75dff1ebb56dfb8fbf2c80fdfd5be0e8a
Component: engine
2014-01-31 04:01:46 +00:00
f6edb78234 use exists
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 1498cd4e0540c73546a4847948f7d6a75b596178
Component: engine
2014-01-31 02:21:59 +00:00