aboutsummaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAge
...
* {CI:DOCS] run gofmt before lintBrent Baude2020-02-04
| | | | | | 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>
* Cirrus: Fix gate task + make lint|validateChris Evich2020-02-03
| | | | | | | | | | | | | | | | | | 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>
* Assure validate includes lintSorin Sbarnea2020-01-30
| | | | | | Fixed issue where lint was not run on CI, so we missed to prevent regressions. Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
* speed up MakefileValentin Rothberg2020-01-30
| | | | | | | | | | 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>
* Makefile: systemd: echo instead of warnValentin Rothberg2020-01-30
| | | | | | Just echo the message instead of warning to not impact the exit code. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Makefile: remove redundant BUILDFLAGSValentin Rothberg2020-01-30
| | | | | | We don't set it, so there's no need to keep it. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Makefile: consistent PHONY useValentin Rothberg2020-01-30
| | | | | | | 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>
* Makefile: remove dead vagrant targetValentin Rothberg2020-01-30
| | | | Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Makefile: move systemd buildtag checkValentin Rothberg2020-01-30
| | | | | | | | 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>
* Merge pull request #5011 from vrothberg/fix-4814OpenShift Merge Robot2020-01-29
|\ | | | | run `varlink_generate` on Linux only
| * run `varlink_generate` on Linux onlyValentin Rothberg2020-01-29
| | | | | | | | | | | | | | | | 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>
* | [CI:DOCS]Binding overhaulsBrent Baude2020-01-28
|/ | | | | | | | | | 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>
* Add link from docker.sock to podman.sockDaniel J Walsh2020-01-27
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Add service endpointbaude2020-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* post-process swagger yaml for publishbaude2020-01-17
| | | | | Signed-off-by: baude <bbaude@redhat.com> Signed-off-by: Chris Evich <cevich@redhat.com>
* make binaries: include serviceValentin Rothberg2020-01-16
| | | | | | | 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>
* Merge pull request #4807 from ssbarnea/fix/pre-commitOpenShift Merge Robot2020-01-15
|\ | | | | Enable pre-commit linting
| * Enable pre-commit tool lintingSorin Sbarnea2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | make .install.golangci-lint: force specific versionValentin Rothberg2020-01-15
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Makefile: remove gometalinterValentin Rothberg2020-01-15
| | | | | | | | | | | | | | | | 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>
* | make lint: include unit testsValentin Rothberg2020-01-14
| | | | | | | | | | | | | | 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>
* | .golangci.yml: move swagger.go from MakefileValentin Rothberg2020-01-14
|/ | | | Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Merge pull request #4850 from vrothberg/fix-lintingOpenShift Merge Robot2020-01-13
|\ | | | | Fix linting
| * bump golangci-lint to 1.18.0Valentin Rothberg2020-01-13
| | | | | | | | | | | | | | 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>
| * rm contrib/perftestValentin Rothberg2020-01-13
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * remove `.tool/lint`Valentin Rothberg2020-01-13
| | | | | | | | | | | | | | | | 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>
* | Merge pull request #4817 from rhatdan/codespellOpenShift Merge Robot2020-01-13
|\ \ | |/ |/| Add codespell to validate spelling mistakes in code.
| * Add codespell to validate spelling mistakes in code.Daniel J Walsh2020-01-11
| | | | | | | | | | | | Fix all errors found by codespell Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | [Makefile] Ensure .gopathok dependency is met for varlinkMorten Linderud2020-01-11
|/ | | | | | | | | | | 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>
* [CI:DOCS]update apiv2 documentation with swagger goodsbaude2020-01-10
| | | | Signed-off-by: baude <bbaude@redhat.com>
* Initial commit on compatible APIJhon Honce2020-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix Makefile ref libseccomp branch as a commitChris Evich2020-01-09
| | | | | | | | | | | | | | | | | | 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>
* Merge pull request #4758 from rhatdan/validateOpenShift Merge Robot2020-01-08
|\ | | | | Don't show PASS on success for gitvalidate
| * Don't show PASS on success for gitvalidateDaniel J Walsh2020-01-06
| | | | | | | | | | | | Make test logs less verbose so that failures are easier to spot. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | packaging: validate installed rpmsSorin Sbarnea2020-01-07
|/ | | | | | | | | | 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>
* Bump gitvalidation epochMatthew Heon2020-01-06
| | | | Signed-off-by: Matthew Heon <mheon@redhat.com>
* Merge pull request #4762 from NevilleC/nc-issue4367OpenShift Merge Robot2020-01-06
|\ | | | | Generate binaries only if there are changes in src code.
| * Generate binaries only if they are changes in src code.Neville Cain2020-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Bump gitvalidation epochMatthew Heon2020-01-02
|/ | | | Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Ensure 'make uninstall' remove bin and conf files.Neville Cain2019-12-28
| | | | | | | | | | | | 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>
* Merge pull request #4714 from openSUSE/testflagsOpenShift Merge Robot2019-12-16
|\ | | | | Allow the injection of TESTFLAGS
| * Allow the injection of TESTFLAGSSascha Grunert2019-12-16
| | | | | | | | | | | | | | 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>
* | Use systemd/sd-daemon.h headers for systemd presenceChandan Kumar (raukadah)2019-12-16
|/ | | | | | | | | | | | | | | 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>
* Merge pull request #4690 from Foxboron/morten/fix-ldflagsOpenShift Merge Robot2019-12-13
|\ | | | | [Makefile] `LDFLAGS` is reserved for the GCC linker
| * [Makefile] `LDFLAGS` is reserved for the GCC linkerMorten Linderud2019-12-12
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Bump gitvalidation epochMatthew Heon2019-12-11
| | | | | | | | Signed-off-by: Matthew Heon <mheon@redhat.com>
* | Merge pull request #4601 from ssbarnea/fix/test-build-rpm-changesOpenShift Merge Robot2019-12-05
|\ \ | | | | | | Enable multi-platform rpm building
| * | Enable multi-platform rpm buildingSorin Sbarnea2019-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | | Avoid git warnings by using detach on checkoutSorin Sbarnea2019-12-04
|/ / | | | | | | | | | | | | | | | | 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>
* | Attempt to install go-md2man only if missingSorin Sbarnea2019-12-03
| | | | | | | | | | Fixes: #4632 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>