Commit graph

367 commits

Author SHA1 Message Date
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
Valentin Rothberg 633610769e run varlink_generate on Linux only
Running the `varlink_generate` make target on non-Linux machines is not
supported, so restrict it to Linux only.

Fixes: #4814
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-29 12:17:42 +01:00
Brent Baude 54587335be [CI:DOCS]Binding overhauls
Add binding for networks and begin documentation for binding methods for godoc.  Also, add major functions to their own subpackages so reduce the amount of of method confusion.  So instead of: bindings.ListImages(), we now do a [bindings].images.List().

Also, the connection is passed to each binding method via a context to allow for future growth.

Lastly, add first set of tests.  There are a couple of things to work out for rootless tests yet.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-28 08:42:18 -06:00
Daniel J Walsh 4ab6a10d0c
Add link from docker.sock to podman.sock
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-27 09:52:25 -05:00
baude d4c2aaf38a Add service endpoint
add service endpoint for the new API.  Also supports the varlink
implementation.

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

Refactor to allow developer more control of API server

* Add api.NewServerWithSettings() to create an API server with custom
  settings
* Add api.ListenUnix() to create a UDS net.Listener and setup UDS

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

More service completion

Add podman service command that allows users to run either a RESTful or
varlink protocol API service.

Addition of docs and RESTful listening.

Signed-off-by: baude <bbaude@redhat.com>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-21 16:35:45 -06:00
baude 9be6f30a42
post-process swagger yaml for publish
Signed-off-by: baude <bbaude@redhat.com>
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-01-17 15:41:33 -05:00
Valentin Rothberg c3d90179dc make binaries: include service
Include the service into make binaries such that we're it's being build
in the CI.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-16 14:05:39 +01:00
OpenShift Merge Robot e1e405b70d
Merge pull request #4807 from ssbarnea/fix/pre-commit
Enable pre-commit linting
2020-01-15 23:51:22 +01:00
Valentin Rothberg b830d3eb07 make .install.golangci-lint: force specific version
Instead of only performing a presence check of the binary, also do a
version check and force installing the specified one if needed.  This
will prevent users and the CI from using a wrong version in the future.

Move the logic into a dedicated shell script as I find built-in bash in
Makefiles hard to maintain.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 08:55:46 +01:00
Valentin Rothberg b6155c1657 Makefile: remove gometalinter
Remove all references on gometalinter including the target to install
it.  We are not using it anymore since we have fully migrated to
golangci-lint.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 08:29:33 +01:00
Sorin Sbarnea e9cd3319cf Enable pre-commit tool linting
This should help use keep the codebase more consistent, and avoid sevel
whitespace related issues, or bad file permissions.

pre-commit allows us to easily introduce other linters in follow-ups,
like bashate.

Note: pre-commit tool does *not* install any git-hooks. Making commits
will will call the tool unless you deliverately tell it to install the
hooks.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2020-01-14 13:42:59 +00:00
Valentin Rothberg cf1f3191d2 make lint: include unit tests
Include the unit tests (i.e., _test.go files) for linting to make the
tests more robust and enforce the linters' coding styles etc.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 10:51:59 +01:00
Valentin Rothberg a102869746 .golangci.yml: move swagger.go from Makefile
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 09:54:48 +01:00
OpenShift Merge Robot 796ae87b1a
Merge pull request #4850 from vrothberg/fix-linting
Fix linting
2020-01-13 21:03:21 +01:00
OpenShift Merge Robot e83a1b87da
Merge pull request #4817 from rhatdan/codespell
Add codespell to validate spelling mistakes in code.
2020-01-13 17:59:58 +01:00
Valentin Rothberg eeb61427bb bump golangci-lint to 1.18.0
The latest versions have regressions in --skip-dirs where some linters
will still run and error out.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
Valentin Rothberg 6041f707ca rm contrib/perftest
Perftest was intended to be used for testing CPU intensive tasks of
Podman.  However, it does not compile for a long while and is not
integrated in the CI which clearly indicates that it has not been
used for a considerable amount of time.

