2673 Commits

Author SHA1 Message Date
52d95f5072 Propogate error codes from SHM lock creation and open
Also add a few more unit tests

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
b489feff71 Add mutex invariant to SHM semaphores.
Check value of semaphores when incrementing to ensure we never go
beyond 1, preserving mutex invariants.

Also, add cleanup code to the lock tests, ensuring that we never
leave the locks in a bad state after a test. We aren't destroying
and recreating the SHM every time, so we have to be careful not
to leak state between test runs.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
27cebb780b Initial skeleton of in-memory locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
6868b5aa14 Merge pull request #2045 from vrothberg/init
add init support
2019-01-04 06:41:07 -08:00
75578aad61 add container-init support
Add support for executing an init binary as PID 1 in a container to
forward signals and reap processes.  When the `--init` flag is set for
podman-create or podman-run, the init binary is bind-mounted to
`/dev/init` in the container and "/dev/init --" is prepended to the
container's command.

The default base path of the container-init binary is `/usr/libexec/podman`
while the default binary is catatonit [1].  This default can be changed
permanently via the `init_path` field in the `libpod.conf` configuration
file (which is recommended for packaging) or temporarily via the
`--init-path` flag of podman-create and podman-run.

[1] https://github.com/openSUSE/catatonit

Fixes: #1670
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-04 11:42:03 +01:00
b0fcd555db If local storage file exists, then use it rather then defaults.
Currently we always force overlay if it exists even though a user might want
vfs.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-03 16:25:02 -05:00
9ffd480616 Merge pull request #2071 from baude/vendorcs
vendor in new containers/storage
2019-01-03 12:14:24 -08:00
561e65969f vendor in new containers/storage
vendor in latest containers/storage which contains a fix for when
a filesystem that overlayfs is on is ENOSPC.

adding pgzip/compress as a new dep for c/s

Signed-off-by: baude <bbaude@redhat.com>
2019-01-03 12:49:30 -06:00
1334696814 Merge pull request #2072 from rhatdan/completions
Fix completions
2019-01-03 10:26:10 -08:00
0c26aec2ae Fix completions
Currently completions do not work.  podman generate kube and podman play kube
completions broke this.

Also fixed podman import to work properly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-03 11:57:55 -05:00
098c13418a Merge pull request #2065 from TomSweeneyRedHat/dev/tsweeney/troublefix1
Touch up some troubleshooting nits
2019-01-02 12:02:43 -08:00
a25b707fdb Touch up some troubleshooting nits
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-01-02 14:14:50 -05:00
a634d5559f Merge pull request #2068 from mheon/log_container_command
Log container command before starting the container
2019-01-02 10:56:49 -08:00
945d0e8700 Log container command before starting the container
Runc does not produce helpful error messages when the container's
command is not found, so print the command ourselves.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-02 12:11:50 -05:00
e796f522f6 Merge pull request #2067 from mheon/fix_garbage_ports
Use sprintf to generate port numbers while committing
2019-01-02 07:55:24 -08:00
9c7d512136 Use sprintf to generate port numbers while committing
Casting integers to strings is definitely not correct, so let the
standard library handle matters.

Fixes #2066

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-02 10:26:44 -05:00
7438b7bd3a Merge pull request #2052 from rhatdan/sparse
Add troubleshooting for sparse files
2018-12-31 08:23:29 -08:00
ad36345fde Add troubleshooting for sparse files
A common failure with people building container images is the
creation of large sparse files, particularly useradd creating
the lastlog file.

This PR Documents the failures.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-30 08:08:13 -05:00
1aa55edda5 Merge pull request #2058 from adrianreber/enable-cr
Re-enable checkpoint/restore CI tests on Fedora
2018-12-28 17:54:35 -08:00
1438d5471f Merge pull request #2059 from rhatdan/ociruntime
podman build is not using the default oci-runtime
2018-12-28 17:44:35 -08:00
0420215f65 Merge pull request #2060 from rhatdan/devices
Fix handling of symbolic links
2018-12-28 17:33:35 -08:00
c141c5cfd2 Fix handling of symbolic links
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-28 13:10:15 -05:00
652a985998 podman build is not using the default oci-runtime
Currently if the user installs runc in an alternative path
podman run uses it but podman build does not.

This patch will pass the default oci runtime to be used by podman
down to the image builder.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-28 12:36:25 -05:00
2b41cd5fd3 Re-enable checkpoint/restore CI tests on Fedora
Now that the correct distribution CRIU packages are installed the
checkpoint/restore tests should no longer fail. This re-enables the
disabled tests on Fedora.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-12-28 14:05:27 +01:00
c50332d057 Merge pull request #2051 from rhatdan/shm
Fixes to handle /dev/shm correctly.
2018-12-24 08:43:10 -08:00
df99522c67 Fixes to handle /dev/shm correctly.
We had two problems with /dev/shm, first, you mount the
container read/only then /dev/shm was mounted read/only.
This is a bug a tmpfs directory should be read/write within
a read-only container.

