all: Bump Go to 1.4

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Merge pull request #586 from flynn/go1.4

all: Bump to Go 1.4
Godeps: Bump Go subrepos to latest git versions

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Godeps: Bump Docker for security fixes

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Merge pull request #588 from flynn/bump-godeps

Bump Docker packages
host: combined the AddJob and SetInternalIP functions, since they both cause persistence for the host state to be fired and are presently never used in isolation anyway.

Signed-off-by: Eric Myhre <eric@flynn.io>
host: Transforming host state persistence to use boltdb for persistence instead of flat files.

Components:
 - Only initialize persistence db filehandle once.
 - Move persistence path to host state setup time, and ensure it has a default when starting the host executable.  (This is mostly clarifying behavior because previously persistence would do some rather odd things if restore hadn't previously been called.)
 - Bring go-check into the host state tests, because these tests are touching the filesystem and crave tmpdirs.
 - Change filenames for host state.  (Attempting to open one of the old json files will cause boltdb to report an error; this makes that migration forgetful, but survivable.  And json is no longer an accurate description.)
 - When persisting host state changes, limit the serialization and disk changes to the job that is being changed.
 - Remove stateFileMtx from host state.  Use of boltdb has its own internal locking mechanisms which obviate the need for this mutex.
 - Place persistence back into the same control flow as the state changes that trigger it, so persistence is complete by the time the mutation returns.  (This is more feasible than before since the amount of changes flushed to disk by ever persist call is now limited in scope, and doing so makes testing and other behavior less complicated.)
 - Split the interface backends use to declare their persistence needs into two parts, one for per-job state and one for global state.  Neither is necessary.
 - Libvirt backend actually has no use for global state, so since that interface is now separate, we'll drop it.

Signed-off-by: Eric Myhre <eric@flynn.io>
host: During host backend revivification, dispatch container connection attempts in bulk, and gather them later.  This prevents their timeouts from occurring serially, which could cause host service launch to time out in the case of many dead containers.

Signed-off-by: Eric Myhre <eric@flynn.io>
Merge pull request #581 from flynn/host-state-database

Host state database
test: Fix host manifest path

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Merge pull request #592 from flynn/test-fix-host-manifest-path

test: Fix host manifest path
test: Run BlobstoreSuite concurrently

Signed-off-by: Lewis Marshall <lewis@lmars.net>
pkg/exec: Initialize done channel in Start

This allows the Cmd struct to be initialized directly.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
host/containerinit: Fix deadlock during exit

This lock doesn’t appear to protect anything.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
host: Add missing call to containerinit resume on error

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Merge pull request #594 from flynn/test-blobstore-concurrent

test: Run BlobstoreSuite concurrently
cli: Use docker term package for run

This properly handles making the terminal raw, which allows terminal
control like ^C to work properly.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Godeps: Remove unused github.com/heroku/hk/term package

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
pkg/exec: Remove spurious finished checks

finished is set as soon as Wait is called.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
host/cli: Add run command to run interactive jobs

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>