Commit graph

133 commits

Author SHA1 Message Date
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
Solomon Hykes
0469e7d062 Engine: tiny cosmetic fix
To make @creack happy :)

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-24 12:31:39 -08:00
Solomon Hykes
d985fd4984 Engine: add tests for ParseJob()
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-24 12:31:39 -08:00
Solomon Hykes
cd846ecb60 Engine: builtin command 'commands' returns a list of registered commands
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-24 12:29:49 -08:00
Solomon Hykes
62b21daded Engine: cleanup side effects between tests
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-24 12:29:39 -08:00
Solomon Hykes
8a1778301b 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)
2014-02-24 11:53:56 -08:00
Solomon Hykes
2019a73f03 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)
2014-02-24 11:38:13 -08:00
Solomon Hykes
353cc8c2a5 Fix engine tests on systems where temp directories are symlinked.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-15 14:39:51 -08:00
Victor Vieux
8fbdb7b59e add setSubEnv and getSubEnv
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 04:01:46 +00:00
Victor Vieux
24086fa75d job.error\* now return engine.StatusErr
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 04:01:46 +00:00
Victor Vieux
1498cd4e05 use exists
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 02:21:59 +00:00
Victor Vieux
28b5ae8cc4 changed default value of getenvint to 0. fix tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 02:06:08 +00:00
Victor Vieux
187646127f fix convertion issues
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 00:56:42 +00:00
Victor Vieux
5ea2986ce5 Move containers to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 16:07:42 -08:00
Victor Vieux
f41e0cf048 fix error handling
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:59:46 -08:00
Victor Vieux
35641f0ec7 remove useless flush method
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:46:31 -08:00
Victor Vieux
90e9a2d85a fix flush
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:46:31 -08:00
Victor Vieux
9dcbdbc4b1 move pull and import to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:46:31 -08:00
Victor Vieux
42e35ecff3 remove useless anonymous field mentions
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-23 16:20:51 -08:00
Victor Vieux
e7a9d23640 don't user os.Stderr in attach
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-22 15:54:22 -08:00
Victor Vieux
e3461bc8d6 switch back to the valid json format
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-21 15:06:23 -08:00
Victor Vieux
8cbabf2c3e clean up test log
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-16 16:07:42 -08:00
Victor Vieux
e1d8543c78 move attach to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 17:11:44 -08:00
Victor Vieux
a33bc3018b use the same 'Used' method as before
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 14:52:58 -08:00
Victor Vieux
7fbc315aa9 move viz to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 13:52:35 -08:00
Victor Vieux
16ca6a1c12 move legacy stuff outside the job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-13 16:20:05 -08:00
Victor Vieux
3a610f754f Add compat 1.8
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-13 15:50:20 -08:00
Solomon Hykes
17a806c8a0 Port 'docker images' to the engine API
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-13 15:49:33 -08:00
Tianon Gravi
8f3b8f3835 Run 'gofmt -s -w' 2014-01-06 22:14:35 -07:00
Ben Wiklund
0fccf0f686 small batch of edits/corrections to comments 2013-12-24 16:40:14 -08:00
Josh Poimboeuf
94821a3353 Move root symlink check to engine.New
Since commit c91c365, when starting the docker daemon without an
existing /var/lib/docker directory, it fails with:

  2013/12/18 23:39:36 Unable to canonicalize root (%!s(*string=0xc210077c80)): lstat /var/lib/docker: no such file or directory

