1858 Commits

Author SHA1 Message Date
e4ded6ce7f Switch to using libnetwork's resolvconf package
Libnetwork provides a well-tested package for generating
resolv.conf from the host's that has some features our current
implementation does not. Swap to using their code and remove our
built-in implementation.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-04 17:34:59 -04:00
094b8b7350 Merge pull request #1570 from giuseppe/fix-gvisor
podman: allow usage of gVisor as OCI runtime
2018-10-04 13:24:57 -07:00
06a959f74a Merge pull request #469 from adrianreber/master
Add support to checkpoint/restore containers
2018-10-04 12:34:49 -07:00
3c31e176c7 Merge pull request #1557 from rhatdan/systemd
Don't tmpcopyup on systemd cgroup
2018-10-04 09:54:51 -07:00
7213ac81b0 Merge pull request #1591 from baude/disablecontainerbuildservice
disable gce building of images
2018-10-04 12:24:04 -04:00
2c79b8e22e disable gce building of images
Signed-off-by: baude <bbaude@redhat.com>
2018-10-04 11:22:41 -05:00
dc987af0b0 completions: add checkpoint/restore completions
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:40 +02:00
5246238e7e tests: add checkpoint/restore test
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:40 +02:00
5bafafc7eb tutorial: add checkpoint/restore to tutorial
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:40 +02:00
e2b639a32f docs: add checkpoint and restore man pages
This adds the podman-container-checkpoint and
podman-container-restore man pages.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:40 +02:00
f7c8fd8a3d Add support to checkpoint/restore containers
runc uses CRIU to support checkpoint and restore of containers. This
brings an initial checkpoint/restore implementation to podman.

None of the additional runc flags are yet supported and container
migration optimization (pre-copy/post-copy) is also left for the future.

The current status is that it is possible to checkpoint and restore a
container. I am testing on RHEL-7.x and as the combination of RHEL-7 and
CRIU has seccomp troubles I have to create the container without
seccomp.

With the following steps I am able to checkpoint and restore a
container:

 # podman run --security-opt="seccomp=unconfined" -d registry.fedoraproject.org/f27/httpd
 # curl -I 10.22.0.78:8080
 HTTP/1.1 403 Forbidden # <-- this is actually a good answer
 # podman container checkpoint <container>
 # curl -I 10.22.0.78:8080
 curl: (7) Failed connect to 10.22.0.78:8080; No route to host
 # podman container restore <container>
 # curl -I 10.22.0.78:8080
 HTTP/1.1 403 Forbidden

I am using CRIU, runc and conmon from git. All required changes for
checkpoint/restore support in podman have been merged in the
corresponding projects.

To have the same IP address in the restored container as before
checkpointing, CNI is told which IP address to use.

If the saved network configuration cannot be found during restore, the
container is restored with a new IP address.

For CRIU to restore established TCP connections the IP address of the
network namespace used for restore needs to be the same. For TCP
connections in the listening state the IP address can change.

During restore only one network interface with one IP address is handled
correctly. Support to restore containers with more advanced network
configuration will be implemented later.

v2:
 * comment typo
 * print debug messages during cleanup of restore files
 * use createContainer() instead of createOCIContainer()
 * introduce helper CheckpointPath()
 * do not try to restore a container that is paused
 * use existing helper functions for cleanup
 * restructure code flow for better readability
 * do not try to restore if checkpoint/inventory.img is missing
 * git add checkpoint.go restore.go

v3:
 * move checkpoint/restore under 'podman container'

v4:
 * incorporated changes from latest reviews

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:39 +02:00
c5546729b8 oci: split the stdout and stderr pipes
read the OCI status from stdout, not the combined stdout+stderr
stream.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-03 21:39:35 +02:00
c21e85e5f4 oci: always set XDG_RUNTIME_DIR
Fix an issue when using gVisor that couldn't start the container since
the XDG_RUNTIME_DIR env variable used for the "create" and "start"
commands is different.  Set the environment variable for each command
so that the OCI runtime gets always the same value.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-03 21:39:34 +02:00
3750b35ae2 Merge pull request #1578 from baude/addubuntuci
Add Ubuntu-18.04 to CI testing
2018-10-03 11:35:13 -07:00
14473270d7 Add ability for ubuntu to be tested
unfortunately the papr CI system cannot test ubuntu as a VM; therefore,
this PR still keeps travis.  but it does include fixes that will be required
for running on modern versions of ubuntu.

Signed-off-by: baude <bbaude@redhat.com>
2018-10-03 12:45:37 -05:00
2a3e3e7f25 Merge pull request #1584 from giuseppe/drop-superflous-relabel
selinux: drop superflous relabel
2018-10-03 09:36:13 -07:00
7abf46d15e selinux: drop superflous relabel
The same relabel is already done in writeStringToRundir so we don't
need to do it twice.  The version in writeStringToRundir takes into
account the correct file path when using user namespaces.

Closes: https://github.com/containers/libpod/pull/1584

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-03 16:54:28 +02:00
230edff521 Merge pull request #1580 from giuseppe/rootless-always-set-XDG_RUNTIME_DIR
rootless: always set XDG_RUNTIME_DIR
2018-10-03 07:03:16 -07:00
a3c4ce6717 Merge pull request #1531 from mheon/add_exited_state
Add ContainerStateExited and OCI delete() in cleanup()
2018-10-03 06:06:14 -07:00
2f73a9b0f6 rootless: always set XDG_RUNTIME_DIR
it is used internally by containers/image to locate the auth file.