Remove contrib/perftest entirely.  If the desire arises to revive it,
all code is still reachable in the git history.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:26:57 +01:00
Valentin Rothberg 17988f239e remove .tool/lint
We should only use `make golangci-lint` which is also used in `make
validate`.  However, we need to enable more linters which we can
do step by step in future commits.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 11:20:44 +01:00
Morten Linderud 627d71312f
[Makefile] Ensure .gopathok dependency is met for varlink
When executing make in parallel, e.g `make -j8`, there is a chance steps are
executed at the same time. There is a chance .gopathok and the actual varlink
generation happening at the same time, causing a race and ultimately failing the
build.

Ensuring the .gopathok dependency is met at the actual step fixes the problem.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-01-11 13:50:45 +01:00
Daniel J Walsh 4093b2c011
Add codespell to validate spelling mistakes in code.
Fix all errors found by codespell

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-11 06:32:19 -05:00
baude 25b34972f4 [CI:DOCS]update apiv2 documentation with swagger goods
Signed-off-by: baude <bbaude@redhat.com>
2020-01-10 09:41:54 -06:00
Jhon Honce d924494f56 Initial commit on compatible API
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Create service command

Use cd cmd/service && go build .

$ systemd-socket-activate -l 8081 cmd/service/service &
$ curl http://localhost:8081/v1.24/images/json

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

Correct Makefile

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

Two more stragglers

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

Report errors back as http headers

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

Split out handlers, updated output

Output aligned to docker structures

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

Refactored routing, added more endpoints and types

* Encapsulated all the routing information in the handler_* files.
* Added more serviceapi/types, including podman additions. See Info

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

Cleaned up code, implemented info content

* Move Content-Type check into serviceHandler
* Custom 404 handler showing the url, mostly for debugging
* Refactored images: better method names and explicit http codes
* Added content to /info
* Added podman fields to Info struct
* Added Container struct

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

Add a bunch of endpoints

containers: stop, pause, unpause, wait, rm
images: tag, rmi, create (pull only)

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

Add even more handlers

* Add serviceapi/Error() to improve error handling
* Better support for API return payloads
* Renamed unimplemented to unsupported these are generic endpoints
  we don't intend to ever support.  Swarm broken out since it uses
  different HTTP codes to signal that the node is not in a swarm.
* Added more types
* API Version broken out so it can be validated in the future

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

Refactor to introduce ServiceWriter

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

populate pods endpoints

/libpod/pods/..

exists, kill, pause, prune, restart, remove, start, stop, unpause

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

Add components to Version, fix Error body

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

Add images pull output, fix swarm routes

* docker-py tests/integration/api_client_test.py pass 100%
* docker-py tests/integration/api_image_test.py pass 4/16
+ Test failures include services podman does not support

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

pods endpoint submission 2

add create and others; only top and stats is left.

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

Update pull image to work from empty registry

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

pod create and container create

first pass at pod and container create.  the container create does not
quite work yet but it is very close.  pod create needs a partial
rewrite.  also broken off the DELETE (rm/rmi) to specific handler funcs.

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

Add docker-py demos, GET .../containers/json

* Update serviceapi/types to reflect libpod not podman
* Refactored removeImage() to provide non-streaming return

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

create container part2

finished minimal config needed for create container.  started demo.py
for upcoming talk

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

Stop server after honoring request

* Remove casting for method calls
* Improve WriteResponse()
* Update Container API type to match docker API

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

fix namespace assumptions

cleaned up namespace issues with libpod.

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

wip

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

Add sliding window when shutting down server

* Added a Timeout rather than closing down service on each call
* Added gorilla/schema dependency for Decode'ing query parameters
* Improved error handling
* Container logs returned and multiplexed for stdout and stderr
  * .../containers/{name}/logs?stdout=True&stderr=True
* Container stats
  * .../containers/{name}/stats

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

Improve error handling

