|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +set -euxo pipefail |
| 4 | + |
| 5 | +unset PYTORCH_VERSION |
| 6 | + |
| 7 | +root_dir="$(git rev-parse --show-toplevel)" |
| 8 | +env_dir="${root_dir}/env" |
| 9 | +source "${env_dir}/bin/activate" |
| 10 | +export PATH="$HOME/.local/bin:$PATH" |
| 11 | + |
| 12 | +uv_pip_install() { |
| 13 | + uv pip install --no-progress --python "${env_dir}/bin/python" "$@" |
| 14 | +} |
| 15 | + |
| 16 | +if [ "${CU_VERSION:-}" == cpu ] ; then |
| 17 | + torch_index="https://download.pytorch.org/whl/nightly/cpu" |
| 18 | + stable_torch_index="https://download.pytorch.org/whl/cpu" |
| 19 | +else |
| 20 | + torch_index="https://download.pytorch.org/whl/nightly/${CU_VERSION}" |
| 21 | + stable_torch_index="https://download.pytorch.org/whl/${CU_VERSION}" |
| 22 | +fi |
| 23 | + |
| 24 | +git submodule sync && git submodule update --init --recursive |
| 25 | + |
| 26 | +uv_pip_install \ |
| 27 | + cloudpickle \ |
| 28 | + coverage \ |
| 29 | + expecttest \ |
| 30 | + future \ |
| 31 | + hydra-core \ |
| 32 | + hypothesis \ |
| 33 | + importlib_metadata \ |
| 34 | + orjson \ |
| 35 | + packaging \ |
| 36 | + psutil \ |
| 37 | + "pyvers>=0.2.0,<0.3.0" \ |
| 38 | + pybind11[global] \ |
| 39 | + pytest \ |
| 40 | + pytest-asyncio \ |
| 41 | + pytest-cov \ |
| 42 | + pytest-error-for-skips \ |
| 43 | + pytest-instafail \ |
| 44 | + pytest-json-report \ |
| 45 | + pytest-mock \ |
| 46 | + pytest-rerunfailures \ |
| 47 | + pytest-timeout \ |
| 48 | + pyyaml \ |
| 49 | + scipy \ |
| 50 | + setuptools \ |
| 51 | + wheel |
| 52 | + |
| 53 | +if [[ "$TORCH_VERSION" == "nightly" ]]; then |
| 54 | + uv_pip_install --upgrade --pre torch --index-url "${torch_index}" |
| 55 | +elif [[ "$TORCH_VERSION" == "stable" ]]; then |
| 56 | + uv_pip_install --upgrade torch --index-url "${stable_torch_index}" |
| 57 | +else |
| 58 | + echo "Failed to install pytorch" |
| 59 | + exit 1 |
| 60 | +fi |
| 61 | + |
| 62 | +# Install TensorDict before TorchRL. Nightly CI validates against TensorDict main. |
| 63 | +if [[ "$RELEASE" == 0 ]]; then |
| 64 | + uv_pip_install --no-build-isolation --no-deps git+https://github.com/pytorch/tensordict.git |
| 65 | +else |
| 66 | + uv_pip_install --no-deps tensordict |
| 67 | +fi |
| 68 | + |
| 69 | +uv_pip_install -e . --no-build-isolation --no-deps |
| 70 | + |
| 71 | +# LIBERO is source-only. Its root is a namespace-package parent; keep it on |
| 72 | +# PYTHONPATH at test time instead of relying on the upstream editable install. |
| 73 | +libero_dir="${root_dir}/libero-src" |
| 74 | +rm -rf "${libero_dir}" |
| 75 | +git clone --depth 1 https://github.com/Lifelong-Robot-Learning/LIBERO.git "${libero_dir}" |
| 76 | + |
| 77 | +uv_pip_install \ |
| 78 | + "bddl==1.0.1" \ |
| 79 | + easydict \ |
| 80 | + "gym==0.25.2" \ |
| 81 | + h5py \ |
| 82 | + imageio \ |
| 83 | + matplotlib \ |
| 84 | + "numpy<2" \ |
| 85 | + opencv-python \ |
| 86 | + "robosuite==1.4.0" \ |
| 87 | + termcolor \ |
| 88 | + tqdm |
| 89 | + |
| 90 | +timeout 120s python -c "import functorch; import tensordict; import torchrl" |
| 91 | + |
| 92 | +export LIBERO_CONFIG_PATH="${root_dir}/.libero-ci" |
| 93 | +timeout 120s env PYTHONPATH="${libero_dir}:${PYTHONPATH:-}" python -c "from torchrl.envs.libs.libero import _ensure_libero_config; _ensure_libero_config()" |
| 94 | +timeout 120s env PYTHONPATH="${libero_dir}:${PYTHONPATH:-}" python -c "from libero.libero import benchmark; from libero.libero.envs import OffScreenRenderEnv; print(sorted(benchmark.get_benchmark_dict()))" |
0 commit comments