Commit graph

79 commits

Author SHA1 Message Date
Nalin Dahyabhai
1e1d6a512f Build with ostree
Build using a locally-built copy of ostree in testing setups.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-24 13:03:07 -04:00
Giuseppe Scrivano
a30f84906c Makefile: do not rebuild tests every time "make" runs
bin2img/checkseccomp/copyimg are file targets and should not be .PHONY.
This prevents to build them if not necessary.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2017-07-22 11:37:24 +02:00
Nalin Dahyabhai
375ffaee03 Build all of our binaries with the same build tags
Build all of our binaries with the same build tags and the same LDFLAGS.
This means we add $(LDFLAGS) to bin2img, copyimg, and cri-o,
$(BUILDTAGS) to kpod, and both to crioctl and checkseccomp.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-21 10:28:10 -04:00
Daniel J Walsh
23c66c7bdf We need to support the name cri-o and crio for rpm and systemd
Adding these aliases will make it easier for users who forget to
use crio or cri-o.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-07-19 07:29:36 -04:00
umohnani8
26126085eb Man pages were being created empty
This patch causes the man pages to be created with the correct content.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2017-07-10 17:20:42 -04:00
Mrunal Patel
762f508d9c lint: Use a fixed commit for gometalinter
Pulling latest code breaks our lint when unstable code is merged
into gometalinter.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-07-10 13:06:57 -07:00
umohnani8
9595d7900e Add kpod version
Signed-off-by: umohnani8 <umohnani@redhat.com>
2017-06-27 16:48:24 -04:00
Antonio Murdaca
16f44674a4
Makefile: exclude ./vendor from git-validation
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-06-07 00:04:15 +02:00
Antonio Murdaca
7c75cb080f
Makefile: enable git-validation dangling whitespace
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-05-16 15:23:35 +02:00
Mrunal Patel
5e4809bdfe Fix remnants of ocid -> crio rename
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-05-15 15:05:58 -07:00
Mrunal Patel
7ea255fcea Merge pull request #495 from rhatdan/rename
Rename ocid to crio
2017-05-15 11:27:28 -07:00
Antonio Murdaca
712df31f9c
Makefile: clean and rebuild binaries before testing
if you run `make localintegration` from a branch, switch to another and
re-run the command again, `ocid` won't get built again causing tests to
run with binaries from the old branch you switched from.
This patch makes sure we cleanup binaries and rebuild before running
tests.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-05-12 18:55:18 +02:00
Dan Walsh
4493b6f176 Rename ocid to crio.
The ocid project was renamed to CRI-O, months ago, it is time that we moved
all of the code to the new name.  We want to elminate the name ocid from use.
Move fully to crio.

Also cric is being renamed to crioctl for the time being.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2017-05-12 09:56:06 -04:00
Mrunal Patel
b71bcd65af makefile: Look for go-md2man in system path first
In build environments such as koji, there is no access to download
and install go packages so we should look for go-md2man in system
path first.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-05-05 15:01:37 -07:00
Dan Walsh
c07780a328 Merge branch 'master' of github.com:kubernetes-incubator/cri-o into RemoveAllContainers 2017-04-20 17:33:17 -04:00
Daniel J Walsh
54ee55493d Need to cleanup all pods on service poweroff
When powering off the system, we want the ocid service, to shutdown
all containers running on the system so they can cleanup properly
This patch will cleanup all pods on poweroff.

The ocid-shutdown.service drops a file /var/run/ocid.shutdown when the system
is shutting down. The ocid-shutdown.service should only be executed at system
shutdown.

On bootup sequence should be
start ocid.service
start ocid-shutdown.service (This is a NO-OP)

On system shutdown
stop ocid-shutdown.service (Creates /var/run/ocid.shutdown)
stop ocid.service (Notices /var/run/ocid.service and stops all pods before exiting.)

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-04-14 06:04:14 -04:00
Dan Williams
95846211c9 build: find dependencies for Go executables
To ensure that changing a dependency source file actually triggers
a rebuild of the core binaries when you type 'make', find their
dependencies and add them to the makefile's target dependencies.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2017-03-31 20:45:21 -05:00
Dan Williams
9c44933b58 build: create a local GOPATH if none specified
Instead of requiring the developer to set up their own GOPATH somewhere,
do like Kubernetes and OpenShift Origin do:

