2016-12-13 17:37:22 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
|
|
|
|
|
|
|
echo "PYTHON is $PYTHON"
|
|
|
|
|
2020-02-15 23:50:44 +01:00
|
|
|
# Make sure all important package versions are static (via env variables
|
|
|
|
# or assign default values to them).
|
|
|
|
tf_version="$TF_VERSION"
|
|
|
|
if [[ $tf_version == "" ]]; then tf_version="2.0.0b1"; fi
|
|
|
|
echo "tf_version is $tf_version"
|
|
|
|
tfp_version="$TFP_VERSION"
|
|
|
|
if [[ tfp_version == "" ]]; then tfp_version="0.8"; fi
|
|
|
|
echo "tfp_version is $tfp_version"
|
|
|
|
torch_version="$TORCH_VERSION"
|
|
|
|
if [[ torch_version == "" ]]; then torch_version="1.4"; fi
|
|
|
|
echo "torch_version is $torch_version"
|
|
|
|
|
2016-12-13 17:37:22 -08:00
|
|
|
platform="unknown"
|
|
|
|
unamestr="$(uname)"
|
|
|
|
if [[ "$unamestr" == "Linux" ]]; then
|
|
|
|
echo "Platform is linux."
|
|
|
|
platform="linux"
|
|
|
|
elif [[ "$unamestr" == "Darwin" ]]; then
|
|
|
|
echo "Platform is macosx."
|
|
|
|
platform="macosx"
|
|
|
|
else
|
|
|
|
echo "Unrecognized platform."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-02-15 23:50:44 +01:00
|
|
|
# Upgrade pip and other packages to avoid incompatibility ERRORS.
|
|
|
|
pip install --upgrade pip # setuptools cloudpickle urllib3
|
|
|
|
|
2020-02-26 12:28:13 -08:00
|
|
|
# If we're in a CI environment, do some configuration
|
2020-03-01 14:04:06 -08:00
|
|
|
if [ "${TRAVIS-}" = true ] || [ -n "${GITHUB_WORKFLOW-}" ]; then
|
2020-02-26 12:28:13 -08:00
|
|
|
pip config --user set global.disable-pip-version-check True
|
|
|
|
pip config --user set global.no-color True
|
|
|
|
pip config --user set global.progress_bar off
|
|
|
|
pip config --user set global.quiet True
|
|
|
|
fi
|
|
|
|
|
2020-02-12 11:15:47 -08:00
|
|
|
if [[ "$PYTHON" == "3.6" ]] && [[ "$platform" == "linux" ]]; then
|
2016-12-13 17:37:22 -08:00
|
|
|
sudo apt-get update
|
2020-03-23 08:46:56 -07:00
|
|
|
sudo apt-get install -y build-essential curl unzip tmux gdb libunwind-dev
|
2016-12-13 17:37:22 -08:00
|
|
|
# Install miniconda.
|
2019-11-22 14:32:14 -08:00
|
|
|
wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -O miniconda.sh -nv
|
2016-12-13 17:37:22 -08:00
|
|
|
bash miniconda.sh -b -p $HOME/miniconda
|
|
|
|
export PATH="$HOME/miniconda/bin:$PATH"
|
2020-02-26 12:28:13 -08:00
|
|
|
"${ROOT_DIR}/install-strace.sh" || true
|
|
|
|
pip install scipy tensorflow==$tf_version \
|
2020-02-15 23:50:44 +01:00
|
|
|
cython==0.29.0 gym \
|
|
|
|
opencv-python-headless pyyaml pandas==0.24.2 requests \
|
2020-03-23 08:46:56 -07:00
|
|
|
feather-format lxml openpyxl xlrd py-spy pytest pytest-timeout networkx tabulate aiohttp \
|
2019-12-18 11:50:21 -08:00
|
|
|
uvicorn dataclasses pygments werkzeug kubernetes flask grpcio pytest-sugar pytest-rerunfailures pytest-asyncio \
|
2020-03-08 03:12:25 +08:00
|
|
|
blist scikit-learn numba
|
2020-02-12 11:15:47 -08:00
|
|
|
elif [[ "$PYTHON" == "3.6" ]] && [[ "$platform" == "macosx" ]]; then
|
2016-12-13 17:37:22 -08:00
|
|
|
# Install miniconda.
|
2019-11-22 14:32:14 -08:00
|
|
|
wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.4-MacOSX-x86_64.sh -O miniconda.sh -nv
|
2016-12-13 17:37:22 -08:00
|
|
|
bash miniconda.sh -b -p $HOME/miniconda
|
|
|
|
export PATH="$HOME/miniconda/bin:$PATH"
|
2020-02-26 12:28:13 -08:00
|
|
|
pip install scipy tensorflow==$tf_version \
|
2020-02-15 23:50:44 +01:00
|
|
|
cython==0.29.0 gym \
|
|
|
|
opencv-python-headless pyyaml pandas==0.24.2 requests \
|
2020-03-23 08:46:56 -07:00
|
|
|
feather-format lxml openpyxl xlrd py-spy pytest pytest-timeout networkx tabulate aiohttp \
|
2019-12-18 11:50:21 -08:00
|
|
|
uvicorn dataclasses pygments werkzeug kubernetes flask grpcio pytest-sugar pytest-rerunfailures pytest-asyncio \
|
2020-03-08 03:12:25 +08:00
|
|
|
blist scikit-learn numba
|
2017-03-01 23:34:44 -08:00
|
|
|
elif [[ "$LINT" == "1" ]]; then
|
|
|
|
sudo apt-get update
|
2019-02-26 23:07:43 -08:00
|
|
|
sudo apt-get install -y build-essential curl unzip
|
2017-03-01 23:34:44 -08:00
|
|
|
# Install miniconda.
|
2019-11-22 14:32:14 -08:00
|
|
|
wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -O miniconda.sh -nv
|
2017-03-01 23:34:44 -08:00
|
|
|
bash miniconda.sh -b -p $HOME/miniconda
|
2017-03-21 12:57:54 -07:00
|
|
|
export PATH="$HOME/miniconda/bin:$PATH"
|
|
|
|
# Install Python linting tools.
|
2020-02-26 12:28:13 -08:00
|
|
|
pip install flake8==3.7.7 flake8-comprehensions flake8-quotes==2.0.0
|
2020-02-24 11:12:07 -08:00
|
|
|
# Install TypeScript and HTML linting tools.
|
|
|
|
pushd "$ROOT_DIR/../../python/ray/dashboard/client"
|
|
|
|
source "$HOME/.nvm/nvm.sh"
|
|
|
|
nvm install node
|
|
|
|
nvm use node
|
|
|
|
npm ci
|
|
|
|
popd
|
2017-08-21 23:48:20 -07:00
|
|
|
elif [[ "$LINUX_WHEELS" == "1" ]]; then
|
|
|
|
sudo apt-get install docker
|
|
|
|
sudo usermod -a -G docker travis
|
|
|
|
elif [[ "$MAC_WHEELS" == "1" ]]; then
|
2019-04-02 22:17:33 -07:00
|
|
|
:
|
2016-12-13 17:37:22 -08:00
|
|
|
else
|
|
|
|
echo "Unrecognized environment."
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-09-23 08:50:40 -07:00
|
|
|
|
2020-03-06 19:37:12 +01:00
|
|
|
# Install modules needed in all jobs.
|
|
|
|
pip install dm-tree
|
|
|
|
|
2020-02-15 23:50:44 +01:00
|
|
|
# Additional RLlib dependencies.
|
|
|
|
if [[ "$RLLIB_TESTING" == "1" ]]; then
|
2020-02-26 12:28:13 -08:00
|
|
|
pip install tensorflow-probability==$tfp_version gast==0.2.2 \
|
2020-02-15 23:50:44 +01:00
|
|
|
torch==$torch_version torchvision \
|
2020-03-06 19:37:12 +01:00
|
|
|
atari_py gym[atari] lz4 smart_open
|
2020-02-15 23:50:44 +01:00
|
|
|
fi
|
|
|
|
|
2020-02-25 10:33:33 +08:00
|
|
|
# Additional streaming dependencies.
|
|
|
|
if [[ "$RAY_CI_STREAMING_PYTHON_AFFECTED" == "1" ]]; then
|
|
|
|
pip install -q msgpack>=0.6.2
|
|
|
|
fi
|
|
|
|
|
2020-02-12 11:15:47 -08:00
|
|
|
if [[ "$PYTHON" == "3.6" ]] || [[ "$MAC_WHEELS" == "1" ]]; then
|
2019-09-23 08:50:40 -07:00
|
|
|
# Install the latest version of Node.js in order to build the dashboard.
|
2020-02-24 11:12:07 -08:00
|
|
|
source "$HOME/.nvm/nvm.sh"
|
2019-09-23 08:50:40 -07:00
|
|
|
nvm install node
|
|
|
|
fi
|
2020-02-05 14:16:58 -08:00
|
|
|
|
2020-02-26 12:28:13 -08:00
|
|
|
pip install psutil setproctitle \
|
2020-02-05 14:16:58 -08:00
|
|
|
--target="$ROOT_DIR/../../python/ray/thirdparty_files"
|