我是一名 BGI 的工程师。我在安装 DeepVariant 的时候,遇到一些问题。我希望在 Tensorflow 讨论区寻找一些帮助。DeepVariant 的安装脚本需要安装 Tensorflow,CUDA,CUDNN 以及 bazel 等依赖的软件工具包。安装 DeepVariant 时,需要先运行 build-prereq.sh 脚本用于安装 DeepVariant 的配置环境,build-prereq.sh 脚本分别调用了 seeting.sh 以及 run-prereq.sh 用于设置安装包的版本以及安装 Tensorflow、CUDA 与 CUDNN 等依赖包,buid-prereq.sh 运行起来没有遇到问题。但是在运行 build_and_test.sh 测试脚本时,我遇到了一些问题。build_and_test.sh 脚本调用 bazel 对 DeepVariant 进行编译,问题出现的原因我认为就是由于 bazel 调用有问题。安装 DeepVariant 遇到的问题主要有两个:
1.我在一台远程的服务器上安装 DeepVariant 时,在该服务器中安装的 bazel 是最新的 0.12 版本,运行 buil_and_test.sh 出现如下的错误:
如果在我自己的 home 目录上调用 bazel,是可以调用的,如下图 1 所示。
但是进入 DeepVariant 的安装包路径 /home/lujianliang/deepvariant-r0.6,bazel 是找不到的,而且运行./build_and_test.sh 也是出现同样的报错,如下图所示。
2.我的同事在另外一台本地的服务器也尝试安装 DeepVariant 时,也是在运行最后的测试脚本 build_and_test.sh 遇到的问题。我们尝试 0.6 版本的 DeepVariant 与 0.5 版本的 DeepVariant,都遇到同样的 build_and_test.sh 调用 bazel 的问题。我们使用 0.6 版本的 DeepVariant 中 build_and_test.sh 测试,其中 bazel 的版本是 0.11.0,出现如下的问题:
(14:19:27) ERROR: /home/suanfa/Downloads/deepvariant-r0.6/third_party/nucleus/io/BUILD:400:1: no such package '@com_google_absl//absl/memory': The repository could not be resolved and referenced by '//third_party/nucleus/io:vcf_writer'
(14:19:27) ERROR: Analysis of target '//deepvariant/labeler:labeled_examples_to_vcf' failed; build aborted: no such package '@com_google_absl//absl/memory': The repository could not be resolved
(14:19:27) INFO: Elapsed time: 33.556s (14:19:27) FAILED: Build did NOT complete successfully (53 packages loaded)
(14:19:27) ERROR: Couldn't start the build. Unable to run tests
我们使用 0.5 版本的 DeepVariant 中 build_and_test.sh 测试,其中 bazel 的版本是 0.9.0,出现如下的问题:
(14:21:41) INFO: Current date is 2018-04-19
(14:21:44) ERROR: /home/suanfa/Downloads/deepvariant-r0.5/deepvariant/core/BUILD:126:1: no such package '@com_google_absl//absl/memory': The repository could not be resolved and referenced by '//deepvariant/core:vcf_writer'
(14:21:44) ERROR: Analysis of target '//deepvariant/core:vcf_writer' failed; build aborted: no such package '@com_google_absl//absl/memory': The repository could not be resolved
(14:21:44) INFO: Elapsed time: 3.102s
(14:21:44) FAILED: Build did NOT complete successfully (21 packages loaded)
currently loading: @protobuf_archive// ... (3 packages)
(14:21:44) ERROR: Couldn't start the build. Unable to run tests
我之前没有用过 bazel,对 bazel 的工作原理不太熟悉。希望讨论区有人可以提供一些帮助,感谢!
build-prereq.sh、settings.sh、run-prereq.sh 以及 build_and_test.sh 的具体脚本如下:
以下是 build-prereq.sh 脚本
#!/bin/bash
set -euo pipefail
# Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
echo ========== Load config settings.
source settings.sh
################################################################################
# Misc. setup
################################################################################
note_build_stage "Install the runtime packages"
./run-prereq.sh
note_build_stage "Update package list"
sudo -H apt-get -qq -y update
note_build_stage "Install development packages"
sudo -H apt-get -y install pkg-config zip g++ zlib1g-dev unzip curl git
################################################################################
# Java
################################################################################
note_build_stage "Install Java and friends"
# Java is available on Kokoro, so we add this cutout.
if ! java -version 2>&1 | fgrep "1.8"; then
echo "No Java 8, will install."
sudo -H apt-get install -y software-properties-common debconf-utils
# Debian needs authentication.
# ([url=http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html] http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html [/url])
[[ $(lsb_release -d | grep 'Debian') ]] && \
sudo -H apt-get install -y gnupg dirmngr && \
sudo -H apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
sudo add-apt-repository -y ppa:webupd8team/java
sudo -H apt-get -qq -y update
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
sudo -H apt-get install -y oracle-java8-installer
sudo -H apt-get -y install ca-certificates-java
sudo update-ca-certificates -f
else
echo "Java 8 found, will not reinstall."
fi
################################################################################
# bazel
################################################################################
note_build_stage "Install bazel"
function update_bazel_linux {
BAZEL_VERSION=$1
rm -rf ~/bazel
mkdir ~/bazel
pushd ~/bazel
curl -L -O [url=https://github.com/bazelbuild/bazel/releases/download/] https://github.com/bazelbuild/bazel/releases/download/[/url]"${BAZEL_VERSION}"/bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh
chmod +x bazel-*.sh
./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh --user
rm bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh
popd
PATH="$HOME/bin:$PATH"
}
bazel_ver="0.11.0"
if
v=$(bazel --bazelrc=/dev/null --nomaster_bazelrc version) &&
echo "$v" | awk -v b="$bazel_ver" '/Build label/ { exit ($3 != b)}'
then
echo "Bazel $bazel_ver already installed on the machine, not reinstalling"
else
update_bazel_linux "$bazel_ver"
fi
################################################################################
# CLIF
################################################################################
note_build_stage "Install CLIF binary"
if [[ -e /usr/local/clif/bin/pyclif ]];
then
echo "CLIF already installed."
else
# Figure out which linux installation we are on to fetch an appropriate
# version of the pre-built CLIF binary. Note that we only support now Ubuntu
# 14 and 16.
case "$(lsb_release -d)" in
*Ubuntu*16.*.*) export DV_PLATFORM="ubuntu-16" ;;
*Ubuntu*14.*.*) export DV_PLATFORM="ubuntu-14" ;;
*Debian*9.*) export DV_PLATFORM="debian" ;;
*Debian*rodete) export DV_PLATFORM="debian" ;;
*) echo "CLIF is not installed on this machine and a prebuilt binary is not
unavailable for this platform. Please install CLIF at
[url=https://github.com/google/clif] https://github.com/google/clif [/url] before continuing."
exit 1
esac
OSS_CLIF_CURL_ROOT="${DV_PACKAGE_CURL_PATH}/oss_clif"
OSS_CLIF_PKG="oss_clif.${DV_PLATFORM}.latest.tgz"
if [[ ! -f "/tmp/${OSS_CLIF_PKG}" ]]; then
curl "${OSS_CLIF_CURL_ROOT}/${OSS_CLIF_PKG}" > /tmp/${OSS_CLIF_PKG}
fi
(cd / && sudo tar xzf "/tmp/${OSS_CLIF_PKG}")
sudo ldconfig # Reload shared libraries.
fi
################################################################################
# TensorFlow
################################################################################
note_build_stage "Download and configure TensorFlow sources"
(cd .. &&
git clone [url=https://github.com/tensorflow/tensorflow] https://github.com/tensorflow/tensorflow [/url] &&
cd tensorflow &&
echo | ./configure)
note_build_stage "build-prereq.sh complete"
以下是 settings.sh 脚本
# Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# Source this file---these options are needed for TF config and for
# successive bazel runs.
# Set this to 1 if the system image already has TensorFlow preinstalled. This
# will skip the installation of TensorFlow.
export DV_USE_PREINSTALLED_TF="${DV_USE_PREINSTALLED_TF:-0}"
export TF_CUDA_CLANG=0
export TF_ENABLE_XLA=0
export TF_NEED_CUDA=0
export TF_NEED_GCP=1
export TF_NEED_GDR=0
export TF_NEED_HDFS=0
export TF_NEED_JEMALLOC=0
export TF_NEED_MKL=0
export TF_NEED_MPI=0
export TF_NEED_OPENCL=0
export TF_NEED_OPENCL_SYCL=0
export TF_NEED_S3=0
export TF_NEED_VERBS=0
# Used if TF_NEED_CUDA=1
export TF_CUDA_VERSION="8.0"
export CUDA_TOOLKIT_PATH="/usr/local/cuda"
export TF_CUDNN_VERSION="6"
export CUDNN_INSTALL_PATH="/usr/lib/x86_64-linux-gnu"
# Path to the public bucket containing DeepVariant-related artifacts.
export DEEPVARIANT_BUCKET="gs://deepvariant"
export DV_PACKAGE_BUCKET_PATH="${DEEPVARIANT_BUCKET}/packages"
export DV_PACKAGE_CURL_PATH="https://storage.googleapis.com/deepvariant/packages"
# Set this to 1 to use DeepVariant with GPUs. Set it to an already existing
# value in the environment (allowing command line control of the build),
# defaulting to 0 (CPU only build).
export DV_GPU_BUILD="${DV_GPU_BUILD:-0}"
# If this variable is set to 1, DeepVariant will use a TensorFlow wheel file
# compiled to use AVX and SSE instructions. This instructions require Sandy
# Bridge or better chipsets on the host machine. The default TensorFlow wheel
# files don't contain these instructions (and thereby run on a broader set of
# CPUs). Using this optimized wheel reduces the runtime of DeepVariant's
# call_variants step by ~20%. This is called the GCP (Google Cloud Platform)
# optimized wheel because all GCP instances have at least Sandy Bridge or better
# chipsets, so this wheel should run anywhere on GCP.
export DV_USE_GCP_OPTIMIZED_TF_WHL="${DV_USE_GCP_OPTIMIZED_TF_WHL:-1}"
export GCP_OPTIMIZED_TF_WHL_FILENAME="tensorflow-1.4.1.deepvariant_gcp-cp27-none-linux_x86_64.whl"
export GCP_OPTIMIZED_TF_WHL_PATH="${DV_PACKAGE_BUCKET_PATH}/tensorflow"
export GCP_OPTIMIZED_TF_WHL_CURL_PATH="${DV_PACKAGE_CURL_PATH}/tensorflow"
# Set this to 1 to use the nightly (latest) build of TensorFlow instead of a
# named release version. Set it to an already existing value in the environment
# (allowing command line control of the build), defaulting to 0 (release build).
export DV_TF_NIGHTLY_BUILD="${DV_TF_NIGHTLY_BUILD:-0}"
# Set this to 1 to make our prereq scripts install the CUDA libraries.
# If you already have CUDA installed, such as on a properly provisioned
# Docker image, it shouldn't be necessary.
export DV_INSTALL_GPU_DRIVERS="${DV_INSTALL_GPU_DRIVERS:-0}"
export PYTHON_BIN_PATH=$(which python)
export USE_DEFAULT_PYTHON_LIB_PATH=1
export DV_COPT_FLAGS="--copt=-msse4.1 --copt=-msse4.2 --copt=-mavx --copt=-O3"
function note_build_stage {
echo "========== [$(date)] Stage '${1}' starting"
}
以下是 run-prereq.sh 脚本
#!/bin/bash
# Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# This installs all the libraries (python, dso, etc) that are needed
# by DeepVariant at runtime (except for tensorflow, which is special).
# Some extra stuff may also be included.
set -euo pipefail
echo ========== Load config settings.
source settings.sh
################################################################################
# misc setup
################################################################################
note_build_stage "Misc setup"
if [[ "$EUID" = "0" ]]; then
# Ensure sudo exists, even if we don't need it.
apt-get update
apt-get -y install sudo
fi
note_build_stage "Update package list"
sudo -H apt-get -qq -y update
note_build_stage "Install development packages"
sudo -H apt-get -y install pkg-config zip zlib1g-dev unzip curl
note_build_stage "Install python packaging infrastructure"
sudo -H apt-get -y install python-dev python-pip python-wheel
sudo -H pip install --upgrade pip
################################################################################
# python packages
################################################################################
note_build_stage "Install python packages"
sudo -H pip install contextlib2
sudo -H pip install enum34
sudo -H pip install intervaltree
sudo -H pip install 'mock>=2.0.0'
sudo -H pip install 'numpy==1.12'
sudo -H pip install 'requests>=2.18'
sudo -H pip install 'scipy==1.0'
sudo -H pip install 'oauth2client>=4.0.0'
sudo -H pip install 'crcmod>=1.7'
sudo -H pip install six
################################################################################
# TensorFlow
################################################################################
note_build_stage "Install TensorFlow pip package"
if [[ "${DV_USE_PREINSTALLED_TF}" = "1" ]]; then
echo "Skipping TensorFlow installation at user request; will use pre-installed TensorFlow."
else
# Also pip install the latest TensorFlow with cpu support. We don't build the
# full TF from source, but instead using prebuilt version. However, we still
# need the full source version to build DeepVariant.
# Gets the nightly TF build: https://pypi.python.org/pypi/tf-nightly which is
# necessary right now if we aren't pinning the TF source. We have observed
# runtime failures if there's too much skew between the released TF package and
# the source.
if [[ "${DV_TF_NIGHTLY_BUILD}" = "1" ]]; then
if [[ "${DV_GPU_BUILD}" = "1" ]]; then
echo "Installing GPU-enabled TensorFlow nightly wheel"
sudo -H pip install --upgrade tf_nightly_gpu
else
echo "Installing CPU-only TensorFlow nightly wheel"
sudo -H pip install --upgrade tf_nightly
fi
else
# Use the official TF release pip package.
if [[ "${DV_GPU_BUILD}" = "1" ]]; then
echo "Installing GPU-enabled TensorFlow wheel"
sudo -H pip install --upgrade 'tensorflow-gpu==1.4'
elif [[ "${DV_USE_GCP_OPTIMIZED_TF_WHL}" = "1" ]]; then
echo "Installing Google Cloud Platform optimized CPU-only TensorFlow wheel"
curl "${GCP_OPTIMIZED_TF_WHL_CURL_PATH}/${GCP_OPTIMIZED_TF_WHL_FILENAME}" \
> "/tmp/${GCP_OPTIMIZED_TF_WHL_FILENAME}"
sudo -H pip install --upgrade "/tmp/${GCP_OPTIMIZED_TF_WHL_FILENAME}"
else
echo "Installing standard CPU-only TensorFlow wheel"
sudo -H pip install --upgrade 'tensorflow==1.4'
fi
fi
fi
################################################################################
# CUDA
################################################################################
if [[ "${DV_GPU_BUILD}" = "1" ]]; then
if [[ "${DV_INSTALL_GPU_DRIVERS}" = "1" ]]; then
if [[ "$(lsb_release -d)" != *Ubuntu*16.*.* ]]; then
echo "CUDA installation only configured for Ubuntu 16"
exit 1
fi
# from https://cloud.google.com/compute/docs/gpus/add-gpus
echo "Checking for CUDA..."
if ! dpkg-query -W cuda-8-0; then
echo "Installing CUDA..."
CUDA_DEB="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_DEB}
sudo -H dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo -H apt-get update
sudo -H apt-get -y install cuda-8-0
fi
echo "Checking for CUDNN..."
if [[ ! -e /usr/local/cuda-8.0/include/cudnn.h ]]; then
echo "Installing CUDNN..."
CUDNN_TAR_FILE="cudnn-8.0-linux-x64-v6.0.tgz"
wget http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/${CUDNN_TAR_FILE}
tar -xzvf ${CUDNN_TAR_FILE}
sudo cp -P cuda/include/cudnn.h /usr/local/cuda-8.0/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64/
sudo chmod a+r /usr/local/cuda-8.0/lib64/libcudnn*
sudo ldconfig
fi
# Tensorflow says to do this.
sudo -H apt-get -y install libcupti-dev
fi
# If we are doing a gpu-build, nvidia-smi should be install. Run it so we
# can see what gpu is installed.
nvidia-smi || :
fi
################################################################################
# Misc dependencies
################################################################################
note_build_stage "Install other packages"
# for htslib
sudo -H apt-get -y install libssl-dev libcurl4-openssl-dev liblz-dev libbz2-dev liblzma-dev
# for the debruijn graph
sudo -H apt-get -y install libboost-graph-dev
note_build_stage "run-prereq.sh complete"
以下是 build_and_test.sh 脚本
#!/bin/bash
# Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# NOLINT
set -eux -o pipefail
source settings.sh
# Run all deepvariant tests. Take bazel options from args, if any.
# Note: If running with GPU, tests must be executed serially due to a GPU
# contention issue.
if [[ "${DV_GPU_BUILD:-0}" = "1" ]]; then
bazel test -c opt --local_test_jobs=1 ${DV_COPT_FLAGS} "$@" \
deepvariant/...
# Also run the GPU-specific tests.
bazel test -c opt --local_test_jobs=1 ${DV_COPT_FLAGS} "$@" \
deepvariant:gpu_tests
else
# Running parallel tests on CPU.
bazel test -c opt ${DV_COPT_FLAGS} "$@" deepvariant/...
fi
# Create some build artifacts.
bazel build -c opt ${DV_COPT_FLAGS} "$@" deepvariant:binaries
# Bundle the licenses.
bazel build :licenses_zip