Commit graph

164 commits

Author SHA1 Message Date
Chris Evich 2b5778d416
Cirrus: Update images + new automation library
Add support for new automation library version w/ `$DEBUG` fix
(ref: containers/automation_images#128) and added definitions
for commonly used Distro/version variables.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-05-10 10:49:32 -04:00
OpenShift Merge Robot f1703abea1
Merge pull request #14092 from vrothberg/benchmarks
benchmarks: push/pull
2022-05-05 03:40:19 -04:00
Valentin Rothberg 8781a3635a benchmarks: push/pull
Polish the push and pull benchmarks.  In particular, make sure to not be
network bound during these benchmarks by running a local registry and
pushing a local image that can later on be pulled.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-05-04 12:15:45 +02:00
Ed Santiago 5fac879ea4 vendor treadmill script: run 'git add vendor'
Situation encountered just now after buildah #3949 but
before podman #14084: go.mod changed in such a way that
other modules were updated, not just buildah, and those
changes weren't git-added by 'make vendor'. This resulted
in the dirty-tree CI test failing.

Solution: check for untracked vendor files after 'make vendor',
and git-add them. Show a friendly message that we're doing so:

    +---> Adding untracked files under containers/image, containers/storage, klauspost/compress, x/sys

In order to do this safely, we run an untracked-files check
under vendor as one of the first sanity checks. If there are
any when we start the script, fail early.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-05-03 06:53:36 -06:00
Ed Santiago e74717f348 Treadmill script: revamp
Major revamp: instead of stacking a vendor commit on top of
the treadmill changes, do it the other way around: vendor,
then apply treadmill diffs.

Reason: the build-all-new-commits test. Sigh. It fails in the
common case where our treadmill changes include a new struct
element in cmd/podman/images/build.go

Why this is good: well, superficially, it's more intuitive.

Why this is horrible: omg the rebasing games are a nightmare.
When the vendor commit is on top (HEAD), it's ultra-trivial
to drop it, rebase the treadmill changes on main, then add
a new vendor-buildah commit on top. As you can see from the
diffs in this PR, treadmill-as-HEAD introduces all sorts
of complex dance steps in which things can go catastrophically
wrong and you can lose all your treadmill patches. I try very
hard to prevent this, and to offer hints if there's a problem,
and heck in the worst case it's still git so it's still possible
to find lost commits... but it's still much riskier than the
old way.

Alternative I considered: using sed magic to disable the
build-all-new-commits test. So tempting... but that would
also disable the bloat check.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-05-02 13:06:13 -06:00
Ed Santiago 23de3801d6 buildah-vendor-treadmill script: yet more checks
More safety checks for the treadmill script:

 * for --sync:
   - issue warning if HEAD is not a vendor commit
   - if run-buildah-bud-tests fails, leave the working dir
     for user to investigate. And offer a long helpful warning.
   - tweak .cirrus.yml so buildah-bud tests run early, so
     we can fail early. (Remember, the top commit will never
     ever ever ever be merged)

 * for --pick:
   - check branch merge-base (of your vendor-update branch),
     compare against that of the treadmill PR. If treadmill
     is newer, bail, and suggest rebasing. This would've
     saved us some time in #14005.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-29 15:15:28 -06:00
Valentin Rothberg facc009ca0 benchmarks: add more image benchmarks
Add more benchmarks for the most common and performance-critical image
commands.  Benchmarks for `podman build` should go into a separate
section.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-04-26 14:25:17 +02:00
Brent Baude 833456e079 Add podman machine test suite
This PR introduces a test suite for podman machine.  It can currently be
run on developers' local machines and is not part of the official CI
testing; however, the expectation is that any work on machine should
come with an accompanying test.

At present, the test must be run on Linux.  It is untested on Darwin.
There is no Makefile target for the test.  It can be run like `ginkgo -v
pkg/machine/test/.`.  It should be run as a unprivileged user.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-04-25 13:05:35 -05:00
Chris Evich dc02e99d8f
Fix size-check to display more context
When going through the rebase+build loop, the repository state won't
match the exact branch or PR history.  This results in the `Building:
XYZSHA` indications being entirely useless.  Fix this by at least
including the title line of the commit being built.  This will allow a
human to make sense of any size-check failure WRT their view of history.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-21 14:07:20 -04:00
Ed Santiago 93b8ef627c Buildah Vendor Treadmill: the script
This is the script I've been using (and tweaking) for the past
two weeks. It's ready for general review and use, with the
proviso that there are still corner cases I haven't tested.

See https://github.com/containers/podman/wiki/Buildah-Vendor-Treadmill
for an overview and instructions.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-20 14:12:13 -06:00
Ed Santiago 1b3dc899d6 manpage vs --help checker: better error messages
Use quotes to indicate the command, and remove some duplication

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-18 10:09:38 -06:00
Ed Santiago c602084a5c size-check: display binary size and growth
This won't actually be seen except by someone who takes the
time to clickety-click into Cirrus - but that's better than
not showing it at all.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-29 08:56:19 -06:00
Daniel J Walsh ffbab30d7b
Run codespell to cleanup typos
[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-03-25 15:34:41 -04:00
OpenShift Merge Robot 4d271912e8
Merge pull request #13602 from edsantiago/size_check_part2
Binary growth check, part 2 of 2
2022-03-24 18:47:51 +01:00
Ed Santiago 9b0c8d23bd man pages: sort flags, and keep them that way
Command flags (OPTIONS) in man pages have to date been in
haphazard order. Sometimes that order is sensible, e.g.,
most-important options first, but more often they're
just in arbitrary places. This makes life hard for users.

Here, I update the man-page-check Makefile script so it
checks and enforces alphabetical order in OPTIONS sections.
Then -- the hard part -- update all existing man pages to
conform to this requirement.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-23 13:49:42 -06:00
Ed Santiago 88d4db009e Binary growth check, part 2 of 2
Add a CI check to prevent unwanted bloat in binary images,
by building a baseline (pre-PR) binary then comparing file
sizes post-PR.

Part 1 (#13518) added a new script that runs multiple 'make's,
comparing image sizes against an original, and failing loudly
if growth is too big. An override mechanism is defined.

This is part 2 of 2: adding the CI rule. We couldn't do that
in part 1, because the rule would call a script that didn't
exist in the pre-PR commit.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-22 13:17:10 -06:00
Ed Santiago 84e7ce82d9 Binary growth check, part 1 of 2
Add a CI check to prevent unwanted bloat in binary images,
by building a baseline (pre-PR) binary then comparing file
sizes post-PR.

We piggyback onto the existing 'Build Each Commit' CI check
because it gives us an easy way to run 'make' against the
parent commit.

This is part 1 of 2: adding the script, not the Makefile rule.
We can't add the Makefile rule now because the script it would
invoke does not exist in the parent commit.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-22 07:38:05 -06:00
Pascal Bourdier e5a86d293f
CI: fix golangci-lint installation
avoid this warn:
```
golangci/golangci-lint info installed ./bin/golangci-lint
golangci/golangci-lint err this script is deprecated, please do not use it anymore. check https://github.com/goreleaser/godownloader/issues/207
```

Signed-off-by: Pascal Bourdier <pascal.bourdier@gmail.com>
2022-03-10 08:41:23 +01:00
Ed Santiago 3d3e8d8f8a hack/bats: fix broken usage message
I am so, so sorry.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-02-02 11:26:22 -07:00
Chris Evich 4c26a3a5cd
Cirrus: Fix get_ci_vm.sh initial setup
Due to some recent changes in the Makefile, the setup part of the script
is now breaking with the error:

```
install: cannot stat 'bin/rootlessport': No such file or directory
make: *** [Makefile:767: install.bin] Error 1
```

The root-cause seems to be the `install` targets not
properly specifying their build dependencies.  This may lead to other
problems WRT automation, but for now I'm just patching this tool to
workaround the issue.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-01-27 11:36:48 -05:00
OpenShift Merge Robot 094b11cbcb
Merge pull request #12908 from Luap99/network-conf-dir
rename --cni-config-dir to --network-config-dir
2022-01-18 15:42:06 -05:00
Paul Holzinger c0e0723463
rename --cni-config-dir to --network-config-dir
Since this option will also be used for netavark we should rename it to
something more generic. It is important that --cni-config-dir still
works otherwise we could break existing container cleanup commands.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-18 19:28:25 +01:00
OpenShift Merge Robot 0bbf8fa140
Merge pull request #12797 from edsantiago/test_image_scp_sudo
Tests for podman image scp (the sudo form)
2022-01-18 10:30:08 -05:00
Valentin Rothberg bd09b7aa79 bump go module to version 4
Automated for .go files via gomove [1]:
`gomove github.com/containers/podman/v3 github.com/containers/podman/v4`

Remaining files via vgrep [2]:
`vgrep github.com/containers/podman/v3`

[1] https://github.com/KSubedi/gomove
[2] https://github.com/vrothberg/vgrep

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2022-01-18 12:47:07 +01:00
Ed Santiago c8124b88ae [WIP] Tests for podman image scp (the sudo form)
Start inching our way back to having tests for the sudo form
of podman image scp. Basically, copy an image to another user
and then back, using a pseudorandom name. Confirm that the
image makes it to the remote end, and that when we copy it
back, the original image digest is preserved.

When scp'ing as root, we identify the destination rootless
user account via the $PODMAN_ROOTLESS_USER envariable. Setting
this and creating the account is left as an exercise for the
CI framework (be it github, or Fedora/CentOS/RHEL gating, or
other).

Also: amend hack/bats to set and relay $PODMAN_ROOTLESS_USER,
so developers can test locally.

Also: remove what I'm 99% sure is a debugging printf.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-01-17 14:40:30 -07:00
Giuseppe Scrivano 48cb446514
build: fix test for subid 4
libsubid changes its ABI in version 4.  Account for the different name
in the configure script.

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

[NO NEW TESTS NEEDED] it is a change in the build script

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-20 10:09:34 +01:00
Paul Holzinger 22ef7b6208
fix duplicated logs command
Podman logs was defined twice, once for container logs and once for pod
logs. This causes problems with the shell completion. Also podman --help
showed this command twice.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-18 22:57:32 +01:00
Ed Santiago e367f46147 hack/bats: deal with new bin helpers
Some time in the last month, podman started to depend on a bunch
of external helper binaries: rootlessport, pause, catatonit.
System tests fail without these.

Update the hack/bats script to pass $CONTAINERS_HELPER_BINARIES_DIR
(set to ./bin); podman will then use locally-built helpers. (This
requires https://github.com/containers/common/pull/823 , which as
of this PR is not yet vendored into podman. There is no harm in
merging this while we wait.)

Also: if bats helper is invoked as root, run only once; i.e.,
skip the "rootless" step.

Also (piggybacked): the name of the podman pause image has
changed, from pause to podman-pause. Adjust that in our
teardown so we don't leave droppings.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-16 12:51:17 -07:00
Valentin Rothberg c8790bfbbb cirrus: force-install catatonit
A temporary workaround until the CI images are updated.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-15 12:53:25 +01:00
Ed Santiago 6236be4ff9 [CI:DOCS] Add CI check for SEE ALSO in man pages
Add new CI check to confirm that links and references
in SEE ALSO sections are properly formatted and that
links are valid (at least in theory: we do no actual
URL fetching to test for 404).

The check is piggybacked into existing xref-helpmsgs-manpages
script. It could conceivably be more elegant to write a
separate tool for this purpose, but I don't wish to duplicate
the logic for finding and reading markdown files.

Script identified various problems, which I fix in this PR:

  . missing '**' (asterisks) around some references, or '**'
    in the wrong place.

  . links pointing to github.com/.../tree/ instead of /blob/
    (github redirects those automatically, but I like
    consistency)

  . a few copy-paste errors, e.g. subgid linking to subuid.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-10 09:03:40 -07:00
Chris Evich 5fbc67f205
Bump Catatonit up to v0.1.7
Ref: https://github.com/containers/podman/pull/12218

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-08 11:35:19 -05:00
Ed Santiago bf94ebf423 System tests: tighten 'is' operator
Fix day-one sloppiness: when I first wrote this framework
it compared strings using 'expr', not '=', to be more
forgiving of extra cruft in output. This was a bad decision.
It means that warnings or additional text are ignored:

    is "all is ok, NOT!"  "all is ok"  <-- this would pass

Solution: tighten up the 'is' check. Use '=' (direct
compare) first. If it fails, look for wild cards ('*')
or character classes ('[') in the expect string. If
so, and only then, use 'expr'. And, thanks to a clever
suggestion from Luap99, include '(using expr)' in the
error message when we do so; this could make it easier
for a developer to understand a string mismatch.

This change exposes a lot of instances in which we weren't
doing proper comparisons. Fix those. Thankfully, there
weren't as many as I'd feared.

Also, and completely unrelated, add '-T' flag to bats
helper, for showing timing results. (I will open this
as a separate PR if requested. I too find it offensive
to jumble together unrelated commits.)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-09-30 13:32:51 -06:00
Daniel J Walsh 1c4e6d8624
standardize logrus messages to upper case
Remove ERROR: Error stutter from logrus messages also.

[ NO TESTS NEEDED] This is just code cleanup.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-22 15:29:34 -04:00
Chris Evich 34043bd81d
Fix Error, empty output for info: 'VERSION'
When building releases, the definitive canonical version of podman (or
podman-remote) is needed.  Previously this was accomplished by scraping
`version/version.go`.  However, due to tooling differences across
platforms, this has proven problematic, unreliable, and hard to
maintain.

Fix this by building and caching a small golang binary who's only purpose
is to print the version number to stdout.  This not only provides a quick
and reliable way to determine the current version, it also acts as a check
on the version API vs tooling that relies on it.

Lastly, remove several `RELEASE_*` Makefile definitions which aren't
actually used anywhere.  These were originally added a very long time
ago to serve as part of a long since retired release process.  The
remaining items, were updated to make use of the new `.podmanversion`
binary on an as-required basis (i.e. not every time `make` is run).

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-21 12:29:26 -04:00
Daniel J Walsh 613ef220f3
Fix up build the docs site
[NO TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-16 17:41:00 -04:00
jesperpedersen 0d1ba0a58f Remove changelog.txt from the repository
The changelog.txt file hasn't been kept in sync with release tags,
especially on main, so remove it.

The release notes will be featured in RELEASE_NOTES.md.

Signed-off-by: jesperpedersen <jesper.pedersen@redhat.com>

[NO TESTS NEEDED]
2021-09-07 10:53:26 -04:00
Daniel J Walsh db60a1e654
Add support for libsubid
This will enable remote access to /etc/subuid and /etc/subgid
information from ldap services, if shadow-utils ships with a libsubid.

[NO TESTS NEEDED] Since we have no way to test this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-27 08:13:01 -04:00
Jhon Honce e88b62b34b Fix swagger issue
Add special case for op PlayKubeDownLibpod Heuristic for guessing swagger operation id too limited for PlayKubeDownLibpod

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-08-25 15:50:55 -05:00
Ed Santiago 03ffba29a2 podman-registry: minor usability updates
1) use cached quay.io image
 2) use 'podman unshare' when rm -rf'ing, to avoid EPERM

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-08-02 14:01:47 -06:00
Chris Evich 40ef17ac28
Cirrus: Fixes due to master->main rename
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-06-30 11:39:19 -04:00
Matthew Heon 8f3605e7d6 Add script for identifying commits in release branches
One of the worst parts of a Podman release is writing the release
notes. It requires manually going through all merged commits
since the last release, figuring out what was actually done, and
writing a small blurb about what was fixed. The worst part of
this is the difficulty in finding the commits that were actually
included in previous releases - our extensive backports to prior
releases mean that there are usually dozens of commits that were
included in a prior release, but do not have a matching SHA (as
the original author did not do the backport, and often the commit
required massaging to cherry-pick in).

This script automates the job of finding commits in one release
branch that are not in another, with filtering to remove most
cherry-picked commits. It makes my life a lot easier during
releases, so I figured I'd include it in hack/ so anyone else
stuck with the enjoyable task of writing release notes can have a
slightly easier life.

The script is written in absolutely terrible Ruby and its
performance is absolutely terrible, but you only need to run it
once per major release and a 30-second wait to generate the list
of commits to include isn't bad.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-05-17 16:40:35 -04:00
Ed Santiago b18931cef3 [CI:DOCS] hack/bats - new helper for running system tests
Well, new to you. It's been something I've used for years.
Simple, but it takes care of a lot of housekeeping, and
makes it ever-so-much-more pleasant to invoke bats tests.
And when it's easier to run tests, tests get run.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-05-11 16:31:56 -06:00
Paul Holzinger 30e731ecc8 Revert escaped double dash man page flag syntax
Commit 800a2e2d35 introduced a way to disable the conversion of `--`into
an en dash on docs.podman.io, so the ugly workaround of escaping the
dashes is no longer necessary.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-07 18:30:00 +02:00
Chris Evich 0e83851f08
Simplify Makefile help target
An in-line Python script, while flexible, is arguably
more complex and less stable than the long-lived `grep`,
`awk`, and `printf`.  Make use of these simple tools
to display a column-aligned table of target and description
help output.

Also, the first target that appears in a Makefile is considered
the default (when no target is specified on the command-line).
However, despite it's name, the `default` target was not listed
first.  Fix this, and redefine "default" target to "all" as
intended, instead of "help".

Lastly, add a small workaround for a vim syntax-hilighting bug.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:19:51 -04:00
Chris Evich e296b6023e
Fix incorrect version number output
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:01:03 -04:00
Tom Deseyn 4ceed6eb2f Update swagger-check
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2021-04-07 15:26:24 +02:00
Ed Santiago daab9658f8 [CI:DOCS] swagger-check: compare operations
Until now we've only compared operations when called with the
non-default --pedantic flag, because there were way too many
exceptions.

With the merge of #9944 the rules have become much cleaner.
Still not perfect, but it's now possible to have simple
general rules with a (semi-)manageable list of exceptions.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-04-06 11:36:38 -06:00
OpenShift Merge Robot a0873b6650
Merge pull request #9953 from jwhonce/wip/operation_id
[CI:DOCS] Polish swagger OperationIDs
2021-04-06 13:31:56 -04:00
Jhon Honce 51b23be38b [CI:DOCS] Polish swagger OpertionIDs
Renamed 4 IDs to be consistent with other endpoints.

Fixes #9951

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-06 10:10:54 -07:00
Chris Evich 804da7ca07
Cirrus: Make use of shared get_ci_vm container
Depends on:
    https://github.com/containers/automation_images/pull/57
    https://github.com/containers/automation/pull/64
    https://github.com/containers/automation/pull/66
    https://github.com/containers/automation/pull/67
    https://github.com/containers/automation/pull/68

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-05 15:38:04 -04:00