Commit graph

226 commits

Author SHA1 Message Date
Daniel J Walsh 77b8187ea0
Attempt to turn on special_testing_in_podman tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-04 10:58:37 -04:00
Matthew Heon e0d9404634 Enable detached exec for remote
The biggest obstacle here was cleanup - we needed a way to remove
detached exec sessions after they exited, but there's no way to
tell if an exec session will be attached or detached when it's
created, and that's when we must add the exit command that would
do the removal. The solution was adding a delay to the exit
command (5 minutes), which gives sufficient time for attached
exec sessions to retrieve the exit code of the session after it
exits, but still guarantees that they will be removed, even for
detached sessions. This requires Conmon 2.0.17, which has the new
`--exit-delay` flag.

As part of the exit command rework, we can drop the hack we were
using to clean up exec sessions (remove them as part of inspect).
This is a lot cleaner, and I'm a lot happier about it.

Otherwise, this is just plumbing - we need a bindings call for
detached exec, and that needed to be added to the tunnel mode
backend for entities.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-02 15:30:42 -04:00
Valentin Rothberg dc80267b59 compat handlers: add X-Registry-Auth header support
* Support the `X-Registry-Auth` http-request header.

 * The content of the header is a base64 encoded JSON payload which can
   either be a single auth config or a map of auth configs (user+pw or
   token) with the corresponding registries being the keys.  Vanilla
   Docker, projectatomic Docker and the bindings are transparantly
   supported.

 * Add a hidden `--registries-conf` flag.  Buildah exposes the same
   flag, mostly for testing purposes.

 * Do all credential parsing in the client (i.e., `cmd/podman`) pass
   the username and password in the backend instead of unparsed
   credentials.

 * Add a `pkg/auth` which handles most of the heavy lifting.

 * Go through the authentication-handling code of most commands, bindings
   and endpoints.  Migrate them to the new code and fix issues as seen.
   A final evaluation and more tests is still required *after* this
   change.

 * The manifest-push endpoint is missing certain parameters and should
   use the ABI function instead.  Adding auth-support isn't really
   possible without these parts working.

 * The container commands and endpoints (i.e., create and run) have not
   been changed yet.  The APIs don't yet account for the authfile.

 * Add authentication tests to `pkg/bindings`.

Fixes: #6384
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-29 15:39:37 +02:00
Chris Evich 8d54e4855c
Cirrus: Fix image-name hints
This properly prints out image-name hints when executing the hack script
without any arguments.  It is required due to changes made by Ed for
test-name beatification.  An identical change was made and reviewed by
Ed in the containers/storage repo.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-14 15:00:34 -04:00
Chris Evich 6479b54f41
Cirrus: Update Ubuntu 18 to 20
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-14 15:00:34 -04:00
Matthew Heon 440e97c2c0 Remove libpod.conf from repo
Now that we're shipping containers.conf, we don't want to provide
a libpod.conf anymore. This removes libpod.conf from the repo and
as many direct uses as I can find.

There are a few more mentions in the documentation, but someone
more familiar with containers.conf should make those edits.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-12 14:15:44 -04:00
Brent Baude a4c607cc71 set binding tests to required
some small fix ups for binding tests and then make them required.

update containers-common

V2 bindings tests were failing because of changes introduced in commit
a2ad5bb.

Fix some typos.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

in the case where the specgen attribute for Env and Labels are nil, we should should then make the map IF we have labels and envs that need to be added.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-08 09:05:37 -05:00
Chris Evich 50cb32fdfb
CI:DOCS: Document API docs + CORS maintenance
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-06 15:52:53 -04:00
Chris Evich 6e60772dc3
Cirrus: Utilize new base images
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-30 13:21:03 -04:00
Chris Evich 7c44c05425
cirrus: Update to Fedora 32 proper
Now that it's officially released, update to it from the beta.  Also
(and significant), adjust the SELinux context of the GCP metadata
service.  Add a comment to the code explaining why this is necessary.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-30 13:21:03 -04:00
Chris Evich 97ecd21b59
Cirrus: Unify package installation
Also, test-build critical container images depended upon for
CI-purposes.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-24 08:22:50 -04:00
Chris Evich d2d9722454
Cirrus: Add support for Fedora 32
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-20 14:22:23 -04:00
Chris Evich e282c88d2c
Cirrus: More Ubuntu 19 + Fedora 31
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-20 14:22:23 -04:00
Ed Santiago 1be8a34f5e Log formatter: add BATS summary line
BATS emits a summary line (number of tests passed/failed)...
but only on a tty or when run with --pretty! In our CI
context, with TAP output, it gives no end summary.

Fix that. Keep track of 'ok', 'not ok', and 'skipped',
and display the counts at the end.

