Commit graph

355 commits

Author SHA1 Message Date
Giuseppe Scrivano ae10f55362
test: fix remote tests for rootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-08 22:16:55 +02:00
Chris Evich 599714d9f2
Cirrus: Support special-case modes of testing
Previously libpod CI was fairly straight-forward, run unit and
integration tests in a standard set of 3 VMs.  Off on the side was a
single special case of running tests as an ordinary user.  There is a
desire to stop using the PAPR system to support testing inside of a
container.

Since having two special cases potentially invites more
down the road, make provisions to handle them more gracefully.  This
commit introduces an environment variable:  ``$SPECIALMODE``.  It's
value has the following meanings within the CI scripts:

Mode 'none': Nothing special, business as usual (default)
Mode 'rootless': Rootless testing
Mode 'in_podman': Build container, run integration tests in it.

This will make adding additional special-cases later easier, as well as
extending the special cases in a Matrix across multiple OS's.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-04-03 09:57:20 -04:00
Matthew Heon 87162d6cd8 Bump to v1.3.0-dev
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-30 11:33:15 -04:00
Matthew Heon 5ed62991dc Remove ulele/deepcopier in favor of JSON deep copy
We have a very high performance JSON library that doesn't need to
perform code generation. Let's use it instead of our questionably
performant, reflection-dependent deep copy library.

Most changes because some functions can now return errors.

