56 Commits

Author SHA1 Message Date
b54c350a07 Use systemd/sd-daemon.h headers for systemd presence
Finding systemd devel packages using libsystemd does not work as
in RHEL based distro the package name is systemd-devel and for
deb/ubunutu it is libsystemd. It is also giving false result when
podman rpm is built with systemd but hack/systemd_tag.sh does not
return anything.

Install systemd-devel package in build_rpm.sh script

Moving to systemd/sd-daemon.h header files which comes from devel
packages fixes the issue.

Signed-off-by: Chandan Kumar (raukadah) <raukadah@gmail.com>
2019-12-16 20:37:15 +05:30
9db92d540a Improve hack/get_release_info.sh
- Adopt bash strict mode
- Avoid cd errors as seen on CI vendor jobs:
hack/get_release_info.sh: line 9: cd: /go/src/github.com/containers/libpod: No such file or directory

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2019-12-04 16:23:55 +00:00
8d928d525f codespell: spelling corrections
Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2019-11-13 08:15:00 +11:00
486fcd4e1e Update document formatting and packaging code
* Refactored code and Makefile to support new docs layout
* Removed some old code packaging code
* Add Readme.md to document what we're doing

Signed-off-by: Jhon Honce <jhonce@redhat.com>
Signed-off-by: baude <bbaude@redhat.com>
2019-10-31 12:31:39 -05:00
52b92023ed Restructure documentation dir
Restructuring the docs dir to make integration with sphinx easier.  man
pages now exist in docs/source/man and the sphinx make files exists in
docs.

Signed-off-by: baude <bbaude@redhat.com>
2019-10-31 12:31:39 -05:00
2046be6ae0 build: drop support for ostree
it is going to be removed from containers/image as well, so no longer
depend on it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-30 11:28:10 +01:00
049aafa4c0 Merge pull request #4090 from vrothberg/build-catatonit
Build catatonit
2019-10-01 06:05:22 -07:00
80f6af7766 catatonit: clone and build
Instead of unconditionally pulling the x86 binary, clone the repository
and build the binary to make it independent of the architecture.

Fixes: #2699
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-25 11:05:41 +02:00
6f4e3beedc bump catatonit to v0.1.4
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-25 10:16:01 +02:00
601052b386 Cirrus: Upload windows MSI release file
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-09-24 15:13:40 -04:00
2c73633e3b hack/man_page_checker - improve diagnostics
Make the errors more readable, with clearer instructions on
what to look for, and which filename, and what we expect to
see, and perhaps even how to approach a fix.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-09-09 09:37:52 -06:00
d266dbea15 Exclude podman-remote
Signed-off-by: Ryan Whalen <rj.whalen@gmail.com>
2019-08-31 08:05:51 -04:00
c153895424 WIP - ignore man pages for commands besides podman
Signed-off-by: Ryan Whalen <rj.whalen@gmail.com>
2019-08-30 12:47:41 -04:00
e35a5a674d Fix formatting and enable hack/man-page-checker
Signed-off-by: Ryan Whalen <rj.whalen@gmail.com>
2019-08-30 12:00:19 -04:00
370b1a887c Cirrus: Reimplement release archive + upload
The initial implementation was far more complicated than necessary.
Strip out the complexities in favor of a simpler and more direct
approach.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-08-28 11:54:06 -04:00
b843804d51 Adjust get_ci_vm.sh for substitution
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-08-12 12:01:55 -04:00
c1b792c1e0 vendor github.com/containers/image@v2.0.1
* progress bar: use spinners for unknown blob sizes
* use 'containers_image_ostree' as build tag
* ostree: default is no OStree support
* Add "Env" to ImageInspectInfo
* config.go: improve debug message
* config.go: log where credentials come from
* Fix typo in docs/containers-registries.conf.5.md
* docker: delete: support all MIME types
* Try harder in storageImageDestination.TryReusingBlob
* docker: allow deleting OCI images
* ostree: improve error message

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-07-22 14:35:03 +02:00
11484580d3 Cirrus: Add support for testing F30
Remove disused `build_cache_images` task, and
update relevant dockerfiles for F30.

Fix problem of cloud-init failing to expand root-device on boot
(/var/lib/cloud/instance left in improper state).

Fix problem of cloud-init racing with google-network-daemon.service on
boot (looking for cloudconfig metadata too early).  Causing
root-device to _sometimes_ fail to expand.

