2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-26 11:57:52 +00:00

16 Commits

Author SHA1 Message Date
Adrian Reber
396c37dd62 tests: fix builds on alpine and centos
Install sudo, create test user with ID 1000, install bash,
fix pidfile creation and pidfile chmod.

v2:
 * use sleep to give the criu daemon some time to start up

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-23 08:25:07 +03:00
Andrei Vagin
c4b398fd0a build/docker: install packages to run tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-08 09:54:22 +03:00
Adrian Reber
579872a530 travis: fix python2 package installation
For python2/python3 compatibility install additional (python2-future)
and different (python2-ipaddress) packages during test.

Also switch Fedora tests to explicitly install versioned python packages
(python2-* instead of python-*).

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-25 00:23:00 +03:00
Kir Kolyshkin
b21fda47fd scripts/build/Dockerfiles: nitpicks
1. Sort lists of packages to be installed, unify indentation.

2. Merge "ccache -s" and "ccache -z".

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-23 00:46:11 +03:00
Andrei Vagin
59770d4f8b phaul: run the phaul test in a docker container
golang from the Ubuntu Trusty is too old.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:36:15 +03:00
Andrei Vagin
061a407ce3 alpine: compile all tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
833c10450d travis: use a last alpine release to build criu
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kir Kolyshkin
e4000c59a7 Dockerfiles: don't ignore make failures
Commit 299e4b4 ("travis: enable ccache for docker/qemu builds") combined
multiple RUN statements in Dockerfiles into a single one, which is good
for performance (as there is an intermediate cache created after each
statement). Unfortunately, it partially did so by combining statements
with use of semicolons, meaning we are ignoring non-zero exit codes.
As a result, failure from make are ignored and Travis builds are all
green.

To fix, replace all occurences of semicolon with &&.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:12:10 +03:00
Kir Kolyshkin
7290de5902 travis: enable ccache for docker/qemu builds
As we compile-test non-x86_64 architectures under qemu emulation,
it works pretty slow.
Dmitry Safonov suggested, and Andrey Vagin initially implemented
supporting ccache for such builds. This patch is based heavily
on Andrey's work -- all the bugs added are purely mine though.

Performance results: in an ideal environment (two builds of the same
code, one with cold (empty) ccache, another with the hot one)
I saw compile time improvements of 4x to 5x, and total test run time
improvement up to 2x to 2.5x. In layman terms, the complete test run
that was taking more than 50 minutes now takes about 25!

Notes on handling .ccache directory:

1. Before running docker build, .ccache directory (saved in between
   runs by Travis) is moved to criu source code root, from where it
   is copied by docker together with criu sources.

2. In Dockerfile, .ccache gets moved to /tmp, and CCACHE_DIR
   is set accordingly.

3. After running docker build, .ccache is copied out from docker
   container back to the host (from where it is saved by Travis).

Ccache envorinment notes:

1. CCACHE_NOCOMPRESS is needed because otherwise tons of time is spent
   on compression/decompression (big performance hit under qemu).

2. CCACHE_CPP2 is required with clang, see detailed explanation at
   http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
   The logic of setting CCACHE_CPP2 in Dockerfile is somewhat fancy;
   unfortunately I was not able to come up with a simpler approach.

Misc:

1. Travis runs "ccache -s" after the build is completed. A call to
   "ccache -s" is called to Dockerfile before make, so one can
   compare before/after numbers.

2. make invocations are surrounded by "date" calls so one can get the
   compilation times.

Changes in v2:
 - consolidate Dockerfile statements (ENV, RUN)
 - single object make test is no longer commented out
 - simplify "make mrproper" test

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:09:34 +03:00
Andrei Vagin
0ecd9c2b28 travis: execute tests on Alpine
"zdtm.py run -a" doesn't work on Alpine:
find: unrecognized: -executable

So run zdtm/static/env00 for now to be sure that
it is not broken at all.

travis-ci: success for travis: execute tests on Alpine
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-03-02 00:19:03 +03:00
Andrei Vagin
46caa25a1a dockerfile: use a newer version of Alpine
We see the "No space left on device" error on the current version,
so let's try to use a newer version of Alpine, maybe this error
has been fixed there.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-02 00:19:02 +03:00
Andrei Vagin
aec9eb921f build: install libnet-dev
It will be used to generate tcp packets for restoring half-closed sockets.

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:43 +03:00
Kir Kolyshkin
1ccc94ffc5 scripts/build: add clang targets
With this, one can do a CRUI build via QEMU+Docker using clang
as a compiler, for example:

	make -C scripts/build alpine-clang
	make -C scripts/build ppc64le-clang

For alpine, default clang version is used. For others, a version has
to be specified explicitly, as there is no package called "clang" in
Ubuntu Trusty (which is used as a base for most arches). Since
clang-3.8 appears to be available from Trusty, and this is the current
stable version of clang, let's use it.

travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:57 +03:00
Kir Kolyshkin
f571f92b53 Dockerfile: do make mrproper before build
I just spent some considerable time trying to figure out the source
of errors like this:

	make -C scripts/build ppc64
	...
	  DEP      images/autofs.pb-c.d
	In file included from images/autofs.pb-c.c:9:0:
	images/autofs.pb-c.h:7:35: fatal error: protobuf-c/protobuf-c.h:
	No such	file or directory
	 #include <protobuf-c/protobuf-c.h>
					   ^
	compilation terminated.

It appears that we copy the complete tree to a docker container, and it
is not cleaned properly before the build. In particular, images/*.pb-c.{c,h}
are not removed/rebuilt. The problem is not noticeable until version of
protobuf-c differs between the host and container, and they use different
include paths (/usr/include/google/protobuf-c/ vs /usr/include/protobuf-c).

As I don't want anyone else to spend so much time figuring this out,
here is the patch.

travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:56 +03:00
Kir Kolyshkin
d86a3a0e1c Dockerfile.alpine: add git and coretuils
git is needed as the top-level Makefile calls it. Strictly speaking
git is not required to build CRIU, but it's better to have it than
to see some error messages.

coreutils is needed for nproc utility which is called from Dockerfile:

	make -j $(nproc)

Before this patch, it was equivalent to "make -j" (plus an error
message) which is not the best thing to do.

travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:56 +03:00
Andrew Vagin
8876c4bbb8 travis: add a docker file to build on Alpine Linux
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:05 +03:00