15817 Commits

Author SHA1 Message Date
98b22e29c9 Merge pull request #14932 from jakecorrenti/pull-all-tags-shorthand
Podman pull --all-tags shorthand option
2022-07-15 15:12:58 +00:00
b513dc4c1e Clean up cached machine images
When initing machines, we download a machine image, and uncompress and
copy the image for the actual vm image. When a user constantly pulls new
machines, there may be a buildup of old, unused machine images. This
commit cleans ups the unused cached images.

Changes:
- If the machine is pulled from a URL or from the FCOS releases, we pull
  them into XDG_DATA_HOME/containers/podman/machine/vmType/cache
- Cache cleanups only happen if there is a cache miss, and we need to
  pull a new image
- For Fedora and FCOS, we actually use the cache, so we go through the
  cache dir and remove any images older than 2 weeks (FCOS's release cycle), on a cache miss.
- For generic files pulled from a URL, we don't actually cache, so we
  delete the pulled file immediately after creating a machine image
- For generic files from a local path, the original file will never be
  cleaned up

Note that because we cache in a different dir, this will not clean up
old images pulled before this commit.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-07-15 09:10:43 -04:00
b4c09bef66 Merge pull request #14909 from eriksjolund/add_socket_activation_tutorial
[CI:DOCS] Add socket_activation.md
2022-07-15 09:36:28 +00:00
aa7aedc958 Merge pull request #14944 from cevich/machine-label-task
Cirrus: Trigger podman-machine task by label
2022-07-15 04:18:03 +00:00
10bf85c07f Merge pull request #14927 from cevich/fix_error_grep
[CI:DOCS] GHA: Fix dumb error check
2022-07-14 20:56:06 +00:00
f6e41e77c7 Merge pull request #14832 from karthikelango137/filterFlagStop
Podman stop --filter flag
2022-07-14 19:16:05 +00:00
313ec3e251 Merge pull request #14938 from nicrowe00/12475remix
fix tests for "podman kube play"
2022-07-14 18:48:41 +00:00
d95e79ebe3 GHA: Fix dumb error check
Previously the reply JSON was examined for the literal presence of the
string 'error'.  This was intended to catch server or query errors and
the like.  However it's not a sound design as valid/legitimate contents
could potentially contain the string.  Fix this by using the `-e` option
to `jq`, with a filter that should always result in a non-empty/null
match.  If this fails or returns null for some reason, then it's safe to
throw a real error code & message.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-07-14 14:42:59 -04:00
d385914cd9 Cirrus: Trigger podman-machine task by label
Instead of requiring developers to search for a magic button, make the
task trigger at the time a special PR label is added.  Update comments
accordingly.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-07-14 14:29:07 -04:00
a2f6cc74e7 Podman stop --filter flag
Filter flag is added for podman stop and podman --remote stop. Filtering logic is implemented in
getContainersAndInputByContext(). Start filtering can be manipulated to use this logic as well to limit redundancy.

Signed-off-by: Karthik Elango <kelango@redhat.com>
2022-07-14 13:18:53 -04:00
3637d55191 Merge pull request #14935 from saschagrunert/semver-v4
Switch to `github.com/blang/semver/v4`
2022-07-14 15:50:39 +00:00
90607a6d04 Podman pull --all-tags shorthand option
I added the shorthand option for `podman pull --all-tags`. Like Docker,
Podman can now do `podman pull -a`.

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-07-14 10:54:24 -04:00
3b5034e91a fix tests for "podman kube play"
This is a follow up to fix some of the apiv2
tests related to "podman kube play" while also
removing reduntant system tests.

Signed-off-by: Niall Crowe <nicrowe@redhat.com>
2022-07-14 15:47:27 +01:00
8e2add7709 [CI:DOCS] Update docs/tutorials/socket_activation.md
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-14 15:20:59 +02:00
2270bc5f96 [CI:DOCS] Add socket activation tutorial
Closes #14908

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-14 15:20:52 +02:00
35e637daf8 Merge pull request #14914 from edsantiago/xref_manpages_stricter
[CI:DOCS] man page checker: enforce stricter options format
2022-07-14 13:14:41 +00:00
23a266b2e7 Merge pull request #14919 from gbraad/fedorawsl
Use prepared image for WSL machine init
2022-07-14 12:35:56 +00:00
ad7c54e13a man page checker: enforce stricter options format
Followup to #14906, in which a nonexistent option was found
in a man page. The xref script was designed to catch that,
but I was too lax in my parsing: the option was documented
using wrong syntax, and the script didn't catch it.

Solution: do not allow *any* unrecognized cruft in the
option description lines. And fix all improperly-written
entries to conform to the rule:

    **--option**=*value(s)*

Two asterisks around option, which must have two dashes. One
asterisk around value(s).

This is going to cause headaches for some people adding new
options, but I don't think I can fix that: there are many
factors that make an unparseable line. Adding 'hint' code
would make the script even more complex than it is. I have
to assume that our contributors are smart enough to look
at surrounding context and figure out the right way to
specify options.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-14 06:35:51 -06:00
d4dc067117 Merge pull request #14923 from rhatdan/events
Add podman events -f to be alias for --filter
2022-07-14 12:01:40 +00:00
66cb856f9d Switch to github.com/blang/semver/v4
Switch to the latest version of the now go module compatible release.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-14 13:53:13 +02:00
0f53abd093 Fixes #14698 Use prepared image for WSL2 machine init
This commit introduces a prepared image for setting up the WSL2
environment. This means that the deployment will take considerable
less time to finish (as it does not need to run an update and package
install), but also allows to rely on a cached image to re-init the
environment without the need for an internet connection.

[NO NEW TESTS NEEDED]

Signed-off-by: Gerard Braad <me@gbraad.nl>
2022-07-13 17:19:38 -05:00
5c3eec5589 Merge pull request #14772 from nicrowe00/12475
Add "podman kube play" cmd
2022-07-13 19:29:16 +00:00
cc2cfe0602 Add podman events -f to be alias for --filter
Needed for Docker compatibility.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-13 10:55:27 -04:00
5f8d08d593 Merge pull request #14915 from eriksjolund/rename_c_to_cpu_shares
[CI:DOCS] man pages: replace -c with --cpu-shares
2022-07-13 14:54:57 +00:00
d2c620e1c4 Merge pull request #14895 from baude/machinewip
Fix machine test for list
2022-07-13 14:50:37 +00:00
e08a77ce64 Add "podman kube play" cmd
The "podman kube play" command is designed to be a replacement for the
"podman play kube" command.
It performs the same function as "play kube"  while also still working with the same flags and options.
The "podman play kube" command is still functional as an alias of "kube play".

Closes #12475
Signed-off-by: Niall Crowe <nicrowe@redhat.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-13 15:27:03 +01:00
1392922d4a [CI:DOCS] man pages: replace -c with --cpu-shares
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-13 16:06:42 +02:00
4df6122aaa Merge pull request #14904 from giuseppe/move-to-subcgroup-in-a-container
abi: create new cgroup when running in a container
2022-07-13 09:10:57 +00:00
6323af78e7 Merge pull request #14916 from rhatdan/docker
Docker uses "-c" to mean "--cpu-shares" in create and run
2022-07-13 09:07:00 +00:00
e3419c0324 abi: create new cgroup when running in a container
if podman is running in the root cgroup, it will create a new
subcgroup and move itself there.

[NO NEW TESTS NEEDED] it needs nested podman

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-13 09:13:06 +02:00
7b4afbf621 podman: always call into SetupRootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-13 09:13:06 +02:00
16b8d77f9e utils: call MaybeMoveToSubCgroup once
memoize its result and use it for subsequent calls.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-13 09:13:06 +02:00
4b547a72ab podman: move MaybeMoveToSubCgroup to utils/
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-13 09:13:06 +02:00
255740bdf8 Merge pull request #14910 from flouthoc/fix-test
test,manifest-run: declare `TARGETPLATFORM` in test containerfile.
2022-07-12 21:41:22 +00:00
4450894217 Fix last machine test
The list --format json test case had a typo like error.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-07-12 15:29:46 -05:00
bb8ff86bf2 Use SafeChown rather then chown for volumes on NFS
NFS Servers will thrown ENOTSUPP error if you attempt to
chown a directory to the same UID and GID as the directory
already has. If volumes are stored on NFS directories this
throws an ugly error and then works on the next try.

Bottom line don't chown directories that already have the correct
UID and GID.

Fixes: https://github.com/containers/podman/issues/14766

[NO NEW TESTS NEEDED] Difficult to setup an NFS Server in testing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-12 15:41:13 -04:00
72d13c56ce Merge pull request #14905 from eriksjolund/remove_rootless_considerations
[CI:DOCS] rootless_tutorial: Remove incorrect advice regarding volume…
2022-07-12 19:35:01 +00:00
587807b8aa Merge pull request #14912 from edsantiago/ci_confirm_runtime
[CI:DOCS] CI: sanity check for desired runtime
2022-07-12 19:26:53 +00:00
c9a82d72a7 Docker uses "-c" to mean "--cpu-shares" in create and run
Add support for -c as an alias for --cpu-shares to be compatible with
Docker.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-12 14:53:17 -04:00
e83ff8e5e6 [CI:DOCS] podman-create.md: replace -c with --cpu-shares
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-12 19:41:20 +02:00
edbfbfcda1 Merge pull request #14911 from eriksjolund/remove_builtin_volume_option_from_man_pages
[CI:DOCS] man pages: remove non-existent option builtin-volume
2022-07-12 11:14:17 -04:00
09ea46d162 Merge pull request #14893 from Luap99/machine-proxy
podman machine: do not commit proxies into config file
2022-07-12 15:10:36 +00:00
da8c6a8eaf CI: sanity check for desired runtime
We're still not testing runc in CI (#14833), and it may be weeks
or months before we can, due to criu/glibc nightmare, but one day
we'll be back on track, then later on we'll update VMs again,
and screw it up, and lose runc, and not notice, and RHEL will
break, and oh noes headless chicken again, repeat repeat.

We can do better. Use .cirrus.yml to explicitly define which
VMs should use which runtimes, and enforce it early in the
CI build step. This should never fail (uh huh) in a PR,
only in one of the update-VM PRs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-12 08:47:09 -06:00
b8a7e275d1 [CI:DOCS] rootless_tutorial: Remove incorrect advice regarding volumes and mount points
* Remove the instruction
  "The mount point must exist in the container"
  as it is incorrect which is shown by this example
  ```
  $ mkdir dir1
  $ podman run --rm -v ./dir1:/dir1:Z docker.io/library/fedora:36 touch /dir1/file
  $ ls dir1
  file
  $ podman run --rm docker.io/library/fedora:36 ls -l /dir1
  ls: cannot access '/dir1': No such file or directory
  $ podman --version
  podman version 4.1.1
  $
  ```

* Rewrite the advice "You should always give the full path to the volume you'd like to mount"
  so that it also mentions relative paths starting with a dot.

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-12 16:32:14 +02:00
f6ed7a8c94 [CI:DOCS] man pages: remove non-existent option builtin-volume
Closes #14906

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-12 16:28:31 +02:00
27e12aa074 test,manifest-run: declare TARGETPLATFORM before using it
As part of fix for https://github.com/openshift/imagebuilder/issues/231
`FROM` does not expands `ARGS` which are not declared so
`TARGETPLATFORM`

Note: I think a patch should be added at imagebuilder to allow using
inbuilt ARGS  in FROM without declaring it as well but it is something
to be discussed so lets declare it manually in our tests

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-12 19:52:11 +05:30
a51a63023c Merge pull request #14896 from edsantiago/logformatter_by_task
logformatter: link by *task ID*, not build ID
2022-07-12 13:54:11 +00:00
4d111fa9af Merge pull request #14901 from tyler92/fix-trace-log
fix wrong log message on Trace level
2022-07-12 11:24:13 +00:00
ffbc2adf70 fix wrong log message on Trace level
[NO NEW TESTS NEEDED]

Empty path to runtime binary was printed instead of a real path.

Before fix:
TRAC[0000] found runtime ""
TRAC[0000] found runtime ""

After:
TRAC[0000] found runtime "/usr/bin/crun"
TRAC[0000] found runtime "/usr/bin/runc"

Signed-off-by: Mikhail Khachayants <khachayants@arrival.com>
2022-07-12 10:37:56 +03:00
151d7584c1 Merge pull request #14898 from eriksjolund/improve_language_and_fix_spelling_and_typos
[CI:DOCS] Improve language. Fix spelling and typos.
2022-07-11 21:29:41 +00:00