2016-12-13 17:37:22 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
# Push caller's shell options (quietly)
|
|
|
|
{ SHELLOPTS_STACK="${SHELLOPTS_STACK-}|$(set +o); set -$-"; } 2> /dev/null
|
2020-04-15 08:10:22 -07:00
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
ROOT_DIR=$(builtin cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
|
|
|
WORKSPACE_DIR="${ROOT_DIR}/../.."
|
|
|
|
|
|
|
|
pkg_install_helper() {
|
|
|
|
case "${OSTYPE}" in
|
2020-05-05 10:47:49 -07:00
|
|
|
darwin*)
|
|
|
|
brew install "$@"
|
|
|
|
;;
|
|
|
|
linux*)
|
|
|
|
sudo apt-get install -qq -o=Dpkg::Use-Pty=0 "$@" | {
|
|
|
|
grep --line-buffered -v "^\(Preparing to unpack\|Unpacking\|Processing triggers for\) "
|
|
|
|
}
|
|
|
|
;;
|
2020-04-15 08:10:22 -07:00
|
|
|
*) false;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
install_bazel() {
|
2021-01-25 16:05:59 -08:00
|
|
|
if command -v bazel; then
|
|
|
|
if [ -n "${BUILDKITE-}" ]; then
|
|
|
|
echo "Bazel exists, skipping the install"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
"${ROOT_DIR}"/install-bazel.sh
|
|
|
|
if [ -f /etc/profile.d/bazel.sh ]; then
|
|
|
|
. /etc/profile.d/bazel.sh
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-04-15 08:10:22 -07:00
|
|
|
install_base() {
|
2021-01-25 16:05:59 -08:00
|
|
|
if [ -n "${BUILDKITE-}" ]; then
|
|
|
|
echo "Skipping install_base in Buildkite"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2020-04-15 08:10:22 -07:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*)
|
2020-06-09 14:07:54 -07:00
|
|
|
# Expired apt key error: https://github.com/bazelbuild/bazel/issues/11470#issuecomment-633205152
|
|
|
|
curl -f -s -L -R https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - || true
|
2020-04-15 08:10:22 -07:00
|
|
|
sudo apt-get update -qq
|
2020-05-05 10:47:49 -07:00
|
|
|
pkg_install_helper build-essential curl unzip libunwind-dev python3-pip python3-setuptools \
|
|
|
|
tmux gdb
|
2020-04-15 08:10:22 -07:00
|
|
|
if [ "${LINUX_WHEELS-}" = 1 ]; then
|
|
|
|
pkg_install_helper docker
|
2020-04-29 21:19:02 -07:00
|
|
|
if [ -n "${TRAVIS-}" ]; then
|
|
|
|
sudo usermod -a -G docker travis
|
|
|
|
fi
|
2020-04-15 08:10:22 -07:00
|
|
|
fi
|
|
|
|
if [ -n "${PYTHON-}" ]; then
|
|
|
|
"${ROOT_DIR}/install-strace.sh" || true
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
install_miniconda() {
|
2020-07-20 12:41:57 -07:00
|
|
|
if [ "${OSTYPE}" = msys ]; then
|
|
|
|
# Windows is on GitHub Actions, whose built-in Python installations we added direct support for.
|
|
|
|
python --version
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
local conda="${CONDA_EXE-}" # Try to get the activated conda executable
|
|
|
|
if [ -z "${conda}" ]; then # If no conda is found, try to find it in PATH
|
|
|
|
conda="$(command -v conda || true)"
|
2020-04-29 21:19:02 -07:00
|
|
|
fi
|
2020-05-05 10:47:49 -07:00
|
|
|
|
|
|
|
if [ ! -x "${conda}" ]; then # If no conda is found, install it
|
|
|
|
local miniconda_dir # Keep directories user-independent, to help with Bazel caching
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) miniconda_dir="/opt/miniconda";;
|
|
|
|
darwin*) miniconda_dir="/usr/local/opt/miniconda";;
|
|
|
|
msys) miniconda_dir="${ALLUSERSPROFILE}\Miniconda3";; # Avoid spaces; prefer the default path
|
|
|
|
esac
|
|
|
|
|
|
|
|
local miniconda_version="Miniconda3-py37_4.8.2" miniconda_platform="" exe_suffix=".sh"
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) miniconda_platform=Linux;;
|
|
|
|
darwin*) miniconda_platform=MacOSX;;
|
|
|
|
msys*) miniconda_platform=Windows; exe_suffix=".exe";;
|
|
|
|
esac
|
|
|
|
|
|
|
|
local miniconda_url="https://repo.continuum.io/miniconda/${miniconda_version}-${miniconda_platform}-${HOSTTYPE}${exe_suffix}"
|
|
|
|
local miniconda_target="${HOME}/${miniconda_url##*/}"
|
|
|
|
curl -f -s -L -o "${miniconda_target}" "${miniconda_url}"
|
|
|
|
chmod +x "${miniconda_target}"
|
|
|
|
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
msys*)
|
|
|
|
# We set /AddToPath=0 because
|
|
|
|
# (1) it doesn't take care of the current shell, and
|
|
|
|
# (2) it's consistent with -b in the UNIX installers.
|
|
|
|
MSYS2_ARG_CONV_EXCL="*" "${miniconda_target}" \
|
|
|
|
/RegisterPython=0 /AddToPath=0 /InstallationType=AllUsers /S /D="${miniconda_dir}"
|
|
|
|
conda="${miniconda_dir}\Scripts\conda.exe"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
mkdir -p -- "${miniconda_dir}"
|
|
|
|
# We're forced to pass -b for non-interactive mode.
|
|
|
|
# Unfortunately it inhibits PATH modifications as a side effect.
|
2020-06-09 14:07:54 -07:00
|
|
|
"${WORKSPACE_DIR}"/ci/suppress_output "${miniconda_target}" -f -b -p "${miniconda_dir}"
|
2020-05-05 10:47:49 -07:00
|
|
|
conda="${miniconda_dir}/bin/conda"
|
|
|
|
;;
|
|
|
|
esac
|
2020-06-18 00:00:20 -07:00
|
|
|
else
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
darwin*)
|
|
|
|
# When 'conda' is preinstalled on Mac (as on GitHub Actions), it uses this directory
|
|
|
|
local miniconda_dir="/usr/local/miniconda"
|
|
|
|
sudo mkdir -p -- "${miniconda_dir}"
|
|
|
|
sudo chown -R "${USER}" "${miniconda_dir}"
|
|
|
|
;;
|
|
|
|
esac
|
2020-04-29 21:19:02 -07:00
|
|
|
fi
|
2020-05-05 10:47:49 -07:00
|
|
|
|
|
|
|
if [ ! -x "${CONDA_PYTHON_EXE-}" ]; then # If conda isn't activated, activate it
|
|
|
|
local restore_shell_state=""
|
|
|
|
if [ -o xtrace ]; then set +x && restore_shell_state="set -x"; fi # Disable set -x (noisy here)
|
|
|
|
|
|
|
|
# TODO(mehrdadn): conda activation is buggy on MSYS2; it adds C:/... to PATH,
|
|
|
|
# which gets split on a colon. Is it necessary to work around this?
|
|
|
|
eval "$("${conda}" shell."${SHELL##*/}" hook)" # Activate conda
|
|
|
|
conda init "${SHELL##*/}" # Add to future shells
|
|
|
|
|
|
|
|
${restore_shell_state} # Restore set -x
|
|
|
|
fi
|
|
|
|
|
|
|
|
local python_version
|
|
|
|
python_version="$(python -s -c "import sys; print('%s.%s' % sys.version_info[:2])")"
|
|
|
|
if [ -n "${PYTHON-}" ] && [ "${PYTHON}" != "${python_version}" ]; then # Update Python version
|
|
|
|
(
|
|
|
|
set +x
|
|
|
|
echo "Updating Anaconda Python ${python_version} to ${PYTHON}..."
|
2020-06-09 14:07:54 -07:00
|
|
|
"${WORKSPACE_DIR}"/ci/suppress_output conda install -q -y python="${PYTHON}"
|
2020-05-05 10:47:49 -07:00
|
|
|
)
|
2020-05-01 14:08:57 -07:00
|
|
|
fi
|
2020-05-05 10:47:49 -07:00
|
|
|
|
|
|
|
command -V python
|
|
|
|
test -x "${CONDA_PYTHON_EXE}" # make sure conda is activated
|
|
|
|
}
|
|
|
|
|
2020-07-30 16:39:28 -07:00
|
|
|
install_shellcheck() {
|
|
|
|
local shellcheck_version="0.7.1"
|
|
|
|
if [ "${shellcheck_version}" != "$(command -v shellcheck > /dev/null && shellcheck --version | sed -n "s/version: //p")" ]; then
|
|
|
|
local osname=""
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) osname="linux";;
|
|
|
|
darwin*) osname="darwin";;
|
|
|
|
esac
|
|
|
|
local name="shellcheck-v${shellcheck_version}"
|
|
|
|
if [ "${osname}" = linux ] || [ "${osname}" = darwin ]; then
|
|
|
|
sudo mkdir -p /usr/local/bin || true
|
|
|
|
curl -f -s -L "https://github.com/koalaman/shellcheck/releases/download/v${shellcheck_version}/${name}.${osname}.x86_64.tar.xz" | {
|
|
|
|
sudo tar -C /usr/local/bin -x -v -J --strip-components=1 "${name}/shellcheck"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
mkdir -p /usr/local/bin
|
|
|
|
curl -f -s -L -o "${name}.zip" "https://github.com/koalaman/shellcheck/releases/download/v${shellcheck_version}/${name}.zip"
|
|
|
|
unzip "${name}.zip" "${name}.exe"
|
|
|
|
mv -f "${name}.exe" "/usr/local/bin/shellcheck.exe"
|
|
|
|
fi
|
|
|
|
test "${shellcheck_version}" = "$(shellcheck --version | sed -n "s/version: //p")"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
install_linters() {
|
2020-07-30 11:22:56 -07:00
|
|
|
pip install -r "${WORKSPACE_DIR}"/python/requirements_linters.txt
|
2020-07-30 16:39:28 -07:00
|
|
|
|
|
|
|
install_shellcheck
|
2020-04-15 08:10:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
install_nvm() {
|
|
|
|
local NVM_HOME="${HOME}/.nvm"
|
|
|
|
if [ "${OSTYPE}" = msys ]; then
|
2020-05-05 10:47:49 -07:00
|
|
|
local ver="1.1.7"
|
2020-04-15 08:10:22 -07:00
|
|
|
if [ ! -f "${NVM_HOME}/nvm.sh" ]; then
|
|
|
|
mkdir -p -- "${NVM_HOME}"
|
|
|
|
export NVM_SYMLINK="${PROGRAMFILES}\nodejs"
|
|
|
|
(
|
|
|
|
cd "${NVM_HOME}"
|
2020-05-05 10:47:49 -07:00
|
|
|
local target="./nvm-${ver}.zip"
|
|
|
|
curl -f -s -L -o "${target}" \
|
|
|
|
"https://github.com/coreybutler/nvm-windows/releases/download/${ver}/nvm-noinstall.zip"
|
2020-04-15 08:10:22 -07:00
|
|
|
unzip -q -- "${target}"
|
|
|
|
rm -f -- "${target}"
|
|
|
|
printf "%s\r\n" "root: $(cygpath -w -- "${NVM_HOME}")" "path: ${NVM_SYMLINK}" > settings.txt
|
|
|
|
)
|
2020-05-05 10:47:49 -07:00
|
|
|
printf "%s\n" \
|
|
|
|
"export NVM_HOME=\"$(cygpath -w -- "${NVM_HOME}")\"" \
|
2020-07-21 19:56:41 -07:00
|
|
|
"nvm() { \"\${NVM_HOME}/nvm.exe\" \"\$@\"; }" \
|
2020-05-05 10:47:49 -07:00
|
|
|
> "${NVM_HOME}/nvm.sh"
|
2020-04-15 08:10:22 -07:00
|
|
|
fi
|
2021-01-18 00:44:24 -08:00
|
|
|
elif [ -n "${BUILDKITE-}" ]; then
|
2021-01-25 16:05:59 -08:00
|
|
|
echo "Skipping nvm on Buildkite because we will use apt-get."
|
2020-04-15 08:10:22 -07:00
|
|
|
else
|
|
|
|
test -f "${NVM_HOME}/nvm.sh" # double-check NVM is already available on other platforms
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-12-03 13:47:54 -08:00
|
|
|
install_upgrade_pip() {
|
2020-04-15 08:10:22 -07:00
|
|
|
local python=python
|
|
|
|
if command -v python3 > /dev/null; then
|
|
|
|
python=python3
|
|
|
|
fi
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
if "${python}" -m pip --version || "${python}" -m ensurepip; then # Configure pip if present
|
2020-04-15 08:10:22 -07:00
|
|
|
"${python}" -m pip install --upgrade --quiet pip
|
|
|
|
|
|
|
|
# If we're in a CI environment, do some configuration
|
2020-06-15 17:27:17 -07:00
|
|
|
if [ "${CI-}" = true ]; then
|
2020-04-15 08:10:22 -07:00
|
|
|
"${python}" -W ignore -m pip config -q --user set global.disable-pip-version-check True
|
|
|
|
"${python}" -W ignore -m pip config -q --user set global.no-color True
|
|
|
|
"${python}" -W ignore -m pip config -q --user set global.progress_bar off
|
|
|
|
"${python}" -W ignore -m pip config -q --user set global.quiet True
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
install_node() {
|
2021-01-25 16:05:59 -08:00
|
|
|
if command -v node; then
|
|
|
|
if [ -n "${BUILDKITE-}" ]; then
|
|
|
|
echo "Node existed, skipping install";
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-01-18 17:20:45 -08:00
|
|
|
if [ "${OSTYPE}" = msys ] ; then
|
2020-05-05 10:47:49 -07:00
|
|
|
{ echo "WARNING: Skipping running Node.js due to incompatibilities with Windows"; } 2> /dev/null
|
2021-01-18 17:20:45 -08:00
|
|
|
elif [ -n "${BUILDKITE-}" ] ; then
|
2021-01-25 16:05:59 -08:00
|
|
|
# https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
|
|
|
|
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
|
|
|
|
sudo apt-get install -y nodejs
|
2020-04-15 08:10:22 -07:00
|
|
|
else
|
|
|
|
# Install the latest version of Node.js in order to build the dashboard.
|
|
|
|
(
|
|
|
|
set +x # suppress set -x since it'll get very noisy here
|
|
|
|
. "${HOME}/.nvm/nvm.sh"
|
|
|
|
nvm install node
|
|
|
|
nvm use --silent node
|
|
|
|
npm config set loglevel warn # make NPM quieter
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-05-11 09:53:35 -07:00
|
|
|
install_toolchains() {
|
2021-01-18 00:44:24 -08:00
|
|
|
if [ -z "${BUILDKITE-}" ]; then
|
|
|
|
"${ROOT_DIR}"/install-toolchains.sh
|
|
|
|
fi
|
2020-05-11 09:53:35 -07:00
|
|
|
}
|
|
|
|
|
2021-04-13 14:20:26 -07:00
|
|
|
download_mnist() {
|
|
|
|
mkdir -p "${HOME}/data"
|
|
|
|
curl -o "${HOME}/data/mnist.zip" https://ray-ci-mnist.s3-us-west-2.amazonaws.com/mnist.zip
|
|
|
|
unzip "${HOME}/data/mnist.zip" -d "${HOME}/data"
|
|
|
|
}
|
|
|
|
|
2020-04-15 08:10:22 -07:00
|
|
|
install_dependencies() {
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
install_bazel
|
2020-07-13 15:31:46 -07:00
|
|
|
|
2020-04-15 08:10:22 -07:00
|
|
|
install_base
|
2020-05-11 09:53:35 -07:00
|
|
|
install_toolchains
|
2020-04-15 08:10:22 -07:00
|
|
|
install_nvm
|
2020-12-03 13:47:54 -08:00
|
|
|
install_upgrade_pip
|
2020-04-15 08:10:22 -07:00
|
|
|
|
2020-05-20 12:25:04 -07:00
|
|
|
if [ -n "${PYTHON-}" ] || [ "${LINT-}" = 1 ]; then
|
2020-04-15 08:10:22 -07:00
|
|
|
install_miniconda
|
2020-12-03 13:47:54 -08:00
|
|
|
# Upgrade the miniconda pip.
|
|
|
|
install_upgrade_pip
|
2020-05-20 12:25:04 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Install modules needed in all jobs.
|
2021-04-12 13:50:49 -07:00
|
|
|
pip install --no-clean dm-tree==0.1.5 # --no-clean is due to: https://github.com/deepmind/tree/issues/5
|
2020-04-28 22:24:55 -07:00
|
|
|
|
2020-05-20 12:25:04 -07:00
|
|
|
if [ -n "${PYTHON-}" ]; then
|
2021-01-07 14:03:06 -08:00
|
|
|
# Remove this entire section once RLlib and Serve dependencies are fixed.
|
2021-01-25 16:05:59 -08:00
|
|
|
if [ "${DOC_TESTING-}" != 1 ] && [ "${SGD_TESTING-}" != 1 ] && [ "${TUNE_TESTING-}" != 1 ]; then
|
2021-01-07 14:03:06 -08:00
|
|
|
# PyTorch is installed first since we are using a "-f" directive to find the wheels.
|
|
|
|
# We want to install the CPU version only.
|
|
|
|
local torch_url="https://download.pytorch.org/whl/torch_stable.html"
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
darwin*) pip install torch torchvision;;
|
2021-04-13 14:20:26 -07:00
|
|
|
*) pip install torch==1.8.1+cpu torchvision==0.9.1+cpu -f "${torch_url}";;
|
2021-01-07 14:03:06 -08:00
|
|
|
esac
|
|
|
|
fi
|
2020-04-28 22:24:55 -07:00
|
|
|
|
2020-05-07 17:39:35 +02:00
|
|
|
# Try n times; we often encounter OpenSSL.SSL.WantReadError (or others)
|
|
|
|
# that break the entire CI job: Simply retry installation in this case
|
|
|
|
# after n seconds.
|
|
|
|
local status="0";
|
|
|
|
local errmsg="";
|
2020-07-24 15:24:19 -07:00
|
|
|
for _ in {1..3}; do
|
2021-02-11 15:43:09 -08:00
|
|
|
errmsg=$(CC=gcc pip install -r "${WORKSPACE_DIR}"/python/requirements.txt 2>&1) && break;
|
2020-05-07 17:39:35 +02:00
|
|
|
status=$errmsg && echo "'pip install ...' failed, will retry after n seconds!" && sleep 30;
|
|
|
|
done
|
|
|
|
if [ "$status" != "0" ]; then
|
|
|
|
echo "${status}" && return 1
|
|
|
|
fi
|
2020-04-29 21:19:02 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${LINT-}" = 1 ]; then
|
2020-05-05 10:47:49 -07:00
|
|
|
install_linters
|
2020-04-29 21:19:02 -07:00
|
|
|
# readthedocs has an antiquated build env.
|
|
|
|
# This is a best effort to reproduce it locally to avoid doc build failures and hidden errors.
|
2020-05-20 12:25:04 -07:00
|
|
|
local python_version
|
|
|
|
python_version="$(python -s -c "import sys; print('%s.%s' % sys.version_info[:2])")"
|
|
|
|
if [ "${OSTYPE}" = msys ] && [ "${python_version}" = "3.8" ]; then
|
|
|
|
{ echo "WARNING: Pillow binaries not available on Windows; cannot build docs"; } 2> /dev/null
|
|
|
|
else
|
2020-12-03 13:47:54 -08:00
|
|
|
pip install --use-deprecated=legacy-resolver -r "${WORKSPACE_DIR}"/doc/requirements-rtd.txt
|
|
|
|
pip install --use-deprecated=legacy-resolver -r "${WORKSPACE_DIR}"/doc/requirements-doc.txt
|
2020-05-20 12:25:04 -07:00
|
|
|
fi
|
2020-04-15 08:10:22 -07:00
|
|
|
fi
|
|
|
|
|
2020-11-30 12:41:24 +01:00
|
|
|
# Additional RLlib test dependencies.
|
2020-04-15 08:10:22 -07:00
|
|
|
if [ "${RLLIB_TESTING-}" = 1 ]; then
|
2020-07-30 11:22:56 -07:00
|
|
|
pip install -r "${WORKSPACE_DIR}"/python/requirements_rllib.txt
|
2020-10-07 23:23:27 -07:00
|
|
|
# install the following packages for testing on travis only
|
|
|
|
pip install 'recsim>=0.2.4'
|
2020-04-15 08:10:22 -07:00
|
|
|
fi
|
|
|
|
|
2021-01-13 19:10:21 -08:00
|
|
|
# Additional Tune/SGD/Doc test dependencies.
|
|
|
|
if [ "${TUNE_TESTING-}" = 1 ] || [ "${SGD_TESTING-}" = 1 ] || [ "${DOC_TESTING-}" = 1 ]; then
|
2021-03-02 15:55:03 -08:00
|
|
|
pip install -r "${WORKSPACE_DIR}"/python/requirements/requirements_tune.txt
|
2021-04-13 14:20:26 -07:00
|
|
|
download_mnist
|
2020-07-25 06:22:54 +02:00
|
|
|
fi
|
|
|
|
|
2021-01-13 19:10:21 -08:00
|
|
|
# For Tune, install upstream dependencies.
|
|
|
|
if [ "${TUNE_TESTING-}" = 1 ] || [ "${DOC_TESTING-}" = 1 ]; then
|
|
|
|
pip install -r "${WORKSPACE_DIR}"/python/requirements/requirements_upstream.txt
|
2020-07-25 06:22:54 +02:00
|
|
|
fi
|
|
|
|
|
2021-01-07 14:03:06 -08:00
|
|
|
# Remove this entire section once RLlib and Serve dependencies are fixed.
|
|
|
|
if [ "${DOC_TESTING-}" != 1 ] && [ "${SGD_TESTING-}" != 1 ] && [ "${TUNE_TESTING-}" != 1 ]; then
|
|
|
|
# If CI has deemed that a different version of Tensorflow or Torch
|
|
|
|
# should be installed, then upgrade/downgrade to that specific version.
|
|
|
|
if [ -n "${TORCH_VERSION-}" ] || [ -n "${TFP_VERSION-}" ] || [ -n "${TF_VERSION-}" ]; then
|
2021-04-13 14:20:26 -07:00
|
|
|
case "${TORCH_VERSION-1.8.1}" in
|
|
|
|
1.8.1) TORCHVISION_VERSION=0.9.1;;
|
2021-01-07 14:03:06 -08:00
|
|
|
1.5) TORCHVISION_VERSION=0.6.0;;
|
|
|
|
*) TORCHVISION_VERSION=0.5.0;;
|
|
|
|
esac
|
|
|
|
pip install --use-deprecated=legacy-resolver --upgrade tensorflow-probability=="${TFP_VERSION-0.8}" \
|
2021-04-13 14:20:26 -07:00
|
|
|
torch=="${TORCH_VERSION-1.8.1}" torchvision=="${TORCHVISION_VERSION}" \
|
2021-01-07 14:03:06 -08:00
|
|
|
tensorflow=="${TF_VERSION-2.2.0}" gym
|
|
|
|
fi
|
2020-04-15 08:10:22 -07:00
|
|
|
fi
|
|
|
|
|
2020-10-24 01:08:46 -07:00
|
|
|
# Additional Tune dependency for Horovod.
|
|
|
|
# This must be run last (i.e., torch cannot be re-installed after this)
|
|
|
|
if [ "${INSTALL_HOROVOD-}" = 1 ]; then
|
|
|
|
# TODO: eventually pin this to master.
|
|
|
|
HOROVOD_WITH_GLOO=1 HOROVOD_WITHOUT_MPI=1 HOROVOD_WITHOUT_MXNET=1 pip install -U git+https://github.com/horovod/horovod.git
|
|
|
|
fi
|
|
|
|
|
2020-04-29 21:19:02 -07:00
|
|
|
if [ -n "${PYTHON-}" ] || [ -n "${LINT-}" ] || [ "${MAC_WHEELS-}" = 1 ]; then
|
2020-04-15 08:10:22 -07:00
|
|
|
install_node
|
|
|
|
fi
|
|
|
|
|
2021-03-17 00:58:36 -04:00
|
|
|
CC=gcc pip install psutil setproctitle==1.2.2 --target="${WORKSPACE_DIR}/python/ray/thirdparty_files"
|
2020-04-15 08:10:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
install_dependencies "$@"
|
|
|
|
|
2020-05-05 10:47:49 -07:00
|
|
|
# Pop caller's shell options (quietly)
|
|
|
|
{ set -vx; eval "${SHELLOPTS_STACK##*|}"; SHELLOPTS_STACK="${SHELLOPTS_STACK%|*}"; } 2> /dev/null
|