Commit graph

277 commits

Author SHA1 Message Date
umohnani8 5330d3da7c Update kpod info to use new libpod api
Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #124
Approved by: mheon
2017-12-14 00:54:21 +00:00
baude 9cc0c8ae14 kpod stats
Move kpod stats to the libpod backend.

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

Closes: #113
Approved by: baude
2017-12-13 21:15:09 +00:00
umohnani8 74ee579375 Update kpod inspect to use the new container state
kpod inspect now uses the new libpod container state
and closely matches the output of docker inspect
some aspects of it are still WIP as the libpod container state
is still being worked on

Signed-off-by: umohnani8 <umohnani@redhat.com>
2017-12-12 09:46:23 -05:00
Suraj Deshmukh e64da85ccb Use debugf to allow parsing of format specifier
Signed-off-by: Suraj Deshmukh <surajd.service@gmail.com>
2017-12-12 00:13:44 +05:30
umohnani8 622d5e3b9a Fix misleading print statement in kpod load
When loading an image, kpod load would print something like
"Trying to pull docker.io/library/alpine...", which is misleading
and makes it sound like its pulling it form the registry.
Fixed this by removing these print statements for kpod load

Signed-off-by: umohnani8 <umohnani@redhat.com>
2017-12-11 12:07:54 -05:00
Daniel J Walsh 12682aa475
Merge pull request #72 from mheon/file_locking
Move containers to file locks from c/storage
2017-12-11 10:48:29 -06:00
Daniel J Walsh 62e19beeec
Merge pull request #94 from mheon/restart
Add handling for system restart in libpod
2017-12-11 10:47:50 -06:00
Daniel J Walsh 915410aaff
Merge pull request #111 from mheon/crio_1206
Carry CRI-O #1206 to fix a potential runtime issue
2017-12-11 10:44:57 -06:00
Daniel J Walsh 7e179b6ddb
Merge pull request #115 from umohnani8/containers
Vendor in latest upstream containers/image
2017-12-11 10:42:36 -06:00
umohnani8 eaf4d6c8c2 Vendor in latest upstream containers/image
Signed-off-by: umohnani8 <umohnani@redhat.com>
2017-12-11 09:51:34 -05:00
baude e8a32e3722 kpod exec
Initial wiring of kpod exec. We wont support the following options
for exec:

* detach -- unsure of use case
* detach-keys -- not supported by runc
* interactive -- all terminals will be interactive

Not adding exec tests as we need to think about how to support a
test that requires console access but our CI tests have no console.

Signed-off-by: baude <bbaude@redhat.com>
2017-12-11 08:24:30 -06:00
Matthew Heon 00df767a99 Carry CRI-O #1206 to fix a potential runtime issue
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-07 14:44:21 -05:00
umohnani8 8d31ec2ad7 Add Artifacts directory to containers
Create an artifacts directory in the container's
static directory so store container information
coming from outside of libpod to specified files
An example is to hold data from user specified flags
in kpod run/create such as --cap-add, --ipcMode, etc...

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

Closes: #108
Approved by: mheon
2017-12-07 18:45:54 +00:00
Matthew Heon b71cde19c8 Add ability to refresh state in DB
Also, ensure we always recreate runtime spec so our net namespace
paths will be correct

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-07 13:15:34 -05:00
Matthew Heon b66287689a Do not recreate containers in runc after restart
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-06 11:15:17 -05:00
Matthew Heon 190b05209f Small comment update to make use of syncContainer more obvious
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-05 19:02:32 -05:00
Matthew Heon 70da705c36 Remove check for existance of lockfile when retrieving containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-05 10:04:59 -05:00
Matthew Heon ceb7fb1c60 Do not recreate OCI spec in init() if it exists
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-05 09:30:51 -05:00
Matthew Heon 92bc448624 Fix potential race condition in initializing libpod
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-04 14:45:49 -05:00
Matthew Heon ae5aac50aa Add handling for system restart in libpod
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-04 14:29:59 -05:00
Matthew Heon eb942b1b47 Fix lint
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-04 14:18:48 -05:00
Matthew Heon 43c51c58ad Fix unit tests and provide more realistic test environment
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-04 13:40:27 -05:00
Matthew Heon e9298a533a Remove SQL state locking and rely on sqlite locking
Also renames some parameters from locksDir -> lockDir for
consistency.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-04 13:40:27 -05:00
Matthew Heon abfd18b0db Move containers to file locks from c/storage
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2017-12-04 13:39:44 -05:00
Matthew Heon 750fc239b5 Consolidate mount logic
There are still two places that don't use the new function,
export and mount, but both can probably be converted to it
in the future.

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

Closes: #99
Approved by: rhatdan
2017-12-04 18:10:52 +00:00
Daniel J Walsh 1f482c9f1f You can only attach to running containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #98
Approved by: mheon
2017-12-04 17:53:23 +00:00
Daniel J Walsh 55c8b69d8f When shutting down the runtime we should always close the database
Even if the storage fails to shutdown. This patch fixes on TODO.

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

Closes: #97
Approved by: mheon
2017-12-04 17:17:06 +00:00
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