13417 Commits

Author SHA1 Message Date
9eaa6f4566 Merge pull request #12297 from edsantiago/no_remote_unshare
Network test: fix podman-remote-rootless corner case
2021-11-15 16:42:40 +01:00
e9d8ca22b8 Merge pull request #11076 from boaz0/closes_10275
Support template unit files in podman generate systemd
2021-11-15 16:30:38 +01:00
d40736fef1 Merge pull request #12257 from adrianreber/2021-11-10-print-stats
Add optional checkpoint/restore statistics
2021-11-15 16:17:37 +01:00
c21259bf86 Network test: fix podman-remote-rootless corner case
Followup to #12229, in which I added a podman unshare for
flake debugging. Turns out that doesn't work in podman-remote.
It was not caught because CI doesn't run podman-remote rootless.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-15 07:01:22 -07:00
d28b39a90d Added test for checkpoint/restore --print-stats
Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-15 11:50:25 +00:00
914f4c8905 Update man pages for checkpoint/restore --print-stats
This commit updates the man pages for checkpoint and restore to describe
the '--print-stats' parameter.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-15 11:50:25 +00:00
80e56fa12b Added optional container restore statistics
This adds the parameter '--print-stats' to 'podman container restore'.
With '--print-stats' Podman will measure how long Podman itself, the OCI
runtime and CRIU requires to restore a checkpoint and print out these
information. CRIU already creates process restore statistics which are
just read in addition to the added measurements. In contrast to just
printing out the ID of the restored container, Podman will now print
out JSON:

 # podman container restore --latest --print-stats
 {
     "podman_restore_duration": 305871,
     "container_statistics": [
         {
             "Id": "47b02e1d474b5d5fe917825e91ac653efa757c91e5a81a368d771a78f6b5ed20",
             "runtime_restore_duration": 140614,
             "criu_statistics": {
                 "forking_time": 5,
                 "restore_time": 67672,
                 "pages_restored": 14
             }
         }
     ]
 }

The output contains 'podman_restore_duration' which contains the
number of microseconds Podman required to restore the checkpoint. The
output also includes 'runtime_restore_duration' which is the time
the runtime needed to restore that specific container. Each container
also includes 'criu_statistics' which displays the timing information
collected by CRIU.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-15 11:50:25 +00:00
6202e8102b Added optional container checkpointing statistics
This adds the parameter '--print-stats' to 'podman container checkpoint'.
With '--print-stats' Podman will measure how long Podman itself, the OCI
runtime and CRIU requires to create a checkpoint and print out these
information. CRIU already creates checkpointing statistics which are
just read in addition to the added measurements. In contrast to just
printing out the ID of the checkpointed container, Podman will now print
out JSON:

 # podman container checkpoint --latest --print-stats
 {
     "podman_checkpoint_duration": 360749,
     "container_statistics": [
         {
             "Id": "25244244bf2efbef30fb6857ddea8cb2e5489f07eb6659e20dda117f0c466808",
             "runtime_checkpoint_duration": 177222,
             "criu_statistics": {
                 "freezing_time": 100657,
                 "frozen_time": 60700,
                 "memdump_time": 8162,
                 "memwrite_time": 4224,
                 "pages_scanned": 20561,
                 "pages_written": 2129
             }
         }
     ]
 }

The output contains 'podman_checkpoint_duration' which contains the
number of microseconds Podman required to create the checkpoint. The
output also includes 'runtime_checkpoint_duration' which is the time
the runtime needed to checkpoint that specific container. Each container
also includes 'criu_statistics' which displays the timing information
collected by CRIU.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-15 11:50:24 +00:00
cca6df428c Merge pull request #12272 from hshiina/memory-swappiness
Enable 'podman run --memory-swappiness=0'
2021-11-13 13:12:48 +01:00
8f3fb743ee Merge pull request #12270 from rhatdan/auth
--authfile command line argument for image sign command.
2021-11-13 13:10:48 +01:00
78bc2390f4 Merge pull request #12271 from Luap99/play-kube-net
Fix network mode in play kube
2021-11-12 19:59:44 +01:00
9226ccb59f Enable 'podman run --memory-swappiness=0'
'--memory-swappiness=0' used to work. This patch fixes the regression
issue, which was caused by the change of infra container creation
process.

Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
2021-11-12 13:20:20 -05:00
0aecacb865 Merge pull request #12224 from cdoern/scp
Podman Image SCP transfer patch
2021-11-12 18:44:44 +01:00
164c42b485 Fix network mode in play kube
We need to use the config network mode when no network mode was set. To
do so we have to keep the nsmode empty, MakeContainer() will use the
correct network mode from the config when needed.

