Commit graph

50 commits

Author SHA1 Message Date
Daniel J Walsh adf8809521 Add NetMode, UTSMode and IPCMode
Allow kpod create/run to create contianers in different network namespaces, uts namespaces and
IPC Namespaces.

This patch just handles the simple join the host, or another containers namespaces.

Lots more work needed to full integrate  --net

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #64
Approved by: mheon
2017-12-02 15:32:56 +00:00
Matthew Heon 7eb5ce940c Add schema validation to DB
This ensures we don't open a DB with an earlier schema or a
config that differs from ours

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #86
Approved by: rhatdan
2017-11-30 18:05:56 +00:00
Matthew Heon 1f9c8942f1 Add randomly generates container names
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #88
Approved by: baude
2017-11-30 02:03:23 +00:00
baude 742475885e kpod_start
Starts one or more containers.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #83
Approved by: rhatdan
2017-11-29 22:01:47 +00:00
Daniel J Walsh cefa782e50 Move libpod under containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #65
Approved by: mheon
2017-11-29 20:40:50 +00:00
Matthew Heon 13e833a388 Change location of created runc specs to make them survive reboot
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #78
Approved by: rhatdan
2017-11-29 18:43:56 +00:00
Matthew Heon d55cb0f589 Fix error in runtime_ctr
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #85
Approved by: rhatdan
2017-11-29 17:57:32 +00:00
Matthew Heon 681a8c85ed Ensure that we can't remove paused containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #85
Approved by: rhatdan
2017-11-29 17:57:32 +00:00
Matthew Heon ce3081786b Fix rmi -f removing containers from storage without telling libpod
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
2017-11-29 12:15:16 +00:00
Matthew Heon ed41a290a2 Fix removing running containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
2017-11-29 12:15:16 +00:00
Matthew Heon 66ed73f89f First pass at fixing test errors
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
2017-11-29 12:15:16 +00:00
Matthew Heon bbef986214 Fix comment on container.Stop()
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
2017-11-29 12:15:15 +00:00
Matthew Heon 4f8fe2b810 Shut down containers when force stopping the runtime
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
2017-11-29 12:15:15 +00:00
Matthew Heon 831e2c30d4 Add ability to kill and stop containers
Also migrates kpod kill and kpod stop to libpod to use the new code

Fixes force removing containers, and actually deletes containers in runc when
removing them

Start is now capable of starting even when the container is unmounted

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
2017-11-29 12:15:15 +00:00
baude 342ce4db50 kpod ps
Wire up kpod ps with the new libpod container backend.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #67
Approved by: rhatdan
2017-11-28 14:47:35 +00:00
Suraj Deshmukh 7eb4772694 remove unused functions and variables
Signed-off-by: Suraj Deshmukh <surajd.service@gmail.com>

Closes: #71
Approved by: rhatdan
2017-11-28 14:30:12 +00:00
TomSweeneyRedHat d43f786728 Add docker transport to push image before final failure
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #42
Approved by: rhatdan
2017-11-28 12:53:25 +00:00
baude 52ea0deee6 kpod_wait
Convert to libpod container backend

Signed-off-by: baude <bbaude@redhat.com>

Closes: #70
Approved by: rhatdan
2017-11-27 19:05:59 +00:00
baude 61e0ab4f47 Create|Run container from Image ID
As reported in Issue #50, we need to be able to run
or create a container based on an image ID (as well
as name).

Signed-off-by: baude <bbaude@redhat.com>

Closes: #76
Approved by: rhatdan
2017-11-27 16:41:08 +00:00
umohnani8 b1a3b03068 Update kpod pause and unpause to use new container state
Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #66
Approved by: mheon
2017-11-24 15:53:17 +00:00
umohnani8 40dce698d3 Update kpod mount and umount to use the new state
The new state for containers has been added
moved kpod mount and umount over to use it

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>

Closes: #57
Approved by: rhatdan
2017-11-22 18:23:19 +00:00
Matthew Heon 34ba0cb8a9 Order containers returned from state and make container config public
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #63
Approved by: baude
2017-11-22 18:12:57 +00:00
Urvashi Mohnani 2a3934f1da Update kpod export to use the new container state and runtime
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>

Closes: #59
Approved by: rhatdan
2017-11-22 16:17:06 +00:00
Matthew Heon 4ff251d911 Add PID to the containers used to test SQLite state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #56
Approved by: rhatdan
2017-11-21 20:09:09 +00:00
Matthew Heon 152882bf19 Add ability to retrieve container's log path to API
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #56
Approved by: rhatdan
2017-11-21 20:09:09 +00:00
Matthew Heon 8e76ebcf6e Add ability to update container status from runc
Wire this in to all state-bound container operations to ensure
syncronization of container state.

