Commit Graph

495 Commits

Author SHA1 Message Date
Tianon Gravi 4f2dd420be Add cross-compilation testing to .travis.yml
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-30 17:08:01 -06:00
Victor Marmol 77c5125e87 Merge pull request #56 from crosbymichael/nsinit-pause
Add pause and unpause commands to nsinit
2014-06-26 18:17:13 -07:00
Michael Crosby 3f0764fa51 Add pause and unpause commands to nsinit
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 16:45:18 -07:00
Victor Marmol 14567adea1 Merge pull request #55 from crosbymichael/nsinit-config
Rename nsinit spec to config and only display raw json
2014-06-26 16:37:36 -07:00
Michael Crosby 361ac10612 Just output raw stats json
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 16:25:55 -07:00
Michael Crosby 21b71ef33d Rename spec to config
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 16:24:16 -07:00
Michael Crosby 53cfe0a1eb Merge pull request #54 from crosbymichael/report-child-error
Report child error to parent
2014-06-26 14:38:11 -07:00
Michael Crosby a980a961c1 Return error on shutdown call
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 14:18:39 -07:00
Michael Crosby bd7d1eb7b6 Fix parent type in sync pipe
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 14:08:49 -07:00
Michael Crosby e098c02ef7 Update tests for network state
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 14:06:26 -07:00
Michael Crosby 73ff1addf9 Fix cross compile with syscall
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 14:03:49 -07:00
Michael Crosby e7916505a3 Add unit test for sync pipe
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 14:03:49 -07:00
Michael Crosby eb9a561b18 Address review comments
Ensure that the command is killed if we receive an error from the child
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 14:02:43 -07:00
Alexander Larsson ca9544522e Report child error better (and later)
We use a unix domain socketpair instead of a pipe for the sync pipe,
which allows us to use two-way shutdown. After sending the
context we shut down the write side which lets the child know
it finished reading.

We then block on a read in the parent for the child closing the file
(ensuring we close our version of it too) to sync for when the child
is finished initializing. If the read is non-empty we assume this
is an error report and fail with an error. Otherwise we continue as
before.

This also means we're now calling back the start callback later,
meaning at that point its more likely to have succeeded, as well as
having consumed all the container resources (like volume mounts,
making it safe to e.g. unmount them when the start callback is
called).

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-06-26 14:02:43 -07:00
Michael Crosby f975ff9159 Merge pull request #25 from vishh/network_stats
Adding per container network stats
2014-06-26 13:58:18 -07:00
Vishnu Kannan 813d247bc7 Fixing some nits.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-26 20:49:02 +00:00
Victor Marmol dfb1ea8171 Merge pull request #43 from cf-guardian/nsinit_usage
Improve nsinit usage instructions
2014-06-26 07:09:11 -07:00
Glyn Normington 29adc8c29f Improve nsinit usage instructions
nsinit must be run as root.

Tidy up the README somewhat to clarify the distinction between
libcontainer and the nsinit CLI.

Fix some typos in other files.

Docker-DCO-1.1-Signed-off-by: Glyn Normington <gnormington@gopivotal.com> (github: glyn)
2014-06-26 11:57:09 +01:00
Vishnu Kannan 3e5fe45417 Further refactoring.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-26 05:40:58 +00:00
Vishnu Kannan ab4201f240 Refactoring.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-26 05:04:20 +00:00
Vishnu Kannan 98c2593cdc Refactores network Interface a bit to use NetworkState struct instead of a map for passing runtime information around.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 22:51:28 +00:00
Vishnu Kannan edf1e856a0 RuntimeCkpt is now State and the checkpoint file is called state.json.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 21:29:04 +00:00
Vishnu Kannan 481552c02b Created a global runtime checkpoint for libcontainer. Got rid of the network specific runtime checkpoint.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 19:20:07 +00:00
Vishnu Kannan 9253412ee1 1. Added a basic version of network stats inside network package.
2. Introducing a new checkpoint file 'network.stats' which will contain the network runtime information (veth interface names for now).
3. Adding network stats to 'nsinit stats'.
4. Added a libcontainer Stats API to get both network and cgroup stats

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 19:19:10 +00:00
Michael Crosby ce034dff2e Merge pull request #50 from crosbymichael/create-state
Create state
2014-06-25 12:16:02 -07:00
Michael Crosby f6ada60a68 Merge pull request #48 from crosbymichael/add-oom-event
Add oom notify event
2014-06-25 11:56:28 -07:00
Michael Crosby 5bb250143e Rename to InitPid
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-25 11:42:08 -07:00
Michael Crosby 77dcaac129 Update code based on review comments
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-25 11:36:54 -07:00
Michael Crosby 854bcc0f7e Update readme with state.json changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-25 11:36:54 -07:00
Michael Crosby 81e5a3f7a7 Replace pid and started file with State type
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-25 11:36:54 -07:00
Victor Marmol e49f5f4788 Merge pull request #51 from crosbymichael/type-context
Strongly type context on the Config
2014-06-24 20:29:07 -07:00
Michael Crosby 43e877e1db Add tests and sample files for selinux and apparmor
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-24 18:11:52 -07:00
Michael Crosby 882dfdd568 Update sample config with context changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-24 17:33:30 -07:00
Michael Crosby 5c86dd962f Remove generic context and replace with fields
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-24 17:31:03 -07:00
Michael Crosby 775666b733 Fix nits on chan direction and defer
Closes #9
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-24 12:08:03 -07:00
Victor Marmol 5210a236b9 Merge pull request #39 from vmarmol/rename-container
Rename Container -> Config.
2014-06-24 10:56:40 -07:00
Victor Marmol 60b381e600 Rename Container -> Config.
Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
2014-06-23 17:08:15 -07:00
Michael Crosby e783cac215 Merge pull request #41 from vishh/refactoring
Refactoring libcontainer to avoid cyclic dependencies in the future.
2014-06-23 16:45:15 -07:00
Vish Kannan 0ebe104569 Merge pull request #2 from crosbymichael/fix-crosscompile
Fix cross compile for network and node pkgs
2014-06-23 16:27:14 -07:00
Michael Crosby d2c7999a57 Fix cross compile for network and node pkgs
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-23 16:23:51 -07:00
Vish Kannan 626420b6c4 Merge pull request #1 from crosbymichael/refactor-fixes
This fixes mount and networking
2014-06-23 15:55:08 -07:00
Michael Crosby 0023305afc Make MountConfig on container a pointer
Also add unit test for container json files to ensure that the mount
config is read and device nodes are validated.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-23 15:33:30 -07:00
Michael Crosby 1aff270a6c Fix veth json and tags
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-23 15:33:30 -07:00
Vishnu Kannan f216ad7b65 Use internal types in the API instead of duplicating the types.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 15:33:30 -07:00
Vishnu Kannan 952b884882 Use internal types in the API instead of duplicating the types.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 21:11:01 +00:00
Vishnu Kannan ad5286acd9 Addressed more comments.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 20:40:37 +00:00
Vishnu Kannan 561534244a Minor fixes.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 19:30:59 +00:00
Vishnu Kannan 0f14662b9c Remove 'Context' type from the libcontainer API. It will be a generic map with string key and value henceforth.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 18:54:26 +00:00
Vishnu Kannan c5f93a9a48 Reuse internal mount.Mount in the API.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 18:41:39 +00:00
Vishnu Kannan ece2d83558 Added DropCapabilities() and DropBoundingSet() API to libcontainer.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 18:36:38 +00:00