Commit graph

871 commits

Author SHA1 Message Date
OpenShift Merge Robot 32021ebc70
Merge pull request #14179 from cevich/ensure_dest_branch
Cirrus: Guarantee $DEST_BRANCH is passed through
2022-05-10 13:53:57 -04:00
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
Chris Evich abf4f77bc7
Cirrus: Simplify use of cache in automation
With the increasingly complex `.cirrus.yml` task relationships, build
cache wasn't always working as intended.  Recently, non-build tasks were
observed assuming authority over `gopath_cache`.  Ref.:
https://github.com/containers/podman/pull/13998#issuecomment-1108834538

Address this by an overall simplification using artifacts instead of
cache.  Using artifacts allows establishing concrete
authorship/authority over cached repo. content.  In this way, dependent
tasks may simply consume the artifact with `curl` instead of relying on
complex caching algorithms.

Also/Minor: Add YAML checking to the pre-commit configuration.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-05-10 10:49:32 -04:00
Chris Evich 237f761262
Cirrus: Simplify rootless ssh setup
The sshd service is guaranteed to be running by the VM image build
process - it's required by the packer tool for access.  Remove the
startup and check on the sshd service.

For many tests, man ssh connections to/from $ROOTLESS_USER on the
host are needed.  To facilitate this, the localhost key is added to
`known_hosts` for root and `$ROOTLESS_USER`.  Simplify this setup using
the `ssh-keyscan` tool.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-05-10 10:49:32 -04:00
Chris Evich c1656e2ee5
Cirrus: Guarantee $DEST_BRANCH is passed through
There are several runtime contexts (rootless and container) where
`$DEST_BRANCH` is needed but was not supplied.  A prior commit
(c486576717) removed the default value, `main` which was being
set incorrectly when CI ran on release branches.  Fix this by ensuring
the variable is non-empty upon entry to `setup_environment.sh`, then
ensure it gets passed through to child environments by way of the
`/etc/ci_environment` file.  This will maintain compatibility with
both CI and `hack/get_ci_vm.sh` use.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-05-10 10:22:01 -04:00
Ed Santiago 82f2b3edbc bloat check: make more robust
The use of 'C^' (parent) in 'git rebase' is counterintuitive,
at least to me: when C is a merge of multiple commits, rebase
picks each of those commits. That probably makes good sense
to a git expert, which I'm not.

Solution: forget using '^', just calculate the baseline sizes
by doing a checkout of the PR's parent.

Also: compute PR parent using git-merge-base instead of
blindly trusting $DEST_BRANCH (which may be volatile as
other PRs are merged).