Also exposes PID of running containers via API.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #56
Approved by: rhatdan
2017-11-21 20:09:09 +00:00
Matthew Heon 51fc8827f5 Add tests for SQL-backed state impl
Minor changes to container.go and sql_state.go to fix issues
identified by the tests

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-20 16:24:28 -05:00
Matthew Heon f2894eda68 Fix lint errors
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 13:17:03 -05:00
Matthew Heon 898138441d Need to provide ID of container being updated
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:58:48 -05:00
Matthew Heon b10fb66c28 StopSignal is allowed to be 0
If StopSignal is 0, it is assumed that the default signal will be used.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:58:48 -05:00
Matthew Heon 12f19ca013 Resolve another segfault
This one cleans up after container creation fails

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:58:48 -05:00
Matthew Heon 657cb1b7f6 Fix lingering SQL error
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:58:48 -05:00
Matthew Heon 57300be94d Fix segfault cleaning up in after failing to create a Runtime
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:58:48 -05:00
Matthew Heon 4bc3acc7aa Rename Create to Init for containers to be less confusing
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:58:48 -05:00
Matthew Heon 763e372649 Wire SQL backed state into rest of libpod
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:58:48 -05:00
Matthew Heon cb56716fc4 Address review comments, fix gofmt and lint
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:54:05 -05:00
Matthew Heon c6fe4430b7 Compile-tested implementation of SQL-backed state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-18 12:54:05 -05:00
baude d2eda1a864 Enhancements to papr tests
The PR contains several enhancements to our CI testing.

- enable lint testing on Fedora
- add Centos Atomic as test platform
- integration tests on run on the OS natively (uncontainerized)
- builds are done in containers
- inclusion of Vagrant file for local testing

Signed-off-by: baude <bbaude@redhat.com>

Closes: #18
Approved by: mheon
2017-11-17 02:07:18 +00:00
baude acd9c66864 Fix terminal attach
Re-order the startup of a new container via run from
initialize > start > attach to initialize > attach > start.

This fixes output when running:

kpod run -i -t IMAGE command

and

kpod run IMAGE command

Signed-off-by: baude <bbaude@redhat.com>
2017-11-15 16:27:57 -06:00
baude 5cfd7a313f Address run/create performance issues
Fixed the logic where we observed different performance
results when running an image by its fqname vs a shortname. In
the case of the latter, we resolve the name without using the
network.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #37
Approved by: rhatdan
2017-11-14 21:14:13 +00:00
Urvashi Mohnani 23979f8e06 Add 'kpod import' command
Imports a tarball and saves it as a filesystem image

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>

Closes: #12
Approved by: rhatdan
2017-11-07 19:16:31 +00:00
Daniel J Walsh df54adeaae Respect the quiet flag.
When setting the `kpod load -q` flag, output was still going to the
screen.  This patch adds a check to not output to the terminal unless
there is an io.Writer specified, and then to write to the io.Writer.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #23
Approved by: rhatdan
2017-11-07 15:37:50 +00:00
baude 0026075d59 libpod/runtime_img_test.go Unit Tests
Unit tests for getRegistry related functions.

Signed-off-by: baude <bbaude@redhat.com>
2017-11-04 11:12:14 -05:00
baude 99ca35f185 util_test.go: Unittests for util.go
Add unit tests for func StringInSlice.

Signed-off-by: baude <bbaude@redhat.com>
2017-11-03 20:37:27 -05:00
Daniel J Walsh 098389dc3e Parse SecurityOpts
This should turn on handling of SELinux, NoNewPrivs, seccomp and Apparmor

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #15
Approved by: rhatdan
2017-11-03 20:55:10 +00:00
Daniel J Walsh 92818fdfb7 Fix gofmt errors
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-11-02 15:30:39 -04:00
Matthew Heon 32f352d846 Fix trivial import issue
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-01 15:39:04 -04:00
baude 8cf07b2ad1 libpod create and run
patched version of the same code that went into crio

Signed-off-by: baude <bbaude@redhat.com>
2017-11-01 14:19:19 -05:00
Matthew Heon c13f61798a Prune Server package. Convert to new github location.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-01 13:22:04 -04:00
Matthew Heon a031b83a09 Initial checkin from CRI-O repo
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-11-01 11:24:59 -04:00