Commit graph

365 commits

Author SHA1 Message Date
Wong Hoi Sing Edison f53812a11e
Cleanup nix derivation for static builds
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
2020-07-18 09:03:28 +08:00
Matthew Heon 237fe441b3 Remove outdated seccomp policy
Some time ago, we moved the Seccomp policy (and related setup
code) to a place where all our tools could share it [1]. We did
not, however, remove the in-repo seccomp.json file. Over the last
year or so, the in-repo seccomp policy has become progressively
more and more outdated, with no effort made to maintain it
(because what sense is there in keeping a duplicate?). Today, a
friend came to me and asked if a Podman container could access
keyctl, assuming it could not because he was reading the outdated
Seccomp policy which does not allow it. Since it's becoming clear
that this file is doing no good and actively causing confusion,
let's just drop it.

[1] https://github.com/seccomp/containers-golang

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-07-13 16:35:04 -04:00
Daniel J Walsh a10da9a999
Add containers.conf default file for windows and MAC Installs
We want to add this configuration file so that users can descover
how to configure the permanent connection to a remote podman instance.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-24 12:58:44 -04:00
Ed Santiago aa16a0aab1 system tests: invoke with abs path to podman
Reversion of one part of #6679: my handling of 'realpath'
would not work when $PODMAN is 'podman-remote --url etc'.
Trying to handle that case got unmaintainable; so instead
let's just force 'make {local,remote}system' to invoke
with a full PODMAN path. This breaks down if someone
runs the tests with a manual 'bats' invocation, but I
think I'm the only one who ever does that.

Since podman path will now be very long in the logs,
add code to logformatter to abbreviate it like we do
for the ginkgo logs.

And, one thing that has bugged me for a long time:
in the error logs, show a different prompt ('#' vs '$')
to distinguish root vs rootless. This should make it
much easier to see at-a-glance whether a log file
is root or not. Add tests for it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-23 08:10:57 -06:00
Lokesh Mandvekar 78bd0e0a63 Makefile: allow customizable GO_BUILD
This will let me use a customizable GO_BUILD so that I can run build
targets for deb packages

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-06-22 09:59:30 -04:00
Lokesh Mandvekar 30c0fc9f12 Makefile: install.varlink needs to create dirs
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-06-17 15:58:11 -04:00
Ed Santiago 15f273b931 WIP: Enable (and disable) remote testing
podman-remote has not been tested. A principal part of the
problem was #5387 - the YAML I wrote did not have the
intended effect, it did not set TEST_REMOTE_CLIENT=true
and because of my multiple iterations I did not catch this
during testing.

Part 1 of this PR is to fix .cirrus.yml to enable remote tests.

Part 2 -- what I had first noticed and tried to fix -- is that
rootless_test.sh was never running remote because, of course,
envariables are not sent via ssh. I reworked integration_test.sh
and rootless_test.sh to use a command-line decision instead.

Part 3, sigh, is to disable one failing integration test
and *all* system tests, because so many of the latter are
failing. Addressing those failures needs to be done in
subsequent PRs. Issues #6538, #6539, #6540 are filed for
some of the problems I isolated. There will be more.

Also, minor, fixed some stale references to varlink.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-09 12:43:58 -06:00
Valentin Rothberg b6148b6576 force bats version to v1.1.0
We experienced regression when using the latest `v1.2.0-dev` bats in
Ubuntu 20.04 (see github.com/containers/libpod/pull/6418).  Using
bats v1.1.0 worked in the Ubuntu test VM.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-08 15:21:34 +02:00
Daniel J Walsh 9263ed2ab1
Remove use of ABISupport buildtag
We need to default to building podman. If you specify no build
tags you will not build podman, not podman-remote.

Just using remote flag to indicate podman-remote and !remote for
podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-03 15:11:34 -04:00
Lokesh Mandvekar 8a914e8a0b default build without varlink tag
Issue gh#6286 was already fixed in a prior commit but the Makefile still
ran some varlink steps by default.

This commit makes any varlink build steps dependent on the varlink
build tag and also makes the contrib rpm spec file independent of
varlink.

Endpoint tests will be run only if BUILDTAGS contains varlink.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-05-29 14:38:33 -04:00
Daniel J Walsh 911b6d8b48
Vendor in containers/common v0.12.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-28 16:58:53 -04:00
Daniel J Walsh f8632bad82
Fix builds on 32 bit arches
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-27 09:52:36 -04:00
Ed Santiago b81b865b52 podman-registry: many unrelated fixes
1) fix lost credentials.

    must_pass(), added in #6375, eats the credentials
    generated via 'podman run --entrypoint htpasswd'.
    Run that podman instance directly, and add explicit
    error check.

    (The error and stdout/stderr handling here has gotten
    cumbersome. There must be something I'm missing that
    could make it all simpler.)

 2) fix default podman path.

    When setting $PODMAN, default to the locally built
    one -- there may not be one in $PATH (e.g. in
    Ubuntu, see #6366). This in turn requires us to:

 3) run registry test in integration, not unit test

    It looks like unit tests run before podman is built,
    causing a chicken-egg dilemma. Try to solve that by
    running the new hack/podman-registry-go test in
    integration tests, not unit tests.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-05-26 08:21:46 -06:00