Fixes #12248

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-12 18:32:01 +01:00
07f5a94711 Merge pull request #12279 from mscherer/fix_11842
Always create working directory when using compat API
2021-11-12 16:55:24 +01:00
19c79eeff3 Merge pull request #12280 from vrothberg/fix-12254
play kube: don't force-pull infra image
2021-11-12 16:45:25 +01:00
b1c0023424 Always create working directory when using compat API
Docker/Moby always create the working directory, and some tools
rely on that behavior (example, woodpecker/drone).

Fixes #11842

Signed-off-by: Michael Scherer <misc@redhat.com>
2021-11-12 14:18:26 +01:00
f517510bc8 play kube: don't force-pull infra image
Do not force-pull the infra image in `play kube` but let the backend
take care of that when creating the pod(s) which may build a local
`podman-pause` image instead of using the default infra image.

Fixes: #12254
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-12 13:44:13 +01:00
ac38eca3fd Podman Image SCP transfer patch
Fixed syntax so that podman image scp transfer works with no user specified.
This command can only be executed as root so to obtain the default user, I searched for
the SUDO_USER environmental variable. If that is not found, we error out and inform the user
to set this variable and make sure they are running as root

Signed-off-by: cdoern <cdoern@redhat.com>
Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
2021-11-11 20:14:38 -05:00
92da8682b3 Merge pull request #12256 from cevich/update_to_U2110
Cirrus: Update to Ubuntu 21.10 + Disable F33
2021-11-11 22:25:42 +01:00
6762d5e238 --authfile command line argument for image sign command.
Adds the --authfile command line argument to allow users to use
alternative authfile paths when signing images.

Replaces: https://github.com/containers/podman/pull/10975
Fixes: https://github.com/containers/podman/issues/10866

Signed-off-by: José Guilherme Vanz <jvanz@jvanz.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-11 15:11:19 -05:00
4c08291f9e Merge pull request #12197 from gliptak/readme1
[ci:docs] Add Static Build download instructions to README
2021-11-11 20:53:44 +01:00
d6d89fa79f Merge pull request #12267 from giuseppe/safely-create-etc-mtab
libpod: create /etc/mtab safely
2021-11-11 20:47:42 +01:00
69d2e78b3b Merge pull request #12214 from giuseppe/fix-rootless-error-message
rootless: adjust error message
2021-11-11 20:42:43 +01:00
f35d7f4dc7 Cirrus: Temp. disable prior-fedora testing
With F35 released, F33 is officially dead.  Move it out of the way
temporarily until F35 VM images are ready.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-11 14:10:17 -05:00
0b60b191d1 Cirrus: Update to Ubuntu 21.10
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-11 14:10:17 -05:00
375ff223f4 Merge pull request #12131 from Luap99/netavark-interface
Netavark interface
2021-11-11 19:12:43 +01:00
3af19917a1 Add failing run test for netavark
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 17:50:10 +01:00
fe90a45e0d Add flag to overwrite network backend from config
To make testing easier we can overwrite the network backend with the
global `--network-backend` option.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 17:30:27 +01:00
9f4d63f91b libpod: create /etc/mtab safely
make sure the /etc/mtab symlink is created inside the rootfs when /etc
is a symlink.

Closes: https://github.com/containers/podman/issues/12189

[NO NEW TESTS NEEDED] there is already a test case

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-11 17:00:53 +01:00
8041d44c93 Add network backend to podman info
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 16:49:46 +01:00
b2f7430b67 Add more netavark tests
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 16:49:28 +01:00
1c88f741a7 select network backend based on config
You can change the network backendend in containers.conf supported
values are "cni" and "netavark".

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 16:26:47 +01:00
3fe0c49174 Fix RUST_LOG envar for netavark
THe rust netlink library is very verbose. It contains way to much debug
and trave logs. We can set `RUST_LOG=netavark=<level>` to make sure this
log level only applies to netavark and not the libraries.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 16:25:52 +01:00
4febe55769 netavark IPAM assignment
Add a new boltdb to handle IPAM assignment.

