From 766fab793965630331ebbcac089c2e3668cd6b5f Mon Sep 17 00:00:00 2001 From: Callum Tilbury Date: Tue, 23 Jul 2024 14:31:50 +0200 Subject: [PATCH 01/15] chore: mypy. --- flashbax/buffers/prioritised_trajectory_buffer.py | 2 +- flashbax/buffers/trajectory_buffer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flashbax/buffers/prioritised_trajectory_buffer.py b/flashbax/buffers/prioritised_trajectory_buffer.py index d93d6b1..88893a3 100644 --- a/flashbax/buffers/prioritised_trajectory_buffer.py +++ b/flashbax/buffers/prioritised_trajectory_buffer.py @@ -801,7 +801,7 @@ def make_prioritised_trajectory_buffer( init_fn = functools.partial( prioritised_init, add_batch_size=add_batch_size, - max_length_time_axis=max_length_time_axis, + max_length_time_axis=max_length_time_axis, # type: ignore period=period, ) add_fn = functools.partial( diff --git a/flashbax/buffers/trajectory_buffer.py b/flashbax/buffers/trajectory_buffer.py index a06ad45..ba005cd 100644 --- a/flashbax/buffers/trajectory_buffer.py +++ b/flashbax/buffers/trajectory_buffer.py @@ -588,7 +588,7 @@ def make_trajectory_buffer( init_fn = functools.partial( init, add_batch_size=add_batch_size, - max_length_time_axis=max_length_time_axis, + max_length_time_axis=max_length_time_axis, # type: ignore ) add_fn = functools.partial( add, From 6579542ca764bab704dedb9648030cae4622d1da Mon Sep 17 00:00:00 2001 From: Callum Tilbury Date: Tue, 23 Jul 2024 16:02:00 +0200 Subject: [PATCH 02/15] chore: use asserts instead of ignores --- flashbax/buffers/prioritised_trajectory_buffer.py | 3 ++- flashbax/buffers/trajectory_buffer.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flashbax/buffers/prioritised_trajectory_buffer.py b/flashbax/buffers/prioritised_trajectory_buffer.py index 88893a3..2337bf8 100644 --- a/flashbax/buffers/prioritised_trajectory_buffer.py +++ b/flashbax/buffers/prioritised_trajectory_buffer.py @@ -798,10 +798,11 @@ def make_prioritised_trajectory_buffer( if max_size is not None: max_length_time_axis = max_size // add_batch_size + assert max_length_time_axis is not None init_fn = functools.partial( prioritised_init, add_batch_size=add_batch_size, - max_length_time_axis=max_length_time_axis, # type: ignore + max_length_time_axis=max_length_time_axis, period=period, ) add_fn = functools.partial( diff --git a/flashbax/buffers/trajectory_buffer.py b/flashbax/buffers/trajectory_buffer.py index ba005cd..73b33b6 100644 --- a/flashbax/buffers/trajectory_buffer.py +++ b/flashbax/buffers/trajectory_buffer.py @@ -585,10 +585,11 @@ def make_trajectory_buffer( if max_size is not None: max_length_time_axis = max_size // add_batch_size + assert max_length_time_axis is not None init_fn = functools.partial( init, add_batch_size=add_batch_size, - max_length_time_axis=max_length_time_axis, # type: ignore + max_length_time_axis=max_length_time_axis, ) add_fn = functools.partial( add, From 0ee266fe043b4df06fdf19f716560da8bcae4634 Mon Sep 17 00:00:00 2001 From: Callum Tilbury Date: Wed, 24 Jul 2024 09:42:26 +0200 Subject: [PATCH 03/15] chore: empty commit to retrigger gh runners. From 0fd8d11903f8f79e0e0cd4bf846cd7d098b89e2f Mon Sep 17 00:00:00 2001 From: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:54:50 +0200 Subject: [PATCH 04/15] chore: update to use instadeep-ci --- .github/workflows/tests_linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index b88b89e..e0f991b 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: python-version: ["3.9"] - os: [self-hosted] + os: [instadeep-ci] steps: - name: Install dependencies for viewer test From 7efc6b12cf429ecc47737bafc6a24a53edb795e8 Mon Sep 17 00:00:00 2001 From: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:52:44 +0200 Subject: [PATCH 05/15] chore: testing new runner format --- .github/workflows/tests_linters.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index e0f991b..feb4513 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -10,16 +10,15 @@ jobs: strategy: matrix: python-version: ["3.9"] - os: [instadeep-ci] + os: ["instadeep-ci"] + container: + image: python:3.9 steps: - name: Install dependencies for viewer test run: sudo apt-get update && sudo apt-get install -y xvfb - name: Checkout flashbax uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "${{ matrix.python-version }}" - name: Install python dependencies ๐Ÿ”ง run: pip install .[dev] - name: List python packages ๐Ÿ“ฆ From c79ad50a25b96177fa7c44836bce68d8269a2111 Mon Sep 17 00:00:00 2001 From: Vikranth Tirumuru Date: Wed, 24 Jul 2024 12:59:27 +0200 Subject: [PATCH 06/15] move to instadeep-ci --- .github/workflows/release.yml | 4 +++- .github/workflows/tests_linters.yml | 13 +++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1484088..b188d7c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,9 @@ on: jobs: deploy: - runs-on: ubuntu-latest + runs-on: instadeep-ci + container: + image: ghcr.io/catthehacker/ubuntu:runner-latest timeout-minutes: 30 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index feb4513..69620f3 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -4,25 +4,22 @@ on: [ push, pull_request ] jobs: tests-and-linters: - name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" - runs-on: "${{ matrix.os }}" - - strategy: - matrix: - python-version: ["3.9"] - os: ["instadeep-ci"] + name: "Python 3.9 on instadeep-ci" + runs-on: instadeep-ci container: image: python:3.9 steps: - name: Install dependencies for viewer test - run: sudo apt-get update && sudo apt-get install -y xvfb + run: apt-get update && apt-get install -y xvfb - name: Checkout flashbax uses: actions/checkout@v3 - name: Install python dependencies ๐Ÿ”ง run: pip install .[dev] - name: List python packages ๐Ÿ“ฆ run: pip list + # Workaround for https://github.com/actions/checkout/issues/1169 + - run: git config --system --add safe.directory $GITHUB_WORKSPACE - name: Run linters ๐Ÿ–Œ๏ธ run: pre-commit run --all-files --verbose - name: Run tests ๐Ÿงช From 056cedaf7e90f960d4991ff0c51884397f11c4d2 Mon Sep 17 00:00:00 2001 From: Vikranth Tirumuru Date: Wed, 24 Jul 2024 17:05:40 +0200 Subject: [PATCH 07/15] test public runners --- .github/workflows/release.yml | 2 +- .github/workflows/tests_linters.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b188d7c..ce4280e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: deploy: - runs-on: instadeep-ci + runs-on: ubuntu:latest container: image: ghcr.io/catthehacker/ubuntu:runner-latest timeout-minutes: 30 diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index 69620f3..a8fae60 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -5,7 +5,7 @@ on: [ push, pull_request ] jobs: tests-and-linters: name: "Python 3.9 on instadeep-ci" - runs-on: instadeep-ci + runs-on: ubuntu:latest container: image: python:3.9 From f15b843ba3cd29ee7f29ff07ae0cc5f2ea20d116 Mon Sep 17 00:00:00 2001 From: Vikranth Tirumuru Date: Wed, 24 Jul 2024 17:07:05 +0200 Subject: [PATCH 08/15] fix spell --- .github/workflows/tests_linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index a8fae60..1ee2efa 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -5,7 +5,7 @@ on: [ push, pull_request ] jobs: tests-and-linters: name: "Python 3.9 on instadeep-ci" - runs-on: ubuntu:latest + runs-on: ubuntu-latest container: image: python:3.9 From ce78ee71c0ea6291abd36845107f2c9e92655bd6 Mon Sep 17 00:00:00 2001 From: Vikranth Tirumuru Date: Wed, 24 Jul 2024 17:07:13 +0200 Subject: [PATCH 09/15] fix spell --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce4280e..25bbb77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: deploy: - runs-on: ubuntu:latest + runs-on: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:runner-latest timeout-minutes: 30 From 6a315bc685f234d52fb87ec4835fe6b9e3a640e6 Mon Sep 17 00:00:00 2001 From: Vikranth Tirumuru Date: Wed, 24 Jul 2024 17:09:18 +0200 Subject: [PATCH 10/15] move to github hosted runner --- .github/workflows/tests_linters.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index 1ee2efa..42835b3 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -4,7 +4,7 @@ on: [ push, pull_request ] jobs: tests-and-linters: - name: "Python 3.9 on instadeep-ci" + name: "Python 3.9 on GitHub Hosted runner" runs-on: ubuntu-latest container: image: python:3.9 @@ -18,8 +18,6 @@ jobs: run: pip install .[dev] - name: List python packages ๐Ÿ“ฆ run: pip list - # Workaround for https://github.com/actions/checkout/issues/1169 - - run: git config --system --add safe.directory $GITHUB_WORKSPACE - name: Run linters ๐Ÿ–Œ๏ธ run: pre-commit run --all-files --verbose - name: Run tests ๐Ÿงช From 363c24141bc8c877db98f166455f3e9334f0d59b Mon Sep 17 00:00:00 2001 From: Callum Tilbury Date: Fri, 26 Jul 2024 12:57:09 +0200 Subject: [PATCH 11/15] chore: empty commit to retrigger gh runners. From 9ed0ec5a5e15843119ce31e021e06ae54c559af4 Mon Sep 17 00:00:00 2001 From: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:33:09 +0200 Subject: [PATCH 12/15] chore: check if git is missing in gh runner --- .github/workflows/tests_linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index 42835b3..a919496 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Install dependencies for viewer test - run: apt-get update && apt-get install -y xvfb + run: apt-get update && apt-get install -y xvfb git - name: Checkout flashbax uses: actions/checkout@v3 - name: Install python dependencies ๐Ÿ”ง From 1386e344239b607a85e3dbd2d02fab914c559a54 Mon Sep 17 00:00:00 2001 From: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:44:13 +0200 Subject: [PATCH 13/15] chore: check git info before precommit step --- .github/workflows/tests_linters.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index a919496..266f8b9 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -11,13 +11,15 @@ jobs: steps: - name: Install dependencies for viewer test - run: apt-get update && apt-get install -y xvfb git + run: apt-get update && apt-get install -y xvfb - name: Checkout flashbax uses: actions/checkout@v3 - name: Install python dependencies ๐Ÿ”ง run: pip install .[dev] - name: List python packages ๐Ÿ“ฆ run: pip list + - name: Check git settings + run: git --version - name: Run linters ๐Ÿ–Œ๏ธ run: pre-commit run --all-files --verbose - name: Run tests ๐Ÿงช From ab9880126317c11bf2988ea1d0bbf3e1452e6b28 Mon Sep 17 00:00:00 2001 From: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:48:40 +0200 Subject: [PATCH 14/15] chore: print log message on failure --- .github/workflows/tests_linters.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index 266f8b9..c1543d5 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -18,8 +18,6 @@ jobs: run: pip install .[dev] - name: List python packages ๐Ÿ“ฆ run: pip list - - name: Check git settings - run: git --version - name: Run linters ๐Ÿ–Œ๏ธ run: pre-commit run --all-files --verbose - name: Run tests ๐Ÿงช @@ -28,3 +26,6 @@ jobs: run: | coverage html --directory=coverage_html_report coverage report --fail-under=0.97 + - name: Print pre-commit log on failure + if: failure() + run: cat /github/home/.cache/pre-commit/pre-commit.log From 28a482cf3cac9839f00320702bbbb5f99a86c8de Mon Sep 17 00:00:00 2001 From: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:51:18 +0200 Subject: [PATCH 15/15] chore: fix for git permissions --- .github/workflows/tests_linters.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linters.yml b/.github/workflows/tests_linters.yml index c1543d5..3b6eee9 100644 --- a/.github/workflows/tests_linters.yml +++ b/.github/workflows/tests_linters.yml @@ -18,6 +18,8 @@ jobs: run: pip install .[dev] - name: List python packages ๐Ÿ“ฆ run: pip list + - name: Update git permissions + run: git config --global --add safe.directory /__w/flashbax/flashbax - name: Run linters ๐Ÿ–Œ๏ธ run: pre-commit run --all-files --verbose - name: Run tests ๐Ÿงช @@ -26,6 +28,3 @@ jobs: run: | coverage html --directory=coverage_html_report coverage report --fail-under=0.97 - - name: Print pre-commit log on failure - if: failure() - run: cat /github/home/.cache/pre-commit/pre-commit.log