diff options
author | Arnstein Ressem <aressem@verizonmedia.com> | 2021-05-18 21:23:50 +0200 |
---|---|---|
committer | Arnstein Ressem <aressem@verizonmedia.com> | 2021-05-18 21:23:50 +0200 |
commit | 3d12e94939ae6995088431841009b1b7cf547841 (patch) | |
tree | bf5cb137311178a4706bbcfa98f9d3b709f18262 /screwdriver | |
parent | 72e477e68f44ba210406b6dad8a80efcc4eab17d (diff) |
Remove Travis remains.
Diffstat (limited to 'screwdriver')
-rwxr-xr-x | screwdriver/build-vespa.sh | 79 | ||||
-rwxr-xr-x | screwdriver/detect-what-to-build.sh | 35 |
2 files changed, 114 insertions, 0 deletions
diff --git a/screwdriver/build-vespa.sh b/screwdriver/build-vespa.sh new file mode 100755 index 00000000000..4480b33e6f9 --- /dev/null +++ b/screwdriver/build-vespa.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +set -e + +readonly SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd )" +readonly NUM_THREADS=$(( $(nproc) + 2 )) + +source /etc/profile.d/enable-devtoolset-9.sh +source /etc/profile.d/enable-rh-maven35.sh + +export MALLOC_ARENA_MAX=1 +export MAVEN_OPTS="-Xss1m -Xms128m -Xmx2g" +export VESPA_MAVEN_EXTRA_OPTS="${VESPA_MAVEN_EXTRA_OPTS:+${VESPA_MAVEN_EXTRA_OPTS} }--no-snapshot-updates --batch-mode --threads ${NUM_THREADS}" + +ccache --max-size=1600M +ccache --set-config=compression=true +ccache -p + +if ! source $SOURCE_DIR/screwdriver/detect-what-to-build.sh; then + echo "Could not detect what to build." + SHOULD_BUILD=all +fi + +echo "Building: $SHOULD_BUILD" + +cd ${SOURCE_DIR} + +case $SHOULD_BUILD in + cpp) + ./bootstrap.sh full + cmake3 -DVESPA_UNPRIVILEGED=no . + time make -j ${NUM_THREADS} + time ctest3 --output-on-failure -j ${NUM_THREADS} + ccache --show-stats + ;; + java) + ./bootstrap.sh java + mvn -V $VESPA_MAVEN_EXTRA_OPTS install + ;; + *) + ./bootstrap.sh java + time mvn -V $VESPA_MAVEN_EXTRA_OPTS install + cmake3 -DVESPA_UNPRIVILEGED=no . + time make -j ${NUM_THREADS} + time ctest3 --output-on-failure -j ${NUM_THREADS} + ccache --show-stats + make install + ;; +esac + +if [[ $SHOULD_BUILD == systemtest ]]; then + yum -y --setopt=skip_missing_names_on_install=False install \ + zstd \ + devtoolset-9-gcc-c++ \ + devtoolset-9-libatomic-devel \ + devtoolset-9-binutils \ + libxml2-devel \ + rh-ruby27-rubygems-devel \ + rh-ruby27-ruby-devel \ + rh-ruby27 \ + rh-ruby27-rubygem-net-telnet + + source /opt/rh/rh-ruby27/enable + gem install libxml-ruby gnuplot distribution test-unit builder concurrent-ruby ffi + + cd $HOME + git clone https://github.com/vespa-engine/system-test + export SYSTEM_TEST_DIR=$(pwd)/system-test + export RUBYLIB="$SYSTEM_TEST_DIR/lib:$SYSTEM_TEST_DIR/tests" + useradd vespa + export USER=$(whoami) + + $SYSTEM_TEST_DIR/lib/node_server.rb & + NODE_SERVER_PID=$! + sleep 3 + ruby $SYSTEM_TEST_DIR/tests/search/basicsearch/basic_search.rb || (/opt/vespa/bin/vespa-logfmt -N && false) +fi + diff --git a/screwdriver/detect-what-to-build.sh b/screwdriver/detect-what-to-build.sh new file mode 100755 index 00000000000..1c4809f7295 --- /dev/null +++ b/screwdriver/detect-what-to-build.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +if (( ${#BASH_SOURCE[@]} == 1 )); then + echo "This script must be sourced." + exit 1 +fi + +if [[ -z $SD_PULL_REQUEST == false ]]; then + export SHOULD_BUILD=all + return 0 +fi + +JSON=$(curl -sLf https://api.github.com/repos/vespa-engine/vespa/pulls/$SD_PULL_REQUEST) +PR_TITLE=$(jq -re '.title' <<< "$JSON") + +JSON=$(curl -sLf https://api.github.com/repos/vespa-engine/vespa/pulls/$SD_PULL_REQUEST/commits) +COMMITS=$(jq -re '.[].sha' <<< "$JSON") + +FILES=$(for C in $COMMITS; do JSON=$(curl -sLf https://api.github.com/repos/vespa-engine/vespa/commits/$C); jq -re '.files[].filename' <<< "$JSON"; done) + +if [[ $PR_TITLE =~ \[run-systemtest\] ]]; then + SHOULD_BUILD=systemtest +elif [[ -z $FILES ]]; then + SHOULD_BUILD=all +elif ! grep -v -E "(\.h|\.hh|\.hxx|\.c|\.cpp|\.cxx)$" <<< "$FILES" &> /dev/null; then + SHOULD_BUILD=cpp +elif ! grep -v -E "(\.java)$" <<< "$FILES" &> /dev/null; then + SHOULD_BUILD=java +else + SHOULD_BUILD=all +fi + +export SHOULD_BUILD + |