Also: add a regression test. You don't need to review
or even read it: it's stark, and I'm not even enabling
it for CI because it almost certainly won't run due to
missing Perl library modules. It's just something I
need on my end.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-17 08:12:09 -06:00
Ed Santiago 55eea9127a logformat: handle apiv2 results, add anchor links
apiv2 tests emit TAP-compliant output; recognize it and
highlight it the same way we do BATS tests.

Add anchor links to TAP output, so other tools (e.g.
cirrus-flake-summarize) can link to particular lines

And, remove a "-f" from "wait" in test-apiv2; looks
like there's some version of bash used in some CI VM
that doesn't grok it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-08 12:10:24 -06:00
Chris Evich 19c3b5462f
Cirrus: Minor docs update
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-30 16:00:01 -04:00
OpenShift Merge Robot 17ad800905
Merge pull request #5368 from cevich/opensuse_ubuntu_packages
Opensuse openbuild ubuntu + buildah packages
2020-03-28 10:50:10 +01:00
OpenShift Merge Robot debd6face3
Merge pull request #4340 from cevich/libseccomp_update
Log libseccomp package version
2020-03-28 10:47:32 +01:00
OpenShift Merge Robot b743f60a4b
Merge pull request #5479 from cevich/auto_release
Cirrus: Disable non-docs release processing
2020-03-23 14:36:30 +01:00
Chris Evich 6ac04366ee
Cirrus: Enable future installing buildah packages
Many of the packages required for CI in buildah overlap with libpod.
When building new VM images, attempt to source a package list
from the buildah repository.  If found, also install the listed
packages on the VM.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-19 12:28:24 -04:00
Chris Evich e810dd135e
Cirrus: Include packages for buildah CI
Also, move some setup steps at VM image build time to save runtime.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-19 12:28:24 -04:00
Chris Evich 4c9b021533
Cirrus: Update Ubuntu base images
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-19 12:28:24 -04:00
Chris Evich 7cbdd48f78
Cirrus: Use opensuse open build Ubuntu packages
This is necessary as the projectatomic PPA is no longer maintained.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-19 12:28:24 -04:00
Brent Baude 14186ca28e fix timeout file flake
this is a temporary fix for the flake that has been troubling us.  once conmon is in fedora 30 and 31 stable, we can remove this fix.  the images will just need to be rebuilt.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-17 15:44:39 -05:00
Ed Santiago 3003384785 Four small CI fixes:
1) 'podman system info' (in logcollector): has been silently
     failing in special_testing_rootless, with:
       logcollector.sh: line 16: podman: command not found
     Use ./bin/podman instead of just podman; this is probably
     the right thing to do in the general case anyway

  2) logformatter: highlight 'panic:', seen in bindings test:
        https://storage.googleapis.com/cirrus-ci-5385732420009984-fcae48/artifacts/containers/libpod/6693715108429824/html/integration_test.log.html

  3) logformatter: handle Unicode bullet in front of 'Running',
     seen in bindings test.

  4) logformatter: turn down contrast on BATS 'ok' results,
     for legibility

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-16 11:37:27 -06:00
Chris Evich 9215eb0331
Cirrus: Disable non-docs release processing
Detecting when it's time to upload a release inside Cirrus-CI is really
difficult for many automation and human reasons.  Disabling it for now
until a more robust solution can be implemented

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-12 15:41:03 -04:00
Brent Baude 194759b96e turn off color-mode for bindings
the binding ginkgo tests were using color mode which throws in a bunch of ansi garbage that makes it hard to read the logs

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-12 13:45:56 -05:00
Daniel J Walsh ac354ac94a
Fix spelling mistakes in code found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-07 10:30:44 -05:00
Brent Baude 8b5e2a6297 add default network for apiv2 create
during container creation, if no network is provided, we need to add a default value so the container can be later started.

use apiv2 container creation for RunTopContainer instead of an exec to the system podman. RunTopContainer now also returns the container id and an error.

added a libpod commit endpoint.

also, changed the use of the connections and bindings slightly to make it more convenient to write tests.

Fixes: 5366
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-06 14:31:45 -06:00
OpenShift Merge Robot 60e9e7ca9c
Merge pull request #5039 from cevich/fix_gobin_exit_bug
Cirrus: Fix gate image & false-positive exits
2020-03-05 19:28:10 +01:00
Ed Santiago 1814638000 CI: format cirrus logs
This introduces a new cirrus helper script, logformatter.
Usage is:

    [commands...] | logformatter TEST-NAME

It reformats its input into a readable, highlighed, linkable
form. Some features:

   - boring stuff (timestamps, standard podman options) is
     deemphasized
   - important stuff (warnings, errors) is emphasized
   - in-page links to the actual failures
   - active links to source files
   - jumps to bottom of page on load, because that's where
     the errors are. (All errors are linked)

Add it to select test commands (integration, system) and
add a new artifacts_html, run in the 'always' block, which
uploads generated *.log.html into Cirrus; from there we
generate a live URL that can be viewed in browser.

