625 Commits

Author SHA1 Message Date
0115a4800b CI: remove build without cgo task
Podman is basically unusable without cgo, checking if it compiles
without adds no value and just tricks people into thinking it works when
it does not.

This means we do not need extra to NOP out a lot of cgo calls with
functions that just return an error like `XXX is not supported without
cgo`.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-20 15:46:28 -04:00
f32dd49e20 Merge pull request #19226 from openshift-cherrypick-robot/cherry-pick-19214-to-v4.6
[v4.6] Makefile: `package` -> `rpm`
2023-07-13 20:45:23 +02:00
145748d1f1 Makefile: package -> rpm
package and package-install targets have been renamed
to rpm and rpm-install respectively for clarity.

`make rpm` will now build rpm using HEAD.

Resolves: #18817

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-07-13 15:30:41 +00:00
62fc35c070 Trim whitespace from unit files while parsing
Fixes: https://github.com/containers/podman/issues/18979

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-13 09:05:56 -04:00
1a1602b72b Makefile: don't rely on the non-standard -r flag for ln
This flag is not supported on BSD-derived systems including FreeBSD and
macos. We can get exactly the same symlink by passing the desired
relative path as source argument to 'ln -sf'.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-06-30 10:17:27 -04:00
aeff58e0b8 [CI:BUILD] Help Renovate manage the golangci-lint version
It's a bit cumbersome to manage a tooling version buried deep in a
command, let alone one also buried deep in a `Makefile`.  Add a
variable to hold the version number so renovate can easily manage it.
This happens via a `regex` manager in the shared configuration
include `containers/automation//renovate/defaults.json5`.  Also add a
helpful note/reminder to humans who may want to manually change the
version for some reason.

Depends on: https://github.com/containers/automation/pull/145

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-06-21 15:16:01 -04:00
a35da3ad87 bump golangci-lint to v1.53.3
Disable new linters and drop comments on them.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-19 14:11:10 +02:00
3efaffae43 New command: podmansh
This commit creates a new command `podmansh` command which can be used by
administrators to provide a confined shell to their users.

The user will only have access to the volumes and capabilities for that
user.

Co-authored-by: Paul Holzinger <pholzing@redhat.com>
Co-authored-by: Daniel Walsh <dwalsh@redhat.com>
Co-authored-by: Petr Lautrbach <lautrbach@redhat.com>
Co-authored-by: Ed Santiago <santiago@redhat.com>

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-06-15 08:14:12 -04:00
f31466e747 Revert "rootlessport: exclude storage drivers via build tags"
This reverts commit ebf7474747787827b1fdc09ac58e949f1ace2d67.

With the c/storage change[1] we no longer need this workaround.

[1] https://github.com/containers/storage/pull/1637

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-13 17:51:34 +02:00
9454242814 Merge pull request #18859 from dfr/freebsd-help
Makefile: add support for 'make help' on FreeBSD
2023-06-13 05:26:19 -04:00
676c4d4e86 Makefile: add support for 'make help' on FreeBSD
This simply uses GNU grep instead of the FreeBSD base grep.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-06-12 17:52:11 +01:00
ebf7474747 rootlessport: exclude storage drivers via build tags
Because of a c/storage change[1] all we get a lot of new dependencies in
rootlessport despite not using them. Add build tags to exclude storage
drivers to make the binary smaller until it get addressed in c/storage.

This saves about 800 MB but the bloat due that change is still causing
us to gain over 2 MB. This is not ideal but we should get vendoring
going and not wait any longer.

[1] https://github.com/containers/storage/pull/1618

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-12 10:51:30 +02:00
71cae3159f Makefile to force a shell when running command
Address a build break on Ubuntu 20.04 in the Makefile whereby calling `command` fails

