Commit Graph

6355 Commits

Author SHA1 Message Date
Peter Hunt a1a79c08b7 Implement conmon exec
This includes:
	Implement exec -i and fix some typos in description of -i docs
	pass failed runtime status to caller
	Add resize handling for a terminal connection
	Customize exec systemd-cgroup slice
	fix healthcheck
	fix top
	add --detach-keys
	Implement podman-remote exec (jhonce)
	* Cleanup some orphaned code (jhonce)
	adapt remote exec for conmon exec (pehunt)
	Fix healthcheck and exec to match docs
		Introduce two new OCIRuntime errors to more comprehensively describe situations in which the runtime can error
		Use these different errors in branching for exit code in healthcheck and exec
	Set conmon to use new api version

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-22 15:57:23 -04:00
OpenShift Merge Robot cf9efa90e5
Merge pull request #3620 from haircommander/bump-conmon
use conmon v1.0.0-rc2
2019-07-22 21:43:59 +02:00
OpenShift Merge Robot 69f74f13b0
Merge pull request #3598 from vrothberg/update-image
vendor github.com/containers/image@v2.0.1
2019-07-22 19:39:55 +02:00
Peter Hunt 0671dca90d bump conmon to 1.0.0-rc2
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-22 13:20:51 -04:00
Chris Evich 9b2e98f1e8
Cirrus: Temp. workaround missing imgprune image
The 'image_prune' task only runs on master, post-merge and
is currently failing for all builds.  This is because it
references a non-existent image.  The person with access
to add/enable this image is on PTO.  Fix this by temporarily
using a hand-built image until an automatic build can be added.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-07-22 10:49:31 -04:00
Valentin Rothberg c1b792c1e0 vendor github.com/containers/image@v2.0.1
* progress bar: use spinners for unknown blob sizes
* use 'containers_image_ostree' as build tag
* ostree: default is no OStree support
* Add "Env" to ImageInspectInfo
* config.go: improve debug message
* config.go: log where credentials come from
* Fix typo in docs/containers-registries.conf.5.md
* docker: delete: support all MIME types
* Try harder in storageImageDestination.TryReusingBlob
* docker: allow deleting OCI images
* ostree: improve error message

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-07-22 14:35:03 +02:00
OpenShift Merge Robot ab7b47ca60
Merge pull request #3605 from nc-ruth/patch-1
"mkdir -p /etc/cni/net.d" requires sudo
2019-07-22 13:30:50 +02:00
OpenShift Merge Robot 3b52e4d0b5
Merge pull request #3562 from baude/golangcilint3
golangci-lint round #3
2019-07-22 13:13:50 +02:00
baude db826d5d75 golangci-lint round #3
this is the third round of preparing to use the golangci-lint on our
code base.

Signed-off-by: baude <bbaude@redhat.com>
2019-07-21 14:22:39 -05:00
OpenShift Merge Robot d6b41eb393
Merge pull request #3611 from rhatdan/dan
Remove debug message
2019-07-21 09:56:07 +02:00
Daniel J Walsh f7f66f6a88
Remove debug message
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-20 16:20:48 -04:00
OpenShift Merge Robot a5aa44c583
Merge pull request #3610 from rhatdan/pullmsg
Cleanup Pull Message
2019-07-20 17:05:05 +02:00
OpenShift Merge Robot 8364552e10
Merge pull request #3601 from cevich/fix_post_merge_build_each_commit
Cirrus: Fix post-merge env. var. not set.
2019-07-20 12:18:08 +02:00
Daniel J Walsh 20302cb65d
Cleanup Pull Message
Currently the pull message on failure is UGLY.  This patch removes a lot of the noice
when pulling an image from multiple registries to make the user experience better.

Our current messages are way too verbose and need to be dampened down.  Still has
verbose mode if you turn on log-level=debug.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-20 06:08:22 -04:00
Chris Evich 4c6e8aa6e2
Cirrus: Fix post-merge env. var. not set.
Cirrus-CI automatically sets `$CIRRUS_BASE_BRANCH` during PR testing.
This is used for the `build_each_commit` task, in order to compute the
commit-chain properly.  However, prior to this commit and after a PR
merges, the post-merge `build_each_commit` task would fail with
something similar to:

```
make build-all-new-commits GIT_BASE_BRANCH=origin/$CIRRUS_BASE_BRANCH |& ${TIMESTAMP}
[12:28:59] START - All [+xxxx] lines that follow are relative to right now.
[+0000s] # Validate that all the commits build on top of origin/
[+0000s] git rebase origin/ -x make
[+0000s] fatal: invalid upstream 'origin/'
[+0000s] make: *** [Makefile:426: build-all-new-commits] Error 128
[12:28:59] END - [+0000s] total duration since START
Exit status: 2
```