git clone xxxxx
cd xxxxx
make

by creating an _output/ directory and linking the local source tree
into it, and setting that to be the GOPATH.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2017-03-30 15:01:22 -05:00
Mrunal Patel
b7c97540b7 make: Fixup install/invocation of tools
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-03-24 11:18:37 -07:00
Pengfei Ni
25cc9e9810 Fix make
Signed-off-by: Pengfei Ni <feiskyer@gmail.com>
2017-03-02 12:37:45 +08:00
Aleksa Sarai
0d7147ff5c
make: revert switch to 'go install'
go install acts incredibly weirdly and rarely does what you want, not to
mention that it's just bad for distribution build setups. Switch back to
go build, which works properly and doesn't have half as many issues.

Fixes: 6c9628cdb1 ("Build and install from GOPATH")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-02-17 03:22:12 +11:00
Nalin Dahyabhai
893593272f Use build tags for bin2img and copyimg
Use the same build tags for bin2img and copyimg that we use for ocid,
and improve detection of the case where we need to use the
"libdm_no_deferred_remove" tag.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-31 11:57:19 -05:00
Mrunal Patel
bfe4f11f80 Move GOPATH check to a phony target
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-01-19 11:50:08 -08:00
Mrunal Patel
c4673a9136 Merge pull request #325 from runcom/tests-in-docker
fix integration tests in docker
2017-01-19 11:44:38 -08:00
Antonio Murdaca
0d37c41521
test: add a custom binary to reliable check seccomp support
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-01-19 18:51:47 +01:00
Nalin Dahyabhai
9cac1f6d66 Makefile: handle cases where $GOPATH is a list
In multiple places, we've been assuming that we can invoke binaries that
we install as $GOPATH/bin/$binary.  This doesn't work in cases where
$GOPATH is a list.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-19 12:13:49 -05:00
Nalin Dahyabhai
925806b8fa Add and use copyimg for caching images for tests
Add a basic tool for copying images from one location to another,
optionally adding a name if it's to local storage.  Ideally we could use
skopeo for this, but we don't want to build it.

Use it to initially populate the test/testdata/redis-image directory, if
it's not been cleaned out, with a copy of "docker://redis:latest", and
to copy it in to the storage that ocid is using before we start up ocid.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-18 10:23:30 -05:00
Nalin Dahyabhai
636d5d8e9a Add and use bin2img for creating images for tests
Add tests which exercise image pulling, listing, and removal.  When running
tests, prepopulate the store with an image with the default infrastructure
container's name, using the locally-built "pause" binary, so that tests won't
have to pull it down from the network.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-18 10:23:30 -05:00
Jonathan Yu
6c9628cdb1
Build and install from GOPATH
* Rename 'vendor/src' -> 'vendor'
  * Ignore vendor/ instead of vendor/src/ for lint
* Rename 'cmd/client' -> 'cmd/ocic' to make it 'go install'able
* Rename 'cmd/server' -> 'cmd/ocid' to make it 'go install'able
* Update Makefile to build and install from GOPATH
* Update tests to locate ocid/ocic in GOPATH/bin
* Search for binaries in GOPATH/bin instead of PATH
* Install tools using `go get -u`, so they are updated on each run

Signed-off-by: Jonathan Yu <jawnsy@redhat.com>
2017-01-17 12:09:09 -08:00
Mike Brown
7ae5b5fe24 fixes issue with make install on ubuntu
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2017-01-16 17:01:49 -06:00
Jonathan Yu
8b63272908
Install to /usr/local to avoid conflicts with vendor binaries
Closes: #300

