Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/unittest/linux/scripts/environment.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/unittest/linux/scripts/post_process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

set -e

eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env
root_dir="$(git rev-parse --show-toplevel)"
source "${root_dir}/.venv/bin/activate"
32 changes: 32 additions & 0 deletions .github/unittest/linux/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
pip
protobuf
hypothesis
future
cloudpickle
pygame
moviepy<2.0.0
tqdm
pytest
pytest-cov
pytest-mock
pytest-instafail
pytest-rerunfailures
pytest-timeout
pytest-asyncio
expecttest
pybind11[global]
pyyaml
scipy
hydra-core
tensorboard
imageio==2.26.0
wandb
dm_control
mujoco<3.3.6
mlflow
av
coverage
ray
transformers
ninja
timm
92 changes: 41 additions & 51 deletions .github/unittest/linux/scripts/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -v

if [[ $OSTYPE != 'darwin'* ]]; then
apt-get update && apt-get upgrade -y
apt-get install -y vim git wget cmake
apt-get install -y vim git wget curl cmake

# Enable universe repository
# apt-get install -y software-properties-common
Expand All @@ -27,7 +27,7 @@ if [[ $OSTYPE != 'darwin'* ]]; then
apt-get upgrade -y libstdc++6
apt-get dist-upgrade -y
else
apt-get install -y g++ gcc
apt-get install -y g++ gcc cmake
fi

fi
Expand All @@ -45,37 +45,23 @@ fi
# Avoid error: "fatal: unsafe repository"
git config --global --add safe.directory '*'
root_dir="$(git rev-parse --show-toplevel)"
conda_dir="${root_dir}/conda"
env_dir="${root_dir}/env"
lib_dir="${env_dir}/lib"
env_dir="${root_dir}/.venv"

cd "${root_dir}"

case "$(uname -s)" in
Darwin*) os=MacOSX;;
*) os=Linux
esac
# 1. Install uv
printf "* Installing uv\n"
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"

# 1. Install conda at ./conda
if [ ! -d "${conda_dir}" ]; then
printf "* Installing conda\n"
wget -O miniconda.sh "http://repo.continuum.io/miniconda/Miniconda3-latest-${os}-x86_64.sh"
bash ./miniconda.sh -b -f -p "${conda_dir}"
fi
eval "$(${conda_dir}/bin/conda shell.bash hook)"

# 2. Create test environment at ./env
# 2. Create test environment at ./.venv
printf "python: ${PYTHON_VERSION}\n"
if [ ! -d "${env_dir}" ]; then
printf "* Creating a test environment\n"
conda create --prefix "${env_dir}" -y python="$PYTHON_VERSION"
fi
conda activate "${env_dir}"
printf "* Creating a test environment with uv\n"
uv venv "${env_dir}" --python="${PYTHON_VERSION}"
source "${env_dir}/bin/activate"

# 3. Install Conda dependencies
# 3. Install dependencies (except PyTorch)
printf "* Installing dependencies (except PyTorch)\n"
echo " - python=${PYTHON_VERSION}" >> "${this_dir}/environment.yml"
cat "${this_dir}/environment.yml"

if [ "${CU_VERSION:-}" == cpu ] ; then
export MUJOCO_GL=glfw
Expand All @@ -85,31 +71,36 @@ fi

export SDL_VIDEODRIVER=dummy

# legacy from bash scripts: remove?
conda env config vars set \
MAX_IDLE_COUNT=1000 \
MUJOCO_GL=$MUJOCO_GL PYOPENGL_PLATFORM=$MUJOCO_GL DISPLAY=:99 SDL_VIDEODRIVER=dummy LAZY_LEGACY_OP=False RL_LOGGING_LEVEL=DEBUG TOKENIZERS_PARALLELISM=true
# Set environment variables
export MAX_IDLE_COUNT=1000
export PYOPENGL_PLATFORM=$MUJOCO_GL
export DISPLAY=:99
export LAZY_LEGACY_OP=False
export RL_LOGGING_LEVEL=DEBUG
export TOKENIZERS_PARALLELISM=true

pip3 install pip --upgrade
pip install virtualenv
# Install build dependencies FIRST (required for C++ extensions)
printf "* Installing build dependencies\n"
uv pip install setuptools wheel ninja "pybind11[global]"

conda env update --file "${this_dir}/environment.yml" --prune
# Install dependencies from requirements.txt
printf "* Installing dependencies from requirements.txt\n"
uv pip install -r "${this_dir}/requirements.txt"