The db structure is the following:
Each network has their own bucket with the network name as bucket key.
Inside the network bucket there is an ID bucket which maps the container ID (key)
to a json array of ip addresses (value).
The network bucket also has a bucket for each subnet, the subnet is used as key.
Inside the subnet bucket an ip is used as key and the container ID as value.

The db should be stored on a tmpfs to ensure we always have a clean
state after a reboot.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 16:25:19 +01:00
d5b411c484 Merge pull request #12193 from yahavi/patch-1
[CI:DOCS] Fix Zsh completion command documentation
2021-11-11 16:17:41 +01:00
eaae294628 netavark network interface
Implement a new network interface for netavark.
For now only bridge networking is supported.
The interface can create/list/inspect/remove networks. For setup and
teardown netavark will be invoked.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 15:54:02 +01:00
12c62b92ff Make networking code reusable
To prevent code duplication when creating new network backends move
reusable code into a separate internal package.

This allows all network backends to use the same code as long as they
implement the new NetUtil interface.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 15:54:02 +01:00
8fd31c674b Merge pull request #12260 from Luap99/upgrade-flake
Fix flake in upgrade tests
2021-11-11 15:38:41 +01:00
c43b81f9a0 Fix flake in upgrade tests
The cni plugins need access to /run/cni and the dnsname plugin needs
access to /run/containers.

The race condition was basically that a `podman stop` could either do the
cleanup itself or the spawned cleanup process would do the cleanup if it
was fast enough. The `podman stop` is executed on the host while the
podman cleanup process is executed in the "parent container". The parent
container contains older plugins than on the host. The dnsname plugin
before version 1.3 could error and this would prevent CNI from
doing a proper cleanup. The plugin errors because it could not find its
files in /run/containers. On my system the test always failed because
the cleanup process was always faster than the stop process. However in
the CI VMs the stop process was usually faster and so it failed only
sometimes.

Fixes #11558

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 14:15:35 +01:00
73e1cdfe9e export adding id-specifier code to setContainerNameForTemplate
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2021-11-11 11:45:36 +02:00
5f3ce2515d Merge pull request #12261 from rhatdan/Dockerfile
[CI:DOCS] VOLUME must be declared after RUN chown command
2021-11-11 02:33:35 +01:00
fa8184c807 Merge pull request #12240 from umohnani8/table
Print headers for system connection ls
2021-11-10 23:29:36 +01:00
546ad0e6ab Merge pull request #12242 from Luap99/port-reload
network reload without ports should not reload ports
2021-11-10 23:28:35 +01:00
980c47aaa2 VOLUME must be declared after RUN chown command
Podman and Docker will not commit changes via RUN command
of a VOLUME directory, so we need to chown path first.

Not doing do will cause: https://bugzilla.redhat.com/show_bug.cgi?id=2009266

Signed-off-by: Jindrich Novy <jnovy@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-10 17:15:58 -05:00
9dddc47d28 Merge pull request #12258 from edsantiago/xref_manpages_see_also
[CI:DOCS] Add CI check for SEE ALSO in man pages
2021-11-10 22:53:36 +01:00
3690532b3b network reload return error if we cannot reload ports
As rootless we have to reload the port mappings. If it fails we should
return an error instead of the warning.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-10 21:16:30 +01:00
27de152b5a network reload without ports should not reload ports
When run as rootless the podman network reload command tries to reload
the rootlessport ports because the childIP could have changed.
However if the containers has no ports we should skip this instead of
printing a warning.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-10 21:16:08 +01:00
a55fdbb49c Print headers for system connection ls
Print out the headers even if the system connection list
is empty to match the behavior of other list commands.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-11-10 14:48:08 -05:00
4bf0146c29 Merge pull request #12255 from vrothberg/fix-11970
podman load: support downloading files
2021-11-10 18:27:39 +01:00