Signed-off-by: Andy Edwards <andy.edwards@uk.ibm.com>
2023-06-09 13:27:21 +01:00
4d43e1b40d Merge pull request #18827 from dfr/freebsd-bash
Makefile: don't hard-code the path for bash
2023-06-08 17:25:24 -04:00
7832879bf5 Makefile: don't hard-code the path for bash
On FreeBSD, it usually lives in /usr/local/bin/bash. This uses the shell
'commmand' builtin to find the path which works in bash, dash and the
FreeBSD /bin/sh.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-06-08 14:02:38 +01:00
4584350f6e Makefile binaries target adopted for Mac and Win
Signed-off-by: esendjer <esendjer@gmail.com>
2023-06-05 17:59:47 +03:00
dfba6ddd4c Man pages: fix broken tables
Work around a go-md2man bug, and add a check script to make sure
this doesn't hit us again.

Background: go-md2man can't deal with a left-hand column > 31 chars.
It produces man pages that look like:

    | Something With >31 Character |                |
    |                              | ..description  |

(should be all on one row). It also has trouble when the vertical
bars are misaligned: it completely removes the right-hand side.

There's almost certainly a better solution: fix go-md2man, or
use a different conversion tool, or maybe even pre/postprocess.
But this is a quick interim solution.

Sorry for the perl. This could be done in bash/sed/awk/grep,
but not with any sort of sane error messages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-26 06:08:14 -06:00
6003dca9c7 [CI:BUILD] Packit: add jobs for downstream Fedora package builds
Get rid of `podman.spec.rpkg` in favour of
`rpm/podman.spec` which gets synced with fedora dist-git on every
upstream release. The version in the new spec file is set to `0` by
default and gets updated by packit automatically on every packit task.

For local manual rpm builds using the spec, the helper script in the
`rpm/` subdir will update the Version field with the latest version
found in the upstream repo.

Packit will automatically create a PR on fedora dist-git on every new
upstream release. A sample PR will look like:
https://src.fedoraproject.org/rpms/container-selinux/pull-request/10#

A dry run for this can be triggered using:
`$ packit propose-downstream --local-content`

To run this command locally, you would need to have your packit
user-configuration-file set.
Ref: https://packit.dev/docs/configuration/#user-configuration-file

along with a fedora api key created at:
https://src.fedoraproject.org/settings#nav-api-tab with sufficient ACLs.

Also includes a revised `package` Makefile target which will build rpms
using `rpm/podman.spec`. Fixes: #18421.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-05-23 16:41:46 -04:00
8b49872669 Makefile: add ginkgo FOCUS/FOCUS_FILE options
When running ginkgo tests locally we often only want to test a small
subset. I think most people just add the `FIt` block but then you need
to remember to undo that before pushing the changes.

With this change you can just run:
```
make localintegration FOCUS="test name here"
make localintegration FOCUS_FILE="some_test.go"
```
I updated the test Readme to use this new syntax.
The options just map to the ginkgo options, see the upstream docs
linked in the readme for more information about syntax.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-16 14:44:05 +02:00
0c070ebfbd ginkgo json output: only in CI, not on laptop runs
Followup to #18422: disable --json-report except under CI, which
is where it's useful.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-04 08:18:30 -06:00
8308a6f24f Merge pull request #18367 from rhatdan/man
[CI:DOCS]  Add missing man page links for Docker man pages
2023-05-03 16:28:56 -04:00
61985a6104 Add missing man page links for Docker man pages
Generate all docker man pages to match podman man pages
including links.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-03 10:26:30 -04:00
f877d7dcd0 Replace egrep/fgrep with grep -E/-F
There are days when I really, really, really hate GNU. Remember
when someone decided that 'head -1' would no longer work, and
that it was OK to break an infinite number of legacy production
scripts? Someone now decided that egrep/fgrep are deprecated,
and our CI logs (especially pr-should-include-tests) are now
filled with hundreds of warning lines, making it difficult
to find actual errors.

I expect that those warnings will be removed quickly after
furious community backlash, just like the 'head -1' fiasco
was quietly reverted, but ITM the warnings are annoying
so I capitulate.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-03 07:32:42 -06:00
54fd0d752e e2e tests: try writing & preserving ginkgo json artifacts
ginkgo v2 has new options, --junit-report and --json-report.
The JUNIT one is utterly worthless: no timing data, no
separation between test output (podman commands) and
ginkgo output (filenames, linenumbers). JSON goes the
other direction, super-complicated, but I think I can
work with it. Let's try it.