* Add check for at least one std stream required for /containers/{id}/logs
* Add check for state in /containers/{id}/top
* Fill in more fields for /info
* Fixed error checking in service start code

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

get rest  of image tests for pass

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

linting our content

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

more linting

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

more linting

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

pruning

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

[CI:DOCS]apiv2 pods

migrate from using args in the url to using a json struct in body for
pod create.

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

fix handler_images prune

prune's api changed slightly to deal with filters.

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

[CI:DOCS]enabled base container create tests

enabling the base container create tests which allow us to get more into
the stop, kill, etc tests. many new tests now pass.

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

serviceapi errors: append error message to API message

I dearly hope this is not breaking any other tests but debugging
"Internal Server Error" is not helpful to any user.  In case, it
breaks tests, we can rever the commit - that's why it's a small one.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

serviceAPI: add containers/prune endpoint

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

add `service` make target

Also remove the non-functional sub-Makefile.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

add make targets for testing the service

 * `sudo make run-service` for running the service.

 * `DOCKERPY_TEST="tests/integration/api_container_test.py::ListContainersTest" \
 	make run-docker-py-tests`
   for running a specific tests.  Run all tests by leaving the env
   variable empty.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

Split handlers and server packages

The files were split to help contain bloat. The api/server package will
contain all code related to the functioning of the server while
api/handlers will have all the code related to implementing the end
points.

api/server/register_* will contain the methods for registering
endpoints.  Additionally, they will have the comments for generating the
swagger spec file.

See api/handlers/version.go for a small example handler,
api/handlers/containers.go contains much more complex handlers.

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

[CI:DOCS]enabled more tests

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

[CI:DOCS]libpod endpoints

small refactor for libpod inclusion and began adding endpoints.

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

Implement /build and /events

* Include crypto libraries for future ssh work

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

[CI:DOCS]more image implementations

convert from using for to query structs among other changes including
new endpoints.

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

[CI:DOCS]add bindings for golang

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

[CI:DOCS]add volume endpoints for libpod

create, inspect, ls, prune, and rm

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

[CI:DOCS]apiv2 healthcheck enablement

wire up container healthchecks for the api.

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

[CI:DOCS]Add mount endpoints

via the api, allow ability to mount a container and list container
mounts.

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

[CI:DOCS]Add search endpoint

add search endpoint with golang bindings

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

[CI:DOCS]more apiv2 development

misc population of methods, etc

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

rebase cleanup and epoch reset

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

[CI:DOCS]add more network endpoints

also, add some initial error handling and convenience functions for
standard endpoints.

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

[CI:DOCS]use helper funcs for bindings

use the methods developed to make writing bindings less duplicative and
easier to use.

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

[CI:DOCS]add return info for prereview

begin to add return info and status codes for errors so that we can
review the apiv2

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

[CI:DOCS]first pass at adding swagger docs for api

Signed-off-by: baude <bbaude@redhat.com>
2020-01-10 09:41:39 -06:00
Chris Evich eb0f79c337
Fix Makefile ref libseccomp branch as a commit
Commit a824186ac9 mistakenly updated LIBSECCOMP_COMMIT with a branch
name instead of a commit reference.  This breaks on Ubuntu's git with
the `--detach` option, causing it to throw this error:

```
fatal: '--detach' cannot be used with '-b/-B/--orphan'
```

Fix this by using the tag `v2.3.3` which at the time of this commit, is
the current HEAD of the release-2.3 branch.

Thanks to Ed Santiago <santiago@redhat.com> for helping figure
out the error and the fix.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-01-09 14:31:26 -05:00
OpenShift Merge Robot c99b413abb
Merge pull request #4758 from rhatdan/validate
Don't show PASS on success for gitvalidate
2020-01-08 18:46:05 +01:00
Sorin Sbarnea da0319fecd packaging: validate installed rpms
Previously we builded RPMs that contained an outdated conmon which was
not compatible. From now on `make-install` will also call
`podman version` and `podman info` in order to perform a minimal
sanity check of the installation.