Also converts cmd/podman to use jsoniter, instead of pkg/json,
for increased performance.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-27 20:00:31 -04:00
Chris Evich bb068e46f0
Cirrus: Verify manpages for all subcommands exist
fixes #2630

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-21 10:47:27 -04:00
Chris Evich 37eb694bd0
Cirrus: Various fixes for rootless testing
* Randomize the user's UID and GID
* Simplify `setup_environment.sh`
* Support new "-r" option for `hack/get_ci_vm.sh` setting up rootless
* Connect as $ROOTLESS_USER when using "-r" with `hack/get_ci_vm.sh`

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-19 13:00:18 -04:00
baude c6b205be77
Enable rootless integration tests
Signed-off-by: baude <bbaude@redhat.com>
2019-03-19 15:01:48 +01:00
OpenShift Merge Robot 91b00281e8
Merge pull request #2689 from cevich/new_images
Cirrus: Update VM Cache images
2019-03-18 09:47:55 -07:00
Chris Evich 51f223ec1c
Cirrus: Update VM Cache images
Undo short-term slirp4netns workaround (#2660)

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-18 11:25:38 -04:00
Chris Evich 2e2a173567
Cirrus: Fix post-merge failure notice
Likely caused by rebase typos after removing test-commit.  This fixes
notifications to actually get sent.  Also show env. vars after setting
up the environment - helps debugging.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-16 12:14:43 -04:00
Chris Evich 0e76921048
Cirrus: Notify on IRC if post-merge testing fails
Until recently it was very difficult to execute any scripts if part of a
task failed.  A new feature in Cirrus-CI makes this easy.  Use it to
post a notice on IRC when any task fails.

Also: Add quotes around yaml-string values for consistency and
syntax-highlighting correctness.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-15 21:21:50 -04:00
OpenShift Merge Robot e16cdf711f
Merge pull request #2637 from edsantiago/zsh_completion
zsh completion
2019-03-15 07:01:28 -07:00
Giuseppe Scrivano 1442abf032
cirrus: upgrade slirp4netns
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-14 22:12:12 +01:00
TomSweeneyRedHat d033452b3d Replace skopeo-containers with containers-common
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Replaces 'skopeo-containers' with 'containers-common' in the files that
I feel comfortable changing it in.  There are a number of rpm building
related files that still have it, but I was hesitant to do so.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-03-14 09:01:30 -04:00
Ed Santiago 6aa8078cc1 zsh completion
Weekend hack by someone who doesn't grok zsh completion
but who finds it deeply offensive that most completion
files have an unmaintainable duplication of options
and arguments. The idea behind this one is to discover
the command line using --help, with a few hardcoded
helpers for discovering containers, images, pods,
and figuring out which args take files/dirs as args.

Working remarkably well. I am using this in my daily
routine and wondering how I ever managed without it.
It's not perfect -- a future version can perhaps
show only stopped containers for podman rm, only
running ones for podman stop -- but ROI seems low
on that given my limited zsh completion skills.

Sadly, I can't figure out how to write a regression
test suite for this. It would be lovely to have a
list if partial command lines and expected completions,
because the history of this change is that (seemingly)
minor tweaks in one place cause breakage in another.
Does anyone know of such a framework?

Still... working well enough to ship, IMO.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 16:40:07 -06:00
OpenShift Merge Robot b15273a0ca
Merge pull request #2531 from cevich/rootless_stub
Cirrus: Add dedicated rootless mode testing
2019-03-09 04:15:09 -08:00
Chris Evich 4531800f49
Cirrus: Use imgts container to record metadata
Make use of the built imgts container image to track
VM image usage statistics for every automation run.

Also update and add small check to the gate test
that verifies expected formatting/content of the
`.cirrus.yml` file WRT VM Image names.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-06 12:21:14 -05:00
Chris Evich 142442edaa
Cirrus: Add dedicated rootless mode testing
Certain integration tests require execution as a regular user.
This is acomplished by `PodmanTest.PodmanAsUserBase()` wrapping a
specialized execution environment, in `test/utils/utils.go`.  However,
doing this requires passing through python, which vastly increases the
complexity of debugging low-level problems.

This commit introduces a new parallel task, run as a regular user on the
VM as set by three environment variables.  All commands executed in the
``rootless_test.sh`` script, will occur as a real user with a name and
home directory, just as `$DIETY` intended.  All env. vars established
during `environment_setup.sh` (for root) are available.  The PR source
in `$GOSRC` and `$GOPATH` are owned by this user, and ready for use.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-05 11:03:37 -05:00
Chris Evich ba476c1407
Globally increase test timeout to 90-minutes
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-04 17:08:21 -05:00
Chris Evich a888e0fad2
cirrus: Drop ginkgo, gomega, easyjson install
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-04 17:08:21 -05:00
Chris Evich a810d96b6c
Cirrus: Add BATS package for all platforms
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-04 17:08:21 -05:00
Matthew Heon bd9a18df15 Add a task to Cirrus gating to build w/o Varlink
We had a regression on master where we broke the build for
non-Varlink builds. Catch this in CI in the future.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-27 12:21:57 -05:00
Matthew Heon e130657e28 Bump to v1.2.0-dev
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-26 17:33:45 -05:00
Matthew Heon 006206abe1 Bump to v1.1.0
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-26 17:33:45 -05:00
Daniel J Walsh b87bdced1f
Fix up handling of user defined network namespaces
If user specifies network namespace and the /etc/netns/XXX/resolv.conf
exists, we should use this rather then /etc/resolv.conf

Also fail cleaner if the user specifies an invalid Network Namespace.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-23 05:47:27 -05:00
Chris Evich 69c91e044a
Cirrus: Install Go 1.11 on Ubuntu VMs
There is no native package for this, so the packaged version must also
be installed, otherwise all the support/dependencies would be removed
also (like go-md2man).  Fix this by installing from the google released
tarball, into /usr/local/go and set $GOROOT to point there.

Also, include a small fix for hack/get_ci_vm.sh not installing
testing dependencies because of an old assumption.

***CIRRUS: REBUILD IMAGES***

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-02-22 12:07:36 -05:00
Chris Evich 7184efe939
Cirrus: Add 20m extra timeout for Ubuntu
Tests running slower than normally-slow, bump timeout to allow them to
pass until better solution (for slow Ubuntu tests) can be found.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-02-22 12:07:34 -05:00
Nitesh Konkar 383e573299 packer: Make Makefile host arch sensitive
`make localunit` fails on non-amd64 archs
as it unzips packer_1.3.2_linux_amd64.zip
irrespective of host arch its running on.

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-02-18 10:23:57 +05:30
Peter Hunt 81804fc464 pod infra container is started before a container in a pod is run, started, or attached.
Prior, a pod would have to be started immediately when created, leading to confusion about what a pod state should be immediately after creation. The problem was podman run --pod ... would error out if the infra container wasn't started (as it is a dependency). Fix this by allowing for recursive start, where each of the container's dependencies are started prior to the new container. This is only applied to the case where a new container is attached to a pod.

Also rework container_api Start, StartAndAttach, and Init functions, as there was some duplicated code, which made addressing the problem easier to fix.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-02-15 16:39:24 -05:00
Daniel J Walsh 52df1fa7e0
Fix volume handling in podman
iFix builtin volumes to work with podman volume

Currently builtin volumes are not recored in podman volumes when
they are created automatically. This patch fixes this.

Remove container volumes when requested

Currently the --volume option on podman remove does nothing.
This will implement the changes needed to remove the volumes
if the user requests it.

When removing a volume make sure that no container uses the volume.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-14 13:21:52 -05:00
Valentin Rothberg 9ac0ebb079 Cirrus: add vendor_check_task
* Make sure that all vendored dependencies are in sync with the code and
  the vendor.conf by running `make vendor` with a follow-up status check
  of the git tree.

* Vendor ginkgo and gomega to include the test dependencies.

Signed-off-by: Chris Evic <cevich@redhat.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-06 11:14:06 +01:00
Daniel J Walsh 3554bfce98
Merge pull request #2196 from baude/toolbox
Changes to container runlabel for toolbox project
2019-02-05 10:34:40 -05:00
OpenShift Merge Robot 465e19b555
Merge pull request #2213 from cevich/cirrus_imgts_container
[skip ci] Cirrus: Container for tracking image use
2019-02-04 19:18:10 +01:00
baude 735f0de633 Changes to container runlabel for toolbox project
The toolbox project would benefit from a few changes to more closely
resembe the original atomic cli project.  Changes made are:

* only pull image for container runlabel if the label exists in the image
* if a container image does not have the desired label, exit with non-zero

Signed-off-by: baude <bbaude@redhat.com>
2019-01-30 08:44:58 -06:00
Chris Evich 8ca6706be0
Cirrus: Add RHEL-7 testing
Add necessary tweaks to base-image build/import process so that image
can successfully boot with networking enabled.  Build the base image and
update ``.cirrus.yml`` accordingly.

Also make a minor improvement to cache-image building to help save space in
GCP image storage.  Namely, instead of storing every produced image, export
them into google storage buckets w/ life-cycle enabled.  For production use,
they may be converted back into GCE images, otherwise they will expire after
a time.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-30 08:26:48 -05:00
Chris Evich 88f222b41d
Cirrus: Enable AppArmor build and test
This was specifically disabled early on in transitioning to cirrus due to
an excessive number of test failures and lack of knowledge.  This commit
reverses the stance and unifies build and test commands across all
current platforms.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-29 10:38:51 -05:00
Chris Evich 01e609d460
[skip ci] Cirrus: Container for tracking image use
Once built, this container can be utilized by automation to help keep
track of VM images.  All parameters are passed in via env. vars.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-24 08:47:08 -05:00
Chris Evich 7124ef71b5
cirrus: Record start/end time of important things
Previously we only reported the date/time at the beginning of a run
since it's not available in the Cirrus-CI system.  This commit
generalizes the solution, recording start/end times for all major
events.

Also the timestamps are recorded into a local file on the VMs.  This
is intended for future use, for example tracking execution-time
trends.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-17 14:32:28 -05:00
baude b30a56c156 Run integrations test with remote-client
Add the ability to run the integration (ginkgo) suite using
the remote client.

Only the images_test.go file is run right now; all the rest are
isolated with a // +build !remotelinux.  As more content is
developed for the remote client, we can unblock the files and
just block single tests as needed.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-14 14:51:32 -06:00
Matthew Heon 9ab838524c Update master branch with v1.0 changes from 1.0 branch
Grab release notes, changelog, and version changes so master is
up to date.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-14 10:18:09 -05:00
OpenShift Merge Robot 6524041fb0
Merge pull request #2119 from jwhonce/wip/python_podman
Move python code from contrib to it's own repo python-podman
2019-01-10 11:11:46 -08:00
OpenShift Merge Robot e4525cf844
Merge pull request #2129 from cevich/timestamp
Cirrus: (Minor) Print timestamp
2019-01-10 10:58:25 -08:00
Jhon Honce 45fb935fe4 Move python code from contrib to it's own repo python-podman
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-01-10 11:27:50 -07:00
Chris Evich 4e7a7ffe9d
(Minor) Cirrus: Print timestamp at start
Also record into a file in case a later reference is required

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-10 12:59:55 -05:00
Chris Evich b9814e76b2
Minor: Remove redundant basename command in ooe.sh
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-07 14:41:52 -05:00
OpenShift Merge Robot 792f10988e
Merge pull request #2023 from rhatdan/config
Switch all references to image.ContainerConfig to image.Config
2018-12-22 03:11:08 -08:00
Chris Evich 727f8faff6
cirrus: Use updated images including new crui
Also add two minor tweaks which were preventing images from building
properly.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-21 16:08:21 -05:00
Daniel J Walsh c657dc4fdb
Switch all referencs to image.ContainerConfig to image.Config
This will more closely match what Docker is doing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 15:59:34 -05:00
Adrian Reber 38e3fb53f6
Use existing CRIU packages in CI setup
For all in testing involved distribution a new enough CRIU exists as a
package.

Fedora provides CRIU packages directly. For CentOS/RHEL there is a COPR
with the latest CRIU version and for Ubuntu there is a PPA for the
latest CRIU version. Let's use these packages and fall back to building
from git if necessary.

Signed-off-by: Adrian Reber <adrian@lisas.de>
2018-12-21 08:18:21 +01:00
OpenShift Merge Robot 65c5883f5c
Merge pull request #1757 from kunalkushwaha/contrib-perftest
perf test a stress test to profile CPU load of podman
2018-12-20 06:51:01 -08:00
baude f080ba846d prepare for move to validate on 1.11 only
Signed-off-by: baude <bbaude@redhat.com>
2018-12-19 13:43:09 -06:00
Kunal Kushwaha 658f772c16 perf test a stress test to profile CPU load of podman
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-12-19 16:05:21 +09:00
OpenShift Merge Robot 51d80ed01b
Merge pull request #2022 from baude/flakeflake
all flakes must die
2018-12-18 11:16:09 -08:00
baude 8e62d0120e all flakes must die
when cleaning up after a test, don't fail if cleanup doesn't run
perfectly.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-18 12:43:49 -06:00
Chris Evich 4bf7c4b62b
Cirrus: One IRC notice only
The podbot messages are becoming obnoxious as more distributions are
tested.  Only call the `success.sh` script once, after all testing was
successful.  Also make update the message to include more helpful text
and url.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-18 09:16:05 -05:00
Daniel J Walsh 68414c5ee3
Merge pull request #2010 from cevich/cirrus_editors
Cirrus: Add text editors to cache-images
2018-12-17 15:55:03 -05:00
Chris Evich 7b53e86e4f
Add script to create CI VMs for debugging
Frequently debugging of CI-related problems requires going hands-on
within the environment.  However, reproducing the environment by hand is
very tedious and error prone.  This script permits authorized users to
produce VM's based on any available cache-image, and automatically remove
them upon logout.

Also: Bump up VM disk sizes to 200GB due to performance reasons

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-14 14:34:43 -05:00
Chris Evich a1a5f3ba51
Cirrus: Migrate PAPR testing of F28 to Cirrus
Since the most recent TWO versions of Fedora are officially supported
upstream, both need to be tested.  Implement the concept of a 'prior'
Fedora release in both base-image and cache-image production.  Utilize
the produced cache-image to test libpod.  Remove F28 testing from PAPR.

Much thanks to @baude @giuseppe for help with this.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-14 11:19:41 -05:00
Chris Evich 401fb2bf2f
Cirrus: Add text editors to cache-images
Occasionally people need to access the VM's for
troubleshooting/debugging.  Having an editor pre-installed makes life
easier and doesn't cost any extra test-time.

***CIRRUS: REBUILD IMAGES***

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-14 10:51:39 -05:00
Chris Evich d038497b09
Fix documentation links and flow
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-12 10:56:18 -05:00
Chris Evich ac7ddc189e
Cirrus: Update base-image build docs
Mostly minor tweaks and clarifications.  Though there was
one missing (required) make value I fixed.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-10 16:03:37 -05:00
OpenShift Merge Robot d266460f7b
Merge pull request #1893 from jwhonce/bug/1869
Refactor CLI booleans to be consistent and defined behavior
2018-12-07 08:31:55 -08:00
OpenShift Merge Robot d4af59d57c
Merge pull request #1788 from cevich/cirrus_base_images
Codify and document base-image production + Enable testing with Fedora
2018-12-07 07:46:46 -08:00
Matthew Heon ae35efb432 Bump to v0.12.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-12-06 17:33:10 -05:00
Matthew Heon 7ba215f759 Bump to v0.12.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-12-06 17:33:06 -05:00
Chris Evich cb900798ce
Cirrus: Document and codify base-image production
A number of images required for future testing are not present in GCE.
Importing them is a long proscribed process prone to errors and
complications.

Improve this situation by documenting, and encoding the majority of the
steps required.  Due to the required complexity, these are clearly
identified as 'semi-automated'.  This means a discerning eye is
sometimes needed to address unforeseen problems (networking issues,
format or packaging changes, etc).

Nevertheless, having these steps in writing, will reduce current and
future  maintenance burden while supporting future testing needs of
RHEL, Fedora and Fedora Atomic Host.

Also:

* Add necessary configuration, scripts, and Makefile updates needed to
  prepare RHEL, Fedora, & FAH cloud images for use in GCE.  This
  is a complex, multi-step process where the cloud image is booted
  un a local user-mod qemu-kvm instance, where it can be modified.
  From there, it's converted into a specific format, and imported into
  GCE.  Lastly, the imported raw disk data is made available as a GCE
  VM image.

  Note: As of this commit, the RHEL base-image builds (CentOS has native
  image), however neither RHEL or CentOS cache-images build correctly.

* Left testing on FAH disabled, the GCE/Cirrus integration needs needs more
  work.  Specifically, the python3-based google startup script service
  throws a permission-denied (as root) when trying to create a temp.
  directory.  Did not investigate further, though manually running the
  startup script does allow the libpod tests to start running.

* Enabled Fedora 29 image to execute tests and general use.

* Utilize the standardized F28-based container image  for gating
  of more the intensive unit and integration testing.  Update
  documentation to reflect this as the standard platform for
  these checks.  Rename tasks with shorter names and to better
  reflect their purpose.

* Cirrus: Trim unnecessary env vars before testing since the vast
  majority are only required for orchestration purposes.  Since most
  are defined within `.cirrus.yml`, it's a good place to store the
  list of undesirables.  Since each of the cirrus-scripts runs in
  it's own shell, unsetting these near the end will have no
  consequence.  Also trim down the number of calls to show_env_vars()

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-06 15:39:18 -05:00
Chris Evich 8d7fdc7d79
Cirrus: Use Makefile for image-building
The packer tool takes JSON as input for the details of producing VM
images to be used for PR CI-testing.  JSON is not a very human-friendly
format, without support for comments and frequently containing lots of
duplicate data.

Fix this by using a Makefile + simple python one-liner to convert
from a human-friendly YAML format into packer-native JSON.  This allows
use of anchors/aliases to reduce duplication, and allows inline comments
for easier maintainability.  This also allows separating the 'test'
action from the 'build' action, for earlier and better syntax problem
detection.

Lastly, there are some minor ``lib.sh`` and ``integration_test.sh``
updates to support future work, and slightly improve the build and
test environments.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-06 15:39:18 -05:00
Jhon Honce c60489da47 Refactor BooleanAction to mimic golang interface
* Change all store_true or store_false to use store_bool.
  New behavior documented in BooleanAction docstring.
* Remove any extraneous code identified by pylint in files from above.

Fixes #1869

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-12-05 15:43:08 -07:00
Jhon Honce 7c7231ce01 Invert tlsverify default in API
Fixes #1929

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-12-05 15:42:33 -07:00
OpenShift Merge Robot 480a179f01
Merge pull request #1894 from jwhonce/bug/1876
Only include container SizeRootFs when requested
2018-12-04 08:16:15 -08:00
Giuseppe Scrivano deeb3eaf7d
tests: always install runc on Ubuntu
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-01 06:46:24 +01:00
Giuseppe Scrivano 2842b8ad40
cirrus: make apt noninteractive
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-30 22:45:56 +01:00
Jhon Honce 57f7b79400 Only include container SizeRootFs when requested
* API always returns value, so we remove it if not asked for

Fixes #1876

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-28 15:44:46 -07:00
Ed Santiago 3d0cdd898c pypod create/run: ignore args for container command
Don't try to argparse command-line arguments on the right-hand
side of the image; those are intended for the container command:

   pypodman create fedora ls -l
   pypodman run fedora find / -name foo
   pypodman run fedora bash -c 'echo hi'

If/when `pypodman exec` gets implemented, it should use this too.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2018-11-28 11:27:52 -07:00
OpenShift Merge Robot d3bc70d5d0
Merge pull request #1851 from jwhonce/wip/cmd
Add support for --all in pypodman ps command
2018-11-28 09:27:11 -08:00
OpenShift Merge Robot 88c23b0632
Merge pull request #1885 from edsantiago/split_token_none
_split_token(): handle None
2018-11-28 08:57:21 -08:00
Jhon Honce 2a6b683673 Add support for --all in pypodman ps command
* Updated field widths to match changes in go code

Fixes #1654

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-28 08:59:28 -07:00
Jhon Honce f8c5e75a10 Fixes #1867
* Some items included in the CLI and currently not supported by the API.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-28 08:56:24 -07:00
Ed Santiago 8b2affbd5b _split_token(): handle None
The conditional + list comprehension in images.py:_split_token()
wasn't quite working as intended; in particular, when fed None,
it chokes with

    TypeError: 'NoneType' object is not iterable

This is the correct behavior: comprehensions iterate first,
then apply the conditional.

Solution: special-case None, and remove the now-unnecessary
conditional.

Context: seen when trying 'pypodman run' against
docker.io/stackbrew/centos:7, which has no .ContainerConfig.Eng

Signed-off-by: Ed Santiago <santiago@redhat.com>
2018-11-27 16:13:36 -07:00
Anders F Björklund f84452f411 Actually set version for podman module / pypodman
The environment variable wasn't set, giving 0.0.0

It is a still a problem if you use python3 to build,
rather than make. You *need* to set $PODMAN_VERSION,
or your module and packages won't have the version.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2018-11-25 13:50:19 +01:00
Jhon Honce e955ff04ab Improve speed of containers.list()
* Clean up code in containers.py
* Pass pylint tests
* Pass tox tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-19 15:39:45 -07:00
OpenShift Merge Robot ea928f2de6
Merge pull request #1824 from afbjorklund/pypodman_user
pypodman: Don't use $HOST and $USER variables for remote
2018-11-19 08:45:06 -08:00
OpenShift Merge Robot 4eecc8cf70
Merge pull request #1823 from jwhonce/wip/cmd
Implement pypodman start command
2018-11-19 07:49:40 -08:00
OpenShift Merge Robot 47ffaae840
Merge pull request #1780 from cevich/un-magic
Reveal magic, parallel system-testing and system-testing simplification
2018-11-19 05:14:30 -08:00
Anders F Björklund 4adc69f4f9 Don't use $HOST and $USER variables for remote
Also, don't use $PORT. These are too generic.

Make sure to read $LOGNAME _after_ the config.

Prefix all the remote variables with PODMAN_

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2018-11-18 17:37:14 +01:00
Jhon Honce 0d21b90016 Implement pypodman start command
* Improve error messages from argparse Actions
* Silence more pylint errors when supporting a given API
* Refactor BooleanAction to support lower and mixed case input
* Remove spurious print()

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-16 14:57:17 -07:00
Daniel J Walsh dba45a13c0
Add version command to pypodman
pypodman does not currently support the version command.  We want to
have as close to the same functionality between podman and pypodman,
so adding this command.

Also had to fix some validate errors.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-11-15 20:15:52 -05:00
Chris Evich 8b3fcb374b
Cirrus: Add documentation for system-testing
***CIRRUS: REBUILD IMAGES***

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-11-13 13:30:48 -05:00
Chris Evich 2cc9b78ab9
Cirrus: Simplify optional system-test script
Previously it was required to call the verify, unit, and integration
scripts in order to build/install dependencies, and libpod.  This
wastes time during the (optional) system-testing, since the
actual unit/integration testing is also happening in parallel.

Consolidate only the distribution-specific build steps into the
system-testing script.  This way, only the required steps are performed
in their respective (parallel) tasks.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-11-13 13:30:48 -05:00
Chris Evich aa742e9e68
Cirrus: Reveal magic, parallel system-testing
Previously, several magic strings were in place to affect cirrus-ci
operations.  Two were buried within scripts.  One to optionally
execute system-tests within a PR. Another to avoid re-building
cache-images upon every merge.

Move these magic strings out into the open, buy locating their
logic up-front in the ``.cirrus.yml`` file.  This improves
readability and reduces surprise/astonishment at runtime.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-11-13 13:30:48 -05:00
OpenShift Merge Robot dd42c1dcff
Merge pull request #1804 from cevich/lint_verify_image
Standardized container image for gofmt and lint
2018-11-13 09:03:10 -08:00
Chris Evich 86d1196f9b
Standardized container image for gofmt and lint
Having a standardized image allows uniform application of format and
lint checking across multiple host platforms.  This ensures all
contributors and disparate CI systems to play by a common set of basic
rules.  It also makes it easier to maintain the common rules over-time.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-11-13 07:55:07 -05:00
Daniel J Walsh e2013b4ff4
Cleanup podman spec to not show git checkout is dirty
Currently we modify the git checkout which ends up showing that the checkout is dirty.  This patch sets the PYTHON_VERSION so that python code will handle
it correctly without having to modify the actual code.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-11-12 17:09:01 -05:00
OpenShift Merge Robot ada55ab7e0
Merge pull request #1784 from cevich/cirrus_ignore_irc
Cirrus: Ignore any error from the IRC messenger
2018-11-08 18:06:38 -08:00
Matthew Heon acb974f682 Bump to v0.11.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-11-08 14:09:03 -05:00
Matthew Heon a4adfe5e0c Bump to v0.11.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-11-08 14:08:59 -05:00
Chris Evich 916a3ba9d1
Cirrus: Ignore any error from the IRC messenger
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-11-08 13:51:36 -05:00
OpenShift Merge Robot 48914d67ae
Merge pull request #1762 from mheon/fix_python_tests
Temporarily fix the Python tests to fix some PRs
2018-11-07 08:23:49 -08:00
OpenShift Merge Robot 81cef49144
Merge pull request #1616 from cevich/cirrus_add_systemtest
Cirrus-CI: Add option to run system-tests
2018-11-07 08:06:07 -08:00
Matthew Heon fa76b86e3e Temporarily fix the Python tests to fix some PRs
The Python podman bindings have issues around kill - specifically
attempting to make it act like stop, when it should not. We
provide no guarantee of what state a container if in after kill -
it should be stopped, but we might have sent something that's not
SIGKILL. If you want a container or pod stopped, guaranteed, use
Stop().

The Python code attempted to ensure a container was actually
stopped after kill was run, which runs counter the above. This
was holding up some PRs that caused changes in how libpod obtains
its state, so for now, change pod kill to pod stop until the
proper changes in the Python code can be made.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-11-07 09:46:44 -05:00
OpenShift Merge Robot 76360d9a6e
Merge pull request #1743 from jwhonce/issue/1702
Add ChangeAction to parse sub-options from --change
2018-11-05 04:50:16 -08:00
Jhon Honce 573e21f8a0 Fix long image name handling
* Fixed issue where podman printed '<none>' and pypodman
  skipped the image
* Fixed issue where port was printed in place of tags

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-01 11:36:46 -07:00
Jhon Honce a4c0cdedb9 Add ChangeAction to parse sub-options from --change
* Covers both commit and import commands
* Cleaned up export command
* Removed unneeded calls to super().__init__()

Fixes #1702

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-01 10:32:39 -07:00
OpenShift Merge Robot 17716d787a
Merge pull request #1624 from cevich/update_fedora
Cirrus: Enable updating F28 image
2018-11-01 10:23:27 -07:00
OpenShift Merge Robot 7772350f52
Merge pull request #1603 from cevich/fix_cirrus_image_build
Fix Cirrus/Packer VM image building
2018-11-01 10:23:17 -07:00
Jhon Honce 0f232037f6 Change humanize to use MB vs MiB.
Fixes #1653

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-01 07:39:35 -07:00
Chris Evich 989affa2dd
Cirrus-CI: Add option to run system-tests
Normally, we would not run system-tests as part of PR-level CI, they're
simply too heavy-weight and complex.  However, in some instances it may
be desirable to provide a quick feedback loop, prior to release packaging
and official testing.  Enable this by executing the system-tests when
a magic string is present in the PR description:

``***CIRRUS: SYSTEM TEST***``

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-31 09:50:53 -04:00
Chris Evich 91f398db4c
Cirrus: Skip rebuilding images unless instructed
Given frequent merges, it doesn't make sense to rebuild the VM testing
images every time.  Instead, monitor the PR title and description for
a magic string, only triggering builds on a match:

***CIRRUS: REBUILD IMAGES***

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-31 09:48:31 -04:00
Chris Evich 021ca5780c
Cirrus: Add a readme
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-31 09:48:31 -04:00
Chris Evich 4929662c8a
Ubuntu VM image build: try update twice
Occasionally, short-term temporary connectivity problems prevent ubuntu
from updating on GCE.  As a workaround, attempt these commands twice.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-31 09:48:30 -04:00
Chris Evich ed67d302ef
Cirrus: Enable updating F28 image
Previously this was disabled as some package was breaking networking on
GCE after updating + rebooting.  This is fixed now, so we should update
packages when building the fedora test VM image.

https://pagure.io/cloud-sig/issue/292

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-31 09:47:43 -04:00
Jhon Honce d62fa127a1 Ensure test container in running state
* Save storage if tests fail

Fixes #1643

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-25 12:20:11 -07:00
Jhon Honce a7ea7e9d5c Downgrade code to support python3.4
* Added tox configuration to test python 3.4, 3.5 and 3.6.
  Tox testing not enabled on every PR
* Updated MANIFEST.ini to support tox
* Correct comments

Fixes #1641

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-23 07:58:48 -07:00
OpenShift Merge Robot 79befd5158
Merge pull request #1648 from cevich/cirrus_podbot
Add simple IRC messenger
2018-10-23 07:41:43 -07:00
Chris Evich 89b5484ad2
Cirrus: Install CRIU in test images
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-18 12:37:09 -04:00
Chris Evich a18494a345
Cirrus: Use different CNI_COMMIT for Fedora
Just noticed this in Dockerfile.Fedora.  Updated all the right
places to make this happen.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-18 12:37:08 -04:00
Chris Evich 02bc3c9962
Fix Cirrus/Packer VM image building
An invalid GCE value is being passed to packer, preventing it from
building VM images.  Fix this, and centralize the definition of the
image name suffix by setting it at ``setup_environment.sh`` call-time,
rather encoding inside packer's `libpod_images.json`.  This makes
the value available for use by other scripts.

Also, switch the unique component of the name, to be based on the
commit-sha being tested.  This will improve traceability, since the git
history is more permanent than the `CIRRUS_BUILD_ID` env. var.  The
later is subject to log-rotation, destroying evidence of the images
source state.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-18 12:37:08 -04:00
Chris Evich 4de69da7bd
Revert "Cirrus: Enable debugging delay on non-zero exit"
This reverts commit b610913ef5.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-18 12:33:36 -04:00
Chris Evich 0c17f2010a
Cirrus: IRC message when cirrus testing successful
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-18 12:33:36 -04:00
Chris Evich a50410467a
cirrus: Add simple IRC messenger
Add a naive python script that's able to connect to IRC and send a
single line of text to the #podman channel.  Wrap this in a new
library function to ensure nick-name collisions are unlikely.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-18 12:33:36 -04:00
Chris Evich b610913ef5
Cirrus: Enable debugging delay on non-zero exit
There have been some python-podman flakes observed across multiple CI
systems.  Support capturing a VM for further investigation in the
event of a non-zero exit.  This is done by printing a warning message
and delaying script-exit for a long time.  Hopefully a human will notice
and have an opportunity to enable deletion-protection on the VM.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-15 09:48:19 -04:00
Giuseppe Scrivano 1f8b844c2b
tests: do not fail in the cleanup phase
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-14 16:52:31 +02:00
Jhon Honce 40cb756801 Add support for pod commands
* Add support for pod -- create, inspect, kill, pause, ps, rm,
  restart, start, stop, top, unpause
* Update pylintrc to better reflect pep8 code standards
* Fix various pylint reported errors
* Refactor code that determines screen width to no longer
  require initializing curses.  Improved start up time and
  pushing data blob down ssh tunnel.
* Correct pod-create man page, cgroupparent not boolean
* Abort integration tests if podman service fails to start

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-12 09:34:23 -07:00
Matthew Heon c260b5aa8c Bump to v0.10.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-11 16:51:28 -04:00
Matthew Heon e4a155328f Bump to v0.10.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-11 16:51:24 -04:00
OpenShift Merge Robot 141a1327fb
Merge pull request #1573 from baude/readdgolang
re-add BR for golang compiler to contrib/spec/podman.spec.in
2018-10-07 00:07:26 -07:00
Chris Evich 52f0547f64
Re-add source-verify in cirrus-ci
Don't waste GCE VM resources for 30-min of testing,
when verify would fail after 3-minutes.  This is
the simpelest mechanism to save cloud CPU-time
while GCE is under trial-status (can not set quotas).

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-05 11:23:21 -04:00
Chris Evich c53163b75a
Add configuration for Cirrus-CI
Testing podman requires exercising on a full-blown VM.  The current
containerized-approach is complicated, and mostly a band-aid over
shortcomings in the other CI systems.  Namely, we want:

* To pre-build environments with dependencies to reduce the
  setup time needed for testing.
* The ability to verify the pre-built environments are working
  before utilizing them for further testing.
* A simple, single set of flexible automation instructions to
  reduce maintenance burden.
* Ease of environment reproduction across clouds or locally, for
  debugging failures.

This change leverages Cirrus-CI + Packer + collection of shell scripts
to realize all of the above.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-10-04 16:30:48 -04:00
baude c6a6c06435 re-add BR for golang compiler to contrib/spec/podman.spec.in
Signed-off-by: baude <bbaude@redhat.com>
2018-10-04 09:48:22 -05:00
Matthew Heon 978aac6650 Fix python tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-02 14:53:15 -04:00
Jhon Honce ff38edaafe * Update documenation
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-01 07:24:50 -07:00
Jhon Honce 9074565f4e Implement pod varlink bindings
* Update varlink document
* Add NoContainersInPod error in go and python
* Add support for varlink pod interface
* New code passes pylint
* Fix bug in test_runner.sh
* Update integration tests for race condition on status check
* Add missing port config file support

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-01 07:24:50 -07:00
Matthew Heon 9bcf7ce83a
Merge pull request #818 from wking/python-2-clean
Makefile: Call contrib/python's clean regardless of HAS_PYTHON3
2018-09-27 09:42:43 -04:00
baude 4073541981 rework CI tests to test on VMs
This PR makes several key changes to our CI testing.  Firstly, we now test
podman on fedora 28, fedora 29, and centos VMS (rather than containers). Any
of these that having failing tests are not marked as required yet. We
still preserve the podman in podman and podman in docker tests as well and
they are marked as required.

The lint and validate work is now done on a openshift container.  We also
removed the rpm verification on papr and perform this test under the "images"
test on the openshift ci.

This PR exposes integration test fails on some of our OSs.  My expectation is we
will fix those in additional PRs and as they are fixed, we should be flipping
the boolean bit to required.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1492
Approved by: mheon
2018-09-26 15:47:29 +00:00
Matthew Heon 4e4cd0b5f5 Bump to v0.9.4-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-21 18:24:27 -04:00
Jhon Honce 785e9ea1fd Updates from reviews
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1519
Approved by: rhatdan
2018-09-21 19:36:01 +00:00
Jhon Honce e6074eb9ac Implement new subcommands
* Refactor create subparser to share arguments with run subparser
* Add argparse.*Action subclasses to reduce duplicate code in parsers
* Using BooleanAction now accept True/False value as expected
* .pylintrc added to loosen variable name policing
* Update AbstractBaseAction to remove unset arguments before
  transmitting to podman service
* Align logging messages to podman output
* Renamed global argument from --user to --username, to avoid conflict
  with create/run podman commands
* Add new subcommands: run, create, history, import, info, push,
  restart and search

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1519
Approved by: rhatdan
2018-09-21 19:36:01 +00:00
Daniel J Walsh fbd1392a46 Don't output inodes created to run a container
There is a group of inodes that get created when running a container
if they do not exist.

containerMounts = map[string]bool{
	"/dev":               true,
	"/etc/hostname":      true,
	"/etc/hosts":         true,
	"/etc/resolv.conf":   true,
	"/proc":              true,
	"/run":               true,
	"/run/.containerenv": true,
	"/run/secrets":       true,
	"/sys":               true,
}

If the destination inode does not exist, libpod/runc will create the inode.
This can cause programs like podman diff to see the image as having changed,
when actually it has not.  This patch ignores changes in these inodes.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1508
Approved by: giuseppe
2018-09-21 09:45:14 +00:00
Daniel J Walsh 92b28a88d8
Vendor in latest containers/buildah
Switch from projectatomic/buildah to containers/buildah

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-18 17:20:30 -04:00
Matthew Heon fc86a9261a Bump to v0.9.3-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-14 18:13:33 -04:00
W. Trevor King 356765aa95 contrib/python/*/Makefile: Fallback to unversioned 'python'
And pull these from the PATH by default.  This way systems like CentOS
that don't have a python3 can still execute 'make clean', which
doesn't care about the Python major version.

The setup.py shebang, mode change, and ./ prefixing helps address
cases where PYTHON is empty.  This could be the result of improper
user configuration:

  $ make PYTHON='' clean

It could also be the state on systems with no Python installed, in
which case you'll see:

  $ make PYTHON='' clean
  ./setup.py clean --all
  /usr/bin/env: 'python': No such file or directory
  make: *** [Makefile:13: clean] Error 127

I've also shifted the Python invocations to the end of the clean
recipies so that as much as possible gets cleaned up even on systems
without Python installed.

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-09-13 22:15:22 -07:00
baude 08936c3241 do not build with devicemapper
as of now, we do not want to build with device mapper because it cannot
handle parallel requests which would be common-place in podman.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1445
Approved by: mheon
2018-09-12 22:21:50 +00:00
Matthew Heon 3904680858 Bump to v0.9.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-07 14:55:16 -04:00
Daniel J Walsh 6f2bd8d795 Change references to cri-o to point at new repository
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1425
Approved by: mheon
2018-09-07 17:47:45 +00:00
Matthew Heon b5495910dc Bump to v0.9.1-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-31 16:43:58 -04:00
Jhon Honce 6d067fcba2 Turn on test debugging
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1369
Approved by: rhatdan
2018-08-31 16:52:52 +00:00
Jhon Honce 8245f09428 Add support for remote commands
* Add support for commit, export, inspect, kill, logs, mount, pause
  port commands
* Refactored Report class to allow column lengths to be optionally
  driven by data
* Refactored Ps class to truncate image names on the left vs right
* Bug fixes

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1369
Approved by: rhatdan
2018-08-31 16:52:52 +00:00
baude 2caf1a9c33 add conmon to copr spec
For COPR rpms, it is desirable to have conmon built into the podman RPM.  No
code is impacted.

Signed-off-by: baude <bbaude@redhat.com>
2018-08-30 19:18:27 -05:00
baude 9e315518aa Test RPM build and install for regressions
On Fedora and now Centos (added), we build RPMs based on the spec in
contrib/spec to make sure we protect against regressions when creating
RPMs.  Once the RPM is built, we then test actually installing the RPM
to ensure that no deps are missing for install.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1356
Approved by: rhatdan
2018-08-28 11:53:09 +00:00
Matthew Heon 017e2d3468 Bump to v0.8.5-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-24 17:16:36 -04:00