This PR does not actually _do_ anything with the json; all
we do is save it. Over time, I'll download and play with it
and see what I can do with it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-02 10:57:39 -06:00
3858a833bf Makefile: do not run machine test in parallel
while reworking ginkgo to use -p by default we also forced the machine
tests to be run in parallel. Right now this does not work at all
(something that should be fixed).

Using -p is easier becuase that will let ginkgo decide how many parallel
nodes to use so it much faster on high core counts.

So use some makefile magic to instaed of using `GINKGONODES` use
`GINKGO_PARALLEL` and set it to `y` by default. The machine tests will
then use that var to disable it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-02 12:30:18 +02:00
2ce4e935be ginkgo v2: drop localbenchmarks
Porting them over to v2 requires a full rewrite.
IT is not clear who actually uses these benchmarks, Valentin who wrote
them originally is in favor of removing them. He recommends to use
script from hack/perf instead.

This commit also drop the CI integration, it is not clear who actually
uses this data. If it is needed for something please speak up.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-02 11:27:38 +02:00
8cc7a36183 ginkgo: run on all cores
Using -p autodetect the number of cores and thus spins up workers as
needed, this should help speeding up e2e tests, especially locally.

Also -vv for mor everbose logging.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-02 11:27:37 +02:00
666e314478 ginkgo v2: remove deprecated flags
- switch long flags to use `--`
- move the renamed flages noColor, flakeAttempts, outputdir
- remove no longer needed flag -progress

also see https://onsi.github.io/ginkgo/MIGRATING_TO_V2

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-02 11:27:35 +02:00
832b098471 Merge pull request #18303 from n1hility/user-mode
Add user-mode networking feature to Windows/WSL
2023-04-26 16:01:48 -04:00
230ddbe0ca Add user mode networking feature to Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-04-24 17:11:54 -05:00
3c53621885 Merge pull request #18257 from vrothberg/fix-18250
Makefile: do not prefix /etc
2023-04-24 11:45:48 +00:00
acb24f164b Makefile: do not prefix /etc
Revert commit 3d0e08f04e9c67dd8136acd54adabd077dbbd633.
`/etc/` does not need a prefix and can be customized
with the `ETCDIR` env variable.

Fixes: #18250
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-18 16:14:02 +02:00
459f751ae3 Makefile: include release-artifacts target
The current release artifacts generation process is still fairly manual
with a bunch of steps. This commit bundles them all into a single
convenient Makefile target.

The `clean-binaries` target ends up removing `bin/`. So, the artifact
dir has been changed to `release/` instead of the current `bin/` to
avoid breaking other Makefile targets.

Related: https://github.com/containers/podman/issues/18215

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-04-17 14:54:20 -04:00
9d7633d9b7 Merge pull request #17791 from multimeric/portable-wrapper
Portable Docker wrapper
2023-04-03 11:14:00 -04:00
3c9ce3e52a Edit the docker wrapper to use the install prefix
Signed-off-by: Michael Milton <michael.r.milton@gmail.com>
2023-03-31 10:06:17 +11:00
5f274e45f2 Run make codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-21 16:00:54 -04:00
3ef707def2 Makefile: allow specifying /lib dir location
On some platforms, /lib is not actually a directory, it is a symlink to
/usr/lib:

    $ ls -l /lib
    lrwxrwxrwx 1 root root 7 Dec  4 17:11 /lib -> usr/lib

When this is the case, "make install" will be operating under a false
assumption when it generates any relative symlinks to files under a
different root-level directory.

If linking to /libexec/... from /lib/... for example, the generated
relative symlink will be 1 parent directory pointer (../) too short.

This PR allows the builder to specify LIBDIR=/usr/lib, explicitly
installing files to the target of the symlink. This results in
symlinks being generated with the correct depth.