Fixes: #4665
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2020-01-07 20:06:27 +00:00
Daniel J Walsh b061bb276d
Don't show PASS on success for gitvalidate
Make test logs less verbose so that failures are easier to spot.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-06 17:18:18 -05:00
Matthew Heon 8e4a489e1b Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-01-06 15:16:38 -05:00
OpenShift Merge Robot 2d8f1c8fda
Merge pull request #4762 from NevilleC/nc-issue4367
Generate binaries only if there are changes in src code.
2020-01-06 19:27:03 +01:00
Neville Cain 16b793a45a Generate binaries only if they are changes in src code.
Changes I am making:

1. The target `.gopathok` was listed in `.PHONY` which
looks wrong as it regenerates `.gopathok` every time we
 re-run it, which was a part of the issue. I removed it
 to avoid that. If `.gopathok` is present', makefile
should not need to rerun it.

2. Ensure the binaries are created only if they don't
exist by adding `bin/podman`
and `bin/podman-remote`.

3. Add a `SOURCES = $(shell find . -name "*.go")` and put
it as a dependency of the podman binaries target. It allows us
to re-generate the binaries only when there is a change in the
source files. The downside is it increases the running time of
the command that generates them (20 seconds on my virtual machine
running Centos 7). If this is a problem, we could introduce a
hidden file that would list all the files to track, that
would need to be updated only when a dev is introducing new files.

4. Fixed the make package-install as it does not work with yum.
I updated the build_rpm.sh to ensure it works on centos 7
and centos 8 with no pre-required installation.

Closes #4367

Signed-off-by: Neville Cain <neville.cain@qonto.eu>
2020-01-04 23:54:57 +01:00
Matthew Heon 13bff7719e Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-01-02 15:00:43 -05:00
Neville Cain 6441324192 Ensure 'make uninstall' remove bin and conf files.
I updated the 'make uninstall' command to remove:
1. podman and remote bin
2. cni/net.d/87-podman-bridge.conflist
3. podman.conf
4. systemd conf files: io.podman.socket.*

Closes #4572

Signed-off-by: Neville Cain <neville.cain@qonto.eu>
2019-12-28 02:26:38 +01:00
OpenShift Merge Robot 11621836df
Merge pull request #4714 from openSUSE/testflags
Allow the injection of TESTFLAGS
2019-12-16 21:00:23 +01:00
Chandan Kumar (raukadah) 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
Sascha Grunert 25646a4b74
Allow the injection of TESTFLAGS
This allows to specify the tests to be run, for example when setting
`--focus='my-test-regex'`.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-12-16 13:52:25 +01:00
OpenShift Merge Robot 123e7ea568
Merge pull request #4690 from Foxboron/morten/fix-ldflags
[Makefile] `LDFLAGS` is reserved for the GCC linker
2019-12-13 01:05:27 +01:00
Morten Linderud 1df8a4b467
[Makefile] LDFLAGS is reserved for the GCC linker
The env variable `LDFLAGS` belongs to the gcc linker, while the Makefile
currently expects these to be valid go compiler flags. Move them to
`-extldflags` as appropriate. The equivalent flag in go is
`CGO_LDFLAGS`.

Ensure test files are also using `LDFLAGS_PODMAN` instead of `LDFLAGS`.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2019-12-12 17:09:00 +01:00
Matthew Heon 70782b271f Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-12-11 12:49:31 -05:00
OpenShift Merge Robot 465e142bf2
Merge pull request #4601 from ssbarnea/fix/test-build-rpm-changes
Enable multi-platform rpm building
2019-12-05 09:06:20 -08:00
Sorin Sbarnea a03c3a9318 Enable multi-platform rpm building
- make: fix python detection for multiple interpreters
- make: create generic `package` and `package-install` targets
- build_rpm.sh: move package installation into package-install
- build_rpm.sh: fix dnf/yum detection
- build_rpm.sh: install md2man rpm only on platfroms where is available
- build_rpm.sh: temporary skip packaging docs and debug on rhel-8
- docs: `make package-install`

