Commit graph

71 commits

Author SHA1 Message Date
Lokesh Mandvekar 687b165a73 use $GO env-var instead of hard-coded go binary
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

Closes: #817
Approved by: TomSweeneyRedHat
2018-05-21 17:53:07 +00:00
baude 390bd16d37 tidy up the copr spec
on os's (like centos) where python3 might not be installed, do not attempt to build
the python3 varlink client.  varlink python is only supported on python3.

also, change the conditions for f28 to match the fedora official specs.

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

Closes: #813
Approved by: baude
2018-05-21 17:19:14 +00:00
Daniel J Walsh 9d7c50aa03 Tighten the security on the podman varlink socket
We only want root to be allowed to access this socket.
Also move socket to /run/podman directory.  This requires
us to drop a podman.conf tmpfiles.d file.

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

Closes: #806
Approved by: mheon
2018-05-19 07:47:03 +00:00
Matthew Heon 133df588a6 Update gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-18 12:42:09 -04:00
W. Trevor King ea4156108d hooks/docs: Add oci-hooks.5 and per-package man page building
This allows us to reference the hooks docs from podman(1) in a way
that will survive system installation.  The downside is that the
GitHub rendered pages become less usable, now that we can no longer
embed links as freely as we could before.

I've followed the "Sections within a manual page" suggestions from
[1].

locale(7) is [2], which is Linux-specific.  Even section numbering is
platform-dependent [3], so it's unlikely that these external man
references are particularly portable.  Platform packagers can adjust
our local references to match their target system, but that leaves the
GitHub rendering in an awkward place.  For now, I think a
Linux-centric GitHub rendering without clickable links may be the best
we can do without moving away from go-md2man.

As far as I can tell, there's not a nice way to get go-md2man to wrap
the links in SEE ALSO without sometimes hyphenating a URL (which makes
it harder for man-page readers to copy/paste those links into their
browser).

I've also fixed some "extention" -> "extension" typos.

[1]: http://man7.org/linux/man-pages/man7/man-pages.7.html
[2]: http://man7.org/linux/man-pages/man7/locale.7.html
[3]: https://en.wikipedia.org/wiki/Man_page#Manual_sections

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

Closes: #772
Approved by: mheon
2018-05-17 18:22:10 +00:00
W. Trevor King 624660c1b3 Makefile: Use ?= for shell variables (ISODATE, etc.)
Previously, Make would execute these shell commands even if we didn't
need the resulting variable.  With ?='s recursive expansion [1], we
only expand the variable when it's consumed.  For example, the ISODATE
variable is only needed in the recipe for the changelog target, so
most Make invocations won't need the value, and the computation is
just making whatever Make actually is doing slower.

