diff options
author | Geir Storli <geirst@verizonmedia.com> | 2020-04-21 16:09:32 +0200 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2020-04-21 16:09:32 +0200 |
commit | a777a72853d9e45db6c1bbba4c35543928e6b61f (patch) | |
tree | 82c8d84e976dbe11695dc42913c993c8a3da58d1 /docker | |
parent | 00ee3194a13ad2d26ad530aad8d1adf10018833f (diff) |
Remove obsolete build scripts.
Diffstat (limited to 'docker')
-rw-r--r-- | docker/README.md | 26 | ||||
-rwxr-xr-x | docker/build-vespa-image.sh | 16 | ||||
-rwxr-xr-x | docker/build/enter-build-container-internal.sh | 36 | ||||
-rw-r--r-- | docker/ci/build-and-test.sh | 30 | ||||
-rwxr-xr-x | docker/ci/vespa-ci-internal.sh | 30 | ||||
-rwxr-xr-x | docker/enter-build-container.sh | 17 | ||||
-rwxr-xr-x | docker/run-vespa.sh | 21 | ||||
-rw-r--r-- | docker/run/Dockerfile | 16 | ||||
-rwxr-xr-x | docker/run/run-vespa-internal.sh | 28 | ||||
-rwxr-xr-x | docker/vespa-ci.sh | 25 |
10 files changed, 2 insertions, 243 deletions
diff --git a/docker/README.md b/docker/README.md index cd073413ea7..5b939b69c47 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,6 +1,6 @@ <!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> -# Building and running Vespa on Docker (OS X and Linux) +# Building Vespa RPM on Docker (OS X and Linux) ## Installing docker [Docker installation](https://docs.docker.com/engine/installation/) @@ -15,32 +15,10 @@ The produced rpms will be available in this folder after compilation. The version number will be compiled into binaries, but has no other meaning than that. -## Building and testing Vespa -Execute ```./vespa-ci.sh <git commit>``` to build and test a specific branch/tag/commit. - - -## Building Vespa Docker image -Execute ```./build-vespa-image.sh <Vespa version number>``` to build a Docker image (*vesparun*) which has the rpms -from the build step (or downloaded rpms into this folder) installed. - - -## Running Vespa inside Docker container -Execute ```./run-vespa.sh <Vespa version number>``` to start Vespa. - -This starts a Docker container using the Docker image (*vesparun*) from the previous step. -Vespa will be started inside the container. - - -## Building Vespa inside a Docker container -Execute ```./enter-build-container.sh``` to enter the Vespa build environment inside a Docker container. - -The container is entered at the root of the Vespa source repository. Follow the build sections in [README.md](https://github.com/vespa-engine/vespa/blob/master/README.md) to build and test. - - ## Troubleshooting - Use ```docker logs CONTAINER``` for output - useful if the commands above fail. -- If the build fails, start from scratch: ```docker rmi -f vesparun vespabuild``` - then build again. Clean local docker if docker image disk full: +- If the build fails, start from scratch and build again. Clean local docker if docker image disk full: - ```docker rm -v $(docker ps -a -q -f status=exited)``` - ```docker rmi $(docker images -f "dangling=true" -q)``` diff --git a/docker/build-vespa-image.sh b/docker/build-vespa-image.sh deleted file mode 100755 index 1680f4c057a..00000000000 --- a/docker/build-vespa-image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 1 ]; then - echo "Usage: $0 <vespa version>" - exit 1 -fi - -DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) -cd $DIR - -VESPA_VERSION=$1 -DOCKER_IMAGE=vesparun - -docker build -t "$DOCKER_IMAGE":"$VESPA_VERSION" --build-arg VESPA_VERSION="$VESPA_VERSION" -f run/Dockerfile . diff --git a/docker/build/enter-build-container-internal.sh b/docker/build/enter-build-container-internal.sh deleted file mode 100755 index ae76263e2c7..00000000000 --- a/docker/build/enter-build-container-internal.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 0 ]; then - echo "Usage: $0" - echo "This script should not be called manually." - exit 1 -fi - -USERNAME=builder -VESPA_DIR=$(cd $(dirname "${BASH_SOURCE[0]}")/../.. && pwd) -cd $VESPA_DIR - -CALLER_UID=$(stat -c "%u" $VESPA_DIR) - -if [ $CALLER_UID -ne 0 ]; then - # We are in a system that maps the uids and this dir is not owned by root - # Create a user with same uid and gid to avoid mixing - CALLER_GID=$(stat -c "%g" $VESPA_DIR) - - groupadd -f -g $CALLER_GID $USERNAME - useradd -u $CALLER_UID -g $CALLER_GID $USERNAME - echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers -else - USERNAME=root -fi - -su -c "mkdir -p $VESPA_DIR/.ccache" - $USERNAME -su -c "ln -sf $VESPA_DIR/.ccache \$HOME/.ccache" - $USERNAME - -su -c "mkdir -p $VESPA_DIR/.m2" - $USERNAME -su -c "ln -sf $VESPA_DIR/.m2 \$HOME/.m2" - $USERNAME - -su $USERNAME - diff --git a/docker/ci/build-and-test.sh b/docker/ci/build-and-test.sh deleted file mode 100644 index 0f0b8be94df..00000000000 --- a/docker/ci/build-and-test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 4 ]; then - echo "Usage: $0 <source dir> <build dir> <log dir> <num threads>" - echo "This script should not be called manually." - exit 1 -fi - -SOURCE_DIR=$1 -BUILD_DIR=$2 -LOG_DIR=$3 -NUM_THREADS=$4 - -function build_java { - cd "${SOURCE_DIR}" - export MAVEN_OPTS="-Xms128m -Xmx512m" - mvn install -nsu -B -T ${NUM_THREADS} # Should ideally split out test phase, but some unit tests fails on 'mvn test' -} - -function build_cpp { - cd "${BUILD_DIR}" - make -j ${NUM_THREADS} - ctest3 -j ${NUM_THREADS} -} - -bash ${SOURCE_DIR}/bootstrap-cpp.sh ${SOURCE_DIR} ${BUILD_DIR} -build_java 2>&1 | tee ${LOG_DIR}/java.log -build_cpp 2>&1 | tee ${LOG_DIR}/cpp.log diff --git a/docker/ci/vespa-ci-internal.sh b/docker/ci/vespa-ci-internal.sh deleted file mode 100755 index 5067aecaa6a..00000000000 --- a/docker/ci/vespa-ci-internal.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 2 ]; then - echo "Usage: $0 <git commit> <log prefix>" - echo "This script should not be called manually." - exit 1 -fi - -GIT_COMMIT=$1 -LOG_PREFIX=$2 -SOURCE_DIR=~/vespa -BUILD_DIR=~/build -MAPPED_DIR=/vespa -LOG_DIR=~/log - -mkdir "${SOURCE_DIR}" -mkdir "${BUILD_DIR}" -mkdir "${LOG_DIR}" - -git clone --no-checkout --no-hardlinks "file://${MAPPED_DIR}" "${SOURCE_DIR}" -cd "${SOURCE_DIR}" -git -c advice.detachedHead=false checkout ${GIT_COMMIT} - -NUM_THREADS=$(($(nproc --all) * 2)) -bash "${MAPPED_DIR}/docker/ci/build-and-test.sh" "${SOURCE_DIR}" "${BUILD_DIR}" "${LOG_DIR}" ${NUM_THREADS} - -cp "${LOG_DIR}/java.log" "${MAPPED_DIR}/docker/logs/${LOG_PREFIX}-java.log" -cp "${LOG_DIR}/cpp.log" "${MAPPED_DIR}/docker/logs/${LOG_PREFIX}-cpp.log" diff --git a/docker/enter-build-container.sh b/docker/enter-build-container.sh deleted file mode 100755 index ff7a30ecc8f..00000000000 --- a/docker/enter-build-container.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 0 ]; then - echo "Usage: $0" - exit 1 -fi - -DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) -cd $DIR - -DOCKER_IMAGE="vespaengine/vespa-build-centos7:latest" - -docker pull ${DOCKER_IMAGE} -docker run -ti --rm -v $(pwd)/..:/vespa --entrypoint /vespa/docker/build/enter-build-container-internal.sh "$DOCKER_IMAGE" - diff --git a/docker/run-vespa.sh b/docker/run-vespa.sh deleted file mode 100755 index e4e963e5f4b..00000000000 --- a/docker/run-vespa.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 1 ]; then - echo "Usage: $0 <vespa version>" - exit 1 -fi - -DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) -cd $DIR - -VESPA_VERSION=$1 -DOCKER_IMAGE=vesparun - -if [ "$(uname)" != "Darwin" ]; then - docker run -d -v $(pwd)/..:/vespa --net=host --privileged --entrypoint /vespa/docker/run/run-vespa-internal.sh "$DOCKER_IMAGE":"$VESPA_VERSION" -else - # On OS X, net=host does not work. Need to explicitly expose ports from localhost into container. - docker run -d -p 8080:8080 -p 19071:19071 -v $(pwd)/..:/vespa --privileged --entrypoint /vespa/docker/run/run-vespa-internal.sh "$DOCKER_IMAGE":"$VESPA_VERSION" -fi diff --git a/docker/run/Dockerfile b/docker/run/Dockerfile deleted file mode 100644 index d4b7e489451..00000000000 --- a/docker/run/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -FROM centos:7 -ARG VESPA_VERSION - -# Needed to run vespa -RUN yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/vespa/vespa/repo/epel-7/group_vespa-vespa-epel-7.repo && \ - yum -y install epel-release && \ - yum -y install centos-release-scl && \ - yum -y install maven - -COPY vespa*-${VESPA_VERSION}-*.rpm /tmp/ -RUN yum localinstall -y $(ls /tmp/vespa*-${VESPA_VERSION}-*.rpm | xargs) - -ENV VESPA_HOME=/opt/vespa -ENV PATH="${PATH}:${VESPA_HOME}/bin" - diff --git a/docker/run/run-vespa-internal.sh b/docker/run/run-vespa-internal.sh deleted file mode 100755 index cf00c8a32dc..00000000000 --- a/docker/run/run-vespa-internal.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 0 ]; then - echo "Usage: $0" - echo "This script should not be called manually." - exit 1 -fi - -DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) -cd $DIR - -# Workaround until we figure out why rpm does not set the ownership. -chown -R vespa:vespa /opt/vespa - -export VESPA_CONFIGSERVERS=$(hostname) - -/opt/vespa/bin/vespa-start-configserver -# Give config server some time to come up before starting services -sleep 5 -/opt/vespa/bin/vespa-start-services - -# Print log forever -while true; do - /opt/vespa/bin/vespa-logfmt -f /opt/vespa/logs/vespa/vespa.log - sleep 10 -done diff --git a/docker/vespa-ci.sh b/docker/vespa-ci.sh deleted file mode 100755 index 9ac12f155cc..00000000000 --- a/docker/vespa-ci.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -if [ $# -ne 1 ]; then - echo "Usage: $0 <git commit>" - exit 1 -fi - -RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}") -DIR=$(cd "${RELATIVE_DIR}" && pwd) -cd "${DIR}" - -GIT_COMMIT=$1 -DOCKER_IMAGE="vespaengine/vespa-build-centos7:latest" -INTERNAL_DIR=/vespa -LOG_PREFIX=vespa-ci-$(date +%Y-%m-%dT%H:%M:%S) - -mkdir -p logs - -docker run --rm -v ${DIR}/..:${INTERNAL_DIR} --entrypoint "${INTERNAL_DIR}/docker/ci/vespa-ci-internal.sh" "$DOCKER_IMAGE" \ - "$GIT_COMMIT" "$LOG_PREFIX" 2>&1 | tee logs/${LOG_PREFIX}.log - -# Needed because of piping docker run to tee above -exit ${PIPESTATUS[0]} |