This change is validated by new CI jobs run by rdoproject. See link
below for result.

Depends-On: https://review.rdoproject.org/r/#/c/23943/
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2019-12-05 10:34:10 +00:00
Sorin Sbarnea b8ac3f143b Avoid git warnings by using detach on checkout
Git displays a huge and confusing warning when doing a checkout of
a specific commit if the --detach option is not mentioned.

This cleans up our build logs, making it easier to spot real problems.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2019-12-04 21:44:11 +00:00
Sorin Sbarnea cf5bca1338 Attempt to install go-md2man only if missing
Fixes: #4632
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2019-12-03 19:47:42 +00:00
Sorin Sbarnea 86ef7db536 build: improved main makefile
* added .install.md2man as dependency for docs, fixed broken build
  on systems that do not have go-md2man preinstalled.
* sorted PHONY targets

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2019-12-02 16:47:30 +00:00
Sorin Sbarnea 7262e545c8 Detect Python executable in Makefile
`make help` failed on modern platforms that have only
python3 executable installed.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2019-11-27 19:27:14 +00:00
Lokesh Mandvekar 2785615209 create a separate install target for seccomp
podman in Fedora gets seccomp.json from containers-common while
the one in Ubuntu PPA gets seccomp.json from containers-golang.

This change will let me use install.config target unmodified
in downstream packages.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2019-11-10 13:42:29 -05:00
Daniel J Walsh 5f3a61ed42
Add support for make vendor-in-container
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-08 06:27:17 -05:00
Giuseppe Scrivano 16cb2b38a8
Makefile: add vendor-in-container
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-11-06 16:22:17 +01:00
Morten Linderud 9558797fb7
[Makefile] Fix docker documentation install and generation
The final versions of the documentation has been shifted from `docs/` to
`docs/build/man`. Most of the Makefile has been changed accordingly, but
the docker documentation generation was not.

Introduced by #4354

Signed-off-by: Morten Linderud <morten@linderud.pw>
2019-11-02 13:05:34 +01:00
OpenShift Merge Robot ffe36ea996
Merge pull request #4354 from baude/newdocsstruct
Restructure documentation dir
2019-10-31 19:39:44 +01:00
OpenShift Merge Robot 3e2d9f8662
Merge pull request #4352 from vrothberg/config-package
refactor libpod config into libpod/config
2019-10-31 19:21:46 +01:00
Jhon Honce 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
baude 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
Valentin Rothberg 11c282ab02 add libpod/config
Refactor the `RuntimeConfig` along with related code from libpod into
libpod/config.  Note that this is a first step of consolidating code
into more coherent packages to make the code more maintainable and less
prone to regressions on the long runs.

Some libpod definitions were moved to `libpod/define` to resolve
circular dependencies.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-10-31 17:42:37 +01:00
Giuseppe Scrivano 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
Akihiro Suda a9976049f0 Makefile: fix embedding gitCommit
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-29 23:56:34 +09:00
baude aac33a4a30 Initial checking for readthedocs
Signed-off-by: baude <bbaude@redhat.com>
2019-10-22 15:28:32 -05:00
Matthew Heon e2ddfd704b Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-10-17 15:09:46 -04:00
Matthew Heon a1dd2c0ec4 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-10-16 15:32:13 -04:00
Colin Walters ca29a5b2f9 Make user io.podman.service unit WantedBy=default.target
`multi-user.target` doesn't exist in the systemd *user* instance.
We can't hook up the startup of a user unit to a system target.

Doing so causes systemd to error out in Fedora CoreOS builds
during presets.

Make it depend on `default.target` instead.

(Having the same unit in both system and user sessions has some
 tricky bits like this)

Signed-off-by: Colin Walters <walters@verbum.org>
2019-10-11 12:57:59 +00:00
Chris Evich ffe726ed64
Cirrus: Produce and collect varlink output
When executing 'make remotesystem' testing, a varlink process is started
up but it's stdio is dumped due to the production of excessive data.
However, this also means if the process has a problem, any errors will
not be accessible.