The second problem is we were ignoring users mounted /dev/shm
from the host.

If user specified

podman run -d -v /dev/shm:/dev/shm ...

We were dropping this mount and still using the internal mount.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-24 09:03:53 -05:00
bbfe7341b7 Merge pull request #2049 from baude/rootlessusestop
rootless tests using stop is more reliable
2018-12-24 02:53:45 -08:00
8fe30505ac Merge pull request #2044 from rhatdan/list
Allow alias for list, ls, ps to work
2018-12-23 11:37:26 -08:00
df923b2613 rootless tests using stop is more reliable
when testing rootless containers, it is more reliable to stop
a container with a zero timeout than kill a container.  We made
this change in non-rootless tests as well.  When IO or CPU are
taxed, it avoids a situation where the kill signal is sent but the
container has not been able to update its status when a subsequent
action occurs.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-23 11:47:46 -06:00
eb982193c5 Merge pull request #2048 from isimluk/use-idtools-parser
Refactor: use idtools.ParseIDMap instead of bundling own version
2018-12-23 08:10:25 -08:00
a22f00d4c5 Allow alias for list, ls, ps to work
Allow multiple alias for listing containers and images.

Also fix documentation for umount and unmount

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-23 09:38:57 -05:00
4e85f468fc Refactor: use idtools.ParseIDMap instead of bundling own version
ParseIDMap function was extracted to idtools in

    https://github.com/containers/storage/pull/236

it is already used in containers/storage and buildah, it should be used in
libpod as well.

Signed-off-by: Šimon Lukašík <isimluk@fedoraproject.org>
2018-12-23 12:07:54 +01:00
792f10988e Merge pull request #2023 from rhatdan/config
Switch all references to image.ContainerConfig to image.Config
2018-12-22 03:11:08 -08:00
7122b49464 Merge pull request #2042 from cevich/new_criu_images
Use new VM images with updated CRIU
2018-12-22 02:59:10 -08:00
727f8faff6 cirrus: Use updated images including new crui
Also add two minor tweaks which were preventing images from building
properly.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-21 16:08:21 -05:00
c657dc4fdb Switch all referencs to image.ContainerConfig to image.Config
This will more closely match what Docker is doing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 15:59:34 -05:00
fe186c6ebb Merge pull request #2033 from rhatdan/devices
Allow users to specify a directory for additonal devices
2018-12-21 12:09:46 -08:00
fa568e04d6 Merge pull request #2035 from rhatdan/vendor
Vendor in latest psgo code
2018-12-21 08:37:12 -08:00
1ad6f9af15 Allow users to specify a directory for additonal devices
Podman will search through the directory and will add any device
nodes that it finds.  If no devices are found we return an error.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 10:28:14 -05:00
4d13262405 Change all 'can not' to 'cannot' for proper usage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 10:27:54 -05:00
664076c259 Invalid index for array
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 09:25:25 -05:00
faa7ff3568 Merge pull request #2028 from giuseppe/fix-rootless-export
rootless: fix export when using fuse-overlayfs
2018-12-21 06:09:45 -08:00
60a74088fa Vendor in latest psgo code to fix race conditions
When running podman top, the processes collected can exit befor
psgo gets information on the processes.  This can cause some weird
errors and creates some CI flakes.

psgo now properly ignores this situation rather then returning errors

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 09:07:21 -05:00
28e30408b6 Merge pull request #1998 from adrianreber/with-criu-again
Use existing CRIU packages for testing instead of building from git
2018-12-21 05:40:30 -08:00
0ed55f75ab test: add test for rootless export
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-21 11:26:03 +01:00
d389ac45e5 export: fix usage with rootless containers
Fix usage of export when rootless containers are used without vfs.  We
join the conmon process namespaces as the container is running in a
different one.

There can be a problem if the user specify a different path for the
conmon process, and then the file is deleted.  In this case podman
won't be able to find the conmon process to join.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-21 09:46:06 +01:00
f2e96b0934 rootless: add function to join user and mount namespace
Add the possibility to join directly the user and mount namespace
without looking up the parent of the user namespace.

We need this in order to be able the conmon process, as the mount
namespace is kept alive only there.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-21 09:46:05 +01:00
f65eafa6ba libpod: always store the conmon pid file
we need this information to later be able to join
the conmon process.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-21 09:46:05 +01:00
38e3fb53f6 Use existing CRIU packages in CI setup
For all in testing involved distribution a new enough CRIU exists as a
package.

Fedora provides CRIU packages directly. For CentOS/RHEL there is a COPR
with the latest CRIU version and for Ubuntu there is a PPA for the
latest CRIU version. Let's use these packages and fall back to building
from git if necessary.

Signed-off-by: Adrian Reber <adrian@lisas.de>
2018-12-21 08:18:21 +01:00
fa998f224f Merge pull request #2037 from baude/blkioskip
skip test for blkio.weight when kernel does not support it
2018-12-20 10:40:03 -08:00