Signed-off-by: Jonathan Yu <jawnsy@redhat.com>
2017-01-04 21:39:22 -08:00
Nalin Dahyabhai
f893e38d6d Add build tags for integration tests
Add the necessary build tags and configuration so that integration tests
can properly build against device mapper and btrfs libraries.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-12-19 11:44:32 -05:00
Crazykev
3fa48e54ff add gofmt verify in CI
Signed-off-by: Crazykev <crazykev@zju.edu.cn>
2016-12-15 14:15:57 +08:00
6c7756b352
Makefile: fix the creation of man5
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-08 14:49:02 -05:00
Dan Walsh
e61c672aa7 Add missing man pages and bash completions for kpod
We need to start off with man pages and bash completion
support for kpod.

Also fix Makefile to install kpod by default

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-12-02 10:17:58 -05:00
Matthew Heon
f512f211d0 Add basic skeleton of kpod executable
Signed-off-by: Matthew Heon <mheon@redhat.com>
2016-12-01 22:42:54 -05:00
Antonio Murdaca
0e4af6d69d
*: add seccomp buildtag
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-11-29 17:01:45 +01:00
Antonio Murdaca
78ee03a8fc
add seccomp support
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-11-28 22:05:34 +01:00
Dan Walsh
80ef36ba2e Fix install of unit file and configuration file
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-10-31 13:44:18 -04:00
Mrunal Patel
5504b68c96 Merge pull request #131 from cyphar/add-make-arguments
makefile: add make arguments
2016-10-31 10:24:49 -07:00
Dan Walsh
07b869ef0b Fix installation of ocid.systemd
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-10-31 10:43:46 -04:00
Aleksa Sarai
bb15f27eae
makefile: fix several issues and add arguments
The GO= arguments allow for cross-compilation without needing to symlink
over /usr/bin/go. Currently openSUSE uses go-5 for building on exotic
architectures. In addition, installdir options makes installation on
various distributions much easier, for example openSUSE doesn't have a
separate %{_libexecdir}.

Due to how Makefiles are parsed, we have to delay the expansion of the
$(wildcard ...) until the actual install target is being executed.

In addition, fix the oci{c,d} dependency lists so that we don't rebuild
oci{c,d} every time. Also remove "all" as a dependency of make install
-- this breaks building inside RPMs with custom ocid.conf files.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-11-01 00:27:07 +11:00
Aleksa Sarai
f2f369f6f8
systemd: move ocid.service to contrib/
In addition, remove the installation steps from the Makefile. In
general, I personally don't like projects that install service files on
`make install` -- that's the job of a package manager.

Signed-off-by: Aleksa Sarai <asarai@suse.com>
2016-10-31 23:31:05 +11:00
Aleksa Sarai
d559b58fd4
makefile: fix binary dependencies
OCID_LINK is necessary to correctly build all of the binaries. This
syntax is a GNU Make-ism[1] that allows you to specify a path dependency
without rebuilding the target if the dependency is newer than the
target.

[1]: https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html

Signed-off-by: Aleksa Sarai <asarai@suse.com>
2016-10-31 23:27:59 +11:00
Lai Jiangshan
09d470bdcd unistall or cleanup uncompressed manpages when requested
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-10-18 17:16:07 +08:00
Lai Jiangshan
9d65f8a907 don't gzip the manpages
let the package builders of the distros do it

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-10-18 16:35:31 +08:00
Qiang Huang
f3bc6d3660 Makefile: fix remove docs in make clean
On Ubuntu, `/bin/sh` is used in Makefile by default, so
a.{1,2,3} isn't evaluated to a.1 a.2 a.3, another solution
is to use `SHELL=/bin/bash` in Makefile, but I don't think
we should bind to bash this early, at least not for this
case.

This also remove the removal of docs/*.1 which doesn't
exist for now.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-17 13:15:41 +08:00
Dan Walsh
a14ddbde94 Fix up Makefile, to only build when needed
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-10-14 16:48:42 -04:00
Ryan Cole
44afbcb947 Fix installation of manpages
Previously, the markdown versions of the man pages were copied to
their respective locations, but these cannot be parsed by the man
command.  The Makefile was updated to gzip the man pages generated
by go-md2man and install the gzipped files into their respective
man directories.
Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
2016-10-14 08:34:49 -04:00
Dan Walsh
c1b9838af5 Add support got ocid.conf generation and install
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-10-13 09:45:31 -04:00