Fix problem of hack/get_ci_vm.sh argument passing.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-06-14 13:41:58 -04:00
57ada47ce5 hack: support setting local region/zone
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-05-29 09:30:50 -04:00
1bf622a0ea hack: ignore from all VCS files when tarballing
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-05-22 13:13:40 -04:00
53a2994a22 hack: shrink xfer tarball size
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-05-22 12:44:38 -04:00
99bd1d31c7 hack: Display IP address of VM from script
Useful for accessing it from other terminals.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-05-22 12:44:37 -04:00
95141f88d4 Cirrus: fixups based on review feedback
Also remove disused distros (RHEL/CentOS/FAH) and fix get_ci_vm script

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-05-21 08:44:02 -04:00
d1fc3fc702 Add systemd build tag
If the systemd development files are not present on the system which
builds podman, then `podman events` will error on runtime creation.
Beside this, a warning will be printed when compiling podman.

This commit mainly exists because projects which depend on libpod
would not need the podman event support and therefore do not need to
rely on the systemd headers.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-05-13 14:00:27 +02:00
b648ca0810 Cirrus: Add check for make varlink_api_generate
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-05-03 15:04:48 -04:00
b57d2c7d70 CI check for --help vs man pages: usability fix
The output of this CI script leaves much to be desired: it is
output from 'diff' with little clarity on what exactly is wrong.

The proper fix is to make the output clear and readable:

    podman containers --help lists a 'foo' subcommand that
     is not present in docs/podman-containers.1.md

Doing this in bash would take many hours and be fragile
gibberish code. This does not seem worth the effort: the
likely case is that breakages reported by this script
will be due to a newly added subcommand, and the PR
author will find it obvious what to do. Ergo, plan B:
if the test fails, display a blurb at the end describing
how to interpret results. Three minutes' effort, plus
five for writing this commit message.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-04-08 08:17:13 -06:00
b20594ea51 Merge pull request #2433 from cevich/hack_around_home
[ci skip] get_ci_vm.sh: Fix conflicting homedir files
2019-03-27 06:53:17 -07:00
beb71323b1 man pages - consistency fixes
podman-generate and -play had the wrong NAMEs.

podman-restart and -volume-prune the wrong SYNOPSIS.

All the rest are varying degrees of minor:

  - missing a space between the NAME and description
  - multi-line SYNOPSIS that could be collapsed into one
  - use of UPPER CASE in synopsis instead of *asterisks*
  - improper use of **double asterisks** for options
  - varlink and version were transposed in podman-1
  - fixed inconsistencies between the description in
    the man page and that in the parent manpage. These
    are too numerous for me to fix all.

Added: script that could be used in CI to prevent future
such inconsistencies. It cannot be enabled yet because
there are still 35+ inconsistencies in need of cleaning.

This will be difficult to review on github. I suggest
pulling the PR and running 'git log -1 -p | cdif | less'

'cdif' is a handy tool for colorizing individual diffs between
lines:

   http://kaz-utashiro.github.io/cdif/

There are other such tools; use your favorite. Comparing
without visual highlights may be painful.

I also encourage you to run hack/man-page-checker and suggest
more fixes for the problems it's finding.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-20 14:37:59 -06:00
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
c6b205be77 Enable rootless integration tests
Signed-off-by: baude <bbaude@redhat.com>
2019-03-19 15:01:48 +01:00
91e15bd802 add podman-healthcheck(1) to podman(1)
...caught by hack/podman-commands.sh script. Which had a little
buglet, which I fixed: add a special case for 'help', which
neither has nor needs a man page.

I believe the podman-commands.sh script is ready to be run in CI,
hint hint.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-07 14:33:25 -07:00
0666d25b4f get_ci_vm.sh: Fix conflicting homedir files
Previously, the script would bind mount the user's home directory into
the container in order to execute gcloud commands.  This was done
to preserve the `.config/gcloud` directory and new ssh keys in `.ssh`.
However, it's possible the user has modified `.bash*` or `.ssh/config`
files which do not play nicely with gcloud and/or the container.

Fix this by mounting the existing temporary directory on the host, as
the user's home directory.  Then bind mount in a dedicated `gcloud/ssh`
sub-directory, and the libpod repo directory on top.  Pre-create the
necessary mount-points as the user, so later removal does not require
root on the host.