Unfortunately, due to security concerns in Cirrus, it is
not currently possible to make the link a live one.

Kludge: add a line of dashes after Restoring images; without this,
the first test ("systemd PID 1") has no dashes before it, so
logformatter doesn't see it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-02 15:55:05 -07:00
Ed Santiago 5612089412 CI: add API v2 tests
API v2 has been quiet for a few days, and the test script is
actually passing. Let's take advantage of this opportunity
to get them running in CI.

Requires adding a check for cgroupsv2

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-02 13:19:42 -07:00
Chris Evich d0782e7839
Cirrus: Fix gate image & false-positive exits
A number of scripts relating to tooling used and the gate container
image were not exiting upon errors as intended.  Coupled with
external service unavailability (i.e. downloading golangci-lint)
was observed to cause difficult to debug failures.

This change corrects the scripts inside/out of the gate container as
well as fixes many golang related path consistency problems vs other CI
jobs.  After this change, all jobs use consistent path names reducing
the number of special-case overrides needed.

Lastly, I also made a documentation-pass, updating/correcting as needed,
including documenting a likely local validation-failure mode, related to
`$EPOCH_TEST_COMMIT`.  This is dependent on the developers git
environment, so documentation is the only possible "fix".

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-02 08:50:54 -05:00
Chris Evich 0885f76742
Cirrus: Force runc use in F30
Suspect crun might be sneaking in during VM image build via podman RPM
dependency.  Add it to the removal list when building, then also force
use of runc at runtime in F30.

Also quote all true/false vars to force them as strings instead of
booleans (which will become capitalized)

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 10:37:31 -05:00
Chris Evich c96eb612e5
Cirrus: Remove unnecessary handle_crun workaround
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 09:54:36 -05:00
Chris Evich e874b5b222
Cirrus: Print env. vars at end of setup.
There are a number of env. vars set during the setup script.  Therefore
displaying them at end of the script is more helpful for debugging.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 09:54:36 -05:00
Chris Evich 42f04bbdaf
Cirrus: Fix not growing Fedora root
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 09:54:35 -05:00
Ed Santiago cabd6c1607 CI: package_versions: include hostinfo, kernel
In the package_versions CI step, include Fedora/Ubuntu
version, uname -r, and cgroups version.

Cgroups version is simply the FS type of /sys/fs/cgroup,
which shows 'tmpfs' for v1 and 'cgroup2fs' for v2. I
don't think it's worth the effort to prettify those
into 'v1/v2' - I think our readers are sophisticated
enough to figure it out from context - but am willing
to add that feature if requested.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-27 09:40:35 -07:00
Chris Evich 22904c1799
Cirrus: Log libseccomp package version
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-26 11:42:19 -05:00
Chris Evich 5973641404
Cirrus: SELinux Enforcing for F31 w/ CGv2
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-25 12:34:26 -05:00
Chris Evich 7e95e1e25c
Cirrus: collect podman system info
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-25 12:34:25 -05:00
Chris Evich 0ac0e6e612
Cirrus: F31: Force systemd cgroup mgr
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-25 12:34:25 -05:00
Chris Evich 614917d6aa
Cirrus: Handle runc->crun when both are possible
In some distributions it's possible to have both runc and crun
installed and/or for podman to be confused about which to use.  In these
instances, force the decision by adding `OCI_RUNTIME=/usr/bin/crun` into
`/etc/environment`. Also in-place modify libpod.conf to use 'crun'
instead of 'runc'

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-25 12:34:25 -05:00
Chris Evich 70b28bc2cc
Cirrus: Use deadline elevator in F31
The default scheduler is BFQ but integration tests run into

https://bugzilla.redhat.com/show_bug.cgi?id=1767539
aka
https://bugzilla.kernel.org/show_bug.cgi?id=205447

Using the deadline elevator as a workaround.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-25 12:34:25 -05:00
Chris Evich e0ca4a2260
Cirrus: Support testing with F31
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-25 12:34:24 -05:00
Brent Baude a64985c71b enable ci on go binding tests
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-22 09:43:19 -06:00
baude cc0f7defdc [CI:DOCS]Connect API docs and RTD
Signed-off-by: baude <bbaude@redhat.com>
2020-01-17 15:12:35 -06:00
baude 9be6f30a42
post-process swagger yaml for publish
Signed-off-by: baude <bbaude@redhat.com>
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-01-17 15:41:33 -05:00
OpenShift Merge Robot e83a1b87da
Merge pull request #4817 from rhatdan/codespell
Add codespell to validate spelling mistakes in code.
2020-01-13 17:59:58 +01:00
Daniel J Walsh 4093b2c011
Add codespell to validate spelling mistakes in code.
Fix all errors found by codespell

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-11 06:32:19 -05:00