Commit graph

115 commits

Author SHA1 Message Date
Solomon Hykes
eb79dc14fe Engine.Shutdown only waits 5 seconds for active jobs to complete
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:12 +00:00
Solomon Hykes
92105ea0fa Remove unused field from engine.Job
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:12 +00:00
Solomon Hykes
61eab75939 Extra testing for engine.Shutdown
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:12 +00:00
Solomon Hykes
d745067487 Subsystems can register cleanup handlers with Engine.OnShutdown
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Victor Vieux
b3ee9ac74e update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
LK4D4
1d3d1c5d2b Change floats to ints recursively on env encoding
Fixes #6246
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 23:39:26 +00:00
LK4D4
01b424028e Benchmarks for engine/env
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 21:48:16 +04:00
LK4D4
f08cd445b0 Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-18 17:39:57 +00:00
Victor Vieux
384b60b940 remove unused beam, will be back later as libchan
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-11 19:09:55 +00:00
Solomon Hykes
ca231b3de5 pkg/testutils: utility functions to facilitate writing Go tests
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-06-01 23:23:31 +00:00
Solomon Hykes
8d213e91b3 Merge pull request #5706 from vieux/remove_add_string 2014-05-14 17:31:52 -07:00
Solomon Hykes
a1754c7e46 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)
2014-05-09 17:10:33 -07:00
Solomon Hykes
c7978c9809 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)
2014-05-09 17:06:32 -07:00
Solomon Hykes
d61190169d 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>
2014-05-09 16:12:21 -07:00
Solomon Hykes
bf25951837 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)
2014-05-09 15:49:44 -07:00
Solomon Hykes
dfdc03b061 Engine: fix a timeout bug in Sender/Receiver
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-05-09 15:49:44 -07:00
Solomon Hykes
0aeff69e59 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
Victor Vieux
0f6fe22833 Merge pull request #5686 from crosbymichael/cast-to-closer
Cast Input and Output to io.Closer
2014-05-09 11:17:53 -07:00
Victor Vieux
e304e3a662 remove addString and replace Tail
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-09 18:09:59 +00:00
Michael Crosby
170e4d2e19 Cast Input and Output to closer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-08 12:57:19 -07:00
Bryan Murphy
fdccfaf72a 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)
2014-05-08 02:31:23 +00:00
Solomon Hykes
3b73c26194 Engine: empty job names are illegal, catchall or not
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-05-02 15:25:33 -07:00
Solomon Hykes
de75af9fe2 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)
2014-05-02 15:25:32 -07:00
Tianon Gravi
defecac279 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
Solomon Hykes
20e9f61971 Merge pull request #5320 from JackDanger/jackdanger/typo-doc-fix 2014-04-29 17:41:16 -07:00
Solomon Hykes
d8332f433f Merge pull request #5422 from shykes/engine-spawn
engine/spawn: run an engine in a subprocess, remote-controlled by Beam
2014-04-28 12:56:02 -07:00
Solomon Hykes
9b23178f58 engine.Len returns the number of keys in an env
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-28 00:37:42 -07:00
Solomon Hykes
b4b83ef8ae 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)
2014-04-27 14:11:46 -07:00
Solomon Hykes
9236e088eb Fix bug in engine.Sender
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-27 14:11:45 -07:00
Solomon Hykes
62f4c88443 Merge pull request #5374 from shykes/beam-engine
Remote communication between engines using beam
2014-04-27 14:10:59 -07:00
Solomon Hykes
4701f8ee60 Merge pull request #5365 from crosbymichael/job-status
Add exported status code from a job
2014-04-25 17:27:07 -07:00
Solomon Hykes
7e3624a498 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)
2014-04-25 17:23:47 -07:00
Solomon Hykes
b63b98ee27 engine.Sender and engine.Receiver support stdin
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-25 17:23:47 -07:00
Solomon Hykes
3c1d5ca33e Remote communication between engines using beam
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-25 17:23:47 -07:00
Solomon Hykes
68d3e75750 engine: allow registering a "catchall" handler which receives all commands
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-25 17:23:16 -07:00
Solomon Hykes
9422451ac3 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)
2014-04-25 17:23:16 -07:00
Solomon Hykes
0fe48b0e59 Merge pull request #5345 from shykes/engine-installer
engine.Installer: a standard interface for "installable" services
2014-04-23 16:16:55 -07:00
Michael Crosby
f90029611f 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)
2014-04-23 13:47:56 -07:00
Michael Crosby
7100ace42b 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)
2014-04-23 11:54:35 -07:00
Michael Crosby
672edfe807 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
2014-04-22 19:04:03 -07:00
Solomon Hykes
4353f25e10 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)
2014-04-22 16:51:06 -07:00
Solomon Hykes
19e6614eeb 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)
2014-04-21 18:17:13 -07:00
Jack Danger Canty
611a1d711b typo fix: 'methid' -> 'method' 2014-04-19 23:25:48 -07:00
Solomon Hykes
ea2fba5ce0 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)
2014-04-07 21:41:25 +00:00
Michael Crosby
95e6fd819b Revert "engine: fix engine.Env.Encode() to stop auto-guessing types."
This reverts commit 76057addb2.

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-04-04 11:29:56 -07:00
Solomon Hykes
76057addb2 engine: fix engine.Env.Encode() to stop auto-guessing types.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-03 23:53:42 +00:00
unclejack
611acf7a7c 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)
2014-03-03 23:00:53 +02:00
Solomon Hykes
56584a92f4 Merge pull request #4314 from shykes/engine-commands
Engine: builtin command 'commands' returns a list of registered commands
2014-02-25 09:59:26 -08:00
Victor Vieux
ad88d0be83 Merge pull request #4315 from shykes/engine-parsejob-test
Engine: add tests for ParseJob()
2014-02-24 14:27:19 -08:00
Victor Vieux
4a4915c8ee Merge pull request #4312 from shykes/engine-error-reporting
Engine: clearer job error reporting
2014-02-24 13:58:12 -08:00