From 3a40993d69a9079f7c890bc365a5f74c96287815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Mar 2017 10:11:25 +0100 Subject: Travis CI: Change the language to C We never use the installed Erlang package. Setting the language to C could also allow us to build on platforms that don't support the Erlang language (e.g. osx). --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index baa55b383d..414107e10f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ -language: erlang - -otp_release: - - 18.0 +language: c sudo: false +os: + - linux + addons: apt: packages: @@ -26,7 +26,6 @@ before_script: - export PATH=$ERL_TOP/bin:$PATH - export ERL_LIBS='' - export MAKEFLAGS=-j6 - - kerl_deactivate script: - ./scripts/build-otp -- cgit v1.2.3 From a434fa4622023560e2877a1de698fd4fd15e6b31 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 6 Mar 2017 16:00:21 +0100 Subject: Add docker images for building 32/64 bit erlang --- scripts/Dockerfile.32 | 13 +++++++++++++ scripts/Dockerfile.32.ubuntu | 5 +++++ scripts/Dockerfile.64 | 13 +++++++++++++ scripts/Dockerfile.64.ubuntu | 5 +++++ scripts/build-docker-otp | 13 +++++++++++++ scripts/build-otp | 6 +++++- 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 scripts/Dockerfile.32 create mode 100644 scripts/Dockerfile.32.ubuntu create mode 100644 scripts/Dockerfile.64 create mode 100644 scripts/Dockerfile.64.ubuntu create mode 100755 scripts/build-docker-otp diff --git a/scripts/Dockerfile.32 b/scripts/Dockerfile.32 new file mode 100644 index 0000000000..9622c48a17 --- /dev/null +++ b/scripts/Dockerfile.32 @@ -0,0 +1,13 @@ +FROM erlang/ubuntu-build:32bit + +COPY ./otp.tar.gz /buildroot/ + +WORKDIR /buildroot/ + +RUN tar xzf otp.tar.gz + +WORKDIR /buildroot/otp/ + +ENV MAKEFLAGS -j10 + +CMD ./scripts/build-otp diff --git a/scripts/Dockerfile.32.ubuntu b/scripts/Dockerfile.32.ubuntu new file mode 100644 index 0000000000..c334f74379 --- /dev/null +++ b/scripts/Dockerfile.32.ubuntu @@ -0,0 +1,5 @@ +FROM 32bit/ubuntu:16.04 + +RUN apt-get update + +RUN apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev fop xsltproc default-jdk git autoconf libwxbase3.0-dev libwxgtk3.0-dev diff --git a/scripts/Dockerfile.64 b/scripts/Dockerfile.64 new file mode 100644 index 0000000000..47702b04a5 --- /dev/null +++ b/scripts/Dockerfile.64 @@ -0,0 +1,13 @@ +FROM erlang/ubuntu-build:64bit + +COPY ./otp.tar.gz /buildroot/ + +WORKDIR /buildroot/ + +RUN tar xzf otp.tar.gz + +WORKDIR /buildroot/otp/ + +ENV MAKEFLAGS -j10 + +CMD ./scripts/build-otp diff --git a/scripts/Dockerfile.64.ubuntu b/scripts/Dockerfile.64.ubuntu new file mode 100644 index 0000000000..514fea70b5 --- /dev/null +++ b/scripts/Dockerfile.64.ubuntu @@ -0,0 +1,5 @@ +FROM ubuntu:16.04 + +RUN apt-get update + +RUN apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev fop xsltproc default-jdk git autoconf libwxbase3.0-dev libwxgtk3.0-dev diff --git a/scripts/build-docker-otp b/scripts/build-docker-otp new file mode 100755 index 0000000000..d796759691 --- /dev/null +++ b/scripts/build-docker-otp @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ $# -lt 1 ]; then + echo "Usage $0 32|64 [command]" + exit 1 +fi + +ARCH="$1" + +git archive --format=tar.gz --prefix=otp/ HEAD >otp.tar.gz + +docker build -t otp --file scripts/Dockerfile.$ARCH . +docker run --volume="$PWD/logs:/buildroot/otp/logs" -i --rm otp $2 diff --git a/scripts/build-otp b/scripts/build-otp index da09fb8045..92031c79c8 100755 --- a/scripts/build-otp +++ b/scripts/build-otp @@ -14,7 +14,7 @@ function progress { } function do_and_log { - log="scripts/latest-log.$$" + log="logs/latest-log.$$" echo "" >$log echo -n "$1..." (progress $log) & @@ -32,6 +32,10 @@ function do_and_log { fi } +if [ ! -d "logs" ]; then + mkdir logs +fi + do_and_log "Autoconfing" autoconf do_and_log "Configuring" configure do_and_log "Building OTP" boot -a -- cgit v1.2.3 From cc96d254379776c83aa85bad397a24fc4365c5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Mar 2017 11:54:39 +0100 Subject: Reduce number of jobs for make Running fewer jobs in parallel reduces the risk of running out of memory. --- .travis.yml | 2 +- scripts/Dockerfile.32 | 2 +- scripts/Dockerfile.64 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 414107e10f..8fc3478379 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ before_script: - export ERL_TOP=$PWD - export PATH=$ERL_TOP/bin:$PATH - export ERL_LIBS='' - - export MAKEFLAGS=-j6 + - export MAKEFLAGS=-j4 script: - ./scripts/build-otp diff --git a/scripts/Dockerfile.32 b/scripts/Dockerfile.32 index 9622c48a17..01025340f7 100644 --- a/scripts/Dockerfile.32 +++ b/scripts/Dockerfile.32 @@ -8,6 +8,6 @@ RUN tar xzf otp.tar.gz WORKDIR /buildroot/otp/ -ENV MAKEFLAGS -j10 +ENV MAKEFLAGS -j4 CMD ./scripts/build-otp diff --git a/scripts/Dockerfile.64 b/scripts/Dockerfile.64 index 47702b04a5..c08184d10a 100644 --- a/scripts/Dockerfile.64 +++ b/scripts/Dockerfile.64 @@ -8,6 +8,6 @@ RUN tar xzf otp.tar.gz WORKDIR /buildroot/otp/ -ENV MAKEFLAGS -j10 +ENV MAKEFLAGS -j4 CMD ./scripts/build-otp -- cgit v1.2.3 From c1dab09a681edac9684afea4b6e2522475cea2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Mar 2017 15:00:09 +0100 Subject: builder-docker-otp: Fix passing of command Pass all argument except the first as the command for "docker run". --- scripts/build-docker-otp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build-docker-otp b/scripts/build-docker-otp index d796759691..928b84a32d 100755 --- a/scripts/build-docker-otp +++ b/scripts/build-docker-otp @@ -1,13 +1,14 @@ #!/bin/bash if [ $# -lt 1 ]; then - echo "Usage $0 32|64 [command]" + echo "Usage $0 32|64 [command] [arg]..." exit 1 fi ARCH="$1" +shift git archive --format=tar.gz --prefix=otp/ HEAD >otp.tar.gz docker build -t otp --file scripts/Dockerfile.$ARCH . -docker run --volume="$PWD/logs:/buildroot/otp/logs" -i --rm otp $2 +docker run --volume="$PWD/logs:/buildroot/otp/logs" -i --rm otp ${1+"$@"} -- cgit v1.2.3 From 247412294cbd04ecbd9680646b16d08f53255caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 8 Mar 2017 10:44:02 +0100 Subject: build-docker-otp: Avoid copying the git repository to docker daemon Since docker is run from the top-level of the otp repository, the entire repository will be the context for the docker daemon. In my private repository, more than 800Mb had to be copied before the build could be started. Let the ./scripts directory be the context for docker instead. That way, only the otp.tar.gz file needs to be copied. While we are it, also use the ADD command in the Dockerfiles to pack up the tar file and avoid copying the tar file itself to the Docker image. --- scripts/Dockerfile.32 | 6 +----- scripts/Dockerfile.64 | 6 +----- scripts/build-docker-otp | 5 +++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/scripts/Dockerfile.32 b/scripts/Dockerfile.32 index 01025340f7..23a360a58e 100644 --- a/scripts/Dockerfile.32 +++ b/scripts/Dockerfile.32 @@ -1,10 +1,6 @@ FROM erlang/ubuntu-build:32bit -COPY ./otp.tar.gz /buildroot/ - -WORKDIR /buildroot/ - -RUN tar xzf otp.tar.gz +ADD ./otp.tar.gz /buildroot/ WORKDIR /buildroot/otp/ diff --git a/scripts/Dockerfile.64 b/scripts/Dockerfile.64 index c08184d10a..199067e5fe 100644 --- a/scripts/Dockerfile.64 +++ b/scripts/Dockerfile.64 @@ -1,10 +1,6 @@ FROM erlang/ubuntu-build:64bit -COPY ./otp.tar.gz /buildroot/ - -WORKDIR /buildroot/ - -RUN tar xzf otp.tar.gz +ADD ./otp.tar.gz /buildroot/ WORKDIR /buildroot/otp/ diff --git a/scripts/build-docker-otp b/scripts/build-docker-otp index 928b84a32d..01bb0b628e 100755 --- a/scripts/build-docker-otp +++ b/scripts/build-docker-otp @@ -8,7 +8,8 @@ fi ARCH="$1" shift -git archive --format=tar.gz --prefix=otp/ HEAD >otp.tar.gz +git archive --format=tar.gz --prefix=otp/ HEAD >scripts/otp.tar.gz -docker build -t otp --file scripts/Dockerfile.$ARCH . +docker build -t otp --file scripts/Dockerfile.$ARCH scripts +rm scripts/otp.tar.gz docker run --volume="$PWD/logs:/buildroot/otp/logs" -i --rm otp ${1+"$@"} -- cgit v1.2.3 From 5f9d4d60a92d74221c751f74fa5ae9422ccc803d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Mar 2017 14:35:12 +0100 Subject: run-smoke-test: Let ERL_TOP default to current working directory --- scripts/run-smoke-tests | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/run-smoke-tests b/scripts/run-smoke-tests index c2333e7825..8912c419a4 100755 --- a/scripts/run-smoke-tests +++ b/scripts/run-smoke-tests @@ -1,6 +1,10 @@ #!/bin/bash set -ev +if [ -z "$ERL_TOP" ]; then + ERL_TOP=$(pwd) +fi + cd $ERL_TOP/release/tests/test_server $ERL_TOP/bin/erl -s ts install -s ts smoke_test batch -s init stop -- cgit v1.2.3 From ec8dc46e4ced05bca7ad51481c0795a0c4742a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 8 Mar 2017 13:47:21 +0100 Subject: Run the smoke test for both SMP and non-SMP emulator --- scripts/run-smoke-tests | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/run-smoke-tests b/scripts/run-smoke-tests index 8912c419a4..5a850c7107 100755 --- a/scripts/run-smoke-tests +++ b/scripts/run-smoke-tests @@ -5,10 +5,17 @@ if [ -z "$ERL_TOP" ]; then ERL_TOP=$(pwd) fi -cd $ERL_TOP/release/tests/test_server -$ERL_TOP/bin/erl -s ts install -s ts smoke_test batch -s init stop +function run_smoke_tests { + cd $ERL_TOP/release/tests/test_server + $ERL_TOP/bin/erl -s ts install -s ts smoke_test batch -s init stop + + if grep -q '=failed *[1-9]' ct_run.test_server@*/*/run.*/suite.log; then + echo "One or more tests failed." + exit 1 + fi + rm -rf ct_run.test_server@* +} + +run_smoke_tests +ERL_FLAGS="-smp disable" run_smoke_tests -if grep -q '=failed *[1-9]' ct_run.test_server@*/*/run.*/suite.log; then - echo "One or more tests failed." - exit 1 -fi -- cgit v1.2.3 From b5a5591678140206d86177d0e2df8dbfad825184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Mar 2017 11:33:59 +0100 Subject: Travis CI: Add building of Erlang/OTP on 32-bit Linux Build Erlang and run smoke test in a Docker container running 32-bit Linxux. --- .travis.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8fc3478379..dfa01a89e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,17 @@ addons: - g++ - xsltproc +matrix: + include: + - env: Linux32 + os: linux + services: + - docker + script: + - ./scripts/build-docker-otp 32 sh -c "scripts/build-otp && ./otp_build tests && scripts/run-smoke-tests" + after_success: + after_script: + before_script: - set -e - export ERL_TOP=$PWD @@ -29,7 +40,7 @@ before_script: script: - ./scripts/build-otp - + after_success: - $ERL_TOP/bin/dialyzer --build_plt --apps asn1 compiler crypto dialyzer edoc erts et hipe inets kernel mnesia observer public_key runtime_tools snmp ssh ssl stdlib syntax_tools wx xmerl --statistics - $ERL_TOP/bin/dialyzer -n -Wunknown -Wunmatched_returns --apps compiler erts kernel stdlib asn1 crypto dialyzer hipe parsetools public_key runtime_tools sasl tools --statistics -- cgit v1.2.3