Instead, grab only the last 100 lines and direct them into a file.  Also
update automation's log collection to retrieve this file when the
`$REMOTE_CLIENT` env. var. is `true`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-10-08 16:47:37 -04:00
Matthew Heon 119bc9b6f8 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-10-02 17:39:05 -04:00
Matthew Heon 3018d700bb Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-10-02 12:42:13 -04:00
Matthew Heon d74fb433a8 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-09-30 19:02:29 -04:00
Nalin Dahyabhai ff2a4ae71c Add a missing escape in the Makefile
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-09-26 18:11:26 -04:00
OpenShift Merge Robot 19075ca16e
Merge pull request #4104 from mheon/bump-1.6.0-rc2
Bump to 1.6.0-rc2
2019-09-25 20:44:13 +02:00
Matthew Heon df433f6f16 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-24 16:40:22 -04:00
Chris Evich 90f82335d9
Cirrus: Fail early on CI script unit test
Instead of running this basic checks for almost all tasks, just do them
once at the beginning.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-09-23 13:41:28 -04:00
Jhon Honce 96bcf8cecc Support podman-remote help on windows
* Update scipts to produce darwin and windows output
* Update batch file to re-direct help requests to browser
* Add pandoc filter for markdown to html links

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-19 14:14:38 -07:00
Matthew Heon 3ad8a349c9 Bump Gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-09-16 09:55:50 -04:00
Jhon Honce 046c081ed0 Add podman icon to installer
Update Makefile per review comments

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-12 09:35:54 -07:00
Jhon Honce ecb958e598 Support building Windows msi file
* Update Makefile to build msi
* Add podman.wxs to define podman.msi
  * Version information provided by Makefile
* Add podman.bat wrapper for podman-remote-windows.exe to ensure environment
* Add wix xml schemas for reference

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-11 16:15:52 -07:00
OpenShift Merge Robot f73c3b868d
Merge pull request #3973 from baude/validateupdate
add lint and manpage check to make validate
2019-09-11 16:45:55 +02:00
baude ba7e863ac3 add lint and manpage check to make validate
make validate now runs golangci-lint and the man-page-checker to ensure
a PR is ready for our CI system.

Signed-off-by: baude <bbaude@redhat.com>
2019-09-10 05:45:59 -05:00
Christian Felder 82025e7dbe Fixup Makefile for BSD systems, e.g. macOS
The bsd variant of `ln` does not support the ``-T`` option.
Testing for existence using wildcard before creating new symlinks
should be sufficient here. Furthermore the target directory is
managed internally by this Makefile anyway.

Signed-off-by: Christian Felder <c.felder@fz-juelich.de>
2019-09-07 19:42:41 +02:00
Valentin Rothberg 90ebd7c909 Makefile: use go proxy
Use GOPROXY=https://proxy.golang.org to speed up fetching dependencies.
Setting it makes `make vendor` three times faster in my local env.

For details please refer to https://proxy.golang.org/.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-30 10:32:29 +02:00
Chris Evich 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
OpenShift Merge Robot 67926d86b5
Merge pull request #3824 from baude/varlinkendpointtest
Create framework for varlink endpoint integration tests
2019-08-26 17:11:12 +02:00
baude 04f2f95bb4 Create framework for varlink endpoint integration tests
add the ability to write integration tests similar to our e2e tests for
the varlink endpoints.

Signed-off-by: baude <bbaude@redhat.com>
2019-08-16 10:10:50 -05:00
Matthew Heon 5d107a2288 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-15 17:13:21 -04:00
OpenShift Merge Robot b6c9b10867
Merge pull request #3662 from marusak/user_socket_service
Add user systemd service and socket
2019-08-13 15:57:27 +02:00
Matej Marusak daf7044aa9 Add user systemd service and socket
This enables user to interact with varlink and create/manage rootless
containers through it.