I've shifted the GIT_COMMIT and BUILD_INFO values over to
LDFLAGS_PODMAN, because the test/*/* targets don't care about those.
I've also moved the Go-specific -ldflags from the variables into the
recipes themselves, because callers probably expect C semantics for
LDFLAGS and not Go's wrapper.  That means that there's no longer a
need for the LDFLAGS/BASE_LDFLAGS separation, so I'm just using
LDFLAGS (and LDFLAGS_PODMAN) now.  That reduces the declared variables
to just LDFLAGS_PODMAN, so I've shifted that declaration up to get it
closer to its GIT_COMMIT and BUILD_INFO precursors.

[1]: https://www.gnu.org/software/make/manual/html_node/Setting.html

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

Closes: #777
Approved by: rhatdan
2018-05-17 00:18:43 +00:00
W. Trevor King db388b1949 Makefile: Respect GOBIN
And use 'go env GOBIN' to detect the user's existing preference.  From
[1]:

> The bin directory holds compiled commands.  Each command is named
> for its source directory, but only the final element, not the entire
> path.  That is, the command with source in DIR/src/foo/quux is
> installed into DIR/bin/quux, not DIR/bin/foo/quux.  The "foo/"
> prefix is stripped so that you can add DIR/bin to your PATH to get
> at the installed commands.  If the GOBIN environment variable is
> set, commands are installed to the directory it names instead of
> DIR/bin.  GOBIN must be an absolute path.
> ...
> Go searches each directory listed in GOPATH to find source code, but
> new packages are always downloaded into the first directory in the
> list.

So if GOBIN is set, it will be non-empty, and we can use $(GOBIN)/...

If GOBIN is unset, 'go env GOBIN' will return an empty string (as it
does on Travis [2]).  In that case, I'm assuming that the package in
question is in the first directory in GOPATH and using the new
FIRST_GOPATH (firstword and subst are documented in [3]).  That's
probably fairly safe, since our previous GOPATH handling assumed it
only contained a single path, and nobody was complaining about that.

Using ?= allows us to skip the 'dirname' call if we end up not needing
GOPKGBASEDIR [4] (e.g. for the 'help' target).  The recursive
expansion could cause an issue if the result of the shell expansions
included a '$', but those seem unlikely in GOPKGBASEDIR, GOMD2MAN, or
the manpage paths.  I haven't used ?= for GOBIN, because we'll always
need the expanded value for the if check.

Using GOMD2MAN allows us to collapse old ||-based recipe into a less
confusing invocation.  And using a static pattern rule [5] for
$(MANPAGES) lets us write a single rule to handle both section 1 and
section 5.

While I was updating the GOPATH handling, I moved .gopathok from the
possibly-shared $(GOPATH)/.gopathok to the
definitely-specific-to-this-project .gopathok.  That may cause some
issues if you rebuild after changing your GOPATH without calling
'clean', but I don't expect folks to change their GOPATH frequently.
And the old approach would fail if different consumers were also using
the same flag path to mean something else (as CRI-O does [6]).

As part of cleaning up .gopathok, I've also collapsed clean's rm calls
into a single invocation.  That will give us the same results with
less process setup/teardown penalties.

[1]: https://golang.org/cmd/go/#hdr-GOPATH_environment_variable
[2]: https://travis-ci.org/projectatomic/libpod/jobs/379345071#L459
[3]: https://www.gnu.org/software/make/manual/html_node/Text-Functions.html
[4]: https://www.gnu.org/software/make/manual/html_node/Setting.html
[5]: https://www.gnu.org/software/make/manual/html_node/Static-Usage.html
[6]: https://github.com/kubernetes-incubator/cri-o/blob/v1.10.1/Makefile#L62

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

Closes: #774
Approved by: mheon
2018-05-16 17:31:55 +00:00
W. Trevor King 5b2627dd77 Makefile: Drop find-godeps.sh for podman target
We inherited this from a031b83a (Initial checkin from CRI-O repo,
2017-11-01), but:

* The output is actually going into bin/podman, so Make will rebuild
  this target every time.  You'll never be able to save compilation
  because the target is newer than all the prerequisites.

* Make expands prerequisites immediately when loading a Makefile [1],
  and on my wimpy Chromebook SD Card, this is *slow*:

    $ time hack/find-godeps.sh ~/.local/lib/go/src/github.com/projectatomic/libpod cmd/podman github.com/projectatomic/libpod
    ...
    real    0m56.225s
    user    0m44.918s
    sys     0m21.918s

* Go is pretty good at this on its own, so having make call 'go build'
  every time will almost certainly be faster than us trying to mimic
  this in a shell script.  And by punting to Go in the recipe, Make
  invocations that do not need the podman target (e.g. 'make help')
  can skip the dependency lookup entirely.

[1]: https://www.gnu.org/software/make/manual/html_node/Reading-Makefiles.html#Rule-Definition

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

Closes: #776
Approved by: rhatdan
2018-05-16 15:42:34 +00:00
Jhon Honce 1aaf8df5be Refactor libpod python varlink bindings
- More pythonic
- Leverage context managers to help with socket leaks
- Add system unittest's
- Add image unittest's
- Add container unittest's
- Add models for system, containers and images, and their collections
- Add helper functions for datetime parsing/formatting
- GetInfo() implemented
- Add support for setuptools
- Update documentation
- Support for Python 3.4-3.6

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

Closes: #748
Approved by: baude
2018-05-16 14:01:10 +00:00
Matthew Heon 266fe390c2 Update gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-11 13:22:18 -04:00
baude 25263558f1 Generate varlink API documentation automatically
Using varlink's idl parser, we generate API documentation for the podman
API relying on the .varlink file as the source.

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

Closes: #734
Approved by: baude
2018-05-08 21:01:28 +00:00
Matthew Heon d04ebf8419 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-04 11:36:36 -04:00
TomSweeneyRedHat 9fc85522fb Add directory for systemd socket and service if not present
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #717
Approved by: baude
2018-05-03 19:39:41 +00:00
baude c8c39779a7 correct varlink command in service file
The struct of the varlink command changed to accept a URI
as input.  This was never updated in the service file

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

Closes: #691
Approved by: mheon
2018-04-30 20:45:33 +00:00
Matthew Heon d9cced240b Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-04-27 17:25:27 -04:00
baude a824186ac9 Use buildah commit and bud in podman
Vendor in buildah and use as much of commit and bug as possible for podman
build and commit.

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

Closes: #681
Approved by: mheon
2018-04-27 20:51:07 +00:00
baude 39a7a773a6 varlink images
implement varlink image functions for working with libpod with the exception of a
couple due to incompletions on the libpod side of things (build).

also, created a first pass at a libpodpy package which will stand as a client to
working with libpod's varlink methods using python.

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

Closes: #669
Approved by: baude
2018-04-26 19:14:44 +00:00
baude 58cb8f742b updated epoch for bad dco
Signed-off-by: baude <bbaude@redhat.com>

Closes: #673
Approved by: mheon
2018-04-25 21:44:27 +00:00
Harald Hoyer 57359619e8 Only generate the varlink glue code if needed and from the vendor dir
Closes: #671
Approved by: baude
2018-04-25 19:49:42 +00:00
Giuseppe Scrivano 9c518eb8b4 Makefile; make podman depend on varlink_generate
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #663
Approved by: baude
2018-04-24 15:51:07 +00:00
Daniel J Walsh c78ce0e8fd
Merge pull request #641 from nathwill/man-libpod
add libpod.conf man page (closes #537)
2018-04-23 20:49:30 -04:00
baude 8493dba23c Initial varlink implementation
Signed-off-by: baude <bbaude@redhat.com>

Closes: #627
Approved by: mheon
2018-04-23 14:29:45 +00:00
Nathan Williams 79f08c4699 add libpod.conf man page
Signed-off-by: Nathan Williams <nath.e.will@gmail.com>
2018-04-21 22:37:21 -07:00
Matthew Heon 97ce49681a Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-04-20 11:41:29 -04:00
baude 7580b1c204 Add make .git target
Runs gomfmt and gitvalidation

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

Closes: #589
Approved by: mheon
2018-04-20 14:30:37 +00:00
Matthew Heon df9ebb024d Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-04-13 14:51:23 -04:00
Matthew Heon 782cf60ebb Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-04-05 13:10:29 -04:00
Marcos Paulo de Souza f41dc0b258 Makefile: Fix typo podmon -> podman
This typo was introduced in 3aa63b2b

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>

Closes: #578
Approved by: rhatdan
2018-04-02 20:16:06 +00:00
Matthew Heon 567902542e Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-03-29 13:33:09 -04:00
Matthew Heon 6a0282a609 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-03-23 14:00:15 -04:00
Valentin Rothberg 9416e2d784 Makefile: add changelog target
Maintaining a changelog for each new version or release of Podman helps
users to quickly skim for new changes.  Add a `make changelog` target to
facilitate creating a new log.

There are two env variables to control the base and target commit for
the new log.  The output gets prepended to the changelog.txt file, which
is a textfile in following format:
- Changelog for $(CHANGELOG_TARGET) (ISO-8601 DATE):
  * Commit subject
  * Commit subject...

Notice that the list of commit subjects excludes merge commits, and can
be manually modified after generation if needed.

`CHANGELOG_BASE=v0.3.2 CHANGELOG_TARGET=v0.3.3 make changelog` would
generate the following shortened output to the changelog.txt file:

Changelog for v0.3.3 (2018-03-17):
  * Bump to v0.3.3
  * Fix build after c/image changes
  * Update containers/image
  * Fix E2E tests
  * Address review comments
  * Fix E2E tests
  * Add restart to main podman manpage
  * Add podman restart to podman bash completions and commands

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
2018-03-21 13:44:35 +01:00
Matthew Heon bd687aaac1 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-03-16 11:06:08 -04:00
Valentin Rothberg 3fe87b011d make shell: build, test and run in a container
Some of the paths in the e2e tests are hard-coded, which complicates
testing a bit on systems with different paths for runc, conmon, etc.
Add a make shell target to the Makefile, which will build and run the
libpod containers, giving a shell to the user in which podman can be
built, run, tested etc.

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

Closes: #481
Approved by: rhatdan
2018-03-13 17:18:23 +00:00
Matthew Heon 80723e4b9b Update gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-03-09 10:08:32 -05:00
Matthew Heon 04d56c9fe3 Update test-related makefile targets
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #460
Approved by: rhatdan
2018-03-08 08:54:32 +00:00
baude f57b7bbf43 Do not strip binaries
We should not strip binaries in Make. That should be left to packages.  Also,
we can not debug stripped binaries so this allows us to debug better as well.

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

Closes: #459
Approved by: rhatdan
2018-03-07 20:57:19 +00:00
Matthew Heon 32be712cd3 Change standard config path and add override config
The standard config has moved to /usr/share/containers/ per
discussion. An override configuration file is allowed at the
previous /etc/containers/ location. This override will be used in
place of the normal config if both are present, and exists to
override distro packaged configs without modifying the standard
config.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
2018-03-06 01:21:09 +00:00
Matthew Heon d589c9fc38 Add support to load runtime configuration from config file
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
2018-03-06 01:21:09 +00:00
baude 4f4a78abb4 networking.go tweak iptables functions
Took duplicated code and merged it into the helper function so only a single
exec was executed.

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

Closes: #446
Approved by: mheon
2018-03-03 19:45:24 +00:00
Matthew Heon bd7de5d5dd Bump to v0.3.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-03-02 15:38:34 -05:00
baude 45478b7843 Re-enable copr builds
New structure for copr builds which hopefully is more stable

Signed-off-by: baude <bbaude@redhat.com>
2018-02-28 13:08:35 -06:00
baude 586bb86a2a Run podman inside a podman container
We should be able to run nested podman containers in particular
for our testing environment. i.e. eat our own dog food.

Some privileges had to be corrected in order for this to work
correctly.

Added a third papr target that runs podman tests inside podman.  I
marked the test as not required right now as we get more confident
in the results

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

Closes: #340
Approved by: rhatdan
2018-02-16 18:35:54 +00:00
Matthew Heon bc1d25bb19 Remove last traces of old version scheme
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #345
Approved by: rhatdan
2018-02-16 18:14:33 +00:00
baude 773aa61f66 Revert to md2man master
Upstream md2man is working again.  We can revert to using it instead
of a specific commit id.

Also, add make integration.CentOS for testing

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

Closes: #320
Approved by: rhatdan
2018-02-10 11:24:16 +00:00
baude 4ea26aace4 libpod/finished_amd64.go -> libpod/finished64.go
Rename finished_amd64 to finished64.go to more accurately reflect
that it covers all 64bit arches.

Also, bumped the EPOCH for gitvalidation to speed up validations.

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

Closes: #318
Approved by: mheon
2018-02-09 17:00:04 +00:00
baude c089cb9c92 Final ginkgo migration
Completion of the migration from bats to ginkgo.  This includes:

* load
* mount
* pause
* port
* run_networking
* search

Note: build will be done within a different PR

Signed-off-by: baude <bbaude@redhat.com>
2018-02-08 12:37:07 -06:00
baude 3609b82fe6 Migrate diff, exec, export, and history to ginkgo
Migrate the diff, exec, export, and history bats tests to
the ginkgo test suite.

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

Closes: #287
Approved by: baude
2018-02-05 20:17:37 +00:00
baude dd133a1ad2 Initial gingko work
This implements the ginkgo integration test framework for
podman.  As tests are migrated from bats to ginkgo, we will
still run both integration suites.  When a test is migrated,
we remove the tests from bats at that time.  All new tests
should be just for the ginkgo framework.

One exception is that we only run the ginkgo suit in the
travis/ubuntu environment.  The CentOS and Fedora PAPR nodes
will more than cover those.

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

Closes: #261
Approved by: baude
2018-01-29 19:12:20 +00:00
Daniel J Walsh 3aa63b2b94 Remove conmon, get package from CRI-O
conmon should not be built in two different places.
conmon is now a separate package in Fedora so we can just
add requires, for use on Ubuntu we can just require cri-o to
be installed.

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

Closes: #151
Approved by: mheon
2018-01-27 06:48:20 +00:00
baude 946b4ced54 Enable port bindings
Set up nbetworking ports for the following use cases:

* bind the same port between host and container
* bind a specific host port to a different container port
* bind a random host port to a specific container port

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

Closes: #214
Approved by: baude
2018-01-20 18:51:21 +00:00