Lokesh Mandvekar 7d64258b94 Makefile: customizable $REMOTETAGS
This change will allow the builder to specify custom REMOTETAGS.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-05-24 06:20:17 -04:00
Brent Baude 8ec08a426e v2 enable remote integration tests
enable remote integration tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-19 14:26:19 -05:00
Daniel J Walsh 46b13d4d61
Fix REMOTETAGS
Handle REMOTETAGS the same way for all remote commands.

This fixes issues where remote commands are not building correctly on rhel7 and centos7 systems.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-14 09:53:40 -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
Sascha Grunert c21258b70e
Add podman static build
We’re now able to build a static podman binary based on a custom nix
derivation. This is integrated in cirrus as well, whereas a later target
would be to provide a self-contained static binary bundle which can be
installed on any Linux x64-bit system.

Fixes: https://github.com/containers/libpod/issues/1399

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-05-11 13:11:07 +02:00
OpenShift Merge Robot e12cc5a3b3
Merge pull request #6136 from liuming50/fix-a-makefile-dependency-issue
Makefile: fix a dependency issue
2020-05-08 17:36:23 +02:00
Ming Liu f339587185 Makefile: fix a dependency issue
Instead of being depended by docs, targets '.install.md2man' and
'docdir' should be depended by 'MANPAGES', or else the path
'docs/build/man' or 'GOMD2MAN' might not exist when it tries to
generate files in it.

This fixes a following build error:
| open docs/build/man/podman-volume-ls.1: no such file or directory
| Makefile:377: recipe for target 'docs/source/markdown/podman-volume-ls.1' failed
| make: *** [docs/source/markdown/podman-volume-ls.1] Error 1
| make: *** Waiting for unfinished jobs....
| open docs/build/man/podman-init.1: no such file or directory
| Makefile:377: recipe for target 'docs/source/markdown/podman-init.1' failed

Signed-off-by: Ming Liu <ming.liu@toradex.com>
2020-05-08 14:57:58 +02:00
Daniel J Walsh b27aa5f81b
Add podman-remote-static target
We should not be building podman-remote with the BUILDTAGS, these
only effect server side.

CRC Group wants to use a static version of podman-remote in order
to install the same podman-remote client on any Linux box.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-07 16:47:56 -04:00
Lokesh Mandvekar c10bd7c11f Makefile: include -nobuild install targets
Distro packaging often uses non-default build and linker flags.
The current Makefile cannot be used in the package build process as it
will end up rebuilding the binaries with the default flags.

This commit introduces install targets which do not depend on the build
targets. Distro packages should prefer these if they want to use any
non-default flags.

NOTE: This commit effectively leaves prior targets unchanged, so users
won't notice any difference.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-04-23 13:08:25 -04:00
Ed Santiago 0e45637a97 Makefile: fix broken chcon for podman-remote
The install.remote target looks like it was copy-pasted
from install.bin and missed a spot.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-21 07:52:43 -06:00
Anatoli Babenia a58c59f401 Make find ignore dot files
There is no need to search for sources in hidden dirs. In my case
there are files from development environment that stand in the way.

Signed-off-by: Anatoli Babenia <anatoli@rainforce.org>
2020-04-20 07:26:55 +03:00
Brent Baude 241326a9a8 Podman V2 birth
remote podman v1 and replace with podman v2.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-16 15:53:58 -05:00
Ed Santiago ba26c763c5 swagger-check: new CI tool to cross-check swagger
New script cross-references r.Handle() and r.HandleFunc()
calls against the preceding '// swagger:operation' comments,
and exits failure (with descriptive error messages) if any
comments do not match the code.

This script should not be necessary: the swagger comments
should be autogenerated from the source code.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-14 11:27:44 -06:00
OpenShift Merge Robot 555b30e9eb
Merge pull request #5634 from jwhonce/wip/service
V2 podman system service
2020-04-09 14:55:45 +02:00
Miloslav Trmač 439485f096 Fix (make vendor)
(export a=b command args) does not run (command args) with a=b,
it sets $a to b, and marks variables $a $command $args as exported,
i.e. (command args) is not run.

So we were not actually running (go mod tidy).

Fix that.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-04-08 20:42:02 +02:00
Jhon Honce e0847f5457 V2 podman system service
* Added support for system service
* Enabled linting on the varlinkapi source, needed to support V2
  service command
* Added support for PODMAN_SOCKET

Skip linting deprecated code