Using as:
`varlink call unix:/run/user/1000/podman/io.podman/io.podman.ListContainers`

Signed-off-by: Matej Marusak <mmarusak@redhat.com>
2019-08-13 07:00:56 +02:00
Ashley Cui 99494b55bc Homebrew installation in install.md
Add brew installation instructions to docs & small fix to brew makefile

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>
2019-08-12 15:03:20 -04:00
OpenShift Merge Robot d65cb66437
Merge pull request #3758 from edsantiago/bats
implement 'make remotesystem'
2019-08-10 11:52:44 +02:00
Matthew Heon 580795077e Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-09 16:00:38 -04:00
Ed Santiago 5c108cdab4 implement 'make remotesystem'
podman-remote rm now works; that's the only thing we were
waiting for to enable podman-remote (varlink) system tests.

Add a (too-complicated, sorry) Makefile target that will
define a random socket path, start the podman varlink server,
and run the test suite using podman-remote.

Also: add two convenience functions, is_rootless and is_remote,
and use those in skip_if_rootless/if_remote and elsewhere

Also: workarounds for broken tests:
 - basic version test: podman-remote emits an empty 'Client'
   line. Just ignore it.
 - looks like 'podman-remote pod' doesn't work; skip test.

Also: minor documentation update

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-08-08 11:44:55 -06:00
baude 096af85278 add make to make installs
as issue #2702 describes, we want to make podman and podman-remote as
part of make install.

Fixes: #2702

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

avoid `make` in `make install` in the rpmbuild process.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2019-08-07 14:52:49 -04:00
Valentin Rothberg 39a9099b3b go build: use -mod=vendor for go >= 1.11.x
Go 1.13.x isn't sensitive to the GO111MODULE environment variable
causing builds to not use the vendored sources in ./vendor. Force builds
of module-supporting go versions to use the vendored sources by setting
-mod=vendor.

Verified in a fedora:rawhide container.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-01 14:04:17 +02:00
Chris Evich 3e3afb942a
Cirrus: Fix release dependencies
The release-task ***must*** always execute last, in order to guarantee a
consistent cache of release archives from dependent tasks.  It
accomplishes this by verifying it's task-number matches one-less than
the total number of tasks.  Previous to this commit, a YAML anchor/alias
was used to avoid duplication of the dependency list between 'success'
and 'release'

However, it's been observed that this opens the possibility for
'release' and 'success' tasks to race when running on a PR.  Because
YAML anchor/aliases cannot be used to modify lists, duplication is
required to make 'release' actually depend upon 'success'.

This duplication will introduce an additional maintenance burden.
Though when adding a new task, it's already very easy to forget to
update the 'depends_on' list.  Assist both cases by the addition
unit-tests to verify ``.cirrus.yml`` dependency contents and structure.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-07-31 11:49:53 -04:00
Ashley Cui ce0132a45e Documenation & build automation for remote darwin
Created shell script to automatically compile remote-only docs & rename
Added make brew-pkg to automatically package files needed for homebrew
Add missing docs

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>
2019-07-25 15:36:39 -04:00
baude 0c3038d4b5 golangci-lint phase 4
clean up some final linter issues and add a make target for
golangci-lint. in addition, begin running the tests are part of the
gating tasks in cirrus ci.

we cannot fully shift over to the new linter until we fix the image on
the openshift side.  for short term, we will use both

Signed-off-by: baude <bbaude@redhat.com>
2019-07-22 15:44:04 -05:00
Lawrence Chan 2be57e1386 Make GOPATH-related symlinking more precise
This change tweaks the symlink commands that are invoked when libpod is
not on GOPATH. This has the following effects:

- If the working directory is not "libpod", it will still create the
  symlink at the correct github.com/containers/libpod path.
- If the github.com/varlink directory/symlink already exists, it will
  still create the symlink at the intended path.

