From 312ec77a7fcb01b3606d4607f22fe29150cae4b2 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Mon, 9 Jun 2025 11:56:02 -0400 Subject: [PATCH 01/15] Update grpcio version for macOS --- docs/Installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Installation.md b/docs/Installation.md index e6194c17c65..8144993ac89 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -172,7 +172,7 @@ for more installation options and versions. On OS X, you may need to explicitly install the GRPC runtime libraries to avoid hitting errors when training like `dlopen(/Users/alex.mccarthy/miniconda3/envs/mlagents/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_CFRelease'`. ```sh -pip3 install grpcio +pip3 install grpcio==1.51.3 ``` #### Installing `mlagents` From eae7333c058fecbc29adc8b7c24a11c33eb4b645 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 10 Jun 2025 08:54:28 -0400 Subject: [PATCH 02/15] Update grpcio version in setup --- ml-agents-envs/setup.py | 2 +- ml-agents/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ml-agents-envs/setup.py b/ml-agents-envs/setup.py index fcbee961515..ac3735d89e3 100644 --- a/ml-agents-envs/setup.py +++ b/ml-agents-envs/setup.py @@ -54,7 +54,7 @@ def run(self): zip_safe=False, install_requires=[ "cloudpickle", - "grpcio>=1.11.0,<=1.48.2", + "grpcio>=1.11.0,<=1.51.3", "Pillow>=4.2.1", "protobuf>=3.6,<3.21", "pyyaml>=3.1.0", diff --git a/ml-agents/setup.py b/ml-agents/setup.py index 1bf1fb4bf90..515017891ff 100644 --- a/ml-agents/setup.py +++ b/ml-agents/setup.py @@ -55,7 +55,7 @@ def run(self): zip_safe=False, install_requires=[ # Test-only dependencies should go in test_requirements.txt, not here. - "grpcio>=1.11.0,<=1.48.2", + "grpcio>=1.11.0,<=1.51.3", "h5py>=2.9.0", f"mlagents_envs=={VERSION}", "numpy>=1.23.5,<1.24.0", From 0b723f3fee4539297cbbd0a33388fdf6aca59316 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 10 Jun 2025 09:45:14 -0400 Subject: [PATCH 03/15] Update the doc. --- docs/Installation.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Installation.md b/docs/Installation.md index 8144993ac89..77e8799bd85 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -172,9 +172,11 @@ for more installation options and versions. On OS X, you may need to explicitly install the GRPC runtime libraries to avoid hitting errors when training like `dlopen(/Users/alex.mccarthy/miniconda3/envs/mlagents/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_CFRelease'`. ```sh -pip3 install grpcio==1.51.3 +pip3 install grpcio ``` +Note that grpcio Python binary wheels version 1.51.3 or higher is required for Apple Silicon. + #### Installing `mlagents` To install the `mlagents` Python package, activate your virtual environment and From 6db61623d78543a456a9136112283638645e40f4 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 10 Jun 2025 13:09:33 -0400 Subject: [PATCH 04/15] Remove GRPC installing instructions for macOS --- docs/Installation.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/Installation.md b/docs/Installation.md index 77e8799bd85..381967df90a 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -167,16 +167,6 @@ Note that on Windows, you may also need Microsoft's if you don't have it already. See the [PyTorch installation guide](https://pytorch.org/get-started/locally/) for more installation options and versions. -#### (OS X) Installing GRPC libraries - -On OS X, you may need to explicitly install the GRPC runtime libraries to avoid hitting errors when training like `dlopen(/Users/alex.mccarthy/miniconda3/envs/mlagents/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_CFRelease'`. - -```sh -pip3 install grpcio -``` - -Note that grpcio Python binary wheels version 1.51.3 or higher is required for Apple Silicon. - #### Installing `mlagents` To install the `mlagents` Python package, activate your virtual environment and From 9ff94975ea005f4492e9e62afb17afe4552a0869 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 10 Jun 2025 15:18:49 -0400 Subject: [PATCH 05/15] Upgrade grpcio version to address the security concern reported by Cycode --- ml-agents-envs/setup.py | 2 +- ml-agents/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ml-agents-envs/setup.py b/ml-agents-envs/setup.py index ac3735d89e3..42641dea564 100644 --- a/ml-agents-envs/setup.py +++ b/ml-agents-envs/setup.py @@ -54,7 +54,7 @@ def run(self): zip_safe=False, install_requires=[ "cloudpickle", - "grpcio>=1.11.0,<=1.51.3", + "grpcio>=1.11.0,<=1.53", "Pillow>=4.2.1", "protobuf>=3.6,<3.21", "pyyaml>=3.1.0", diff --git a/ml-agents/setup.py b/ml-agents/setup.py index 515017891ff..a54711623e7 100644 --- a/ml-agents/setup.py +++ b/ml-agents/setup.py @@ -55,7 +55,7 @@ def run(self): zip_safe=False, install_requires=[ # Test-only dependencies should go in test_requirements.txt, not here. - "grpcio>=1.11.0,<=1.51.3", + "grpcio>=1.11.0,<=1.53", "h5py>=2.9.0", f"mlagents_envs=={VERSION}", "numpy>=1.23.5,<1.24.0", From 26b7fbe80ca6b882bfeaaf9eb38c07c75f412f0f Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 10 Jun 2025 15:20:20 -0400 Subject: [PATCH 06/15] Update again --- ml-agents-envs/setup.py | 2 +- ml-agents/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ml-agents-envs/setup.py b/ml-agents-envs/setup.py index 42641dea564..5e4c80b0863 100644 --- a/ml-agents-envs/setup.py +++ b/ml-agents-envs/setup.py @@ -54,7 +54,7 @@ def run(self): zip_safe=False, install_requires=[ "cloudpickle", - "grpcio>=1.11.0,<=1.53", + "grpcio>=1.11.0,<=1.53.2", "Pillow>=4.2.1", "protobuf>=3.6,<3.21", "pyyaml>=3.1.0", diff --git a/ml-agents/setup.py b/ml-agents/setup.py index a54711623e7..16be25d8b3d 100644 --- a/ml-agents/setup.py +++ b/ml-agents/setup.py @@ -55,7 +55,7 @@ def run(self): zip_safe=False, install_requires=[ # Test-only dependencies should go in test_requirements.txt, not here. - "grpcio>=1.11.0,<=1.53", + "grpcio>=1.11.0,<=1.53.2", "h5py>=2.9.0", f"mlagents_envs=={VERSION}", "numpy>=1.23.5,<1.24.0", From 5ba06700c4bec747dd8b7e7349305f89e2cf6668 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 08:34:46 -0400 Subject: [PATCH 07/15] Use ubuntu-24.04 for pre-commit --- .github/workflows/pre-commit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index bf5363cac5b..c1c38590b5c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,7 +11,7 @@ on: jobs: pre-commit: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -19,7 +19,7 @@ jobs: python-version: 3.10.x - uses: ruby/setup-ruby@v1 env: - ImageOS: ubuntu20 + ImageOS: ubuntu24 with: ruby-version: '2.7' bundler-cache: true # runs 'bundle install' and caches installed gems automatically From ac2503540774d441d2c60a8887d3ed712f052c24 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 08:53:44 -0400 Subject: [PATCH 08/15] Fix Xvfb Initialization --- .github/workflows/colab.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/colab.yml b/.github/workflows/colab.yml index 4ece61ca6a4..12924307ce4 100644 --- a/.github/workflows/colab.yml +++ b/.github/workflows/colab.yml @@ -53,6 +53,11 @@ jobs: python -m pip install --progress-bar=off -e ./ml-agents-envs python -m pip install --progress-bar=off -e ./ml-agents python -m pip install --progress-bar=off -r colab_requirements.txt + - name: Start Xvfb + run: | + sudo apt-get install xvfb + Xvfb :99 -screen 0 1024x768x16 & + export DISPLAY=:99 - name: Execute notebook run: jupyter nbconvert --to notebook --execute --log-level=DEBUG --ExecutePreprocessor.kernel_name=python3 --output output-${{ matrix.notebook_path }} colab/${{ matrix.notebook_path }} - name: Upload colab results From cb258db7ed28909fee627fc0c8f0c021deefa972 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 09:06:41 -0400 Subject: [PATCH 09/15] Fix Notebook Execution RuntimeError --- .github/workflows/colab.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/colab.yml b/.github/workflows/colab.yml index 12924307ce4..cee30830d7b 100644 --- a/.github/workflows/colab.yml +++ b/.github/workflows/colab.yml @@ -53,13 +53,10 @@ jobs: python -m pip install --progress-bar=off -e ./ml-agents-envs python -m pip install --progress-bar=off -e ./ml-agents python -m pip install --progress-bar=off -r colab_requirements.txt - - name: Start Xvfb - run: | - sudo apt-get install xvfb - Xvfb :99 -screen 0 1024x768x16 & - export DISPLAY=:99 - name: Execute notebook - run: jupyter nbconvert --to notebook --execute --log-level=DEBUG --ExecutePreprocessor.kernel_name=python3 --output output-${{ matrix.notebook_path }} colab/${{ matrix.notebook_path }} + run: | + python -m pip install asyncio + jupyter nbconvert --to notebook --execute --log-level=DEBUG --ExecutePreprocessor.kernel_name=python3 --output output-${{ matrix.notebook_path }} colab/${{ matrix.notebook_path }} - name: Upload colab results uses: actions/upload-artifact@v4 with: From d5185c5b501a6d3dc3b163beb088183ff8649ef1 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 09:19:25 -0400 Subject: [PATCH 10/15] Add matplotlib --- .github/workflows/colab.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/colab.yml b/.github/workflows/colab.yml index cee30830d7b..624e0db5293 100644 --- a/.github/workflows/colab.yml +++ b/.github/workflows/colab.yml @@ -53,10 +53,9 @@ jobs: python -m pip install --progress-bar=off -e ./ml-agents-envs python -m pip install --progress-bar=off -e ./ml-agents python -m pip install --progress-bar=off -r colab_requirements.txt + python -m pip install matplotlib - name: Execute notebook - run: | - python -m pip install asyncio - jupyter nbconvert --to notebook --execute --log-level=DEBUG --ExecutePreprocessor.kernel_name=python3 --output output-${{ matrix.notebook_path }} colab/${{ matrix.notebook_path }} + run: jupyter nbconvert --to notebook --execute --log-level=DEBUG --ExecutePreprocessor.kernel_name=python3 --output output-${{ matrix.notebook_path }} colab/${{ matrix.notebook_path }} - name: Upload colab results uses: actions/upload-artifact@v4 with: From 069aaca26e252515676c5381849ed431d74abbec Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 10:27:02 -0400 Subject: [PATCH 11/15] Remove installing matplotlib from workflow --- .github/workflows/colab.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/colab.yml b/.github/workflows/colab.yml index 624e0db5293..4ece61ca6a4 100644 --- a/.github/workflows/colab.yml +++ b/.github/workflows/colab.yml @@ -53,7 +53,6 @@ jobs: python -m pip install --progress-bar=off -e ./ml-agents-envs python -m pip install --progress-bar=off -e ./ml-agents python -m pip install --progress-bar=off -r colab_requirements.txt - python -m pip install matplotlib - name: Execute notebook run: jupyter nbconvert --to notebook --execute --log-level=DEBUG --ExecutePreprocessor.kernel_name=python3 --output output-${{ matrix.notebook_path }} colab/${{ matrix.notebook_path }} - name: Upload colab results From 6c15224ecfc1798c3e3c1e6ca614b972b7665bcf Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 10:47:29 -0400 Subject: [PATCH 12/15] Change ubuntu version --- .github/workflows/colab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/colab.yml b/.github/workflows/colab.yml index 4ece61ca6a4..7946adfd5d0 100644 --- a/.github/workflows/colab.yml +++ b/.github/workflows/colab.yml @@ -16,7 +16,7 @@ on: jobs: colab: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: COLAB_ALWAYS_INSTALL_XVFB: 1 QLEARNING_NUM_TRAINING_STEPS: 5 From ad8a6b062cbcf50b8d005ad625c4db31301e6ca3 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 16:32:24 -0400 Subject: [PATCH 13/15] Update release notes --- com.unity.ml-agents/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index 63f9111f82d..cff299a26f7 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to - Added no-graphics-monitor. (#6014) #### ml-agents / ml-agents-envs +- Upgrade grpcio version. ((#6208) - Update Installation.md (#6004) - Updated Using-Virtual-Environment.md (#6033) From 2ec64b4cd28386b0ea4ed6e89ca1091153d0c0f8 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 16:33:19 -0400 Subject: [PATCH 14/15] Typo --- com.unity.ml-agents/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index cff299a26f7..3379c897066 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -28,7 +28,7 @@ and this project adheres to - Added no-graphics-monitor. (#6014) #### ml-agents / ml-agents-envs -- Upgrade grpcio version. ((#6208) +- Upgraded grpcio version. ((#6208) - Update Installation.md (#6004) - Updated Using-Virtual-Environment.md (#6033) From 15fb6ce5a4f137b0db220333d358212d9ad62106 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Fri, 13 Jun 2025 16:33:47 -0400 Subject: [PATCH 15/15] Typo --- com.unity.ml-agents/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index 3379c897066..1df86732897 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -28,7 +28,7 @@ and this project adheres to - Added no-graphics-monitor. (#6014) #### ml-agents / ml-agents-envs -- Upgraded grpcio version. ((#6208) +- Upgraded grpcio version. (#6208) - Update Installation.md (#6004) - Updated Using-Virtual-Environment.md (#6033)