Signed-off-by: Jack Wearden <jack@jackwearden.co.uk>
2023-03-18 23:02:32 +00:00
e19922d090 Makefile: Define SHELL
When undefined make defaults to `/bin/sh` which is *NOT* the same on all
platforms.  For example, on Fedora it's a symlink to `/bin/bash` but on
Debian, it's a symlink to `/bin/dash`.  Remove any/all ambiguity by
declaring the shell to be bash forever and evermore.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-22 10:31:18 -05:00
5754df806c make docs: sanity check for broken man pages
A recent commit to an included option file resulted in
completely broken man pages, where the markdown processor
just choked and sent the "included file blah blah" markdown
straight through to the nroff source. Hilarity ensued.

The string "included file options/" should never appear
in nroff. This adds a last-minute check to make sure
a similar error never happens again.

(As suggested by @Luap99 we should also add validators for
markdown and/or nroff.)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-20 05:52:24 -07:00
9622d25be9 Emergency fix for man pages: check for broken includes
Somehow the options/secret.md file generated corrupt md which
then generated corrupt .man files. Fix, and add a Makefile
check to prevent this from happening again.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-16 18:54:38 -07:00
9abe8c7853 Introduce podman machine os apply
Podman machine os apply takes a takes a OCI image with container native ostree functionality and rebases the machine os on that image.
Currently, this requires the guest os inside the vm to use rpm-ostree.

When specifying an image, any container transport may be specified. If a
container transport is not specified, OS apply will attempt to search
the local containers-storage for the image, and if it is not found, it
will then attempt to use the Docker transport to pull from a remote
registry.

The architecture of OS apply is as follows:
podman machine os apply ssh's into the machine and calls podman machine os
apply. on the secondary call to podman machine os apply, apply
recognizes that it is inside the machine and does image operations, and
finally calls rpm-ostree rebase.

Tests are written but commented out, due to the chicken-and-egg problem.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-02-15 14:48:12 -05:00
5865159766 Run codespell on codebase
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-09 08:02:43 -05:00
77e4b19397 update golangci-lint to version 1.51.1
The new version contains the ginkgolinter, which makes sure the
assertions are more helpful.

Also replace the deprecated os.SEEK_END with io.SeekEnd.

There is also a new `musttag` linter which checks if struct that are
un/marshalled all have json tags. This results in many warnings so I
disabled the check for now. We can reenable it if we think it is worth
it but for now it way to much work to fix all report problems.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-07 14:16:21 +01:00
a62c9b235c Merge pull request #17367 from xxyzz/fix_doc_build
Move `clean-binaries` before `podman-remote` in podman-remote-docs target
2023-02-06 10:48:06 -05:00
8441f01bec Move clean-binaries before podman-remote in podman-remote-docs target
When run make with muitiple jobs, `clean-binaries` could run after
the `podman-remote` target thus delete the newly built `podman-remote`
binary file. And this would cause the error later in the
`docs/remote-docs.sh` script.

Signed-off-by: xxyzz <gitpull@protonmail.com>
2023-02-05 13:42:25 +08:00
3c3526e532 Install podman-systemd.unit man page, make quadlet discoverable
Currently we are shipping no data about quadlet, since the
podman-systemd.unit file is not shipped. Also want to add the
quadlet name to the description of the man page so that

man -k quadlet

will help users find the man page.

Also add a link file such that if the user types in
man quadlet
man will show the podman-systemd.unit file.

Also eliminate the subpackage podman-quadlet

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-03 08:42:20 -06:00
74c0909736 Add gvproxy to Windows packages
Updated build scripts and installer build scripts to include gvproxy.exe.
Includes tutorial on setting up a Podman VM with QEMU and gvproxy on Windows.

Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2023-01-29 22:01:00 +02:00
b5bfc26542 do not install swagger by default
It is only needed for one CI task, and that task already calls
`make .install.swagger` in setup_environment.sh.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-19 15:44:17 +01:00
3db8ef37d8 add testbindings Makefile target
use this target in the CI script to make sure it uses the correct gingko

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-19 15:44:17 +01:00
6dd1d48fd8 Update win-sshproxy to 0.5.0 gvisor tag
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-01-06 16:52:53 -06:00