Skip to content

Commit 0a8f86d

Browse files
authored
[CI, BugFix] Fix gym related errors (#895)
1 parent 947a2af commit 0a8f86d

File tree

17 files changed

+36
-31
lines changed

17 files changed

+36
-31
lines changed

.circleci/unittest/linux/scripts/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies:
1818
- pytest-cov
1919
- pytest-mock
2020
- pytest-instafail
21+
- pytest-rerunfailures
2122
- expecttest
2223
- pyyaml
2324
- scipy

.circleci/unittest/linux/scripts/run_test.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#!/usr/bin/env bash
22

3-
# this code is supposed to run on CPU
4-
# rendering with the combination of packages we have here in headless mode
5-
# is hard to nail.
6-
# IMPORTANT: As a consequence, we can't guarantee TorchRL compatibility with
7-
# rendering with this version of gym / mujoco-py.
8-
93
set -e
104

115
eval "$(./conda/bin/conda shell.bash hook)"
@@ -23,6 +17,7 @@ lib_dir="${env_dir}/lib"
2317
# solves ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
2418
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$lib_dir
2519
export MKL_THREADING_LAYER=GNU
20+
export CKPT_BACKEND=torch
2621

2722
python .circleci/unittest/helpers/coverage_run_parallel.py -m pytest test/smoke_test.py -v --durations 20
2823
python .circleci/unittest/helpers/coverage_run_parallel.py -m pytest test/smoke_test_deps.py -v --durations 20 -k 'test_gym or test_dm_control_pixels or test_dm_control or test_tb'

.circleci/unittest/linux/scripts/setup_env.sh

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ if [ ! -d "${env_dir}" ]; then
3838
fi
3939
conda activate "${env_dir}"
4040

41-
# 3. Install mujoco
42-
printf "* Installing mujoco and related\n"
43-
mkdir -p $root_dir/.mujoco
44-
cd $root_dir/.mujoco/
45-
wget https://github.com/deepmind/mujoco/releases/download/2.1.1/mujoco-2.1.1-linux-x86_64.tar.gz
46-
tar -xf mujoco-2.1.1-linux-x86_64.tar.gz
47-
wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz
48-
tar -xf mujoco210-linux-x86_64.tar.gz
49-
cd $this_dir
41+
## 3. Install mujoco
42+
#printf "* Installing mujoco and related\n"
43+
#mkdir -p $root_dir/.mujoco
44+
#cd $root_dir/.mujoco/
45+
#wget https://github.com/deepmind/mujoco/releases/download/2.1.1/mujoco-2.1.1-linux-x86_64.tar.gz
46+
#tar -xf mujoco-2.1.1-linux-x86_64.tar.gz
47+
#wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz
48+
#tar -xf mujoco210-linux-x86_64.tar.gz
49+
#cd $this_dir
5050

5151
# 4. Install Conda dependencies
5252
printf "* Installing dependencies (except PyTorch)\n"
@@ -63,21 +63,13 @@ else
6363
fi
6464

6565
export MUJOCO_GL=$PRIVATE_MUJOCO_GL
66-
if [ "${CU_VERSION:-}" == cpu ]; then
67-
conda env config vars set MUJOCO_PY_MUJOCO_PATH=$root_dir/.mujoco/mujoco210 \
66+
conda env config vars set MUJOCO_PY_MUJOCO_PATH=$root_dir/.mujoco/mujoco210 \
6867
DISPLAY=unix:0.0 \
6968
MJLIB_PATH=$root_dir/.mujoco/mujoco-2.1.1/lib/libmujoco.so.2.1.1 \
7069
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$root_dir/.mujoco/mujoco210/bin \
7170
SDL_VIDEODRIVER=dummy \
7271
MUJOCO_GL=$PRIVATE_MUJOCO_GL \
7372
PYOPENGL_PLATFORM=$PRIVATE_MUJOCO_GL
74-
else
75-
conda env config vars set MUJOCO_PY_MUJOCO_PATH=$root_dir/.mujoco/mujoco210 \
76-
MJLIB_PATH=$root_dir/.mujoco/mujoco-2.1.1/lib/libmujoco.so.2.1.1 \
77-
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$root_dir/.mujoco/mujoco210/bin \
78-
MUJOCO_GL=$PRIVATE_MUJOCO_GL \
79-
PYOPENGL_PLATFORM=$PRIVATE_MUJOCO_GL
80-
fi
8173

8274
# Software rendering requires GLX and OSMesa.
8375
if [ $PRIVATE_MUJOCO_GL == 'egl' ] || [ $PRIVATE_MUJOCO_GL == 'osmesa' ] ; then

.circleci/unittest/linux_examples/scripts/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies:
1818
- pytest-cov
1919
- pytest-mock
2020
- pytest-instafail
21+
- pytest-rerunfailures
2122
- expecttest
2223
- pyyaml
2324
- scipy

.circleci/unittest/linux_libs/scripts_brax/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dependencies:
1111
- pytest-cov
1212
- pytest-mock
1313
- pytest-instafail
14+
- pytest-rerunfailures
1415
- expecttest
1516
- pyyaml
1617
- scipy

.circleci/unittest/linux_libs/scripts_envpool/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
- pytest-cov
1717
- pytest-mock
1818
- pytest-instafail
19+
- pytest-rerunfailures
1920
- expecttest
2021
- pyyaml
2122
- scipy

.circleci/unittest/linux_libs/scripts_gym/batch_scripts.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ conda activate ./env
1414
$DIR/install.sh
1515

1616
# Extracted from run_test.sh to run once.
17-
#yum makecache && yum install libglvnd-devel mesa-libGL mesa-libGL-devel mesa-libEGL mesa-libEGL-devel glfw mesa-libOSMesa-devel glew glew-devel egl-utils freeglut xorg-x11-server-Xvfb -y
18-
yum makecache && yum install libglvnd-devel glew xorg-x11-server-Xvfb zlib-devel egl-utils mesa-libEGL -y
17+
yum makecache && yum install libglvnd-devel zlib-devel mesa-libGL mesa-libGL-devel mesa-libEGL mesa-libEGL-devel glfw mesa-libOSMesa-devel glew glew-devel egl-utils freeglut xorg-x11-server-Xvfb -y
18+
#yum makecache && yum install libglvnd-devel glew xorg-x11-server-Xvfb zlib-devel egl-utils freeglut mesa-libEGL -y
1919

2020

2121
# This version is installed initially (see environment.yml)
@@ -24,14 +24,15 @@ do
2424
# Create a copy of the conda env and work with this
2525
conda deactivate
2626
conda create --prefix ./cloned_env --clone ./env -y
27+
conda activate ./cloned_env
2728

2829
echo "Testing gym version: ${GYM_VERSION}"
2930
pip3 install 'gym[atari]'==$GYM_VERSION
3031
$DIR/run_test.sh
3132

3233
# delete the conda copy
3334
conda deactivate
34-
conda env remove -n ./cloned_env
35+
conda env remove --prefix ./cloned_env
3536
done
3637

3738
# gym[atari]==0.19 is broken, so we install only gym without dependencies.
@@ -40,14 +41,15 @@ do
4041
# Create a copy of the conda env and work with this
4142
conda deactivate
4243
conda create --prefix ./cloned_env --clone ./env -y
44+
conda activate ./cloned_env
4345

4446
echo "Testing gym version: ${GYM_VERSION}"
4547
pip3 install gym==$GYM_VERSION
4648
$DIR/run_test.sh
4749

4850
# delete the conda copy
4951
conda deactivate
50-
conda env remove -n ./cloned_env
52+
conda env remove --prefix ./cloned_env
5153
done
5254

5355
# gym[atari]==0.20 installs ale-py==0.8, but this version is not compatible with gym<0.26, so we downgrade it.
@@ -56,6 +58,7 @@ do
5658
# Create a copy of the conda env and work with this
5759
conda deactivate
5860
conda create --prefix ./cloned_env --clone ./env -y
61+
conda activate ./cloned_env
5962

6063
echo "Testing gym version: ${GYM_VERSION}"
6164
pip3 install 'gym[atari]'==$GYM_VERSION
@@ -64,22 +67,23 @@ do
6467

6568
# delete the conda copy
6669
conda deactivate
67-
conda env remove -n ./cloned_env
70+
conda env remove --prefix ./cloned_env
6871
done
6972

7073
for GYM_VERSION in '0.25'
7174
do
7275
# Create a copy of the conda env and work with this
7376
conda deactivate
7477
conda create --prefix ./cloned_env --clone ./env -y
78+
conda activate ./cloned_env
7579

7680
echo "Testing gym version: ${GYM_VERSION}"
7781
pip3 install 'gym[atari]'==$GYM_VERSION
7882
$DIR/run_test.sh
7983

8084
# delete the conda copy
8185
conda deactivate
82-
conda env remove -n ./cloned_env
86+
conda env remove --prefix ./cloned_env
8387
done
8488

8589
# For this version "gym[accept-rom-license]" is required.
@@ -88,6 +92,7 @@ do
8892
# Create a copy of the conda env and work with this
8993
conda deactivate
9094
conda create --prefix ./cloned_env --clone ./env -y
95+
conda activate ./cloned_env
9196

9297
echo "Testing gym version: ${GYM_VERSION}"
9398
pip3 install 'gym[accept-rom-license]'==$GYM_VERSION
@@ -96,5 +101,5 @@ do
96101

97102
# delete the conda copy
98103
conda deactivate
99-
conda env remove -n ./cloned_env
104+
conda env remove --prefix ./cloned_env
100105
done

.circleci/unittest/linux_libs/scripts_gym/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies:
1717
- pytest-cov
1818
- pytest-mock
1919
- pytest-instafail
20+
- pytest-rerunfailures
2021
- expecttest
2122
- pyyaml
2223
- scipy

.circleci/unittest/linux_libs/scripts_gym/run_test.sh

100644100755
File mode changed.

.circleci/unittest/linux_libs/scripts_habitat/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dependencies:
1111
- pytest-cov
1212
- pytest-mock
1313
- pytest-instafail
14+
- pytest-rerunfailures
1415
- expecttest
1516
- pyyaml
1617
- scipy

0 commit comments

Comments
 (0)