Also: run git-rebase directly, not via make rule. That
indirection is too confusing here.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-05-10 05:44:55 -06:00
Ed Santiago c486576717 test skipper: check for $DEST_BRANCH
The test-skipping optimization is failing as rootless on non-main,
because $DEST_BRANCH is not set. Solution: check for envariable,
skip test if missing. (This was part of my original PR, but was
accidentally removed in #14013)

Also: DEST_BRANCH was silently being defaulted to 'main' in lib.sh.
Remove that: per @cevich, it is no longer necessary.

Fixes: #14131

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-05-09 13:14:25 -06:00
Chris Evich 9c0c29f086
Cirrus: Fix ownership of repos. to keep git happy
Newer versions of git are much more pedantic about who owns the
repository files.  When setting up to run rootless, prior to this
commit, the repo. ownership was changed from root.  This causes
all subsequent git-operations as root to fail:

    ```
    fatal: unsafe repository ('<$GOSRC>' is owned by someone else)
    ```

Fix this by re-ordering operations, such that the change in ownership is
done immediately before executing as a user.  Also disable the
git-ownership check on the source repository assuming the CI environment
is disposable.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich cf449e81ab
Cirrus: Temporarily update netavark/aardvark-dns
Normally installing/updating packages at test runtime is highly
discouraged for reliability and efficiency reasons.  However, in this
specific case, development work of these packages is still fairly hot.
As a compromise to support podman test development, temporarily update
these two specific packages at runtime.  At a future date, when updates
are less frequent, this commit can/should be safely reverted.  At that
point, the versions installed at VM image build time will persist.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich cd7cff6bb5
Cirrus: Test w/ netavark/aardvark-dns in F36+
Now that netavark and aardvark are packaged and default in F36, support
CNI-based testing in F35 and Ubuntu.

* Remove the temporary/special `$TEST_ENVIRON=host-netavark` construct.
* Remove dedicated/special integration and system testing tasks.
* Update test-config setup to properly handle CNI vs netavark/aardvark
  environments.
* Update package-version logging to operate based on installed packages
  (along with some other minor script cleanups).
* Update global environment setup to force `$NETWORK_BACKEND=netavark`
  in F36 and later.  Except when `upgrade_test` task runs.
* Discontinue installing netavark and aardvark-dns binaries from
  upstream build artifacts.
* Drop CGV1-vs-2 policy check.  Ubuntu VMs now exclusively test CGv1,
  Fedora VMs test CGv2, with F35 testing CNI and F36 testing Netavark.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich 1a9f110b59
Cirrus: Fix skipping all/most tests
The originally intent for skipping tests based on change-content was to
optimize the PR workflow.  However, a mistake in a conditional is
causing almost all tasks running for Cron and branches to be skipped.
Fix this by checking for an empty '$CIRRUS_PR' variable.  This value is
always empty when operating outside of PRs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-26 11:04:53 -04:00
Chris Evich c5e48f12ec
Cirrus: Re-fix build-cache miss on main
After merging #13998 it was observed that the `docker-py` task was still
failing with the same error on `main`.  The original quick-fix had
placed the full-build (`make`) call too late in the process.  This
commit moves it up to right before the `make install` call which was
resulting in an error.

Again, a further future commit is planned to re-work and simplify the
entire cache setup.  This is only a quick fix to make branch-builds
pass.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-25 15:33:11 -04:00
Chris Evich eb4e53087e
Revert "Cirrus: Fix cirrus cache race on bin/podman"
This reverts commit 2f53259a8d.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-25 15:31:36 -04:00
OpenShift Merge Robot 23d2bf5188
Merge pull request #13998 from cevich/fix_docker-py_test
Cirrus: Fix cirrus cache race on bin/podman
2022-04-25 13:40:01 -04:00
Chris Evich 2f53259a8d
Cirrus: Fix cirrus cache race on bin/podman
A suspected race on uploading gopath cache is causing the docker-py (and
possibly other) tasks to fail unpredictably with an error from `make`
regarding missing `bin/podman`.  Since this failure is affecting all
development activity, apply a quick/dirty fix to the failing task, by
simply rebuilding the binary.  A more comprehensive/long-term fix will
be worked in a future PR.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-25 11:30:14 -04:00
Ashley Cui 1260bf631f Revert "Switch all rootful to rootfull"
This reverts commit cc3790f332.

We can't change rootful to rootfull because `rootful` is written into the machine config. Changing this will break json unmarshalling, which will break existing machines.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-04-25 09:14:04 -04:00
Chris Evich cafb76b635
Increase verbosity and sequencing of APIv2 testing
The default verbosity level does not show the classes or function names.
This makes it difficult to debug problems like hangs.  Also, separate
the bats and python-based tests into two sections.  This allows for
easier debugging, since isolation can be done in `runner.sh` rather than
mucking with the `Makefile`.  Lastly, update the logformatter script
to `autoflush stdout` (thanks @edsantiago).

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-22 16:16:17 -04:00
OpenShift Merge Robot 0d6af14387
Merge pull request #13964 from rhatdan/rootfull
Switch all rootful to rootfull
2022-04-22 06:56:33 -04:00
OpenShift Merge Robot 67a1b520e3
Merge pull request #13956 from cevich/fix_git_id
Cirrus: Fix missing git-enforced runtime identity
2022-04-22 06:22:50 -04:00
Daniel J Walsh cc3790f332
Switch all rootful to rootfull
We are inconsistent on the name, we should stick with rootfull.

[NO NEW TESTS NEEDED] Existing tests should handle this and no tests for
machines exists yet.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-21 17:05:16 -04:00
Chris Evich 566b6071d4
Cirrus: Fix missing git-enforced runtime identity
Newer versions of git (like `2.35`) fail on certain operations (like
`rebase` and `am`) without a local identity.  Add a fake one from the
start, with a clearly identifiable test-value to avoid problems at
runtime.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-21 16:23:36 -04:00
Ed Santiago 55a5bd8a00 Optimization: skip tests in some circumstances
A common pattern is to submit PRs that update only tests or docs.

When the only changes are to test/e2e, there is no point in running
test/system or test/upgrade or test/buildah-bud. Likewise, reciprocally,
and similarly for a bunch of other tests (alt, cross, apiv2, ...)

And when the only changes are under docs/ , there is no point in
running any of the above.

Exception: if $CIRRUS_<mumble> are undefined (e.g., cron), never skip

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-21 11:02:57 -06:00
Chris Evich a95f7f9ca1
Cirrus: Multi-arch build auto-update + tagging update
This new VM image brings in two important updates to multi-arch
image build operations:

1. Future operational changes will no-longer require also updating VM
   images.  Updates to build-push made in `containers/automation_images`
   will automatically be picked up at runtime.
   ref: https://github.com/containers/automation_images/pull/123

2. On the next run, both `vX` and `vX.Y` tagged manifest-lists will be
   pushed.  This is now also reflected in the README.
   ref: https://github.com/containers/automation_images/pull/125

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-07 15:58:13 -04:00
Chris Evich d55c46f8c6
Cirrus: Allow manually running image-build task
Building multi-arch images in a standardized way is complex.  Some
of the builds themselves can take a really long time to run (over
an hour).  Make changes easier to test inside a PR by adding
manually-triggered image-build tasks.  These mirror most of the real
cron-triggered task, without actually pushing the final images.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-03-31 17:07:33 -04:00
Giuseppe Scrivano 81632722ea
systemd: enable all cgroups when running as a service
enable cgroup delegation when running as a systemd service so all the
available controllers are correctly detected.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-03-30 15:49:06 +02:00
Chris Evich f6963cea13
Cirrus: Build multi-arch images + manifests
Github-actions for large/complex tasks is hard to read and maintain.
Reimplement the multi-arch image build workflow into a set of bash
scripts that use all native contrainer-org tooling.  This requires
a special VM image setup with emulation to build foreign architectures.
It also requires renaming the `helloimage` directory, because the build
script uses the directory name in the image FQIN.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-03-28 16:56:28 -04:00
OpenShift Merge Robot 56b2937f87
Merge pull request #13653 from jmontleon/fix-manifest-push-header
Resolves #13629 Add RegistryAuthHeader to manifest push
2022-03-27 13:13:42 +02:00
jason 3cc1739373 Resolves #13629 Add RegistryAuthHeader to manifest push
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2022-03-26 16:39:11 -04: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
OpenShift Merge Robot f049cba47c
Merge pull request #13559 from cevich/success_artifacts
[CI:BUILD] Cirrus: Publish binary artifacts on success
2022-03-23 14:03:46 +01:00
OpenShift Merge Robot ad123687d0
Merge pull request #13567 from n1hility/upgrades
Add Windows installer support for upgrades
2022-03-23 01:35:15 +01: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
Chris Evich 1a7f5b3d51
Cirrus: Publish binary artifacts on success
In general continuous-delivery (CD) tends to pair well with CI.  More
specifically, there is a need for some reverse-dependency CI testing in
netavark/aardvark-dns.  In all cases, the download URL needs to remain
consistent, without elements like `Build%20for%20fedora-35`.

The 'Total Success' task only ever executes when all dependencies are
successful.  When a non `[CI:DOCS]` build is successful, gather all
binary/release artifacts in a new task which depends on 'Total Success'.
This will provide a uniform name (`artifacts`) and URL for downstream
users to use.  For example:

https://api.cirrus-ci.com/v1/artifact/github/containers/podman/artifacts/binary.zip

or

https://api.cirrus-ci.com/v1/artifact/github/containers/podman/artifacts/binary/FILENAME

Where ***FILENAME*** is one of:

* `podman`
* `podman-remote`
* `rootlessport`
* `podman-release-386.tar.gz`
* `podman-release-amd64.tar.gz`
* `podman-release-arm64.tar.gz`
* `podman-release-arm.tar.gz`
* `podman-release-mips64le.tar.gz`
* `podman-release-mips64.tar.gz`
* `podman-release-mipsle.tar.gz`
* `podman-release-mips.tar.gz`
* `podman-release-ppc64le.tar.gz`
* `podman-release-s390x.tar.gz`
* `podman-remote-release-darwin_amd64.zip`
* `podman-remote-release-darwin_arm64.zip`
* `podman-remote-release-windows_amd64.zip`
* `podman-v4.0.0-dev.msi`

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-03-22 11:01:45 -04:00
Ed Santiago 501355d4a5 Fix unreadable netavark logs
ginkgo netavark logs (and, to a lesser extent, cni logs)
are unreadable because the hide-boring-opts code did not
know about --network-backend. Now it does.

Manually filtered an existing netavark log to confirm there
are no other new options we should know about.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-22 08:56:36 -06:00
Jason T. Greene 36ff8f2b38 Add Windows installer support for upgrades
Fixes duplicate installer entries after multiple installs

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-19 19:37:24 -05:00
OpenShift Merge Robot 3853ef9b59
Merge pull request #13540 from mheon/fix_11822
Deduplicate between Volumes and Mounts in compat API
2022-03-18 12:48:41 +01:00
Ed Santiago d3e3ea843e logformatter: link to bats sources on error
We already link to ginkgo sources, now add links to bats.
Ugly, because we need to hardcode containers/podman (git
repo) and test/system (test file path): those can't be
determined from the log results like they can in ginkgo.

Also, great suggestion from @Luap99: in addition to the
'Annotated results' link which we append to the basic log,
include a short summary of failures. This should help a
viewer see exactly which test(s) failed, which in turn
can be helpful for diagnosing known-flake or real-problem.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-17 14:25:09 -06:00
Matthew Heon bde3ca8c36 Add tests with Docker Compose v2
Add a pair of new Cirrus test suites using Compose v2 instead of
Compose v1 (as is currently packaged in Fedora). They work
identically, and run the same tests, as the Compose v1 tests, but
with the new v2 binary instead.

[NO NEW TESTS NEEDED] This adds an entire Cirrus suite...

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-03-17 14:29:48 -04:00
Jhon Honce dca2e7924b Move all python tests to pytest
* Add configuration to add report header for python client used in tests
* Move report headers into the individual test runners vs runner.sh

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-03-04 10:35:29 -07:00
Chris Evich dbf34bfe70
Clarify v2 API testing for podman vs docker clients
Fixes: #13273

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-02-28 13:15:07 -05:00
Paul Holzinger eab5a4cfb7
Load ip_tables modules at boot
Rootless users cannot load the ip_tables module, in fedora 36 this
module is no longer loaded by default so we have to add it manually.
This is needed because rootless network setup tries to use iptables
and if iptables-legacy is used instead of iptables-nft it will fail.

To provide a better user experience we will load the module at boot.

Note that this is not needed for RHEL because iptables-legacy is not
supported on RHEL 8 and newer.

[NO NEW TESTS NEEDED]

Fixes #12661

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-23 16:11:19 +01:00
Daniel J Walsh 80c5962dba
Add containers-common spec and command to podman
Since containers-common package is tied to specific versions
of Podman, add tools to build the package into the contrib directory
This should help other distributions to figure out which commont
package to ship.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-02-22 14:38:57 -05:00
Chris Evich 632c089cc6
Cirrus: Use updated VM images
Mainly this is to confirm some changes needed for the podman-py CI setup
don't disrupt operations here. Ref:

https://github.com/containers/automation_images/pull/111

Also includes a minor steup fix WRT setting up for test-rpm build.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-02-17 16:38:42 -05:00
OpenShift Merge Robot a429dcd2ab
Merge pull request #13241 from edsantiago/logformatter_do_python
[CI:DOCS] logformatter: handle python logs
2022-02-17 11:56:37 -05:00
Chmouel Boudjnah 13f6261f84
increase subuid and subgid in image
increase the number of ids available to the podman users when running as
rootless.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2022-02-16 20:00:47 +01:00
Ed Santiago 7a83d16f95 [CI:DOCS] logformatter: handle python logs
We've got some python tests running in CI, and they're really hard
to troubleshoot. This PR:

  1) colorizes python unittest lines (ok / skipped / fail), and
  2) links to source files

The color is nice for skimming, but it's the linking that might
make it much easier to diagnose future failures.

(Context: failure today in test/python/docker/compat/test_images.py)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-02-16 06:31:05 -07:00
tomsweeneyredhat 40ba9f10e5 Make the hello image leaner
[NO TESTS NEEDED]

Change from using a bash script to a c file
for running the image.  With thanks to discussions
with @afbjorklund, the Containerfile was rigged
up to make the final image be only KB's in size.

Also add USER 1000 to make the image test/run as
non-root, and update the README.md

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-02-10 15:45:04 -05:00
Valentin Rothberg 411fca0b3d helloimage: header symmetry
Make the header symmetric by adding a whitespace before the `!` on the
righthand side.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-02-09 14:57:16 +01:00
Chris Evich 642a691cbb
Cirrus: Add netavark/aardvark system test task
Also add a system-test that verifies netavark driver is in use when
magic env. var. is set.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-02-03 13:07:56 -05:00