Signed-off-by: Lawrence Chan <element103@gmail.com>
2019-07-17 22:02:58 -05:00
Valentin Rothberg aa28dbbf88 analyse package sizes
Analyse the size of all go-packages used during the build process via
the newly added `hack/analyses/go-archive-analysis.sh` script.  The
script expects the `WORK` environment variable to be set, which points
to a temporary work directory generated by `go build`.  To generate such
a work directory, set the `BUILDFLAGS="-work -a"`:

 * `-work` for creating the work directory
 * `-a` to force rebuilding all packages even when already cached

The workflow may look as follows:

```
$ BUILDFLAGS="-work -a" make podman
[...]
WORK=/tmp/go-build127001249
$ WORK=/tmp/go-build127001249 ./hack/analyses/go-archive-analysis.sh
```

The output of the script has the format `$SIZE $PACKAGE` where $SIZE is
the size of the compiled version of the go package (i.e., `.a` file) and
$PACKAGE for the corresponding package, for instance, `math/big` for a
stdlib package or vendor/...  for vendored packages.

Credits to the authors of https://github.com/jondot/goweight, which
inspired this work.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-07-16 14:16:16 +02:00
OpenShift Merge Robot 81e722d086
Merge pull request #3106 from cevich/cirrus_release
Cirrus: Automate releasing of tested binaries
2019-07-10 15:08:03 +02:00
Ed Santiago b205e044d6 make localsystem: wipe all user config state
CI is experiencing failures in the system_test step, caused by
podman commands issuing the following warning:

   time="2019-07-09T13:30:19-04:00" level=error msg="User-selected graph driver \"overlay\" overwritten by graph driver \"vfs\" from database - delete libpod local files to resolve

Hypothesis: integration tests, which run just before us, are
leaving user config files in an unstable state.

Workaround: delete all user cache and config and db before
running system tests. This should be safe, and should be
a NOP when running as root.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-07-09 13:33:30 -06:00
baude 1d36501f96 code cleanup
clean up code identified as problematic by golands inspection

Signed-off-by: baude <bbaude@redhat.com>
2019-07-08 09:18:11 -05:00
Chris Evich 1ef8637ae3
Cirrus: Automate releasing of tested binaries
It's desirable to make archives available of builds containing actual
tested content.  While not official distro-releases, these will enable
third-party testing, experimentation, and development for both branches
(e.g. "master") and pull requests (e.g. "pr3106").

* Add a Makefile targets for archiving both regular podman binaries
  and the remote-client.  Encode release metadata within these
  archives so that their exact source can be identified.

* Fix bug with cross-compiling remote clients for the Windows and Darwin
  platforms.

* Add unit-testing of cross-compiles for Windows and Darwin platforms.

* A few small CI-script typo-fixes

* Add a script which operates in two modes:

  1. Call Makefile targets which produce release archives.
     Upload the archive to Cirrus-CI's built-in caching system
     using reproducible cache keys.

  2. Utilize reproduced cache keys to attempt download of cache
     from each tasks.  When successful, parse the file's
     release metadata, using it to name the archive file.  Upload
     all recovered archives to a publicly accessible storage bucket
     for future reference.

* Update the main testing task to call the script in mode #1 for
  all primary platforms.

* Add a new `$SPECIALMODE` task to call the script in mode #1 for
  Windows and Darwin targets.

* Add a new 'release' task to the CI system, dependent upon all other
  tasks.  This new tasks executes the script in mode #2.

* Update CI documentation

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-07-03 16:51:21 -04:00
OpenShift Merge Robot a22a32a0a5
Merge pull request #3437 from giuseppe/fix-nocgo
build: allow to build without cgo on RISC-V
2019-07-03 15:58:26 +02:00
Matthew Heon 7b0cdd8c16 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-07-02 14:58:54 -04:00
Giuseppe Scrivano 473d060454
cirrus: add test for compiling without cgo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-02 16:41:11 +02:00
Valentin Rothberg 9697b0d91f Makefile: set GO111MODULE=off
Turn of go modules to avoid breaking build environments to accidentally
try pulling the dependencies instead of using the ./vendor directory.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-06-27 16:24:16 +02:00