# Reset conda env variables
conda deactivate
conda activate "${env_dir}"
# Install pip for compatibility with packages that expect it
uv pip install pip

echo "installing gymnasium"
if [[ "$PYTHON_VERSION" == "3.12" ]]; then
pip3 install ale-py
pip3 install sympy
pip3 install "gymnasium[mujoco]>=1.1" mo-gymnasium[mujoco]
uv pip install ale-py
uv pip install sympy
uv pip install "gymnasium[mujoco]>=1.1" mo-gymnasium[mujoco]
else
pip3 install "gymnasium[atari,mujoco]>=1.1" mo-gymnasium[mujoco]
uv pip install "gymnasium[atari,mujoco]>=1.1" mo-gymnasium[mujoco]
fi

# sanity check: remove?
python3 -c """
python -c """
import dm_control
from dm_control import composer
from tensorboard import *
Expand Down Expand Up @@ -140,15 +131,15 @@ git submodule sync && git submodule update --init --recursive
printf "Installing PyTorch with %s\n" "${CU_VERSION}"
if [[ "$TORCH_VERSION" == "nightly" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu -U
uv pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu -U
else
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U
uv pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
else
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION -U
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION -U
fi
else
printf "Failed to install pytorch"
Expand All @@ -167,23 +158,22 @@ python -c "import functorch"

# install tensordict
if [[ "$RELEASE" == 0 ]]; then
pip3 install git+https://github.com/pytorch/tensordict.git
uv pip install git+https://github.com/pytorch/tensordict.git
else
pip3 install tensordict
uv pip install tensordict
fi

printf "* Installing torchrl\n"
python setup.py develop

uv pip install -e . --no-build-isolation

if [ "${CU_VERSION:-}" != cpu ] ; then
printf "* Installing VC1\n"
python3 -c """
python -c """
from torchrl.envs.transforms.vc1 import VC1Transform
VC1Transform.install_vc_models(auto_exit=True)
"""

python3 -c """
python -c """
import vc_models
from vc_models.models.vit import model_utils
print(model_utils)
Expand Down
34 changes: 0 additions & 34 deletions .github/unittest/linux_distributed/scripts/environment.yml

This file was deleted.

20 changes: 10 additions & 10 deletions .github/unittest/linux_distributed/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ unset PYTORCH_VERSION

set -e

eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env
root_dir="$(git rev-parse --show-toplevel)"
source "${root_dir}/.venv/bin/activate"

if [ "${CU_VERSION:-}" == cpu ] ; then
version="cpu"
Expand All @@ -28,15 +28,15 @@ git submodule sync && git submodule update --init --recursive

if [[ "$TORCH_VERSION" == "nightly" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu -U
uv pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu -U
else
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U
uv pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
else
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION -U
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION -U
fi
else
printf "Failed to install pytorch"
Expand All @@ -47,14 +47,14 @@ fi
python -c "import functorch"

## install snapshot
#pip install git+https://github.com/pytorch/torchsnapshot
#uv pip install git+https://github.com/pytorch/torchsnapshot

# install tensordict
if [[ "$RELEASE" == 0 ]]; then
pip3 install git+https://github.com/pytorch/tensordict.git
uv pip install git+https://github.com/pytorch/tensordict.git
else
pip3 install tensordict
uv pip install tensordict
fi

printf "* Installing torchrl\n"
python setup.py develop
uv pip install -e . --no-build-isolation
4 changes: 2 additions & 2 deletions .github/unittest/linux_distributed/scripts/post_process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

set -e

eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env
root_dir="$(git rev-parse --show-toplevel)"
source "${root_dir}/.venv/bin/activate"
29 changes: 29 additions & 0 deletions .github/unittest/linux_distributed/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pip
protobuf
hypothesis
future
cloudpickle
pygame
moviepy<2.0.0
tqdm
pytest
pytest-cov
pytest-mock
pytest-instafail
pytest-rerunfailures
pytest-asyncio
expecttest
pybind11[global]
pyyaml
scipy
hydra-core
tensorboard
imageio==2.26.0
wandb
dm_control
mujoco<3.3.6
mlflow
av
coverage
ray
virtualenv
4 changes: 2 additions & 2 deletions .github/unittest/linux_distributed/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -e

eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env
root_dir="$(git rev-parse --show-toplevel)"
source "${root_dir}/.venv/bin/activate"

export PYTORCH_TEST_WITH_SLOW='1'
python -m torch.utils.collect_env
Expand Down
Loading
Loading