The gcloud tool takes minutes to setup/manage its ssh-keys, so preserving
that work between runs is a necessary optimization.  Similarly, saving the
`.gcloud` directory prevents repeatedly going through the lengthy
client-auth process.

Overall, these changes make the container environment much more selective
with the host-side data it has access to use/modify.  Preventing unrelated
details from getting in the way, and preserving only the bare-minimum of
details on the host, between runs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-01 12:12:46 -05:00
742028e255 podman-commands script: refactor
Make more general-purpose: instead of hardcoding a list
of known subcommands, and duplicating sed pipelines for
each, rely on 'podman help' itself to tell us which
podman commands have subcommands; and examine each
in turn. Should there ever be new subcommands, this
will identify and test them.

A special case is needed for 'podman image trust', whose
documentation format doesn't match the others.

The change to `common.go` fixes an inconsistency: the
Usage message for commands with subcommands had an
unnecessary blank line, making it harder to parse
automatically. This simply produces consistent
Usage messages for all podman commands.

This script will not pass until #2480 is merged.
After that, the goal is to add this as a CI hook.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-02-28 13:16:24 -07:00
b4b7b298fc Clean up man pages to match commands
Also add podman-commands.sh to compare man pages to commands.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-27 16:37:40 -05:00
28ecb0f3da hack/tree_status.sh: preserve new lines
Quote the status output in echo to preserve the new lines.
Having the output in one line complicated debugging issues
and is not friendly to use.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 13:35:52 +01:00
17a5f39739 get_ci_vm : allow running without sudo
More complicated than one would think. The first problem is that,
on certain (but not all) Fedora systems, podman cannot mount
volumes read-only (issue #2312). This is baffling, and since
it's not easily reproducible it's likely that the dev team
will not spend much effort on it. Workaround: instead of bind-
mounting /tmp read-only, bind-mount a *tempdir* (subdirectory)
read-write. This is actually cleaner in some ways but it
leads to complications with the paths we use and with cleanup.

Next, allow overriding the default image and allow asking
for no sudo:

    export GCLOUD_IMAGE=quay.io/edsantiago/gcloud_centos:latest
    export GCLOUD_SUDO=

(yes, that's an equal-sign and EOL. Just an empty string).

The third part, unfortunately, requires a custom image because
the as_dollar_user.sh script (the one that runs gcloud in a
container) is hardwired in a cevich image and needs tweaks
in order to detect rootless and avoid sudo.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-02-13 05:27:56 -07:00
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
d0876282a4 Cirrus: Consolidate VM image names in once place
Previously it was not possible to specify keys from the ``env`` section
in the various GCE sections.  Now that features is added, consolidate
all the cache image definitions into a single place, reducing
maintenance burden.

This also results in the names passing through into the VMs. This is
useful, e.g. for future tracking of image usage statistics.

Update get_ci_vm script hints for new image name definition format

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-17 13:30:06 -05:00
8ee7eb472d [skip ci] Hack: Fix get_ci_vm.sh w/ gcloud ssh/scp
Previously, using the ssh command directly required obtaining the
external IP of the VM and was then subject to the local configuration.
If the local configuration and/or ssh keys are incorrect, these commands
would fail, preventing automatic setup of the VM.

Fix this by using the gcloud ssh and scp wrappers.  Unfortunately rsync
couldn't be made to work in this situation, so use a tarball to transfer
the local repository to the VM.  Lastly, execute `setup_environment.sh`
script, then drop the caller into a bash shell sitting in the remote
`$GOSRC` directory.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-14 10:45:12 -05:00
75578aad61 add container-init support
Add support for executing an init binary as PID 1 in a container to
forward signals and reap processes.  When the `--init` flag is set for
podman-create or podman-run, the init binary is bind-mounted to
`/dev/init` in the container and "/dev/init --" is prepended to the
container's command.

The default base path of the container-init binary is `/usr/libexec/podman`
while the default binary is catatonit [1].  This default can be changed
permanently via the `init_path` field in the `libpod.conf` configuration
file (which is recommended for packaging) or temporarily via the
`--init-path` flag of podman-create and podman-run.

[1] https://github.com/openSUSE/catatonit

Fixes: #1670
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-04 11:42:03 +01:00
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
08cab4ad3a remove hack/dind
The docker-in-docker was script was needed to run AppArmor tests in
Travis, which is not required anymore since Travis isn't being used
for a while.  Removing the script will also cure some hiccups on
some atomic testing nodes.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
2018-10-10 18:05:50 +02:00
8569ed0305 AppArmor: runtime check if it's enabled on the host
Check at runtime if AppArmor is enabled on the host.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1128
Approved by: mheon
2018-07-23 18:11:09 +00:00
1219a3cab3 build: enable ostree in containers/storage when available
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1071
Approved by: rhatdan
2018-07-11 17:26:21 +00:00
06ab343bd7 podman/libpod: add default AppArmor profile
Make users of libpod more secure by adding the libpod/apparmor package
to load a pre-defined AppArmor profile.  Large chunks of libpod/apparmor
come from github.com/moby/moby.

Also check if a specified AppArmor profile is actually loaded and throw
an error if necessary.

The default profile is loaded only on Linux builds with the `apparmor`
buildtag enabled.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1063
Approved by: rhatdan
2018-07-11 16:36:24 +00:00
7a5c376e63 Makefile: Use 'git diff' to show gofmt changes
This makes fixing errors easier.  Before this commit, errors looked
like [1]:

  $ make gofmt
  libpod/container_linux.go:1:⚠️ file is not gofmted with -s (gofmt)
  make: *** [gofmt] Error 1

But that's not very helpful when your local gofmt thinks the file is
fine.  With this commit, errors will look like:

  $ make gofmt
  find . -name '*.go' ! -path './vendor/*' -exec gofmt -s -w {} \+
  git diff --exit-code
  diff --git a/libpod/container_internal.go b/libpod/container_internal.go
  index df4de3fe..22b39870 100644
  --- a/libpod/container_internal.go
  +++ b/libpod/container_internal.go
  @@ -1,7 +1,7 @@
   package libpod

   import (
  -"bytes"
  +       "bytes"
          "context"
          "encoding/json"
          "fmt"
  make: *** [Makefile:87: gofmt] Error 1

(or whatever, I just stuffed in a formatting error for demonstration
purposes).

Also remove the helper script in favor of direct Makefile calls,
because with Git handling difference reporting and exit status, this
becomes a simpler check.  find's -exec, !, and -path arguments are
specified in POSIX [2].

[1]: https://travis-ci.org/kubernetes-incubator/cri-o/jobs/331949394#L1075
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #1038
Approved by: rhatdan
2018-07-03 10:39:54 +00:00
564578989b hack/ostree_tag.sh: Fill in OSTree dependencies
Copying the libraries from:

  $ git grep pkg-config vendor/github.com/containers/image/
  vendor/github.com/containers/image/ostree/ostree_dest.go:// #cgo pkg-config: glib-2.0 gobject-2.0 ostree-1 libselinux
  vendor/github.com/containers/image/ostree/ostree_src.go:// #cgo pkg-config: glib-2.0 gobject-2.0 ostree-1

We need all of those to compile the vendored Go dependency, not just
ostree-1.

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #958
Approved by: giuseppe
2018-06-18 19:16:08 +00:00
cb430d58e6 hack/release.sh: Add a guard against -dev suffixes for argv[2]
Because it's easier to recover from that if we fail early instead of
going through and creating a "Bump to v1.2.3-dev-dev" commit, etc.

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #926
Approved by: rhatdan
2018-06-10 10:51:11 +00:00
96dc5fd0d5 hack/release.sh: Bump spec in dev_version_commit
Bump it to the next version (without a -dev suffix), based on the
precedent set by 70672652 (Bump to v0.6.1-dev, 2018-05-25, #834).
Previously I had VERSION there, which was a copy/paste error.

I've also added an explicit write_spec_version to release_commit.
That *should* be a no-op, with the spec version having already been
set by the previous release's dev_version_commit.  But better to be
safe than to cut a release with the wrong version number in the spec
file (e.g. maybe we guessed NEXT_VERSION wrong during the last
release).

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #879
Approved by: mheon
2018-06-01 21:39:45 +00:00
500b94968b hack/release.sh: No longer need to bump setup.py
Since 727ecfea (Use Version from spec file in setup.py, 2018-05-18, #807),
setup.py has been pulling this from a PODMAN_VERSION environment
variable (which can be set in spec files), and there's no need for us
to bump it as part of our releases.

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #879
Approved by: mheon
2018-06-01 21:39:45 +00:00