Rather than introduce bugs by correcting deprecated code, linting the
code is being skipped. Code that is being ported into V2 is being
checked.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-07 19:22:10 -07:00
Jhon Honce 7a12e01556 V2 Move varlink home
* move cmd/podman/varlink/* to pkg/varlink to support podmanV2 refactor
* update Makefile
* reformatted all impacted code

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-30 08:18:35 -07:00
Daniel J Walsh 8ab686f0e0
Add APIV2 service files
Also fix issue in pods_test.go

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-20 09:09:42 -04:00
OpenShift Merge Robot 49a7856f2e
Merge pull request #5465 from edsantiago/man_page_option_checker
New test: man page cross-ref against --help
2020-03-19 16:53:02 +01:00
Daniel J Walsh fea5f913e3
Don't include SUBDIR in windows.zip
The zip file should returne podman.exe plus the documentation
directory.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-19 08:57:54 -04:00
Ed Santiago 81005f463e New test: man page cross-ref against --help
New hack/xref-helpmsgs-manpages script, added to CI 'gate'
task, runs 'podman [subcommand] --help' and cross-references
against man pages in docs/source/markdown/podman*.1.md

See #5453 and #5460 for instances of the problems the
script has found.

The careful reader will find an alarming number of special-case
bypasses. These are a tradeoff I am making: to get perfect
coverage with no handwaving, it would be necessary to make
drastic changes to some man pages, and I believe those would
be counterproductive.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-18 11:03:26 -06:00
Brent Baude 2c85674773 build for amd64|arm|ppc64le
to protect against architecture specific build regressions, we cross compile for multiple architectures

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-10 13:57:53 -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
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
Daniel J Walsh 00e9db0822
Add installation of pre-commit to Makefile
pre-commit is required for running certain tests by the Makefile.
Adding pre-commit to install.tools allows users to easily use
and test podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-18 16:59:31 -05:00
Valentin Rothberg 51e0a8b1c3 Make: s/uname -o/uname -s/
uname -o doesn't seem to work on Mac OS.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-11 12:53:42 +01:00
Max Goltzsche c588ae1428
Fix varlink code generation target.
Closes #5130.

varlink code generation was skipped when `uname -o` did not print "GNU/Linux".
However on some Linux systems (e.g. alpine) only "Linux" is printed
which results in cmd/podman/varlink/iopodman.go not being generated.
Thus the Makefile target condition has been changed to match "Linux".

Signed-off-by: Max Goltzsche <max.goltzsche@gmail.com>
2020-02-09 21:25:59 +01:00
Brent Baude 0577493688 {CI:DOCS] run gofmt before lint
the linting task identifies gofmt issues; therefore it makes more sense to run our make gofmt first, which actually fixes the gofmt issues.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-04 13:15:22 -06:00
Chris Evich dbb9d098b5
Cirrus: Fix gate task + make lint|validate
A recent Makefile change (4ec893a748) removed a side-effect necessary
for 'make validation' to pass under automation.  Making things worse,
change 12bd7e927c was found upon investigation to always point at
the latest upstream HEAD.  However, this is rarely a fork-point for
pull-requests.  Further investigation showed the built-in Cirrus-CI,
golang-based git does not obtain sufficient data for the Makefile
command `git merge-base HEAD $${DEST_BRANCH:-master}` to function
properly (in the context of the gate container).

Fix this by customizing the clone operation and slightly adjust the
Makefile command to function as intended in the gate container.  Also
add checks to the validate and lint targets which validate the
variable EPOCH_TEST_COMMIT value is never an empty string or whitespace.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-03 16:23:46 -05:00
Sorin Sbarnea 5190407619 Assure validate includes lint
Fixed issue where lint was not run on CI, so we missed to prevent regressions.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2020-01-30 18:39:56 +00:00
Valentin Rothberg 4ec893a748 speed up Makefile
Speed up the Makefile by removing variable references from the release
targets.  Now, the variables will only be (lazily) evaluated when they
are actually needed and not for each invocation of the Makefile which
has it down considerably.

Fixes: #4829
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-30 08:44:34 +01:00
Valentin Rothberg 7b14c02d0d Makefile: systemd: echo instead of warn
Just echo the message instead of warning to not impact the exit code.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-30 08:44:34 +01:00
Valentin Rothberg 79ceb31edf Makefile: remove redundant BUILDFLAGS
We don't set it, so there's no need to keep it.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-30 08:44:34 +01:00
Valentin Rothberg 9fa8b723c8 Makefile: consistent PHONY use
Add a .PHONY line over each target instead of mixing this notation with
a separate but incomplete single list.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-30 08:44:26 +01:00
Valentin Rothberg 0428eb6111 Makefile: remove dead vagrant target
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-30 08:44:10 +01:00
Valentin Rothberg 5aadd45f7c Makefile: move systemd buildtag check
Move the systemd-buildtag check into the `bin/podman` target.
No need to execute the check for all invocations of the
Makefile.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-30 08:44:10 +01:00
OpenShift Merge Robot 8241c1ae94
Merge pull request #5011 from vrothberg/fix-4814
run `varlink_generate` on Linux only
2020-01-29 05:49:47 -08:00