Closes: https://github.com/containers/libpod/issues/1457

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-03 10:41:47 +02:00
d5687946f6 Merge pull request #1528 from baude/runlabel
Add container runlabel command
2018-10-02 17:16:43 -07:00
978aac6650 Fix python tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-02 14:53:15 -04:00
b7c5fa70ab Fix Wait() to allow Exited state as well as Stopped
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-02 14:26:19 -04:00
7e23fb6c5d Fix cleanupRuntime to only save if container is valid
We call cleanup() (which calls cleanupRuntime()) as part of
removing containers, after the container has already been removed
from the database. cleanupRuntime() tries to update and save the
state, which obviously fails if the container no longer exists.
Make the save() conditional on the container not being in the
process of being removed.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-02 13:47:53 -04:00
b63b1f9cb6 Merge pull request #1562 from mheon/update_install_instructions
Update docs to build a runc that works with systemd
2018-10-02 10:34:32 -07:00
506ae3650b Merge pull request #1576 from rhatdan/label
Disable SELinux labeling if --privileged
2018-10-02 09:07:50 -07:00
39d7c869ea Fix bug with exited state and container remove
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-02 12:07:23 -04:00
29dbab6440 Address review comments and fix ps output
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-02 12:05:22 -04:00
2c7f97d5a7 Add ContainerStateExited and OCI delete() in cleanup()
To work better with Kata containers, we need to delete() from the
OCI runtime as a part of cleanup, to ensure resources aren't
retained longer than they need to be.

To enable this, we need to add a new state to containers,
ContainerStateExited. Containers transition from
ContainerStateStopped to ContainerStateExited via cleanupRuntime
which is invoked as part of cleanup(). A container in the Exited
state is identical to Stopped, except it has been removed from
the OCI runtime and thus will be handled differently when
initializing the container.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-02 12:05:22 -04:00
89c5804fe0 Merge pull request #1563 from jwhonce/wip/pods
Implement pod varlink bindings
2018-10-02 08:47:53 -07:00
08898cb5ac Merge pull request #1577 from rhatdan/hooks
Need to allocate memory for hook struct
2018-10-02 06:12:52 -07:00
4fe1979b9c Need to allocate memory for hook struct
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-10-02 05:47:29 -04:00
abdaf79dac Merge pull request #1547 from giuseppe/rootless-error-on-invalid-resources
rootless: raise an error when trying to use cgroups
2018-10-02 00:51:48 -07:00
86d435f32f Disable SELinux labeling if --privileged
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-10-02 03:44:46 -04:00
3bdccd8a46 Merge pull request #1568 from rhatdan/kill
Add --all flag to podman kill
2018-10-01 08:02:27 -07:00
ff38edaafe * Update documenation
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-01 07:24:50 -07:00
9074565f4e Implement pod varlink bindings
* Update varlink document
* Add NoContainersInPod error in go and python
* Add support for varlink pod interface
* New code passes pylint
* Fix bug in test_runner.sh
* Update integration tests for race condition on status check
* Add missing port config file support

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-01 07:24:50 -07:00
dd73525fd5 Update docs to build a runc that works with systemd
Runc disables systemd cgroup support when build statically, so
don't tell people to do that now that we're defaulting to systemd
for cgroup management.

Also, fix some error messages to use the proper ID() call for
containers.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-01 10:23:06 -04:00
df978a264d Merge pull request #1571 from giuseppe/runtime-fix-runc-msg
runtime: fix message which assumes the runtime is runc
2018-10-01 06:01:37 -07:00
28fe7003ac runtime: fix message which assumes the runtime is runc
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-01 11:15:28 +02:00
abde1ef0ef rootless: raise an error when trying to use cgroups
https://github.com/containers/libpod/issues/1429#issuecomment-424040416

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-01 09:33:12 +02:00
05fe1bdbbc Merge pull request #1569 from TomSweeneyRedHat/dev/tsweeney/readme.io
Add podman.io to README.md
2018-09-29 23:21:21 -07:00
249a51a2fc Add --all flag to podman kill
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-30 07:48:41 +02:00
e507e4852f Add podman.io to README.md
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2018-09-29 13:07:26 -04:00
1859e35c76 Merge pull request #1567 from rhatdan/vendor
Vendor in the latest containers/storage, image and buildah
2018-09-29 08:43:26 -07:00
f60fe5fb2f Vendor in the latest containers/storage, image and buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-29 08:01:25 +02:00
87c255f29f Don't tmpcopyup on systemd cgroup
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-29 06:00:47 +02:00
4f825f2e07 Add container runlabel command
Execute the command as described by a container image.  The value of the label is processed
into a command by:

1. Ensuring the first argument of the command is podman.
2. Substituting any variables with those defined by the environment or otherwise.

If no label exists in the container image, nothing is done.

podman container runlabel LABEL IMAGE extra_args
Signed-off-by: baude <bbaude@redhat.com>
2018-09-28 14:14:13 -05:00
7b152a24be Merge pull request #1551 from baude/complexnames
run complex image names with short names
2018-09-28 11:49:42 -07:00
77d8022848 Merge pull request #1561 from baude/addbuildahdisttoinfo
Add buildah version and distribution to info
2018-09-28 11:09:08 -07:00