From 9dd8b292f9c85c47c66366fa627d9a66570fd9ef Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Tue, 23 May 2023 18:46:47 -0700 Subject: [PATCH 01/51] bump to 0.28.1 Signed-off-by: Rohan Potdar --- python/requirements.txt | 2 +- python/requirements/ml/requirements_rllib.txt | 2 +- python/setup.py | 2 +- release/rllib_tests/app_config.yaml | 2 +- rllib/models/catalog.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/requirements.txt b/python/requirements.txt index e6bfd5a7e4667..5e569b8f0b30a 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -41,7 +41,7 @@ scikit-image scipy aiohttp>=3.7 fastapi -gymnasium==0.26.3 +gymnasium==0.28.1 opencensus fsspec dm_tree diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 2d1b6da4b6957..e726989b17708 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -5,7 +5,7 @@ # Atari # TODO(sven): Still needed for Atari (need to be wrapped by gymnasium as it does NOT support Atari yet) gym==0.26.2 -gymnasium[atari,mujoco]==0.26.3 +gymnasium[atari,mujoco]==0.28.1 # For testing MuJoCo envs with gymnasium. mujoco-py<2.2,>=2.1 # Kaggle envs. diff --git a/python/setup.py b/python/setup.py index 6bcfb8cded0e2..2804d4ae477de 100644 --- a/python/setup.py +++ b/python/setup.py @@ -274,7 +274,7 @@ def get_packages(self): setup_spec.extras["rllib"] = setup_spec.extras["tune"] + [ "dm_tree", - "gymnasium==0.26.3", + "gymnasium==0.28.1", "lz4", "scikit-image", "pyyaml", diff --git a/release/rllib_tests/app_config.yaml b/release/rllib_tests/app_config.yaml index fe802591f9b09..48b429d8221c0 100755 --- a/release/rllib_tests/app_config.yaml +++ b/release/rllib_tests/app_config.yaml @@ -15,7 +15,7 @@ python: pip_packages: ## These dependencies should be handled by requirements_rllib.txt and ## requirements_ml_docker.txt and removed here - - gymnasium[atari,mujoco]==0.26.3 + - gymnasium[atari,mujoco]==0.28.1 - ale-py==0.8.0 - gym==0.26.2 - mujoco-py<2.2,>=2.1 diff --git a/rllib/models/catalog.py b/rllib/models/catalog.py index 83c942d1a2779..70b6e4b83103e 100644 --- a/rllib/models/catalog.py +++ b/rllib/models/catalog.py @@ -350,7 +350,7 @@ def get_action_dist( "Unsupported args: {} {}".format(action_space, dist_type) ) - return dist_cls, dist_cls.required_model_output_shape(action_space, config) + return dist_cls, int(dist_cls.required_model_output_shape(action_space, config)) @staticmethod @DeveloperAPI From bd070e53019282300d5d0d191ba4411549398575 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Thu, 25 May 2023 18:24:03 -0700 Subject: [PATCH 02/51] fix test Signed-off-by: Rohan Potdar --- rllib/algorithms/tests/test_algorithm_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rllib/algorithms/tests/test_algorithm_config.py b/rllib/algorithms/tests/test_algorithm_config.py index b93523ef25b21..d966776daa525 100644 --- a/rllib/algorithms/tests/test_algorithm_config.py +++ b/rllib/algorithms/tests/test_algorithm_config.py @@ -17,7 +17,7 @@ class TestAlgorithmConfig(unittest.TestCase): @classmethod def setUpClass(cls): - ray.init(num_cpus=6, local_mode=True) + ray.init() @classmethod def tearDownClass(cls): From 7402830794706eda7ca888fe21b13089dc644716 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Mon, 5 Jun 2023 12:31:42 -0700 Subject: [PATCH 03/51] Atari is now supported by gymnasium Signed-off-by: Rohan Potdar --- rllib/algorithms/algorithm_config.py | 5 +---- rllib/algorithms/ppo/tests/test_ppo_rl_module.py | 11 ++--------- rllib/env/utils.py | 12 +----------- rllib/utils/test_utils.py | 6 +----- 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/rllib/algorithms/algorithm_config.py b/rllib/algorithms/algorithm_config.py index 9c31e101b4c2f..25c1447b0d6be 100644 --- a/rllib/algorithms/algorithm_config.py +++ b/rllib/algorithms/algorithm_config.py @@ -738,10 +738,7 @@ def _detect_atari_env(self) -> bool: return False try: - if self.env.startswith("ALE/"): - env = gym.make("GymV26Environment-v0", env_id=self.env) - else: - env = gym.make(self.env) + env = gym.make(self.env) except gym.error.NameNotFound: # Not an Atari env if this is not a gym env. return False diff --git a/rllib/algorithms/ppo/tests/test_ppo_rl_module.py b/rllib/algorithms/ppo/tests/test_ppo_rl_module.py index 938e285b1eb32..d52b1a182136d 100644 --- a/rllib/algorithms/ppo/tests/test_ppo_rl_module.py +++ b/rllib/algorithms/ppo/tests/test_ppo_rl_module.py @@ -147,10 +147,7 @@ def test_rollouts(self): # LSTM not implemented in TF2 yet continue print(f"[FW={fw} | [ENV={env_name}] | [FWD={fwd_fn}] | LSTM" f"={lstm}") - if env_name.startswith("ALE/"): - env = gym.make("GymV26Environment-v0", env_id=env_name) - else: - env = gym.make(env_name) + env = gym.make(env_name) preprocessor_cls = get_preprocessor(env.observation_space) preprocessor = preprocessor_cls(env.observation_space) @@ -192,11 +189,7 @@ def test_forward_train(self): # LSTM not implemented in TF2 yet continue print(f"[FW={fw} | [ENV={env_name}] | LSTM={lstm}") - # TODO(Artur): Figure out why this is needed and fix it. - if env_name.startswith("ALE/"): - env = gym.make("GymV26Environment-v0", env_id=env_name) - else: - env = gym.make(env_name) + env = gym.make(env_name) preprocessor_cls = get_preprocessor(env.observation_space) preprocessor = preprocessor_cls(env.observation_space) diff --git a/rllib/env/utils.py b/rllib/env/utils.py index 314f7ff8e3c29..982aae8cc4c57 100644 --- a/rllib/env/utils.py +++ b/rllib/env/utils.py @@ -131,17 +131,7 @@ def _gym_env_creator( # If class provided, call constructor directly. if isinstance(env_descriptor, type): env = env_descriptor(env_context) - # Special case: Atari not supported by gymnasium yet -> Need to use their - # GymV26 compatibility wrapper class. - # TODO(sven): Remove this if-block once gymnasium fully supports Atari envs. - elif env_descriptor.startswith("ALE/"): - env = gym.make( - "GymV26Environment-v0", - env_id=env_descriptor, - make_kwargs=env_context, - ) - else: - env = gym.make(env_descriptor, **env_context) + env = gym.make(env_descriptor, **env_context) # If we are dealing with an old gym-env API, use the provided compatibility # wrapper. if auto_wrap_old_gym_envs: diff --git a/rllib/utils/test_utils.py b/rllib/utils/test_utils.py index 26f20fa6e7fb7..cd0257e529931 100644 --- a/rllib/utils/test_utils.py +++ b/rllib/utils/test_utils.py @@ -504,11 +504,7 @@ def check_inference_w_connectors(policy, env_name, max_steps: int = 100): # Avoids circular import from ray.rllib.utils.policy import local_policy_inference - # TODO(sven): Remove this if-block once gymnasium fully supports Atari envs. - if env_name.startswith("ALE/"): - env = gym.make("GymV26Environment-v0", env_id=env_name) - else: - env = gym.make(env_name) + env = gym.make(env_name) # Potentially wrap the env like we do in RolloutWorker if is_atari(env): From 03e3c4b33be7a2f432cbdede64ba74de470c1c5c Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Mon, 5 Jun 2023 12:41:20 -0700 Subject: [PATCH 04/51] Remove all import gym calls Signed-off-by: Rohan Potdar --- .../ray-core/examples/plot_pong_example.ipynb | 44 ++++++++++++++++--- doc/source/rllib/doc_code/training.py | 2 +- doc/source/rllib/rllib-models.rst | 2 +- python/ray/tune/tests/test_api.py | 2 +- .../algorithms/tests/test_algorithm_config.py | 7 ++- rllib/connectors/tests/test_connector.py | 2 +- .../tests/test_learner_group_config.py | 2 +- .../inference_and_serving/serve_and_rllib.py | 4 +- rllib/models/tests/test_preprocessors.py | 9 ++-- 9 files changed, 49 insertions(+), 25 deletions(-) diff --git a/doc/source/ray-core/examples/plot_pong_example.ipynb b/doc/source/ray-core/examples/plot_pong_example.ipynb index 1b753b36e08e7..bb6595cba22fe 100644 --- a/doc/source/ray-core/examples/plot_pong_example.ipynb +++ b/doc/source/ray-core/examples/plot_pong_example.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "id": "f867a908", "metadata": {}, @@ -52,7 +53,11 @@ "cell_type": "code", "execution_count": null, "id": "549e3475", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "python" + } + }, "outputs": [], "source": [ "import numpy as np\n", @@ -64,6 +69,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "39e69bfd", "metadata": {}, @@ -77,7 +83,11 @@ "cell_type": "code", "execution_count": null, "id": "9cb838df", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "python" + } + }, "outputs": [], "source": [ "H = 200 # The number of hidden layer neurons.\n", @@ -88,6 +98,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "a0efd0b2", "metadata": {}, @@ -113,7 +124,11 @@ "cell_type": "code", "execution_count": null, "id": "d20fd47c", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "python" + } + }, "outputs": [], "source": [ "def preprocess(img):\n", @@ -187,6 +202,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "7c00c00a", "metadata": {}, @@ -205,7 +221,11 @@ "cell_type": "code", "execution_count": null, "id": "8992067a", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "python" + } + }, "outputs": [], "source": [ "class Model(object):\n", @@ -256,6 +276,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "c4a847bd", "metadata": {}, @@ -270,7 +291,11 @@ "cell_type": "code", "execution_count": null, "id": "c95ee2f2", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "python" + } + }, "outputs": [], "source": [ "# This forces OpenMP to use 1 single thread, which is needed to \n", @@ -292,7 +317,7 @@ "@ray.remote\n", "class RolloutWorker(object):\n", " def __init__(self):\n", - " self.env = gym.make(\"GymV26Environment-v0\", env_id=\"ALE/Pong-v5\")\n", + " self.env = gym.make(\"ALE/Pong-v5\")\n", "\n", " def compute_gradient(self, model):\n", " # Compute a simulation episode.\n", @@ -317,6 +342,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "1ce7f4da", "metadata": {}, @@ -335,7 +361,11 @@ "cell_type": "code", "execution_count": null, "id": "e353bd1e", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "python" + } + }, "outputs": [], "source": [ "iterations = 20\n", diff --git a/doc/source/rllib/doc_code/training.py b/doc/source/rllib/doc_code/training.py index 40d4ca36f3e50..e972ef5a4ba3b 100644 --- a/doc/source/rllib/doc_code/training.py +++ b/doc/source/rllib/doc_code/training.py @@ -4,7 +4,7 @@ try: import gymnasium as gym - env = gym.make("GymV26Environment-v0", env_id="ALE/Pong-v5") + env = gym.make("ALE/Pong-v5") obs, infos = env.reset() except Exception: import gym diff --git a/doc/source/rllib/rllib-models.rst b/doc/source/rllib/rllib-models.rst index 492ab5cd462ce..09ae1fa75ccc2 100644 --- a/doc/source/rllib/rllib-models.rst +++ b/doc/source/rllib/rllib-models.rst @@ -162,7 +162,7 @@ For example, for manipulating your env's observations or rewards, do: .. code-block:: python - import gym + import gymnasium as gym from ray.rllib.utils.numpy import one_hot class OneHotEnv(gym.core.ObservationWrapper): diff --git a/python/ray/tune/tests/test_api.py b/python/ray/tune/tests/test_api.py index 66418f27b192b..ce4e89dea48ca 100644 --- a/python/ray/tune/tests/test_api.py +++ b/python/ray/tune/tests/test_api.py @@ -10,7 +10,7 @@ from functools import partial from unittest.mock import patch -import gym +import gymnasium as gym import numpy as np import pytest import ray diff --git a/rllib/algorithms/tests/test_algorithm_config.py b/rllib/algorithms/tests/test_algorithm_config.py index 9bbff1f7f0877..35e5e2691fd76 100644 --- a/rllib/algorithms/tests/test_algorithm_config.py +++ b/rllib/algorithms/tests/test_algorithm_config.py @@ -1,4 +1,4 @@ -import gym +import gymnasium as gym from typing import Type import unittest @@ -161,9 +161,8 @@ def test_detect_atari_env(self): config = AlgorithmConfig().environment( env=lambda ctx: gym.make( - "GymV26Environment-v0", - env_id="ALE/Breakout-v5", - make_kwargs={"frameskip": 1}, + "ALE/Breakout-v5", + frameskip=1, ) ) config.validate() diff --git a/rllib/connectors/tests/test_connector.py b/rllib/connectors/tests/test_connector.py index 40442f9b9d644..1226bd9ff7efc 100644 --- a/rllib/connectors/tests/test_connector.py +++ b/rllib/connectors/tests/test_connector.py @@ -1,6 +1,6 @@ import unittest -import gym +import gymnasium as gym from ray.rllib.connectors.connector import Connector, ConnectorPipeline from ray.rllib.connectors.connector import ConnectorContext diff --git a/rllib/core/learner/tests/test_learner_group_config.py b/rllib/core/learner/tests/test_learner_group_config.py index faaf37381bb0a..2732f504d73ac 100644 --- a/rllib/core/learner/tests/test_learner_group_config.py +++ b/rllib/core/learner/tests/test_learner_group_config.py @@ -1,4 +1,4 @@ -import gym +import gymnasium as gym import unittest import ray diff --git a/rllib/examples/inference_and_serving/serve_and_rllib.py b/rllib/examples/inference_and_serving/serve_and_rllib.py index bc05efe3d1283..157e0214b3b92 100644 --- a/rllib/examples/inference_and_serving/serve_and_rllib.py +++ b/rllib/examples/inference_and_serving/serve_and_rllib.py @@ -95,9 +95,7 @@ def train_rllib_policy(config: AlgorithmConfig): # Create the environment that we would like to receive # served actions for. - env = FrameStack( - WarpFrame(gym.make("GymV26Environment-v0", env_id="ALE/MsPacman-v5"), 84), 4 - ) + env = FrameStack(WarpFrame(gym.make("ALE/MsPacman-v5"), 84), 4) obs, info = env.reset() while True: diff --git a/rllib/models/tests/test_preprocessors.py b/rllib/models/tests/test_preprocessors.py index 4093260634589..5859d909eba47 100644 --- a/rllib/models/tests/test_preprocessors.py +++ b/rllib/models/tests/test_preprocessors.py @@ -129,16 +129,13 @@ def test_gym_preprocessors(self): p2 = ModelCatalog.get_preprocessor(gym.make("FrozenLake-v1")) self.assertEqual(type(p2), OneHotPreprocessor) - p3 = ModelCatalog.get_preprocessor( - gym.make("GymV26Environment-v0", env_id="ALE/MsPacman-ram-v5") - ) + p3 = ModelCatalog.get_preprocessor(gym.make("ALE/MsPacman-ram-v5")) self.assertEqual(type(p3), AtariRamPreprocessor) p4 = ModelCatalog.get_preprocessor( gym.make( - "GymV26Environment-v0", - env_id="ALE/MsPacman-v5", - make_kwargs={"frameskip": 1}, + "ALE/MsPacman-v5", + frameskip=1, ) ) self.assertEqual(type(p4), GenericPixelPreprocessor) From 98506e35c65d99902f5bc2011d74ef5c40c5275a Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Mon, 5 Jun 2023 14:28:43 -0700 Subject: [PATCH 05/51] Fix env instantiation for env classes Signed-off-by: Rohan Potdar --- doc/source/serve/tutorials/rllib.md | 4 ++-- rllib/BUILD | 2 +- rllib/env/utils.py | 3 ++- rllib/utils/spaces/space_utils.py | 5 ++++- rllib/utils/spaces/tests/test_space_utils.py | 8 ++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/doc/source/serve/tutorials/rllib.md b/doc/source/serve/tutorials/rllib.md index 04fe467187e11..047b1da1523e0 100644 --- a/doc/source/serve/tutorials/rllib.md +++ b/doc/source/serve/tutorials/rllib.md @@ -24,7 +24,7 @@ In particular, we show: Check out the [Key Concepts](serve-key-concepts) page to learn more general information about Ray Serve. ``` -We will train and checkpoint a simple PPO model with the `CartPole-v0` environment from `gym`. +We will train and checkpoint a simple PPO model with the `CartPole-v1` environment from `gymnasium`. In this tutorial we simply write to local disk, but in production you might want to consider using a cloud storage solution like S3 or a shared file system. @@ -83,7 +83,7 @@ class ServePPOModel: .framework("torch")\ .rollouts(num_rollout_workers=0) # Build the Algorithm instance using the config. - self.algorithm = config.build(env="CartPole-v0") + self.algorithm = config.build(env="CartPole-v1") # Restore the algo's state from the checkpoint. self.algorithm.restore(checkpoint_path) diff --git a/rllib/BUILD b/rllib/BUILD index 324054afc277e..ceb9ad9349ef8 100644 --- a/rllib/BUILD +++ b/rllib/BUILD @@ -2841,7 +2841,7 @@ py_test( ) py_test( - name = "tests/test_supported_spaces_ppo_no_preproceesor_gpu", + name = "tests/test_supported_spaces_ppo_no_preprocessor_gpu", main = "tests/test_supported_spaces.py", tags = ["team:rllib", "gpu", "no_cpu"], size = "large", diff --git a/rllib/env/utils.py b/rllib/env/utils.py index 982aae8cc4c57..a9deba95548db 100644 --- a/rllib/env/utils.py +++ b/rllib/env/utils.py @@ -131,7 +131,8 @@ def _gym_env_creator( # If class provided, call constructor directly. if isinstance(env_descriptor, type): env = env_descriptor(env_context) - env = gym.make(env_descriptor, **env_context) + else: + env = gym.make(env_descriptor, **env_context) # If we are dealing with an old gym-env API, use the provided compatibility # wrapper. if auto_wrap_old_gym_envs: diff --git a/rllib/utils/spaces/space_utils.py b/rllib/utils/spaces/space_utils.py index 133374561dfa3..5bd5638bc8eab 100644 --- a/rllib/utils/spaces/space_utils.py +++ b/rllib/utils/spaces/space_utils.py @@ -369,9 +369,12 @@ def map_(elem, s): elif s.dtype != elem.dtype: elem = elem.astype(s.dtype) - elif isinstance(s, int): + elif isinstance(s, int) or isinstance(s, np.int_): if isinstance(elem, float) and elem.is_integer(): elem = int(elem) + # Note: This does not check if the float element is actually an integer + if isinstance(elem, np.float_): + elem = np.int64(elem) return elem diff --git a/rllib/utils/spaces/tests/test_space_utils.py b/rllib/utils/spaces/tests/test_space_utils.py index 72f141942a6a1..9283e675dad89 100644 --- a/rllib/utils/spaces/tests/test_space_utils.py +++ b/rllib/utils/spaces/tests/test_space_utils.py @@ -35,18 +35,18 @@ def test_convert_element_to_space_type(self): } ) - box_space_uncoverted = box_space.sample().astype(np.float64) + box_space_unconverted = box_space.sample().astype(np.float64) multi_discrete_unconverted = multi_discrete_space.sample().astype(np.int32) multi_binary_unconverted = multi_binary_space.sample().astype(np.int32) - tuple_unconverted = (box_space_uncoverted, float(0)) + tuple_unconverted = (box_space_unconverted, float(0)) modified_element = { - "box": box_space_uncoverted, + "box": box_space_unconverted, "discrete": float(0), "multi_discrete": multi_discrete_unconverted, "multi_binary": multi_binary_unconverted, "tuple_space": tuple_unconverted, "dict_space": { - "box2": box_space_uncoverted, + "box2": box_space_unconverted, "discrete2": float(0), }, } From 0f392095df894f822b4771afefc9be7f594e4151 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Mon, 5 Jun 2023 16:45:53 -0700 Subject: [PATCH 06/51] fix atari wrappers Signed-off-by: Rohan Potdar --- rllib/env/wrappers/atari_wrappers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rllib/env/wrappers/atari_wrappers.py b/rllib/env/wrappers/atari_wrappers.py index b836961669d92..54fe6644b68ec 100644 --- a/rllib/env/wrappers/atari_wrappers.py +++ b/rllib/env/wrappers/atari_wrappers.py @@ -107,7 +107,7 @@ def __init__(self, env, noop_max=30): self.noop_max = noop_max self.override_num_noops = None self.noop_action = 0 - assert env.unwrapped.gym_env.get_action_meanings()[0] == "NOOP" + assert env.unwrapped.get_action_meanings()[0] == "NOOP" def reset(self, **kwargs): """Do no-op action for a number of steps in [1, noop_max].""" @@ -151,8 +151,8 @@ def __init__(self, env): For environments that are fixed until firing.""" gym.Wrapper.__init__(self, env) - assert env.unwrapped.gym_env.get_action_meanings()[1] == "FIRE" - assert len(env.unwrapped.gym_env.get_action_meanings()) >= 3 + assert env.unwrapped.get_action_meanings()[1] == "FIRE" + assert len(env.unwrapped.get_action_meanings()) >= 3 def reset(self, **kwargs): self.env.reset(**kwargs) @@ -183,7 +183,7 @@ def step(self, action): self.was_real_terminated = terminated # check current lives, make loss of life terminal, # then update lives to handle bonus lives - lives = self.env.unwrapped.gym_env.ale.lives() + lives = self.env.unwrapped.ale.lives() if lives < self.lives and lives > 0: # for Qbert sometimes we stay in lives == 0 condtion for a few fr # so its important to keep lives > 0, so that we only reset once @@ -202,7 +202,7 @@ def reset(self, **kwargs): else: # no-op step to advance from terminal/lost life state obs, _, _, _, info = self.env.step(0) - self.lives = self.env.unwrapped.gym_env.ale.lives() + self.lives = self.env.unwrapped.ale.lives() return obs, info @@ -333,7 +333,7 @@ def wrap_deepmind(env, dim=84, framestack=True, noframeskip=False): if env.spec is not None and noframeskip is True: env = MaxAndSkipEnv(env, skip=4) env = EpisodicLifeEnv(env) - if "FIRE" in env.unwrapped.gym_env.get_action_meanings(): + if "FIRE" in env.unwrapped.get_action_meanings(): env = FireResetEnv(env) env = WarpFrame(env, dim) # env = ScaledFloatFrame(env) # TODO: use for dqn? From c925e5991ddd9c4118b6d6a13146c9718a3b2f54 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Mon, 5 Jun 2023 17:07:09 -0700 Subject: [PATCH 07/51] fix pong notebook Signed-off-by: Rohan Potdar --- doc/source/ray-core/examples/plot_pong_example.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/ray-core/examples/plot_pong_example.ipynb b/doc/source/ray-core/examples/plot_pong_example.ipynb index bb6595cba22fe..f3555dc3dfd4a 100644 --- a/doc/source/ray-core/examples/plot_pong_example.ipynb +++ b/doc/source/ray-core/examples/plot_pong_example.ipynb @@ -32,7 +32,7 @@ "To run the application, first install some dependencies.\n", "\n", "```bash\n", - "pip install gymnasium[atari] gym==0.26.2\n", + "pip install gymnasium[atari]==0.28.1\n", "```\n", "\n", "At the moment, on a large machine with 64 physical cores, computing an update\n", From 06e78e132dccc5e319b45bbee17db44ee35eeb59 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Mon, 5 Jun 2023 17:09:14 -0700 Subject: [PATCH 08/51] fix pong notebook Signed-off-by: Rohan Potdar --- .../ray-core/examples/plot_pong_example.ipynb | 42 +++---------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/doc/source/ray-core/examples/plot_pong_example.ipynb b/doc/source/ray-core/examples/plot_pong_example.ipynb index f3555dc3dfd4a..5569d61e83d44 100644 --- a/doc/source/ray-core/examples/plot_pong_example.ipynb +++ b/doc/source/ray-core/examples/plot_pong_example.ipynb @@ -1,7 +1,6 @@ { "cells": [ { - "attachments": {}, "cell_type": "markdown", "id": "f867a908", "metadata": {}, @@ -53,11 +52,7 @@ "cell_type": "code", "execution_count": null, "id": "549e3475", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -69,7 +64,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "39e69bfd", "metadata": {}, @@ -83,11 +77,7 @@ "cell_type": "code", "execution_count": null, "id": "9cb838df", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "H = 200 # The number of hidden layer neurons.\n", @@ -98,7 +88,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "a0efd0b2", "metadata": {}, @@ -124,11 +113,7 @@ "cell_type": "code", "execution_count": null, "id": "d20fd47c", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "def preprocess(img):\n", @@ -202,7 +187,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "7c00c00a", "metadata": {}, @@ -221,11 +205,7 @@ "cell_type": "code", "execution_count": null, "id": "8992067a", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "class Model(object):\n", @@ -276,7 +256,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "c4a847bd", "metadata": {}, @@ -291,11 +270,7 @@ "cell_type": "code", "execution_count": null, "id": "c95ee2f2", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "# This forces OpenMP to use 1 single thread, which is needed to \n", @@ -342,7 +317,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "1ce7f4da", "metadata": {}, @@ -361,11 +335,7 @@ "cell_type": "code", "execution_count": null, "id": "e353bd1e", - "metadata": { - "vscode": { - "languageId": "python" - } - }, + "metadata": {}, "outputs": [], "source": [ "iterations = 20\n", From 65b2eec52b5d2a36f960d5843c1bd29118871754 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Tue, 6 Jun 2023 14:07:48 -0700 Subject: [PATCH 09/51] Add comment Signed-off-by: Rohan Potdar --- rllib/utils/spaces/space_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rllib/utils/spaces/space_utils.py b/rllib/utils/spaces/space_utils.py index 5bd5638bc8eab..e02b0b5cee5e2 100644 --- a/rllib/utils/spaces/space_utils.py +++ b/rllib/utils/spaces/space_utils.py @@ -369,6 +369,7 @@ def map_(elem, s): elif s.dtype != elem.dtype: elem = elem.astype(s.dtype) + # Gymnasium now uses np.int_64 as the dtype of a Discrete action space elif isinstance(s, int) or isinstance(s, np.int_): if isinstance(elem, float) and elem.is_integer(): elem = int(elem) From 68f3cb5af866608fceed65bad33bf18953e1313e Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Thu, 8 Jun 2023 14:36:44 -0700 Subject: [PATCH 10/51] Empty commit From 74d4461efb9e63cb9667c302101383358e5d36d6 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Thu, 8 Jun 2023 16:59:04 -0700 Subject: [PATCH 11/51] Remove gym from requirements Signed-off-by: Rohan Potdar --- doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt | 5 ++--- python/requirements/ml/requirements_rllib.txt | 2 -- release/rllib_tests/app_config.yaml | 3 +-- release/rllib_tests/debug_app_config.yaml | 3 +-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt b/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt index 5c620252fb1dc..1f432758ed072 100644 --- a/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt +++ b/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt @@ -107,6 +107,7 @@ everett==3.2.0 exceptiongroup==1.1.1 executing==1.2.0 fairscale==0.4.6 +farama-notifications==0.0.1 fastapi==0.95.1 fasteners==0.18 fastjsonschema==2.16.3 @@ -143,9 +144,7 @@ graphviz==0.8.4 greenlet==2.0.2 grpcio==1.51.3 gunicorn==20.1.0 -gym==0.26.2 -gym-notices==0.0.8 -Gymnasium==0.26.3 +gymnasium==0.28.1 gymnasium-notices==0.0.1 h11==0.14.0 h5py==3.7.0 diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index e726989b17708..e064396d77321 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -3,8 +3,6 @@ # Environment adapters. # --------------------- # Atari -# TODO(sven): Still needed for Atari (need to be wrapped by gymnasium as it does NOT support Atari yet) -gym==0.26.2 gymnasium[atari,mujoco]==0.28.1 # For testing MuJoCo envs with gymnasium. mujoco-py<2.2,>=2.1 diff --git a/release/rllib_tests/app_config.yaml b/release/rllib_tests/app_config.yaml index 48b429d8221c0..071a575dfee58 100755 --- a/release/rllib_tests/app_config.yaml +++ b/release/rllib_tests/app_config.yaml @@ -16,8 +16,7 @@ python: ## These dependencies should be handled by requirements_rllib.txt and ## requirements_ml_docker.txt and removed here - gymnasium[atari,mujoco]==0.28.1 - - ale-py==0.8.0 - - gym==0.26.2 + - ale-py==0.8.1 - mujoco-py<2.2,>=2.1 # AutoROM downloads ROMs via torrent when they are built. The torrent is unreliable, # so we built it for py3 and use that instead. This wheel was tested for python 3.7, 3.8, diff --git a/release/rllib_tests/debug_app_config.yaml b/release/rllib_tests/debug_app_config.yaml index c51fbcc4d39b0..a0a82c222fd87 100755 --- a/release/rllib_tests/debug_app_config.yaml +++ b/release/rllib_tests/debug_app_config.yaml @@ -16,8 +16,7 @@ python: ## These dependencies should be handled by requirements_rllib.txt and ## requirements_ml_docker.txt and removed here - gymnasium[atari,mujoco]==0.26.3 - - ale-py==0.8.0 - - gym==0.26.2 + - ale-py==0.8.1 - mujoco-py<2.2,>=2.1 # AutoROM downloads ROMs via torrent when they are built. The torrent is unreliable, # so we built it for py3 and use that instead. This wheel was tested for python 3.7, 3.8, From cbc22f39ff304afd291133a822ac4f09bd6f86a5 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Tue, 20 Jun 2023 08:58:32 +0200 Subject: [PATCH 12/51] test other version combination Signed-off-by: sven1977 --- python/requirements/ml/requirements_rllib.txt | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 5f407cb4c2a8e..89eac06da6d7b 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -5,20 +5,26 @@ # Atari gymnasium[atari,mujoco]==0.28.1 # For testing MuJoCo envs with gymnasium. -mujoco-py<2.2,>=2.1 +mujoco==2.3.5 +dm_control==1.0.12 + +# For tests on PettingZoo's multi-agent envs. +pettingzoo==1.23.1; python_version >= '3.7' +# When installing pettingzoo, chess is missing, even though its a dependancy +# TODO: remove if a future pettingzoo and/or ray version fixes this dependancy issue. +chess==1.7.0 +pymunk==6.2.1 +supersuit==3.8.0; python_version >= '3.7' +tinyscaler==1.2.6 +shimmy==0.2.1 + # Kaggle envs. kaggle_environments==1.7.11 # Unity3D testing # TODO(sven): Add this back to requirements_rllib.txt once mlagents no longer pins torch<1.9.0 version. #mlagents==0.28.0 mlagents_envs==0.28.0 -# For tests on PettingZoo's multi-agent envs. -pettingzoo==1.22.1; python_version >= '3.7' -# When installing pettingzoo, chess is missing, even though its a dependancy -# TODO: remove if a future pettingzoo and/or ray version fixes this dependancy issue. -chess==1.7.0 -pymunk==6.2.1 -supersuit==3.7.0; python_version >= '3.7' + # For tests on minigrid. minigrid==2.1.1 # For tests on RecSim and Kaggle envs. From acaa6831419f2b7df34768abe00ec53658ccb4b6 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Tue, 20 Jun 2023 11:30:39 +0200 Subject: [PATCH 13/51] wip Signed-off-by: sven1977 --- docker/ray-ml/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index 1216133d2efa0..bae69140b7cad 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -48,6 +48,8 @@ RUN sudo apt-get update \ requirements*.txt \ && sudo apt-get clean +ENV MUJOCO_GL=osmesa + RUN $HOME/anaconda3/bin/pip freeze > /home/ray/pip-freeze.txt # Make sure tfp is installed correctly and matches tf version. From 829d290ff1cfea93a8a5aaa077f0717d84c98f60 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Tue, 20 Jun 2023 12:27:38 +0200 Subject: [PATCH 14/51] wip Signed-off-by: sven1977 --- docker/ray-ml/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index bae69140b7cad..bd60d723c8a79 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -48,7 +48,12 @@ RUN sudo apt-get update \ requirements*.txt \ && sudo apt-get clean +RUN wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz ./ +RUN mkdir $HOME/.mujoco +RUN tar -zxf mujoco210-linux-x86_64.tar.gz -C $HOME/.mujoco + ENV MUJOCO_GL=osmesa +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.mujoco/mujoco210/bin RUN $HOME/anaconda3/bin/pip freeze > /home/ray/pip-freeze.txt From 7842ff9c57f19a825cbaa36b9b3f556beab52c19 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Tue, 20 Jun 2023 12:47:32 +0200 Subject: [PATCH 15/51] wip Signed-off-by: sven1977 --- python/requirements/ml/requirements_rllib.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index a2931dcd1a3fd..89eac06da6d7b 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -5,7 +5,7 @@ # Atari gymnasium[atari,mujoco]==0.28.1 # For testing MuJoCo envs with gymnasium. -mujoco-py<2.2,>=2.1 +mujoco==2.3.5 dm_control==1.0.12 # For tests on PettingZoo's multi-agent envs. From b95a0a565cf8705b0b2ddf8645cba1f2b8796151 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Tue, 20 Jun 2023 12:50:54 +0200 Subject: [PATCH 16/51] wip Signed-off-by: sven1977 --- docker/ray-ml/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index bd60d723c8a79..bae69140b7cad 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -48,12 +48,7 @@ RUN sudo apt-get update \ requirements*.txt \ && sudo apt-get clean -RUN wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz ./ -RUN mkdir $HOME/.mujoco -RUN tar -zxf mujoco210-linux-x86_64.tar.gz -C $HOME/.mujoco - ENV MUJOCO_GL=osmesa -ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.mujoco/mujoco210/bin RUN $HOME/anaconda3/bin/pip freeze > /home/ray/pip-freeze.txt From f926316d7816f0bc11864404da7931de11baef87 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Tue, 20 Jun 2023 13:51:51 +0200 Subject: [PATCH 17/51] wip Signed-off-by: sven1977 --- python/requirements/ml/requirements_rllib.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 89eac06da6d7b..2488a497d8eee 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -3,10 +3,12 @@ # Environment adapters. # --------------------- # Atari -gymnasium[atari,mujoco]==0.28.1 +gymnasium[atari]==0.28.1 +imageio==2.31.1 +ale_py==0.8.1 # For testing MuJoCo envs with gymnasium. -mujoco==2.3.5 -dm_control==1.0.12 +#mujoco==2.3.5 +#dm_control==1.0.12 # For tests on PettingZoo's multi-agent envs. pettingzoo==1.23.1; python_version >= '3.7' From 58d7b1117b175f0e1c6f77dd31afc92f5a76e3c2 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 22 Jun 2023 14:38:34 +0200 Subject: [PATCH 18/51] wip Signed-off-by: sven1977 --- rllib/env/wrappers/pettingzoo_env.py | 4 ++-- rllib/tests/test_pettingzoo_env.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rllib/env/wrappers/pettingzoo_env.py b/rllib/env/wrappers/pettingzoo_env.py index ba2abc13ce734..9d85413fb702a 100644 --- a/rllib/env/wrappers/pettingzoo_env.py +++ b/rllib/env/wrappers/pettingzoo_env.py @@ -136,7 +136,7 @@ def observation_space_contains(self, x: MultiAgentDict) -> bool: return all(self.observation_space.contains(val) for val in x.values()) def reset(self, *, seed: Optional[int] = None, options: Optional[dict] = None): - info = self.env.reset(seed=seed, return_info=True, options=options) + info = self.env.reset(seed=seed, options=options) return ( {self.env.agent_selection: self.env.observe(self.env.agent_selection)}, info or {}, @@ -221,7 +221,7 @@ def __init__(self, env): ) def reset(self, *, seed: Optional[int] = None, options: Optional[dict] = None): - obs, info = self.par_env.reset(seed=seed, return_info=True, options=options) + obs, info = self.par_env.reset(seed=seed, options=options) return obs, info or {} def step(self, action_dict): diff --git a/rllib/tests/test_pettingzoo_env.py b/rllib/tests/test_pettingzoo_env.py index e9db725dd8b0b..da29aa2a021e2 100644 --- a/rllib/tests/test_pettingzoo_env.py +++ b/rllib/tests/test_pettingzoo_env.py @@ -1,6 +1,6 @@ from numpy import float32 from pettingzoo.butterfly import pistonball_v6 -from pettingzoo.mpe import simple_spread_v2 +from pettingzoo.mpe import simple_spread_v3 from supersuit import ( color_reduction_v0, dtype_v0, @@ -78,7 +78,7 @@ def env_creator(config): algo.stop() def test_pettingzoo_env(self): - register_env("simple_spread", lambda _: PettingZooEnv(simple_spread_v2.env())) + register_env("simple_spread", lambda _: PettingZooEnv(simple_spread_v3.env())) config = ( PPOConfig() From 78cd2b6fced5dc75ccc8255e01ec37ffeb38b6c8 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 22 Jun 2023 15:03:01 +0200 Subject: [PATCH 19/51] wip Signed-off-by: sven1977 --- python/requirements/ml/requirements_rllib.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 2488a497d8eee..51693c27a60e1 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -7,8 +7,8 @@ gymnasium[atari]==0.28.1 imageio==2.31.1 ale_py==0.8.1 # For testing MuJoCo envs with gymnasium. -#mujoco==2.3.5 -#dm_control==1.0.12 +mujoco==2.3.5 +dm_control==1.0.12 # For tests on PettingZoo's multi-agent envs. pettingzoo==1.23.1; python_version >= '3.7' From 859d999c341641563df6bd17d96f37a8ebb58d9e Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 22 Jun 2023 15:40:32 +0200 Subject: [PATCH 20/51] wip Signed-off-by: sven1977 --- docker/ray-ml/Dockerfile | 9 +++++++++ python/requirements/ml/requirements_rllib.txt | 2 +- release/rllib_tests/app_config.yaml | 5 ----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index bae69140b7cad..471651085082f 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -18,6 +18,9 @@ RUN sudo apt-get update \ libgtk2.0-dev \ libgl1-mesa-glx \ libosmesa6 \ + libosmesa6-dev \ + libglfw3 \ + patchelf \ zlib1g-dev \ libgl1-mesa-dev \ unzip \ @@ -48,7 +51,13 @@ RUN sudo apt-get update \ requirements*.txt \ && sudo apt-get clean +# MuJoCo Installation. ENV MUJOCO_GL=osmesa +RUN wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz +RUN mkdir ~/.mujoco +RUN mv mujoco210-linux-x86_64.tar.gz ~/.mujoco/. +RUN cd ~/.mujoco +RUN tar -xf ~/.mujoco/mujoco210-linux-x86_64.tar.gz RUN $HOME/anaconda3/bin/pip freeze > /home/ray/pip-freeze.txt diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 51693c27a60e1..1d0285b2f03ff 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -7,7 +7,7 @@ gymnasium[atari]==0.28.1 imageio==2.31.1 ale_py==0.8.1 # For testing MuJoCo envs with gymnasium. -mujoco==2.3.5 +mujoco-py<2.2,>=2.1 dm_control==1.0.12 # For tests on PettingZoo's multi-agent envs. diff --git a/release/rllib_tests/app_config.yaml b/release/rllib_tests/app_config.yaml index 071a575dfee58..ccc4d6799d12d 100755 --- a/release/rllib_tests/app_config.yaml +++ b/release/rllib_tests/app_config.yaml @@ -13,11 +13,6 @@ debian_packages: python: pip_packages: - ## These dependencies should be handled by requirements_rllib.txt and - ## requirements_ml_docker.txt and removed here - - gymnasium[atari,mujoco]==0.28.1 - - ale-py==0.8.1 - - mujoco-py<2.2,>=2.1 # AutoROM downloads ROMs via torrent when they are built. The torrent is unreliable, # so we built it for py3 and use that instead. This wheel was tested for python 3.7, 3.8, # and 3.9. From 4d20fa2b5a2d83ae14aeb93b6e57fd796dc131f5 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 22 Jun 2023 15:54:13 +0200 Subject: [PATCH 21/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index 0d12d349a992e..b67066d839603 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -353,6 +353,14 @@ install_pip_packages() { requirements_files+=("${WORKSPACE_DIR}/python/requirements/ml/requirements_rllib.txt") #TODO(amogkam): Add this back to requirements_rllib.txt once mlagents no longer pins torch<1.9.0 version. pip install --no-dependencies mlagents==0.28.0 + + # Install MuJoCo. + sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3 patchelf -y + wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz + mkdir /root/.mujoco + mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. + (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) + echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin" >> /root/.bashrc fi # Some Ray Train dependencies have to be installed with --no-deps, From 87f38b7993b133d577e64950add8c3f764fb59a3 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 22 Jun 2023 17:19:55 +0200 Subject: [PATCH 22/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index b67066d839603..09634450373b5 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,7 +360,7 @@ install_pip_packages() { mkdir /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin" >> /root/.bashrc + echo "export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" >> /root/.bashrc fi # Some Ray Train dependencies have to be installed with --no-deps, From f8c4c71ae9543bef0d4eb5e1d27fc5e21ba8c536 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 22 Jun 2023 17:59:27 +0200 Subject: [PATCH 23/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index 09634450373b5..eefe0ad72481b 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -357,7 +357,7 @@ install_pip_packages() { # Install MuJoCo. sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3 patchelf -y wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz - mkdir /root/.mujoco + mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) echo "export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" >> /root/.bashrc From 866fec38fca651dd0a8c40a94b0e09f82f558e34 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 22 Jun 2023 18:20:39 +0200 Subject: [PATCH 24/51] wip Signed-off-by: sven1977 --- python/requirements/ml/requirements_rllib.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 1d0285b2f03ff..aaa7ac5f5ea18 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -18,7 +18,7 @@ chess==1.7.0 pymunk==6.2.1 supersuit==3.8.0; python_version >= '3.7' tinyscaler==1.2.6 -shimmy==0.2.1 +shimmy==1.1.0 # Kaggle envs. kaggle_environments==1.7.11 From c3ce9c912e9ae36478438b0d9219611e5d6a4bf9 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 10:22:50 +0200 Subject: [PATCH 25/51] wip Signed-off-by: sven1977 --- .buildkite/pipeline.ml.yml | 8 -------- python/requirements/ml/requirements_rllib.txt | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.buildkite/pipeline.ml.yml b/.buildkite/pipeline.ml.yml index 788a8ced6207f..cedb65d38bcb1 100644 --- a/.buildkite/pipeline.ml.yml +++ b/.buildkite/pipeline.ml.yml @@ -530,15 +530,7 @@ commands: - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT - # Install mujoco necessary for the testing environments - - sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3 patchelf -y - - wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz - - mkdir /root/.mujoco - - mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. - - (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - - echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin' >> /root/.bashrc - source /root/.bashrc - - (cd rllib_contrib/maml && pip install -r requirements.txt && pip install -e .) - ./ci/env/env_info.sh - pytest rllib_contrib/maml/tests/test_maml.py diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index aaa7ac5f5ea18..5577bbf647750 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -18,7 +18,7 @@ chess==1.7.0 pymunk==6.2.1 supersuit==3.8.0; python_version >= '3.7' tinyscaler==1.2.6 -shimmy==1.1.0 +shimmy # Kaggle envs. kaggle_environments==1.7.11 From 7c41ef654db0145454e69a33cbf93e49dca08225 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 11:11:40 +0200 Subject: [PATCH 26/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index eefe0ad72481b..f8bf16518b18d 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,7 +360,8 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo "export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" >> /root/.bashrc + echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin' >> /root/.bashrc + source /root/.bashrc fi # Some Ray Train dependencies have to be installed with --no-deps, From 5ef2b8aca00ba27239e2b3486a01da1901c76349 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 11:40:09 +0200 Subject: [PATCH 27/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index f8bf16518b18d..d9ec559f43c59 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,7 +360,7 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin' >> /root/.bashrc + echo 'export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin' >> /root/.bashrc source /root/.bashrc fi From 988980d90fc26be42e0bd952071bc00a85df8d70 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 11:41:28 +0200 Subject: [PATCH 28/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index d9ec559f43c59..db76669ca419f 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,7 +360,7 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo 'export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin' >> /root/.bashrc + grep -qxF 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/root/.mujoco/mujoco210/bin' /root/.bashrc || echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/root/.mujoco/mujoco210/bin' >> /root/.bashrc source /root/.bashrc fi From 00aba6cabf84f954dbad2afc75a360a6bc69c243 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 11:42:31 +0200 Subject: [PATCH 29/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index db76669ca419f..d2e46af3ec3e3 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,7 +360,7 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - grep -qxF 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/root/.mujoco/mujoco210/bin' /root/.bashrc || echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/root/.mujoco/mujoco210/bin' >> /root/.bashrc + echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/root/.mujoco/mujoco210/bin' >> /root/.bashrc source /root/.bashrc fi From 606c69cb8b4bc1d3101cfeb34ed2fc5eb5c19045 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 12:06:17 +0200 Subject: [PATCH 30/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index d2e46af3ec3e3..f3c2fb709d952 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,7 +360,7 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/root/.mujoco/mujoco210/bin' >> /root/.bashrc + echo "export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" >> /root/.bashrc source /root/.bashrc fi From 3dda88e9a9d178d87e6d7b60cab3a92513f73174 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 12:25:52 +0200 Subject: [PATCH 31/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index f3c2fb709d952..c2c248b4e094f 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,8 +360,9 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo "export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" >> /root/.bashrc - source /root/.bashrc + #echo "export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" >> /root/.bashrc + #source /root/.bashrc + export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin fi # Some Ray Train dependencies have to be installed with --no-deps, From 37fbd31d9f3f389655a5646af438bf337f4b886a Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 13:31:36 +0200 Subject: [PATCH 32/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index c2c248b4e094f..6c00b3da3accf 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,9 +360,9 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - #echo "export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" >> /root/.bashrc - #source /root/.bashrc - export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin + echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin" >> /root/.bashrc + source /root/.bashrc + #export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin fi # Some Ray Train dependencies have to be installed with --no-deps, From 05085c67055fe90acef7e54255938f63c40f0aad Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 13:57:10 +0200 Subject: [PATCH 33/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index 6c00b3da3accf..71cdf504ca1d2 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,7 +360,7 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin" >> /root/.bashrc + echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin' >> /root/.bashrc source /root/.bashrc #export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin fi From 873e3076f3dbc083381d275a3607e2db66c00588 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 14:37:35 +0200 Subject: [PATCH 34/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index 71cdf504ca1d2..3e2052278e3d5 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,8 +360,9 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin' >> /root/.bashrc - source /root/.bashrc + #echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin' >> /root/.bashrc + #source /root/.bashrc + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin #export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin fi From e9841494eed1ad7ad9df324a944327d9b2c0cc3c Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 15:02:39 +0200 Subject: [PATCH 35/51] wip Signed-off-by: sven1977 --- ci/env/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index 3e2052278e3d5..b3865651fdfae 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -362,7 +362,7 @@ install_pip_packages() { (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) #echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin' >> /root/.bashrc #source /root/.bashrc - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin #export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin fi From 4caebe074d55b06f690f7531b5c19157268d2dfb Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 15:40:36 +0200 Subject: [PATCH 36/51] wip Signed-off-by: sven1977 --- .buildkite/pipeline.build.yml | 3 +++ ci/env/install-dependencies.sh | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipeline.build.yml b/.buildkite/pipeline.build.yml index 3ea792d1ea7a3..ebf0a640ea680 100644 --- a/.buildkite/pipeline.build.yml +++ b/.buildkite/pipeline.build.yml @@ -576,6 +576,7 @@ - pip install -r python/requirements/compat/requirements_py37_compat.txt - ./ci/env/env_info.sh - ./ci/run/run_bazel_test_with_sharding.sh --config=ci $(./ci/run/bazel_export_options) --build_tests_only + --test_env=LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin --test_tag_filters=tests_dir,-multi_gpu --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/... @@ -592,6 +593,7 @@ - ./ci/env/env_info.sh - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only + --test_env=LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin --test_tag_filters=learning_tests_with_ray_data,-multi_gpu,-gpu,-tf_only,-tf2_only --test_arg=--framework=torch rllib/... @@ -610,6 +612,7 @@ - ./ci/env/env_info.sh - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only + --test_env=LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin --test_tag_filters=learning_tests_with_ray_data,-multi_gpu,-gpu,-torch_only --test_arg=--framework=tf2 rllib/... diff --git a/ci/env/install-dependencies.sh b/ci/env/install-dependencies.sh index b3865651fdfae..fc7037685e73e 100755 --- a/ci/env/install-dependencies.sh +++ b/ci/env/install-dependencies.sh @@ -360,10 +360,7 @@ install_pip_packages() { mkdir -p /root/.mujoco mv mujoco210-linux-x86_64.tar.gz /root/.mujoco/. (cd /root/.mujoco && tar -xf /root/.mujoco/mujoco210-linux-x86_64.tar.gz) - #echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin' >> /root/.bashrc - #source /root/.bashrc export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin - #export LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin fi # Some Ray Train dependencies have to be installed with --no-deps, From ed5928bdd201a60706f0636b3dff1fd87df5fbbe Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 23 Jun 2023 16:15:34 +0200 Subject: [PATCH 37/51] wip Signed-off-by: sven1977 --- .buildkite/pipeline.build.yml | 3 --- ci/run/bazel_export_options | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.build.yml b/.buildkite/pipeline.build.yml index ebf0a640ea680..3ea792d1ea7a3 100644 --- a/.buildkite/pipeline.build.yml +++ b/.buildkite/pipeline.build.yml @@ -576,7 +576,6 @@ - pip install -r python/requirements/compat/requirements_py37_compat.txt - ./ci/env/env_info.sh - ./ci/run/run_bazel_test_with_sharding.sh --config=ci $(./ci/run/bazel_export_options) --build_tests_only - --test_env=LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin --test_tag_filters=tests_dir,-multi_gpu --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/... @@ -593,7 +592,6 @@ - ./ci/env/env_info.sh - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only - --test_env=LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin --test_tag_filters=learning_tests_with_ray_data,-multi_gpu,-gpu,-tf_only,-tf2_only --test_arg=--framework=torch rllib/... @@ -612,7 +610,6 @@ - ./ci/env/env_info.sh - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only - --test_env=LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin --test_tag_filters=learning_tests_with_ray_data,-multi_gpu,-gpu,-torch_only --test_arg=--framework=tf2 rllib/... diff --git a/ci/run/bazel_export_options b/ci/run/bazel_export_options index bd69d017c5135..5017b1c5932a4 100755 --- a/ci/run/bazel_export_options +++ b/ci/run/bazel_export_options @@ -6,5 +6,6 @@ logs_archive_flag=--test_env=RAY_TEST_FAILURE_LOGS_ARCHIVE_DIR=/artifact-mount/. summary_directory_flag=--test_env=RAY_TEST_SUMMARY_DIR=/artifact-mount/test-summaries summary_directory_host_flag=--test_env=RAY_TEST_SUMMARY_DIR_HOST=/tmp/artifacts/test-summaries buildkite_env_vars="--test_env=BUILDKITE_COMMIT --test_env=BUILDKITE_LABEL --test_env=BUILDKITE_JOB_ID" +mujoco_env_var="--test_env=LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin" -echo "${event_json_flag} ${logs_archive_flag} ${summary_directory_flag} ${summary_directory_host_flag} ${buildkite_env_vars}" +echo "${event_json_flag} ${logs_archive_flag} ${summary_directory_flag} ${summary_directory_host_flag} ${buildkite_env_vars} ${mujoco_env_var}" From f24f94ca36a79366e935d842d657a25470216faa Mon Sep 17 00:00:00 2001 From: sven1977 Date: Sat, 1 Jul 2023 14:30:58 +0200 Subject: [PATCH 38/51] LINT Signed-off-by: sven1977 --- docker/ray-ml/install-ml-docker-requirements.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/ray-ml/install-ml-docker-requirements.sh b/docker/ray-ml/install-ml-docker-requirements.sh index 6e95aa101bc5a..3670aabdb905d 100755 --- a/docker/ray-ml/install-ml-docker-requirements.sh +++ b/docker/ray-ml/install-ml-docker-requirements.sh @@ -22,7 +22,7 @@ export MUJOCO_GL=osmesa wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz mkdir ~/.mujoco mv mujoco210-linux-x86_64.tar.gz ~/.mujoco/. -cd ~/.mujoco +cd ~/.mujoco || exit tar -xf ~/.mujoco/mujoco210-linux-x86_64.tar.gz pip --no-cache-dir install -U pip pip-tools From ed2ccc20f929a1953873b2b524111a586d6e94ea Mon Sep 17 00:00:00 2001 From: sven1977 Date: Wed, 5 Jul 2023 13:21:59 +0200 Subject: [PATCH 39/51] LINT Signed-off-by: sven1977 --- rllib/examples/env/random_env.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rllib/examples/env/random_env.py b/rllib/examples/env/random_env.py index 5831ef9c50db7..041a53e6b959f 100644 --- a/rllib/examples/env/random_env.py +++ b/rllib/examples/env/random_env.py @@ -82,17 +82,13 @@ def step(self, action): ) if not self.static_samples: - #TEST - obs = self.observation_space.sample() - obs["a"][0] = -100.0 # violate defined space return ( - obs, + self.observation_space.sample(), self.reward_space.sample(), terminated, truncated, {}, ) - #END TEST else: return ( copy.deepcopy(self.observation_sample), From 18baa9470cb07b018ea8e7ccff098ff2d2cfa886 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Wed, 5 Jul 2023 13:27:46 +0200 Subject: [PATCH 40/51] wip Signed-off-by: sven1977 --- docker/ray-ml/install-ml-docker-requirements.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/ray-ml/install-ml-docker-requirements.sh b/docker/ray-ml/install-ml-docker-requirements.sh index 3670aabdb905d..3ebba64454612 100755 --- a/docker/ray-ml/install-ml-docker-requirements.sh +++ b/docker/ray-ml/install-ml-docker-requirements.sh @@ -20,7 +20,7 @@ sudo apt-get update \ # MuJoCo Installation. export MUJOCO_GL=osmesa wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -mkdir ~/.mujoco +mkdir -p ~/.mujoco mv mujoco210-linux-x86_64.tar.gz ~/.mujoco/. cd ~/.mujoco || exit tar -xf ~/.mujoco/mujoco210-linux-x86_64.tar.gz From 43fa60826ef0251fcbc9e451cc97fbd346b33e97 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 6 Jul 2023 17:40:53 +0200 Subject: [PATCH 41/51] wip Signed-off-by: sven1977 --- docker/ray-ml/install-ml-docker-requirements.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/ray-ml/install-ml-docker-requirements.sh b/docker/ray-ml/install-ml-docker-requirements.sh index 3ebba64454612..0ed5a80db4508 100755 --- a/docker/ray-ml/install-ml-docker-requirements.sh +++ b/docker/ray-ml/install-ml-docker-requirements.sh @@ -17,14 +17,6 @@ sudo apt-get update \ unrar \ zlib1g-dev -# MuJoCo Installation. -export MUJOCO_GL=osmesa -wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -mkdir -p ~/.mujoco -mv mujoco210-linux-x86_64.tar.gz ~/.mujoco/. -cd ~/.mujoco || exit -tar -xf ~/.mujoco/mujoco210-linux-x86_64.tar.gz - pip --no-cache-dir install -U pip pip-tools # Install requirements @@ -52,3 +44,11 @@ pip --no-cache-dir install -U \ sudo apt-get clean sudo rm requirements*.txt + +# MuJoCo Installation. +export MUJOCO_GL=osmesa +wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz +mkdir -p ~/.mujoco +mv mujoco210-linux-x86_64.tar.gz ~/.mujoco/. +cd ~/.mujoco || exit +tar -xf ~/.mujoco/mujoco210-linux-x86_64.tar.gz From 59fd88dc731e8ff11c068bae18efa8916c0e8b92 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 27 Jul 2023 14:18:17 +0200 Subject: [PATCH 42/51] wip Signed-off-by: sven1977 --- python/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/python/requirements.txt b/python/requirements.txt index 42ecf09c5d782..34cf3358afd54 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -54,7 +54,6 @@ prometheus_client>=0.7.1 requests pandas tensorboardX<=2.6.0,>=1.9 # >=2.6.1 uses protobuf>=4, and conflicts with other packages. -grpcio<=1.50.0,>=1.42.0 # ray client aiohttp>=3.7 starlette typer From 80ea98ebcd43a8989bb3dad29e0ab2118bd8b441 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 27 Jul 2023 14:41:18 +0200 Subject: [PATCH 43/51] wip Signed-off-by: sven1977 --- python/requirements/ml/rllib-test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements/ml/rllib-test-requirements.txt b/python/requirements/ml/rllib-test-requirements.txt index 2f7c764fa5d85..c138b6a8a6506 100644 --- a/python/requirements/ml/rllib-test-requirements.txt +++ b/python/requirements/ml/rllib-test-requirements.txt @@ -3,7 +3,7 @@ # Environment adapters. # --------------------- # Atari -gymnasium[atari]==0.28.1 +gymnasium==0.28.1 imageio==2.31.1 ale_py==0.8.1 # For testing MuJoCo envs with gymnasium. From d113b64ac7874db97a6820ed2153176d9eb1edeb Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 27 Jul 2023 16:06:41 +0200 Subject: [PATCH 44/51] wip Signed-off-by: sven1977 --- python/requirements_compiled.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements_compiled.txt b/python/requirements_compiled.txt index ace9d6cba7e83..c3058705d5532 100644 --- a/python/requirements_compiled.txt +++ b/python/requirements_compiled.txt @@ -175,7 +175,7 @@ gsutil==5.25 gunicorn==20.1.0 gym==0.26.2 gym-notices==0.0.8 -gymnasium==0.26.3 +gymnasium==0.28.1 gymnasium-notices==0.0.1 h11==0.12.0 h5py==3.7.0 From b8183cafe15f1825b34977b1be34607ad303ed94 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 27 Jul 2023 16:29:01 +0200 Subject: [PATCH 45/51] wip Signed-off-by: sven1977 --- python/requirements_compiled.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/requirements_compiled.txt b/python/requirements_compiled.txt index c3058705d5532..8ecbc7b55fe82 100644 --- a/python/requirements_compiled.txt +++ b/python/requirements_compiled.txt @@ -340,7 +340,7 @@ pathspec==0.11.1 pathtools==0.1.2 patsy==0.5.3 pbr==5.11.1 -pettingzoo==1.22.1 ; python_version >= "3.7" +pettingzoo==1.23.1 ; python_version >= "3.7" pexpect==4.8.0 pickleshare==0.7.5 pillow==9.2.0 ; platform_system != "Windows" @@ -473,7 +473,7 @@ sshpubkeys==3.3.1 stack-data==0.6.2 starlette==0.27.0 statsmodels==0.14.0 -supersuit==3.7.0 ; python_version >= "3.7" +supersuit==3.8.0 ; python_version >= "3.7" sympy==1.12 tabulate==0.9.0 tblib==2.0.0 From f094723c7f115271cdfc8cd55b0f7f352a12db87 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Thu, 27 Jul 2023 16:57:39 +0200 Subject: [PATCH 46/51] wip Signed-off-by: sven1977 --- python/requirements_compiled.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements_compiled.txt b/python/requirements_compiled.txt index 8ecbc7b55fe82..e03f73d81ccbb 100644 --- a/python/requirements_compiled.txt +++ b/python/requirements_compiled.txt @@ -277,7 +277,7 @@ msgpack==1.0.5 msgpack-numpy==0.4.8 msrest==0.7.1 msrestazure==0.6.4 -mujoco==2.2.0 +mujoco==2.3.4 mujoco-py==2.1.2.14 multidict==6.0.4 multipledispatch==1.0.0 From 70c71e5fa97adafd1488885d61268728ab69bad5 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 28 Jul 2023 11:39:45 +0200 Subject: [PATCH 47/51] wip Signed-off-by: sven1977 --- python/requirements_compiled.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/requirements_compiled.txt b/python/requirements_compiled.txt index e03f73d81ccbb..5c02dcb3facdb 100644 --- a/python/requirements_compiled.txt +++ b/python/requirements_compiled.txt @@ -173,7 +173,6 @@ greenlet==2.0.2 grpcio==1.54.2 gsutil==5.25 gunicorn==20.1.0 -gym==0.26.2 gym-notices==0.0.8 gymnasium==0.28.1 gymnasium-notices==0.0.1 @@ -277,7 +276,7 @@ msgpack==1.0.5 msgpack-numpy==0.4.8 msrest==0.7.1 msrestazure==0.6.4 -mujoco==2.3.4 +mujoco==2.3.7 mujoco-py==2.1.2.14 multidict==6.0.4 multipledispatch==1.0.0 From 264c836e30d292436a86ba5130ffcd73be3b1de9 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 28 Jul 2023 13:12:43 +0200 Subject: [PATCH 48/51] wip Signed-off-by: sven1977 --- docker/ray-ml/install-ml-docker-requirements.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/ray-ml/install-ml-docker-requirements.sh b/docker/ray-ml/install-ml-docker-requirements.sh index 293757b337fe8..5d6a645aa7bdc 100755 --- a/docker/ray-ml/install-ml-docker-requirements.sh +++ b/docker/ray-ml/install-ml-docker-requirements.sh @@ -61,3 +61,4 @@ mkdir -p ~/.mujoco mv mujoco210-linux-x86_64.tar.gz ~/.mujoco/. cd ~/.mujoco || exit tar -xf ~/.mujoco/mujoco210-linux-x86_64.tar.gz +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/root/.mujoco/mujoco210/bin From 4ce84987203d7936b2d0b4e42485fef8a2c46a47 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 28 Jul 2023 21:43:06 +0200 Subject: [PATCH 49/51] wip Signed-off-by: sven1977 --- doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt | 2 +- python/requirements/ml/rllib-test-requirements.txt | 3 ++- python/requirements_compiled.txt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt b/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt index 09b707c17898f..a5704dbef11c8 100644 --- a/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt +++ b/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt @@ -225,7 +225,7 @@ msgpack-numpy==0.4.8 msrest==0.7.1 msrestazure==0.6.4 mujoco==2.2.0 -mujoco-py==2.1.2.14 +#mujoco-py==2.1.2.14 multidict==6.0.4 multipledispatch==0.6.0 multiprocess==0.70.14 diff --git a/python/requirements/ml/rllib-test-requirements.txt b/python/requirements/ml/rllib-test-requirements.txt index c138b6a8a6506..3677dbe64ebdd 100644 --- a/python/requirements/ml/rllib-test-requirements.txt +++ b/python/requirements/ml/rllib-test-requirements.txt @@ -7,7 +7,8 @@ gymnasium==0.28.1 imageio==2.31.1 ale_py==0.8.1 # For testing MuJoCo envs with gymnasium. -mujoco-py<2.2,>=2.1 +mujoco==2.3.7 +#mujoco-py<2.2,>=2.1 dm_control==1.0.12 # For tests on PettingZoo's multi-agent envs. diff --git a/python/requirements_compiled.txt b/python/requirements_compiled.txt index 5c02dcb3facdb..b1762f6836234 100644 --- a/python/requirements_compiled.txt +++ b/python/requirements_compiled.txt @@ -277,7 +277,7 @@ msgpack-numpy==0.4.8 msrest==0.7.1 msrestazure==0.6.4 mujoco==2.3.7 -mujoco-py==2.1.2.14 +#mujoco-py==2.1.2.14 multidict==6.0.4 multipledispatch==1.0.0 multiprocess==0.70.14 From 5536b4ba01c092fa85bfa41bf9ebf7ce86e9a480 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 28 Jul 2023 22:28:33 +0200 Subject: [PATCH 50/51] wip Signed-off-by: sven1977 --- python/requirements/ml/rllib-test-requirements.txt | 2 +- python/requirements_compiled.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/requirements/ml/rllib-test-requirements.txt b/python/requirements/ml/rllib-test-requirements.txt index 3677dbe64ebdd..ba82c49d0ce4f 100644 --- a/python/requirements/ml/rllib-test-requirements.txt +++ b/python/requirements/ml/rllib-test-requirements.txt @@ -7,7 +7,7 @@ gymnasium==0.28.1 imageio==2.31.1 ale_py==0.8.1 # For testing MuJoCo envs with gymnasium. -mujoco==2.3.7 +mujoco==2.3.6 #mujoco-py<2.2,>=2.1 dm_control==1.0.12 diff --git a/python/requirements_compiled.txt b/python/requirements_compiled.txt index b1762f6836234..3f93a159fcbb5 100644 --- a/python/requirements_compiled.txt +++ b/python/requirements_compiled.txt @@ -276,7 +276,7 @@ msgpack==1.0.5 msgpack-numpy==0.4.8 msrest==0.7.1 msrestazure==0.6.4 -mujoco==2.3.7 +mujoco==2.3.6 #mujoco-py==2.1.2.14 multidict==6.0.4 multipledispatch==1.0.0 From 51d53f06bd570d736552d3f9bbcceeb3f9aeebf5 Mon Sep 17 00:00:00 2001 From: sven1977 Date: Fri, 28 Jul 2023 23:12:02 +0200 Subject: [PATCH 51/51] wip Signed-off-by: sven1977 --- doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt | 1 - python/requirements/ml/rllib-test-requirements.txt | 1 - python/requirements_compiled.txt | 1 - release/rllib_tests/debug_app_config.yaml | 5 +++-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt b/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt index a5704dbef11c8..f2a28eb65025f 100644 --- a/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt +++ b/doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt @@ -225,7 +225,6 @@ msgpack-numpy==0.4.8 msrest==0.7.1 msrestazure==0.6.4 mujoco==2.2.0 -#mujoco-py==2.1.2.14 multidict==6.0.4 multipledispatch==0.6.0 multiprocess==0.70.14 diff --git a/python/requirements/ml/rllib-test-requirements.txt b/python/requirements/ml/rllib-test-requirements.txt index ba82c49d0ce4f..b99d13ab42d42 100644 --- a/python/requirements/ml/rllib-test-requirements.txt +++ b/python/requirements/ml/rllib-test-requirements.txt @@ -8,7 +8,6 @@ imageio==2.31.1 ale_py==0.8.1 # For testing MuJoCo envs with gymnasium. mujoco==2.3.6 -#mujoco-py<2.2,>=2.1 dm_control==1.0.12 # For tests on PettingZoo's multi-agent envs. diff --git a/python/requirements_compiled.txt b/python/requirements_compiled.txt index 3f93a159fcbb5..b35a84cb65c40 100644 --- a/python/requirements_compiled.txt +++ b/python/requirements_compiled.txt @@ -277,7 +277,6 @@ msgpack-numpy==0.4.8 msrest==0.7.1 msrestazure==0.6.4 mujoco==2.3.6 -#mujoco-py==2.1.2.14 multidict==6.0.4 multipledispatch==1.0.0 multiprocess==0.70.14 diff --git a/release/rllib_tests/debug_app_config.yaml b/release/rllib_tests/debug_app_config.yaml index 2d5fa9f4b03b7..2b6152dcc9709 100755 --- a/release/rllib_tests/debug_app_config.yaml +++ b/release/rllib_tests/debug_app_config.yaml @@ -15,9 +15,10 @@ python: pip_packages: ## These dependencies should be handled by rllib-requirements.txt ## and removed here - - gymnasium[atari,mujoco]==0.26.3 + - gymnasium==0.28.1 + - imageio==2.31.1 - ale-py==0.8.1 - - mujoco-py<2.2,>=2.1 + - mujoco==2.3.6 # AutoROM downloads ROMs via torrent when they are built. The torrent is unreliable, # so we built it for py3 and use that instead. This wheel was tested for python 3.7, 3.8, # and 3.9.