Move the symlink checking code to engine.New after the root dir has been
created.
2013-12-19 00:39:12 -06:00
Victor Vieux
85b9338205 add GetenvInt64 ans SetenvInt64 2013-12-13 16:29:22 -08:00
Victor Vieux
d5f5ecb658 improve GetenvJson 2013-12-13 16:02:19 -08:00
Victor Vieux
930ec9f52c move commit to job 2013-12-13 14:19:56 -08:00
Guillaume J. Charmes
aaa1c48d24 Merge pull request #3175 from vieux/engine-job-stop
Move stop to job
2013-12-13 14:15:58 -08:00
Victor Vieux
4975c1b549 Temporarily remve @shykes from engine/MAINTAINERS 2013-12-13 13:51:20 -08:00
Solomon Hykes
bef8de9319 Engine: integer job status, improved stream API
* Jobs return an integer status instead of a string
* Status convention mimics unix process execution: 0=success, 1=generic error, 127="no such command"
* Stdout and Stderr support multiple thread-safe data receivers and ring buffer filtering
2013-12-11 11:52:59 -08:00
Victor Vieux
0025e9bd71 Merge pull request #3113 from shykes/engine-export
Move 'docker export' to the engine API
2013-12-10 13:28:24 -08:00
Solomon Hykes
f806818154 Engine: convenience http transport for simple remote job execution 2013-12-08 07:33:23 +00:00
Solomon Hykes
a7a171b6c2 Engine: Output.AddEnv decodes structured data from the standard output of a job 2013-12-08 06:16:10 +00:00
Solomon Hykes
a80c059bae Engine: break out Env utilities into their own type - Env 2013-12-08 06:06:05 +00:00
Solomon Hykes
50f3a696bd Engine: don't log job stdout to engine stdout (it might be non-text output, for example tar data for 'export' 2013-12-08 01:33:05 +00:00
Michael Crosby
25d3db048e Enable engine to take Stderr and Stdout for mocking in tests 2013-12-06 01:18:18 -08:00
Victor Vieux
5f55c1aee1 Merge pull request #2966 from andrewsmedina/govet2
fixed some `go vet` issues.
2013-12-04 17:57:10 -08:00
Josh Poimboeuf
e4aba11e80 add env variable to disable kernel version warning
Allow the user to set DOCKER_NOWARN_KERNEL_VERSION=1 to disable the
warning for RHEL 6.5 and other distributions that don't exhibit the
panics described in https://github.com/dotcloud/docker/issues/407.
2013-12-02 15:56:51 -06:00
Andrews Medina
a6c9a332d0 fixed some go vet issues. 2013-11-29 22:53:20 -02:00
Solomon Hykes
35d54c6655 Fix a bug in Output.Write, and improve testing coverage of error cases. 2013-11-30 00:25:46 +00:00
Solomon Hykes
3553a803e3 Engine: better testing of streams and of basic engine primitives. Coverage=81.2% 2013-11-30 00:25:46 +00:00
Solomon Hykes
a4f8a2494b Engine: integer job status, improved stream API
* Jobs return an integer status instead of a string
* Status convention mimics unix process execution: 0=success, 1=generic error, 127="no such command"
* Stdout and Stderr support multiple thread-safe data receivers and ring buffer filtering
2013-11-30 00:25:46 +00:00
Victor Vieux
8e5ab5bfca improve tests on the engine 2013-11-19 11:47:47 -08:00
Solomon Hykes
359a6f49b9 Move integration tests to integration/, expose missing public methods in the core 2013-11-14 10:50:00 -08:00
Solomon Hykes
b00d5f0185 gofmt 2013-11-13 19:25:55 +00:00
Solomon Hykes
6c4393ccbb Merge branch 'job-create-start-clean' into engine-patch-2
Conflicts:
	engine/engine.go
	engine/job.go
	server.go
	utils_test.go
2013-11-13 00:36:20 +00:00
Guillaume J. Charmes
6998c3c387
go fmt 2013-11-07 12:27:33 -08:00
Solomon Hykes
8d6df3a7e2 Remove debug messages 2013-11-05 23:00:20 +00:00
Solomon Hykes
e5f8ab6160 Engine: 'create' creates a container and prints its ID on stdout 2013-11-05 23:00:20 +00:00
Solomon Hykes
434f06d03d Engine: fix a bug when encoding a job environment to json 2013-11-05 23:00:20 +00:00
Solomon Hykes
4e7cb37dcc Engine: improved logging and identification of jobs 2013-11-05 18:39:59 +00:00
Solomon Hykes
ca6f0aa107 Engine: don't export private testing utilities 2013-11-05 18:39:59 +00:00
Solomon Hykes
847411a1ee Engine: fix a bug which caused handlers to be shared between multiple engine instances 2013-11-05 18:39:59 +00:00
Solomon Hykes
958b4a8757 Engine: 'start' starts the specified container 2013-11-05 18:39:59 +00:00
Solomon Hykes
a13241d370 Engine: Engine.Job() never fails, to mimic the os/exec API (and make usage less verbose) 2013-10-26 17:49:16 -07:00
Solomon Hykes
e8491ae54c Engine: cleanly log the start and end of each engine job 2013-10-26 17:17:45 -07:00
Solomon Hykes
1b8eef4efb Engine: centralize checks for supported architectures and kernel versions 2013-10-26 14:21:04 -07:00
Solomon Hykes
2a29bf6245 Engine: basic testing harness 2013-10-26 14:18:28 -07:00
Solomon Hykes
0d1a825137 Minimal, unintrusive implementation of a cleaner Job API.
* Implement a new package: engine. It exposes a useful but minimalist job API.
* Refactor main() to instanciate an Engine instead of a Server directly.
* Refactor server.go to register an engine job.

This is the smallest possible refactor which can include the new Engine design
into master. More gradual refactoring will follow.
2013-10-26 14:18:13 -07:00