* [tarantool-patches] [PATCH v4] Implement Gitlab-ci testing process
2019-06-19 14:56 [tarantool-patches] [PATCH v4 0/2] Implement Gitlab-ci testing process Alexander V. Tikhonov
@ 2019-06-19 14:56 ` Alexander V. Tikhonov
2019-06-19 14:56 ` [tarantool-patches] [PATCH v4 1/2] Temporary disabled on_shutdown.test.lua test Alexander V. Tikhonov
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-06-19 14:56 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Implemented Gitlba-ci testing process additionaly to travis-ci
that is currently uses. New testing process was added to make
able to control the high load of the testing processes to avoid
of flaky fails on timouts, disks layouts and memory swapping.
Created 2 stages for testing and deploying packages.
Stage test consist of testing jobs for all branches at:
Debian 9 (Stretch): release/debug gcc
Debian 10 (Buster): release clang8 + lto
OSX 14 (Mojave): release
FreeBSD 12: release gcc
and for release branch has additionally:
OSX 13 (Sierra) release clang
OSX 14 (Mojave) release clang + lto
Deploy of packages is the same as in Travis-CI.
Additional manual work is needed if the image's depends was
changed at .travis.mk file - in this way need to do:
make -f .gitlab.mk docker_bootstrap
Fixes #4156
---
.gitlab-ci.yml | 297 +++++++++++++++++++++++++++++++++++++++++++++++++
.gitlab.mk | 57 ++++++++++
.travis.mk | 107 +++++++++++++-----
.travis.yml | 3 +
4 files changed, 437 insertions(+), 27 deletions(-)
create mode 100644 .gitlab-ci.yml
create mode 100644 .gitlab.mk
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..cdb19fcdc
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,297 @@
+stages:
+ - test
+ - deploy
+
+variables:
+ DEPS_VERSION: "master"
+ IMAGE_TEST: "${CI_REGISTRY}/${CI_PROJECT_PATH}/debian-stretch:${DEPS_VERSION}"
+ IMAGE_TEST_LTO: "${CI_REGISTRY}/${CI_PROJECT_PATH}/debian-buster:${DEPS_VERSION}"
+ DENABLE_LTO_ON: "-DENABLE_LTO=ON"
+ GITLAB_MAKE: "make -f .gitlab.mk"
+
+# Tests
+
+release:
+ image: ${IMAGE_TEST}
+ stage: test
+ tags:
+ - docker_test
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+debug:
+ image: ${IMAGE_TEST}
+ stage: test
+ tags:
+ - docker_test
+ script:
+ - ${GITLAB_MAKE} test_coverage_debian_no_deps
+
+release_clang:
+ image: ${IMAGE_TEST}
+ stage: test
+ tags:
+ - docker_test
+ variables:
+ CC: clang
+ CXX: clang++
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+release_lto:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: ${IMAGE_TEST_LTO}
+ stage: test
+ tags:
+ - docker_test
+ variables:
+ CMAKE_EXTRA_PARAMS: ${DENABLE_LTO_ON}
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+release_lto_clang8:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: ${IMAGE_TEST_LTO}
+ stage: test
+ tags:
+ - docker_test
+ variables:
+ CC: clang-8
+ CXX: clang++-8
+ CMAKE_EXTRA_PARAMS: ${DENABLE_LTO_ON}
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+osx_13_release:
+ only:
+ refs:
+ - master
+ - /.*/
+ stage: test
+ tags:
+ - vms_sierra
+ variables:
+ VMS_NAME: 'Sierra'
+ VMS_USER: 'tarantool'
+ VMS_PORT: '2212'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_osx
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+osx_14_release:
+ stage: test
+ tags:
+ - vms_mojave
+ variables:
+ VMS_NAME: 'Mojave'
+ VMS_USER: 'tarantool'
+ VMS_PORT: '2222'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_osx
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+osx_14_release_lto:
+ only:
+ refs:
+ - master
+ - /.*/
+ stage: test
+ tags:
+ - vms_mojave
+ variables:
+ EXTRA_ENV: "export CMAKE_EXTRA_PARAMS=${DENABLE_LTO_ON} ;"
+ VMS_NAME: 'Mojave'
+ VMS_USER: 'tarantool'
+ VMS_PORT: '2222'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_osx
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+freebsd_12_release:
+ stage: test
+ tags:
+ - vms_freebsd
+ variables:
+ VMS_NAME: 'Freebsd'
+ VMS_USER: 'vagrant'
+ VMS_PORT: '2232'
+ TRAVIS_MAKE: 'gmake -f .travis.mk'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_freebsd
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+# Packs
+
+centos_6:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:el-6
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+centos_7:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:el-7
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+fedora_28:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:fedora-28
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+fedora_29:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:fedora-29
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+fedora_30:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:fedora-30
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_14_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-trusty
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_16_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-xenial
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_18_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-bionic
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_18_10:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-cosmic
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_19_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-disco
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+debian_8:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:debian-jessie
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+debian_9:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:debian-stretch
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+debian_10:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:debian-buster
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
diff --git a/.gitlab.mk b/.gitlab.mk
new file mode 100644
index 000000000..793d6ac80
--- /dev/null
+++ b/.gitlab.mk
@@ -0,0 +1,57 @@
+GITLAB_MAKE?=make -f .gitlab.mk
+TRAVIS_MAKE?=make -f .travis.mk
+GITLAB_REGISTRY?=registry.gitlab.com
+
+# docker images bootstrap
+docker_set:
+ $(eval DOCKERFILE := "FROM packpack/packpack:debian-stretch\nCOPY .travis.mk .\nRUN make -f .travis.mk deps_debian")
+ $(eval IMAGE := ${GITLAB_REGISTRY}/tarantool/tarantool/debian-stretch:master)
+
+docker_set_lto:
+ $(eval DOCKERFILE := "FROM packpack/packpack:debian-buster\nCOPY .travis.mk .\nRUN make -f .travis.mk deps_buster_clang_8")
+ $(eval IMAGE := ${GITLAB_REGISTRY}/tarantool/tarantool/debian-buster:master)
+
+docker_build:
+ echo ${DOCKERFILE} | \
+ docker build --network=host -t ${IMAGE} -f- .
+ docker push ${IMAGE}
+
+docker_bootstrap_nolto: docker_set docker_build
+docker_bootstrap_lto: docker_set_lto docker_build
+docker_bootstrap:
+ docker login -u $(USER) ${GITLAB_REGISTRY}
+ ${GITLAB_MAKE} docker_bootstrap_nolto
+ ${GITLAB_MAKE} docker_bootstrap_lto
+
+# build sources with different flags and test
+git_submodule_update:
+ git submodule update --force --recursive --init 2>/dev/null || \
+ git submodule update --recursive --init
+
+test_%_no_deps: git_submodule_update
+ ${TRAVIS_MAKE} $@
+
+# build sources with different flags and test under VBox virtual machines
+vms_start:
+ VBoxManage controlvm ${VMS_NAME} poweroff || true
+ VBoxManage snapshot ${VMS_NAME} restore ${VMS_NAME}
+ VBoxManage startvm ${VMS_NAME} --type headless
+
+vms_test_%:
+ ssh ${VMS_USER}@127.0.0.1 -p ${VMS_PORT} "/bin/bash -c \
+ '${EXTRA_ENV} \
+ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ; \
+ cd tarantool && \
+ git fetch -p && \
+ git checkout --force ${CI_BUILD_REF} && \
+ ${GITLAB_MAKE} git_submodule_update && \
+ ${TRAVIS_MAKE} $(subst vms_,,$@)'"
+
+vms_shutdown:
+ VBoxManage controlvm ${VMS_NAME} poweroff
+
+# build packs and test
+package: git_submodule_update
+ git clone https://github.com/packpack/packpack.git packpack
+ # to avoid of issue with too long names build path is short
+ make -f packpack/pack/Makefile -C . BUILDDIR=/builds/pack -j
diff --git a/.travis.mk b/.travis.mk
index 6d0c42207..dc3bdb5ab 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -3,6 +3,7 @@
#
DOCKER_IMAGE?=packpack/packpack:debian-stretch
+TEST_RUN_EXTRA_PARAMS?=
all: package
@@ -13,8 +14,8 @@ package:
test: test_$(TRAVIS_OS_NAME)
# Redirect some targets via docker
-test_linux: docker_test_ubuntu
-coverage: docker_coverage_ubuntu
+test_linux: docker_test_debian
+coverage: docker_coverage_debian
docker_%:
mkdir -p ~/.cache/ccache
@@ -33,43 +34,42 @@ docker_%:
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
-deps_ubuntu:
- sudo apt-get update && apt-get install -y -f \
+#########
+# Linux #
+#########
+
+deps_debian:
+ apt-get -y update && apt-get install -y -f \
build-essential cmake coreutils sed \
libreadline-dev libncurses5-dev libyaml-dev libssl-dev \
libcurl4-openssl-dev libunwind-dev libicu-dev \
python python-pip python-setuptools python-dev \
python-msgpack python-yaml python-argparse python-six python-gevent \
- lcov ruby clang llvm llvm-dev
+ lcov ruby clang llvm-dev
+
+deps_buster_clang_8: deps_debian
+ echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" > /etc/apt/sources.list.d/clang_8.list
+ echo "deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" >> /etc/apt/sources.list.d/clang_8.list
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
+ apt-get -y update
+ apt-get -y install clang-8 llvm-8-dev
-test_ubuntu: deps_ubuntu
+build_debian:
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
- make -j8
- cd test && /usr/bin/python test-run.py --force -j 1
+ make -j
-deps_osx:
- brew update
- brew install openssl readline curl icu4c --force
- python2 -V || brew install python2 --force
- curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | python
- pip install -r test-run/requirements.txt
+test_debian_no_deps: build_debian
+ cd test && /usr/bin/python test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
-test_osx: deps_osx
- cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
- # Increase the maximum number of open file descriptors on macOS
- sudo sysctl -w kern.maxfiles=20480 || :
- sudo sysctl -w kern.maxfilesperproc=20480 || :
- sudo launchctl limit maxfiles 20480 || :
- ulimit -S -n 20480 || :
- ulimit -n
- make -j8
- cd test && ./test-run.py --force -j 1 unit/ app/ app-tap/ box/ box-tap/
+test_debian: deps_debian test_debian_no_deps
-coverage_ubuntu: deps_ubuntu
+build_coverage_debian:
cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_GCOV=ON
- make -j8
+ make -j
+
+test_coverage_debian_no_deps: build_coverage_debian
# Enable --long tests for coverage
- cd test && /usr/bin/python test-run.py --force -j 1 --long
+ cd test && /usr/bin/python test-run.py --force $(TEST_RUN_EXTRA_PARAMS) --long
lcov --compat-libtool --directory src/ --capture --output-file coverage.info.tmp
lcov --compat-libtool --remove coverage.info.tmp 'tests/*' 'third_party/*' '/usr/*' \
--output-file coverage.info
@@ -81,6 +81,59 @@ coverage_ubuntu: deps_ubuntu
coveralls-lcov --service-name travis-ci --service-job-id $(TRAVIS_JOB_ID) --repo-token $(COVERALLS_TOKEN) coverage.info; \
fi;
+coverage_debian: deps_debian test_coverage_debian_no_deps
+
+#######
+# OSX #
+#######
+
+deps_osx:
+ brew update
+ brew install openssl readline curl icu4c --force
+ python2 -V || brew install python2 --force
+ curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py >get-pip.py
+ python get-pip.py --user
+ pip install --user --ignore-installed -r test-run/requirements.txt
+
+build_osx:
+ cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
+ make -j
+
+test_osx_no_deps: build_osx
+ # Increase the maximum number of open file descriptors on macOS
+ sudo sysctl -w kern.maxfiles=20480 || :
+ sudo sysctl -w kern.maxfilesperproc=20480 || :
+ sudo launchctl limit maxfiles 20480 || :
+ ulimit -S -n 20480 || :
+ ulimit -n
+ cd test && ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS) unit/ app/ app-tap/ box/ box-tap/
+
+test_osx: deps_osx test_osx_no_deps
+
+###########
+# FreeBSD #
+###########
+
+deps_freebsd:
+ sudo pkg install -y git cmake gmake gcc coreutils \
+ readline ncurses libyaml openssl curl libunwind icu \
+ python27 py27-pip py27-setuptools py27-daemon \
+ py27-yaml py27-argparse py27-six py27-gevent \
+ gdb bash
+
+build_freebsd:
+ cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
+ gmake -j
+
+test_freebsd_no_deps: build_freebsd
+ cd test && /usr/bin/python test-run.py --force $(TEST_RUN_EXTRA_PARAMS) || true
+
+test_freebsd: deps_freebsd test_freebsd_no_deps
+
+####################
+# Sources tarballs #
+####################
+
source:
git clone https://github.com/packpack/packpack.git packpack
TARBALL_COMPRESSOR=gz packpack/packpack tarball
diff --git a/.travis.yml b/.travis.yml
index e94d02ef5..4b39dbd56 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,6 +17,9 @@ cache:
git:
depth: 100500
+env: >
+ TEST_RUN_EXTRA_PARAMS="-j 1"
+
jobs:
include:
# Testing targets (just run tests on Debian Stretch or OS X).
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v4 1/2] Temporary disabled on_shutdown.test.lua test
2019-06-19 14:56 [tarantool-patches] [PATCH v4 0/2] Implement Gitlab-ci testing process Alexander V. Tikhonov
2019-06-19 14:56 ` [tarantool-patches] [PATCH v4] " Alexander V. Tikhonov
@ 2019-06-19 14:56 ` Alexander V. Tikhonov
2019-06-19 14:56 ` [tarantool-patches] [PATCH v4 2/2] Implement Gitlab-ci testing process Alexander V. Tikhonov
2019-06-21 14:20 ` [tarantool-patches] Re: [PATCH v4 0/2] " Alexander Turenko
3 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-06-19 14:56 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
---
test/box/suite.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/box/suite.ini b/test/box/suite.ini
index 9197e3c0f..beb925faa 100644
--- a/test/box/suite.ini
+++ b/test/box/suite.ini
@@ -2,7 +2,7 @@
core = tarantool
description = Database tests
script = box.lua
-disabled = rtree_errinj.test.lua tuple_bench.test.lua
+disabled = rtree_errinj.test.lua tuple_bench.test.lua on_shutdown.test.lua
release_disabled = errinj.test.lua errinj_index.test.lua rtree_errinj.test.lua upsert_errinj.test.lua iproto_stress.test.lua
lua_libs = lua/fifo.lua lua/utils.lua lua/bitset.lua lua/index_random_test.lua lua/push.lua lua/identifier.lua
use_unix_sockets = True
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v4 2/2] Implement Gitlab-ci testing process
2019-06-19 14:56 [tarantool-patches] [PATCH v4 0/2] Implement Gitlab-ci testing process Alexander V. Tikhonov
2019-06-19 14:56 ` [tarantool-patches] [PATCH v4] " Alexander V. Tikhonov
2019-06-19 14:56 ` [tarantool-patches] [PATCH v4 1/2] Temporary disabled on_shutdown.test.lua test Alexander V. Tikhonov
@ 2019-06-19 14:56 ` Alexander V. Tikhonov
2019-06-21 14:20 ` [tarantool-patches] Re: [PATCH v4 0/2] " Alexander Turenko
3 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-06-19 14:56 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Implemented Gitlba-ci testing process additionaly to travis-ci
that is currently uses. New testing process was added to make
able to control the high load of the testing processes to avoid
of flaky fails on timouts, disks layouts and memory swapping.
Created 2 stages for testing and deploying packages.
Stage test consist of testing jobs for all branches at:
Debian 9 (Stretch): release/debug gcc
Debian 10 (Buster): release clang8 + lto
OSX 14 (Mojave): release
FreeBSD 12: release gcc
and for release branch has additionally:
OSX 13 (Sierra) release clang
OSX 14 (Mojave) release clang + lto
Deploy of packages is the same as in Travis-CI.
Additional manual work is needed if the image's depends was
changed at .travis.mk file - in this way need to do:
make -f .gitlab.mk docker_bootstrap
Fixes #4156
---
.gitlab-ci.yml | 297 +++++++++++++++++++++++++++++++++++++++++++++++++
.gitlab.mk | 57 ++++++++++
.travis.mk | 107 +++++++++++++-----
.travis.yml | 3 +
4 files changed, 437 insertions(+), 27 deletions(-)
create mode 100644 .gitlab-ci.yml
create mode 100644 .gitlab.mk
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..cdb19fcdc
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,297 @@
+stages:
+ - test
+ - deploy
+
+variables:
+ DEPS_VERSION: "master"
+ IMAGE_TEST: "${CI_REGISTRY}/${CI_PROJECT_PATH}/debian-stretch:${DEPS_VERSION}"
+ IMAGE_TEST_LTO: "${CI_REGISTRY}/${CI_PROJECT_PATH}/debian-buster:${DEPS_VERSION}"
+ DENABLE_LTO_ON: "-DENABLE_LTO=ON"
+ GITLAB_MAKE: "make -f .gitlab.mk"
+
+# Tests
+
+release:
+ image: ${IMAGE_TEST}
+ stage: test
+ tags:
+ - docker_test
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+debug:
+ image: ${IMAGE_TEST}
+ stage: test
+ tags:
+ - docker_test
+ script:
+ - ${GITLAB_MAKE} test_coverage_debian_no_deps
+
+release_clang:
+ image: ${IMAGE_TEST}
+ stage: test
+ tags:
+ - docker_test
+ variables:
+ CC: clang
+ CXX: clang++
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+release_lto:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: ${IMAGE_TEST_LTO}
+ stage: test
+ tags:
+ - docker_test
+ variables:
+ CMAKE_EXTRA_PARAMS: ${DENABLE_LTO_ON}
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+release_lto_clang8:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: ${IMAGE_TEST_LTO}
+ stage: test
+ tags:
+ - docker_test
+ variables:
+ CC: clang-8
+ CXX: clang++-8
+ CMAKE_EXTRA_PARAMS: ${DENABLE_LTO_ON}
+ script:
+ - ${GITLAB_MAKE} test_debian_no_deps
+
+osx_13_release:
+ only:
+ refs:
+ - master
+ - /.*/
+ stage: test
+ tags:
+ - vms_sierra
+ variables:
+ VMS_NAME: 'Sierra'
+ VMS_USER: 'tarantool'
+ VMS_PORT: '2212'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_osx
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+osx_14_release:
+ stage: test
+ tags:
+ - vms_mojave
+ variables:
+ VMS_NAME: 'Mojave'
+ VMS_USER: 'tarantool'
+ VMS_PORT: '2222'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_osx
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+osx_14_release_lto:
+ only:
+ refs:
+ - master
+ - /.*/
+ stage: test
+ tags:
+ - vms_mojave
+ variables:
+ EXTRA_ENV: "export CMAKE_EXTRA_PARAMS=${DENABLE_LTO_ON} ;"
+ VMS_NAME: 'Mojave'
+ VMS_USER: 'tarantool'
+ VMS_PORT: '2222'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_osx
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+freebsd_12_release:
+ stage: test
+ tags:
+ - vms_freebsd
+ variables:
+ VMS_NAME: 'Freebsd'
+ VMS_USER: 'vagrant'
+ VMS_PORT: '2232'
+ TRAVIS_MAKE: 'gmake -f .travis.mk'
+ before_script:
+ - ${GITLAB_MAKE} vms_start
+ script:
+ - ${GITLAB_MAKE} vms_test_freebsd
+ after_script:
+ - ${GITLAB_MAKE} vms_shutdown
+
+# Packs
+
+centos_6:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:el-6
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+centos_7:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:el-7
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+fedora_28:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:fedora-28
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+fedora_29:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:fedora-29
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+fedora_30:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:fedora-30
+ stage: deploy
+ tags:
+ - deploy_test
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_14_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-trusty
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_16_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-xenial
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_18_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-bionic
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_18_10:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-cosmic
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+ubuntu_19_04:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:ubuntu-disco
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+debian_8:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:debian-jessie
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+debian_9:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:debian-stretch
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
+
+debian_10:
+ only:
+ refs:
+ - master
+ - /.*/
+ image: packpack/packpack:debian-buster
+ stage: deploy
+ tags:
+ - deploy
+ script:
+ - ${GITLAB_MAKE} package
diff --git a/.gitlab.mk b/.gitlab.mk
new file mode 100644
index 000000000..793d6ac80
--- /dev/null
+++ b/.gitlab.mk
@@ -0,0 +1,57 @@
+GITLAB_MAKE?=make -f .gitlab.mk
+TRAVIS_MAKE?=make -f .travis.mk
+GITLAB_REGISTRY?=registry.gitlab.com
+
+# docker images bootstrap
+docker_set:
+ $(eval DOCKERFILE := "FROM packpack/packpack:debian-stretch\nCOPY .travis.mk .\nRUN make -f .travis.mk deps_debian")
+ $(eval IMAGE := ${GITLAB_REGISTRY}/tarantool/tarantool/debian-stretch:master)
+
+docker_set_lto:
+ $(eval DOCKERFILE := "FROM packpack/packpack:debian-buster\nCOPY .travis.mk .\nRUN make -f .travis.mk deps_buster_clang_8")
+ $(eval IMAGE := ${GITLAB_REGISTRY}/tarantool/tarantool/debian-buster:master)
+
+docker_build:
+ echo ${DOCKERFILE} | \
+ docker build --network=host -t ${IMAGE} -f- .
+ docker push ${IMAGE}
+
+docker_bootstrap_nolto: docker_set docker_build
+docker_bootstrap_lto: docker_set_lto docker_build
+docker_bootstrap:
+ docker login -u $(USER) ${GITLAB_REGISTRY}
+ ${GITLAB_MAKE} docker_bootstrap_nolto
+ ${GITLAB_MAKE} docker_bootstrap_lto
+
+# build sources with different flags and test
+git_submodule_update:
+ git submodule update --force --recursive --init 2>/dev/null || \
+ git submodule update --recursive --init
+
+test_%_no_deps: git_submodule_update
+ ${TRAVIS_MAKE} $@
+
+# build sources with different flags and test under VBox virtual machines
+vms_start:
+ VBoxManage controlvm ${VMS_NAME} poweroff || true
+ VBoxManage snapshot ${VMS_NAME} restore ${VMS_NAME}
+ VBoxManage startvm ${VMS_NAME} --type headless
+
+vms_test_%:
+ ssh ${VMS_USER}@127.0.0.1 -p ${VMS_PORT} "/bin/bash -c \
+ '${EXTRA_ENV} \
+ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ; \
+ cd tarantool && \
+ git fetch -p && \
+ git checkout --force ${CI_BUILD_REF} && \
+ ${GITLAB_MAKE} git_submodule_update && \
+ ${TRAVIS_MAKE} $(subst vms_,,$@)'"
+
+vms_shutdown:
+ VBoxManage controlvm ${VMS_NAME} poweroff
+
+# build packs and test
+package: git_submodule_update
+ git clone https://github.com/packpack/packpack.git packpack
+ # to avoid of issue with too long names build path is short
+ make -f packpack/pack/Makefile -C . BUILDDIR=/builds/pack -j
diff --git a/.travis.mk b/.travis.mk
index 6d0c42207..dc3bdb5ab 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -3,6 +3,7 @@
#
DOCKER_IMAGE?=packpack/packpack:debian-stretch
+TEST_RUN_EXTRA_PARAMS?=
all: package
@@ -13,8 +14,8 @@ package:
test: test_$(TRAVIS_OS_NAME)
# Redirect some targets via docker
-test_linux: docker_test_ubuntu
-coverage: docker_coverage_ubuntu
+test_linux: docker_test_debian
+coverage: docker_coverage_debian
docker_%:
mkdir -p ~/.cache/ccache
@@ -33,43 +34,42 @@ docker_%:
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
-deps_ubuntu:
- sudo apt-get update && apt-get install -y -f \
+#########
+# Linux #
+#########
+
+deps_debian:
+ apt-get -y update && apt-get install -y -f \
build-essential cmake coreutils sed \
libreadline-dev libncurses5-dev libyaml-dev libssl-dev \
libcurl4-openssl-dev libunwind-dev libicu-dev \
python python-pip python-setuptools python-dev \
python-msgpack python-yaml python-argparse python-six python-gevent \
- lcov ruby clang llvm llvm-dev
+ lcov ruby clang llvm-dev
+
+deps_buster_clang_8: deps_debian
+ echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" > /etc/apt/sources.list.d/clang_8.list
+ echo "deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" >> /etc/apt/sources.list.d/clang_8.list
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
+ apt-get -y update
+ apt-get -y install clang-8 llvm-8-dev
-test_ubuntu: deps_ubuntu
+build_debian:
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
- make -j8
- cd test && /usr/bin/python test-run.py --force -j 1
+ make -j
-deps_osx:
- brew update
- brew install openssl readline curl icu4c --force
- python2 -V || brew install python2 --force
- curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | python
- pip install -r test-run/requirements.txt
+test_debian_no_deps: build_debian
+ cd test && /usr/bin/python test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
-test_osx: deps_osx
- cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
- # Increase the maximum number of open file descriptors on macOS
- sudo sysctl -w kern.maxfiles=20480 || :
- sudo sysctl -w kern.maxfilesperproc=20480 || :
- sudo launchctl limit maxfiles 20480 || :
- ulimit -S -n 20480 || :
- ulimit -n
- make -j8
- cd test && ./test-run.py --force -j 1 unit/ app/ app-tap/ box/ box-tap/
+test_debian: deps_debian test_debian_no_deps
-coverage_ubuntu: deps_ubuntu
+build_coverage_debian:
cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_GCOV=ON
- make -j8
+ make -j
+
+test_coverage_debian_no_deps: build_coverage_debian
# Enable --long tests for coverage
- cd test && /usr/bin/python test-run.py --force -j 1 --long
+ cd test && /usr/bin/python test-run.py --force $(TEST_RUN_EXTRA_PARAMS) --long
lcov --compat-libtool --directory src/ --capture --output-file coverage.info.tmp
lcov --compat-libtool --remove coverage.info.tmp 'tests/*' 'third_party/*' '/usr/*' \
--output-file coverage.info
@@ -81,6 +81,59 @@ coverage_ubuntu: deps_ubuntu
coveralls-lcov --service-name travis-ci --service-job-id $(TRAVIS_JOB_ID) --repo-token $(COVERALLS_TOKEN) coverage.info; \
fi;
+coverage_debian: deps_debian test_coverage_debian_no_deps
+
+#######
+# OSX #
+#######
+
+deps_osx:
+ brew update
+ brew install openssl readline curl icu4c --force
+ python2 -V || brew install python2 --force
+ curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py >get-pip.py
+ python get-pip.py --user
+ pip install --user --ignore-installed -r test-run/requirements.txt
+
+build_osx:
+ cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
+ make -j
+
+test_osx_no_deps: build_osx
+ # Increase the maximum number of open file descriptors on macOS
+ sudo sysctl -w kern.maxfiles=20480 || :
+ sudo sysctl -w kern.maxfilesperproc=20480 || :
+ sudo launchctl limit maxfiles 20480 || :
+ ulimit -S -n 20480 || :
+ ulimit -n
+ cd test && ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS) unit/ app/ app-tap/ box/ box-tap/
+
+test_osx: deps_osx test_osx_no_deps
+
+###########
+# FreeBSD #
+###########
+
+deps_freebsd:
+ sudo pkg install -y git cmake gmake gcc coreutils \
+ readline ncurses libyaml openssl curl libunwind icu \
+ python27 py27-pip py27-setuptools py27-daemon \
+ py27-yaml py27-argparse py27-six py27-gevent \
+ gdb bash
+
+build_freebsd:
+ cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
+ gmake -j
+
+test_freebsd_no_deps: build_freebsd
+ cd test && /usr/bin/python test-run.py --force $(TEST_RUN_EXTRA_PARAMS) || true
+
+test_freebsd: deps_freebsd test_freebsd_no_deps
+
+####################
+# Sources tarballs #
+####################
+
source:
git clone https://github.com/packpack/packpack.git packpack
TARBALL_COMPRESSOR=gz packpack/packpack tarball
diff --git a/.travis.yml b/.travis.yml
index e94d02ef5..4b39dbd56 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,6 +17,9 @@ cache:
git:
depth: 100500
+env: >
+ TEST_RUN_EXTRA_PARAMS="-j 1"
+
jobs:
include:
# Testing targets (just run tests on Debian Stretch or OS X).
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] Re: [PATCH v4 0/2] Implement Gitlab-ci testing process
2019-06-19 14:56 [tarantool-patches] [PATCH v4 0/2] Implement Gitlab-ci testing process Alexander V. Tikhonov
` (2 preceding siblings ...)
2019-06-19 14:56 ` [tarantool-patches] [PATCH v4 2/2] Implement Gitlab-ci testing process Alexander V. Tikhonov
@ 2019-06-21 14:20 ` Alexander Turenko
2019-06-24 8:13 ` [tarantool-patches] " Alexander Tikhonov
3 siblings, 1 reply; 6+ messages in thread
From: Alexander Turenko @ 2019-06-21 14:20 UTC (permalink / raw)
To: Alexander V. Tikhonov; +Cc: tarantool-patches
## Changes
(Updated your branch as we agreed voicely.)
Fixed spelling and changed wording in the commit messages.
Splitted goals in .gitlab.mk into sections just like you are made it for
.travis.mk and commented these sections.
Rewritten 'docker_bootstrap' goal to write docker files in a multiline
way. Reworked tags for these images: use :latest in testing, but always
push both :`md5sum of .travis.mk` and :latest tags.
## Comments
I would remove 'master' tag at all, because of several reasons:
* It appears over several files and it will be hard to keep it
consistent.
* We rarely change something here and I don't remember case when we
remove some dependency.
* It is not obvious that 'master' tag is intended to be used for all
branches that are based on master, 2.1 for branches based on 2.1),
etc.
I thinking whether we should use
tarantool/tarantool/testing/debian-<...> for images naming? I would be
more clear why the image is needed and also will allow use to use this
namespace (tarantool/tarantool) for images of other purposes. I don't do
that in my changes.
Re 'deploy' jobs. I would run the packpack script with environment
variables rather then call its internal makefile inside a docker image
run by gitlab runner. This is how it is performed for Travis CI.
I doubt about a hardcoded repository within a virtual machine image. I
suggest to leave only system things in the image (install and setup
packages and so on), but don't do such special tarantool-related things.
I very against of black boxes like these VM images. Nobody knows what it
is. Nobody can reproduce a problem. So, please implement make goals that
will create vm images identical to ones that is used in testing.
Also I would look into vagrant. As I see, there are OS X and FreeBSD
images. We need to check their licenses, BTW. Don't sure about pushing
images, but at least local using should be possible.
Maybe I forgotten something that we discussed voicely.
WBR, Alexander Turenko.
On Wed, Jun 19, 2019 at 05:56:29PM +0300, Alexander V. Tikhonov wrote:
> Implement Gitlab-ci testing process
>
> Implemented Gitlba-ci testing process additionaly to travis-ci
> that is currently uses. New testing process was added to make
> able to control the high load of the testing processes to avoid
> of flaky fails on timouts, disks layouts and memory swapping.
> Created 2 stages for testing and deploying packages.
> Stage test consist of testing jobs for all branches at:
> Debian 9 (Stretch): release/debug gcc
> Debian 10 (Buster): release clang8 + lto
> OSX 14 (Mojave): release
> FreeBSD 12: release gcc
> and for release branch has additionally:
> OSX 13 (Sierra) release clang
> OSX 14 (Mojave) release clang + lto
> Deploy of packages is the same as in Travis-CI.
> Additional manual work is needed if the image's depends was
> changed at .travis.mk file - in this way need to do:
> make -f .gitlab.mk docker_bootstrap
>
> Fixes #4156
>
>
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4156-gitlab-ci-testing
> Issue: https://github.com/tarantool/tarantool/issues/4156
>
> Alexander V. Tikhonov (2):
> Temporary disabled on_shutdown.test.lua test
> Implement Gitlab-ci testing process
>
> .gitlab-ci.yml | 297 +++++++++++++++++++++++++++++++++++++++++++++
> .gitlab.mk | 57 +++++++++
> .travis.mk | 107 +++++++++++-----
> .travis.yml | 3 +
> test/box/suite.ini | 2 +-
> 5 files changed, 438 insertions(+), 28 deletions(-)
> create mode 100644 .gitlab-ci.yml
> create mode 100644 .gitlab.mk
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] Re: [tarantool-patches] Re: [PATCH v4 0/2] Implement Gitlab-ci testing process
2019-06-21 14:20 ` [tarantool-patches] Re: [PATCH v4 0/2] " Alexander Turenko
@ 2019-06-24 8:13 ` Alexander Tikhonov
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Tikhonov @ 2019-06-24 8:13 UTC (permalink / raw)
To: alexander.turenko; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 4543 bytes --]
>Пятница, 21 июня 2019, 17:20 +03:00 от Alexander Turenko <alexander.turenko@tarantool.org>:
>
>## Changes
>
>(Updated your branch as we agreed voicely.)
>
>Fixed spelling and changed wording in the commit messages.
>
>Splitted goals in .gitlab.mk into sections just like you are made it for
>.travis.mk and commented these sections.
>
>Rewritten 'docker_bootstrap' goal to write docker files in a multiline
>way. Reworked tags for these images: use :latest in testing, but always
>push both :`md5sum of .travis.mk` and :latest tags.
Ok.
>
>## Comments
>
>I would remove 'master' tag at all, because of several reasons:
>
>* It appears over several files and it will be hard to keep it
> consistent.
>* We rarely change something here and I don't remember case when we
> remove some dependency.
>* It is not obvious that 'master' tag is intended to be used for all
> branches that are based on master, 2.1 for branches based on 2.1),
> etc.
Ok.
>
>I thinking whether we should use
>tarantool/tarantool/testing/debian-<...> for images naming? I would be
>more clear why the image is needed and also will allow use to use this
>namespace (tarantool/tarantool) for images of other purposes. I don't do
>that in my changes.
Fixed, added /testing/ sub-directory into the image name repository.
>
>Re 'deploy' jobs. I would run the packpack script with environment
>variables rather then call its internal makefile inside a docker image
>run by gitlab runner. This is how it is performed for Travis CI.
Fixed.
>
>I doubt about a hardcoded repository within a virtual machine image. I
>suggest to leave only system things in the image (install and setup
>packages and so on), but don't do such special tarantool-related things.
Fixed.
>
>I very against of black boxes like these VM images. Nobody knows what it
>is. Nobody can reproduce a problem. So, please implement make goals that
>will create vm images identical to ones that is used in testing.
There are all needed targets at the .gitlab.mk file, just use the same environment
of the job from .gitlab-ci.yml that you need and run from tarantool sources, like:
VMS_NAME=osx_14 make -f .gitlab.mk vms_start
VMS_USER=tarantool VMS_PORT=2222 make -f .gitlab.mk vms_test_osx
NOTE: To run it locally the VBOX should be installed with needed images.
>
>Also I would look into vagrant. As I see, there are OS X and FreeBSD
>images. We need to check their licenses, BTW. Don't sure about pushing
>images, but at least local using should be possible.
As discussed voicely currently the Virtual Box will be used and the Vagrant images
will be integrated during the issue:
https://github.com/tarantool/tarantool/issues/4308
>
>Maybe I forgotten something that we discussed voicely.
>
>WBR, Alexander Turenko.
>
>On Wed, Jun 19, 2019 at 05:56:29PM +0300, Alexander V. Tikhonov wrote:
>> Implement Gitlab-ci testing process
>>
>> Implemented Gitlba-ci testing process additionaly to travis-ci
>> that is currently uses. New testing process was added to make
>> able to control the high load of the testing processes to avoid
>> of flaky fails on timouts, disks layouts and memory swapping.
>> Created 2 stages for testing and deploying packages.
>> Stage test consist of testing jobs for all branches at:
>> Debian 9 (Stretch): release/debug gcc
>> Debian 10 (Buster): release clang8 + lto
>> OSX 14 (Mojave): release
>> FreeBSD 12: release gcc
>> and for release branch has additionally:
>> OSX 13 (Sierra) release clang
>> OSX 14 (Mojave) release clang + lto
>> Deploy of packages is the same as in Travis-CI.
>> Additional manual work is needed if the image's depends was
>> changed at .travis.mk file - in this way need to do:
>> make -f .gitlab.mk docker_bootstrap
>>
>> Fixes #4156
>>
>>
>> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4156-gitlab-ci-testing
>> Issue: https://github.com/tarantool/tarantool/issues/4156
>>
>> Alexander V. Tikhonov (2):
>> Temporary disabled on_shutdown.test.lua test
>> Implement Gitlab-ci testing process
>>
>> .gitlab-ci.yml | 297 +++++++++++++++++++++++++++++++++++++++++++++
>> .gitlab.mk | 57 +++++++++
>> .travis.mk | 107 +++++++++++-----
>> .travis.yml | 3 +
>> test/box/suite.ini | 2 +-
>> 5 files changed, 438 insertions(+), 28 deletions(-)
>> create mode 100644 .gitlab-ci.yml
>> create mode 100644 .gitlab.mk
>>
>> --
>> 2.17.1
>>
>
--
Alexander Tikhonov
[-- Attachment #2: Type: text/html, Size: 7457 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread