Skip to content

Commit 748c783

Browse files
committed
try with dedicated for building
1 parent 38d00f9 commit 748c783

File tree

6 files changed

+124
-105
lines changed

6 files changed

+124
-105
lines changed

.ci/travis/linux/docker-build-test.sh

-90
Original file line numberDiff line numberDiff line change
@@ -2,96 +2,6 @@
22

33
set -e
44

5-
##############
6-
# Setup ccache
7-
##############
8-
export CCACHE_TEMPDIR=/tmp
9-
ccache -M 1G
10-
11-
# Temporarily uncomment to debug ccache issues
12-
# export CCACHE_LOGFILE=/tmp/cache.debug
13-
ccache -z
14-
15-
############################
16-
# Setup the (c)test environment
17-
############################
18-
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
19-
export SEGFAULT_SIGNALS="abrt segv"
20-
export CTEST_BUILD_COMMAND="/usr/bin/ninja"
21-
export CTEST_PARALLEL_LEVEL=1
22-
23-
##############################
24-
# Variables for output styling
25-
##############################
26-
27-
bold=$(tput bold)
28-
endbold=$(tput sgr0)
29-
30-
###########
31-
# Configure
32-
###########
33-
pushd /root/QGIS > /dev/null
34-
mkdir -p build
35-
36-
pushd build > /dev/null
37-
38-
echo "travis_fold:start:cmake"
39-
echo "${bold}Running cmake...${endbold}"
40-
cmake \
41-
-GNinja \
42-
-DUSE_CCACHE=OFF \
43-
-DWITH_QUICK=ON \
44-
-DWITH_3D=ON \
45-
-DWITH_STAGED_PLUGINS=ON \
46-
-DWITH_GRASS=OFF \
47-
-DSUPPRESS_QT_WARNINGS=ON \
48-
-DENABLE_MODELTEST=ON \
49-
-DENABLE_PGTEST=ON \
50-
-DENABLE_MSSQLTEST=ON \
51-
-DWITH_QSPATIALITE=ON \
52-
-DWITH_QWTPOLAR=OFF \
53-
-DWITH_APIDOC=OFF \
54-
-DWITH_ASTYLE=OFF \
55-
-DWITH_DESKTOP=ON \
56-
-DWITH_BINDINGS=ON \
57-
-DWITH_SERVER=ON \
58-
-DDISABLE_DEPRECATED=ON \
59-
-DPYTHON_TEST_WRAPPER="timeout -sSIGSEGV 55s"\
60-
-DCXX_EXTRA_FLAGS="${CLANG_WARNINGS}" \
61-
-DWERROR=TRUE \
62-
-DQT5_3DEXTRA_LIBRARY="/usr/lib/x86_64-linux-gnu/libQt53DExtras.so" \
63-
-DQT5_3DEXTRA_INCLUDE_DIR="/root/QGIS/external/qt3dextra-headers" \
64-
-DCMAKE_PREFIX_PATH="/root/QGIS/external/qt3dextra-headers/cmake" \
65-
..
66-
echo "travis_fold:end:cmake"
67-
68-
#######
69-
# Build
70-
#######
71-
# Calculate the timeout for building.
72-
# The tests should be aborted before travis times out, in order to allow uploading
73-
# the ccache and therefore speedup subsequent e builds.
74-
#
75-
# Travis will kill the job after approx 150 minutes, we subtract 5 minutes for
76-
# uploading and subtract the bootstrapping time from that.
77-
# Hopefully clocks are in sync :)
78-
TRAVIS_TIME=150
79-
UPLOAD_TIME=5
80-
CURRENT_TIME=$(date +%s)
81-
TIMEOUT=$((( TRAVIS_TIME - UPLOAD_TIME ) * 60 - CURRENT_TIME + TRAVIS_TIMESTAMP))
82-
TIMEOUT=$(( TIMEOUT < 300 ? 300 : TIMEOUT ))
83-
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
84-
85-
# echo "travis_fold:start:ninja-build.1"
86-
echo "${bold}Building QGIS...${endbold}"
87-
timeout ${TIMEOUT}s ${CTEST_BUILD_COMMAND}
88-
# echo "travis_fold:end:ninja-build.1"
89-
90-
rv=$?
91-
if [ $rv -eq 124 ] ; then
92-
printf '\n\n${bold}Build and test timeout. Please restart the build for meaningful results.${endbold}\n'
93-
exit #$rv
94-
fi
955

966
##############################
977
# Run Python Tests on QGIS app

.ci/travis/linux/script.sh

+10
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@
1717
set -e
1818

1919
# running QGIS tests
20+
21+
docker build -t qgis_testing -f .docker/qgis_testing.dockerfile .
22+
23+
docker run qgis test.sh
24+
docker exec
25+
26+
27+
2028
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml run qgis-deps
29+
30+
docker run -it qgis-deps

.docker/qgis3-build-deps-cosmic.dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,3 @@ ENV CXX=/usr/lib/ccache/clang++
135135
ENV QT_SELECT=5
136136
ENV LANG=C.UTF-8
137137
ENV PATH="/usr/local/bin:${PATH}"
138-
139-
CMD /root/QGIS/.ci/travis/linux/docker-build-test.sh

.docker/qgis3-build-deps.dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,3 @@ ENV CXX=/usr/lib/ccache/clang++
152152
ENV QT_SELECT=5
153153
ENV LANG=C.UTF-8
154154
ENV PATH="/usr/local/bin:${PATH}"
155-
156-
CMD /root/QGIS/.ci/travis/linux/docker-build-test.sh

.docker/qgis_resources/test_runner/qgis_testrunner.sh

-11
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@
1010

1111
TEST_NAME=$1
1212

13-
export PYTHONUNBUFFERED=TRUE
14-
15-
echo "Running test $1 ..."
16-
17-
qgis --version-migration --nologo --code /usr/bin/qgis_testrunner.py "$TEST_NAME" 2>/dev/null
18-
19-
20-
echo "Running test with unbuffer $1 ..."
21-
22-
unbuffer qgis --version-migration --nologo --code /usr/bin/qgis_testrunner.py "$TEST_NAME" 2>/dev/null
23-
2413
echo "Running test really $1 ..."
2514
OUTPUT=$(QGIS_TEST_MODULE=${TEST_NAME} unbuffer qgis --version-migration --nologo --code /usr/bin/qgis_testrunner.py "$TEST_NAME" 2>/dev/null | tee /dev/tty )
2615
EXIT_CODE="$?"

.docker/qgis_testing.dockerfile

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2+
ARG DOCKER_TAG=latest
3+
FROM qgis/qgis3-build-deps:${DOCKER_TAG}
4+
MAINTAINER Denis Rouzaud <denis@opengis.ch>
5+
6+
LABEL Description="Docker container with QGIS build for testing" Vendor="QGIS.org" Version="1.1"
7+
8+
ENV CC=/usr/lib/ccache/clang
9+
ENV CXX=/usr/lib/ccache/clang++
10+
ENV QT_SELECT=5
11+
ENV LANG=C.UTF-8
12+
############################
13+
# Setup the (c)test environment
14+
ENV LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
15+
ENV SEGFAULT_SIGNALS="abrt segv"
16+
ENV CTEST_BUILD_COMMAND="/usr/bin/ninja"
17+
ENV CTEST_PARALLEL_LEVEL=1
18+
19+
20+
##############################
21+
# Copy source
22+
COPY . /usr/src/QGIS
23+
WORKDIR /usr/src/QGIS/build
24+
25+
##############################
26+
# ccache
27+
ENV CCACHE_DIR=/usr/src/QGIS/.ccache
28+
RUN ccache -M 1G
29+
RUN ccache -s
30+
# Temporarily uncomment to debug ccache issues
31+
# export CCACHE_LOGFILE=/tmp/cache.debug
32+
RUN ccache -z
33+
34+
35+
###########
36+
# Configure
37+
RUN echo "travis_fold:start:cmake"
38+
RUN echo "Running cmake..."
39+
RUN cmake \
40+
-GNinja \
41+
-DUSE_CCACHE=OFF \
42+
-DWITH_QUICK=ON \
43+
-DWITH_3D=ON \
44+
-DWITH_STAGED_PLUGINS=ON \
45+
-DWITH_GRASS=OFF \
46+
-DSUPPRESS_QT_WARNINGS=ON \
47+
-DENABLE_MODELTEST=ON \
48+
-DENABLE_PGTEST=ON \
49+
-DENABLE_MSSQLTEST=ON \
50+
-DWITH_QSPATIALITE=ON \
51+
-DWITH_QWTPOLAR=OFF \
52+
-DWITH_APIDOC=OFF \
53+
-DWITH_ASTYLE=OFF \
54+
-DWITH_DESKTOP=ON \
55+
-DWITH_BINDINGS=ON \
56+
-DWITH_SERVER=ON \
57+
-DDISABLE_DEPRECATED=ON \
58+
-DPYTHON_TEST_WRAPPER="timeout -sSIGSEGV 55s"\
59+
-DCXX_EXTRA_FLAGS="${CLANG_WARNINGS}" \
60+
-DWERROR=TRUE \
61+
-DQT5_3DEXTRA_LIBRARY="/usr/lib/x86_64-linux-gnu/libQt53DExtras.so" \
62+
-DQT5_3DEXTRA_INCLUDE_DIR="/root/QGIS/external/qt3dextra-headers" \
63+
-DCMAKE_PREFIX_PATH="/root/QGIS/external/qt3dextra-headers/cmake" \
64+
..
65+
RUN echo "travis_fold:end:cmake"
66+
67+
#######
68+
# Build
69+
#######
70+
# Calculate the timeout for building.
71+
# The tests should be aborted before travis times out, in order to allow uploading
72+
# the ccache and therefore speedup subsequent e builds.
73+
#
74+
# Travis will kill the job after approx 150 minutes, we subtract 5 minutes for
75+
# uploading and subtract the bootstrapping time from that.
76+
# Hopefully clocks are in sync :)
77+
ENV TRAVIS_TIME=150
78+
ENV UPLOAD_TIME=5
79+
RUN export CURRENT_TIME=$(date +%s) \
80+
&& export TIMEOUT=$((( TRAVIS_TIME - UPLOAD_TIME ) * 60 - CURRENT_TIME + TRAVIS_TIMESTAMP)) \
81+
&& export TIMEOUT=$(( TIMEOUT < 300 ? 300 : TIMEOUT )) \
82+
&& echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
83+
84+
# echo "travis_fold:start:ninja-build.1"
85+
RUN echo "Building QGIS..."
86+
RUN timeout ${TIMEOUT}s ${CTEST_BUILD_COMMAND} && rv=$? && \
87+
if [ $rv -eq 124 ] ; then printf '\n\nBuild and test timeout. Please restart the build for meaningful results.\n'; exit #$rv; fi
88+
89+
90+
################################################################################
91+
# Python testing environment setup
92+
93+
# Add QGIS test runner
94+
COPY .docker/qgis_resources/test_runner/qgis_* /usr/bin/
95+
96+
# Make all scripts executable
97+
RUN chmod +x /usr/bin/qgis_*
98+
99+
# Add supervisor service configuration script
100+
COPY .docker/qgis_resources/supervisor/supervisord.conf /etc/supervisor/
101+
COPY .docker/qgis_resources/supervisor/supervisor.xvfb.conf /etc/supervisor/supervisor.d/
102+
103+
# Python paths are for
104+
# - kartoza images (compiled)
105+
# - deb installed
106+
# - built from git
107+
# needed to find PyQt wrapper provided by QGIS
108+
ENV PYTHONPATH=/usr/share/qgis/python/:/usr/share/qgis/python/plugins:/usr/lib/python3/dist-packages/qgis:/usr/share/qgis/python/qgis
109+
110+
111+
WORKDIR /
112+
113+
# Run supervisor
114+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

0 commit comments

Comments
 (0)