This is because `$CIRRUS_BASE_BRANCH` is undefined when CI runs against
a branch (by design).  This commit fixes the problem by referring to
`$DEST_BRANCH` instead.  This variable must always point at the intended
destination branch for testing, and so can be used in this context as
well.

Also updated a few comments to help steer understanding of the
`$DEST_BRANCH` purpose.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-07-19 14:30:35 -04:00
OpenShift Merge Robot 02140ea7d1
Merge pull request #3590 from rhatdan/ro
Add support for listing read/only and read/write images
2019-07-19 14:59:13 +02:00
Rubatharisan Thirumathyam 45b6e98c88 mkdir -p /etc/cni/net.d requires sudo
Signed-off-by: Rubatharisan Thirumathyam <ruth@netcompany.com>
2019-07-19 14:58:37 +02:00
Daniel J Walsh 8ae97b2f57
Add support for listing read/only and read/write images
When removing --all images prune images only attempt to remove read/write images,
ignore read/only images

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-19 06:59:49 -04:00
OpenShift Merge Robot 398aeac853
Merge pull request #3599 from QiWang19/ps-regexp
support podman ps filter regular expressions
2019-07-19 03:27:28 +02:00
OpenShift Merge Robot deb087d7b1
Merge pull request #3443 from adrianreber/rootfs-changes-migration
Include changes to the container's root file-system in the checkpoint archive
2019-07-19 02:38:26 +02:00
OpenShift Merge Robot b59abdc1b1
Merge pull request #3579 from QiWang19/dns_net
fix --dns and --network conflict
2019-07-19 02:22:28 +02:00
OpenShift Merge Robot b98e015527
Merge pull request #3597 from cevich/fix_cmd_not_found
Cirrus: Minor scripting typo fix
2019-07-19 01:40:05 +02:00
OpenShift Merge Robot 2254a35d3a
Merge pull request #3593 from giuseppe/rootless-privileged-devices
rootless: add host devices with --privileged
2019-07-18 19:50:22 +02:00
Qi Wang 5047c79e71 support podman ps filter regular expressions
podman ps --filter use regexp to match the container name.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-18 13:11:04 -04:00
OpenShift Merge Robot 1065548f91
Merge pull request #3584 from QiWang19/pssize
podman-remote make --size optional in ps
2019-07-18 18:04:47 +02:00
Giuseppe Scrivano 350ede1eeb
rootless: add rw devices with --privileged
when --privileged is specified, add all the devices that are usable by
the user.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1730773

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-18 17:07:50 +02:00
Chris Evich 67098029bc
Cirrus: Minor scripting typo fix
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-07-18 10:40:26 -04:00
OpenShift Merge Robot ade0d8778f
Merge pull request #3509 from giuseppe/cgroup-namespace
libpod: support for cgroup namespace
2019-07-18 16:14:52 +02:00
OpenShift Merge Robot 22e62e8691
Merge pull request #3595 from mheon/fix_exec_leak
Remove exec PID files after use to prevent memory leaks
2019-07-18 15:52:57 +02:00
Qi Wang 3f721f8b17 fix --dns* and --network not set to host conflict
Close #3553
This PR makes --dns, --dns-option, --dns-search, and --network not set to host flag mutually exclusive for podman build and create. Returns conflict error if both flags are set.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-18 09:39:31 -04:00
Qi Wang c244c347b1 podman-remote make --size optional in ps
Close #3578 Add `size` field to PsOpts in podman remote to receive size as an option.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-18 09:34:19 -04:00
Matthew Heon 5bbede9d9f Remove exec PID files after use to prevent memory leaks
We have another patch running to do the same for exit files, with
a much more in-depth explanation of why it's necessary. Suffice
to say that persistent files in tmpfs tied to container CGroups
lead to significant memory allocations that last for the lifetime
of the file.

Based on a patch by Andrea Arcangeli (aarcange@redhat.com).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-07-18 09:06:11 -04:00
OpenShift Merge Robot adcde2383f
Merge pull request #3592 from openSUSE/aa-file
Add DefaultContent API to retrieve apparmor profile content
2019-07-18 14:15:33 +02:00
Sascha Grunert 27ebd7d6f0
Add DefaultContent API to retrieve apparmor profile content
The default apparmor profile is not stored on disk which causes
confusion when debugging the content of the profile. To solve this, we
now add an additional API which returns the profile as byte slice.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-07-18 13:14:02 +02:00
OpenShift Merge Robot 456c045ddb
Merge pull request #3591 from llchan/makefile-symlink-tweak
Tweak GOPATH-related symlinking
2019-07-18 12:23:07 +02:00
Giuseppe Scrivano 0b57e77d7c
libpod: support for cgroup namespace
allow a container to run in a new cgroup namespace.

When running in a new cgroup namespace, the current cgroup appears to
be the root, so that there is no way for the container to access
cgroups outside of its own subtree.

By default it uses --cgroup=host to keep the previous behavior.

To create a new namespace, --cgroup=private must be provided.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-18 10:32:25 +02:00
OpenShift Merge Robot 7488ed6d9a
Merge pull request #3522 from mheon/nix_the_artifact
Move the HostConfig portion of Inspect inside libpod
2019-07-18 09:23:47 +02:00
Lawrence Chan 2be57e1386 Make GOPATH-related symlinking more precise
This change tweaks the symlink commands that are invoked when libpod is
not on GOPATH. This has the following effects:

- If the working directory is not "libpod", it will still create the
  symlink at the correct github.com/containers/libpod path.
- If the github.com/varlink directory/symlink already exists, it will
  still create the symlink at the intended path.

Signed-off-by: Lawrence Chan <element103@gmail.com>
2019-07-17 22:02:58 -05:00
OpenShift Merge Robot b2734baee5
Merge pull request #3588 from haircommander/play-kube-command
Fix play kube command
2019-07-18 02:07:43 +02:00
Matthew Heon c91bc31570 Populate inspect with security-opt settings
We can infer no-new-privileges. For now, manually populate
seccomp (can't infer what file we sourced from) and
SELinux/Apparmor (hard to tell if they're enabled or not).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-07-17 16:48:38 -04:00
Matthew Heon 156b6ef222 Properly retrieve Conmon PID
Our previous method (just read the PID that we spawned) doesn't
work - Conmon double-forks to daemonize, so we end up with a PID
pointing to the first process, which dies almost immediately.

Reading from the PID file gets us the real PID.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-17 16:48:38 -04:00
Matthew Heon 1e3e99f2fe Move the HostConfig portion of Inspect inside libpod
When we first began writing Podman, we ran into a major issue
when implementing Inspect. Libpod deliberately does not tie its
internal data structures to Docker, and stores most information
about containers encoded within the OCI spec. However, Podman
must present a CLI compatible with Docker, which means it must
expose all the information in 'docker inspect' - most of which is
not contained in the OCI spec or libpod's Config struct.

Our solution at the time was the create artifact. We JSON'd the
complete CreateConfig (a parsed form of the CLI arguments to
'podman run') and stored it with the container, restoring it when
we needed to run commands that required the extra info.

Over the past month, I've been looking more at Inspect, and
refactored large portions of it into Libpod - generating them
from what we know about the OCI config and libpod's (now much
expanded, versus previously) container configuration. This path
comes close to completing the process, moving the last part of
inspect into libpod and removing the need for the create
artifact.

This improves libpod's compatability with non-Podman containers.
We no longer require an arbitrarily-formatted JSON blob to be
present to run inspect.

Fixes: #3500

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-17 16:48:38 -04:00
Peter Hunt 6f35a57423 Fix play kube command
Before, play kube wasn't properly setting the command. Fix this
Also, begin a dedicated test suite for play kube to catch regressions like this in the future

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-17 12:59:50 -04:00
OpenShift Merge Robot 1c02905ec7
Merge pull request #3583 from giuseppe/ulimit-host-not-set
spec: simplify handling of  --ulimit host
2019-07-17 18:18:09 +02:00
Giuseppe Scrivano 2f0ed531c7
spec: rework --ulimit host
it seems enough to not specify any ulimit block to maintain the host
limits.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-17 13:01:21 +02:00
OpenShift Merge Robot 04a9cb01fe
Merge pull request #3335 from cevich/imgprune
Cirrus: Print images that should be pruned
2019-07-17 11:47:42 +02:00
OpenShift Merge Robot fe83308631
Merge pull request #3548 from cevich/disable_periodic_activity
Cirrus: Disable most periodic services/timers
2019-07-16 22:16:24 +02:00
OpenShift Merge Robot 400851ac31
Merge pull request #3508 from csomh/healthcheck-flag-compat
Make the healthcheck flags compatible with Docker CLI
2019-07-16 21:23:52 +02:00
Chris Evich f58b754c8d
Cirrus: Add image-test for locked dpkg
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-07-16 14:30:42 -04:00
Chris Evich efdb7ad8f2
Cirrus: Use images w/o periodic svcs
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-07-16 14:30:42 -04:00