From fe7e80f4e6dd3cf3b47615886a2f81d7466cc9d9 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 16 Sep 2024 13:21:07 +0200 Subject: [PATCH 1/6] resolve CI status --- .github/workflows/ci-checks.yml | 2 +- .github/workflows/ci-tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index bf0fa4275..f13feeba6 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -26,6 +26,6 @@ jobs: import-name: "pl_bolts" testing-matrix: | { - "os": ["ubuntu-20.04", "macos-11", "windows-2022"], + "os": ["ubuntu-22.04", "macos-13", "windows-2022"], "python-version": ["3.8"] } diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index dfd0b0829..12dbfd9c6 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -21,13 +21,13 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-20.04", "macOS-11"] + os: ["ubuntu-22.04", "macOS-13"] python-version: ["3.8", "3.9", "3.10"] requires: ["latest"] # + "oldest" include: - { os: 'windows-2022', python-version: "3.9" } - { os: 'ubuntu-20.04', python-version: "3.8", requires: "oldest" } - - { os: 'macOS-11', python-version: "3.8", requires: "oldest" } + - { os: 'macOS-13', python-version: "3.8", requires: "oldest" } env: FREEZE_REQUIREMENTS: 1 TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" From 431020ff30a5674bc3cf0a43f0e4d9d74cab27b3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:22:17 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pl_bolts/callbacks/data_monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pl_bolts/callbacks/data_monitor.py b/src/pl_bolts/callbacks/data_monitor.py index 7a39a1e70..1d4e8c9c0 100644 --- a/src/pl_bolts/callbacks/data_monitor.py +++ b/src/pl_bolts/callbacks/data_monitor.py @@ -112,7 +112,7 @@ def _is_logger_available(self, logger: Logger) -> bool: if not isinstance(logger, self.supported_loggers): rank_zero_warn( f"{self.__class__.__name__} does not support logging with {logger.__class__.__name__}." - f" Supported loggers are: {', '.join((str(x.__name__) for x in self.supported_loggers))}" + f" Supported loggers are: {', '.join(str(x.__name__) for x in self.supported_loggers)}" ) available = False return available From 834feadd1f9241250b9769d7dc42e2dc4cd508c1 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 16 Sep 2024 13:32:52 +0200 Subject: [PATCH 3/6] templates --- .github/ISSUE_TEMPLATE/bug_report.md | 23 +++++++++-------- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++ .github/ISSUE_TEMPLATE/documentation.md | 5 ++-- .github/ISSUE_TEMPLATE/how-to-question.md | 30 ----------------------- .github/PULL_REQUEST_TEMPLATE.md | 23 +++++++++-------- 5 files changed, 36 insertions(+), 53 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/how-to-question.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a78343c32..70192ee44 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,25 +12,26 @@ assignees: '' ### To Reproduce -Steps to reproduce the behavior: - -1. Go to '...' -1. Run '....' -1. Scroll down to '....' -1. See error +Steps to reproduce the behavior... -#### Code sample +
+ Code sample + +```python +# Ideally attach a minimal code sample to reproduce the decried issue. +# Minimal means having the shortest code but still preserving the bug. +``` - +
### Expected behavior -### Environment +
+ Environment - PyTorch Version (e.g., 1.0): - OS (e.g., Linux): @@ -41,6 +42,8 @@ Minimal means having the shortest code but still preserving the bug. --> - GPU models and configuration: - Any other relevant information: +
+ ### Additional context diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..b8b40fe44 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a Question + url: https://github.com/Lightning-Universe/lightning-bolts/discussions/new + about: Ask and answer TorchMetrics related questions + - name: 💬 Chat with us + url: https://discord.gg/VptPCZkGNa + about: Live chat with experts, engineers, and users in our Discord community. diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md index c74b34080..456d49be4 100644 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -10,8 +10,7 @@ assignees: '' For typos and doc fixes, please go ahead and: -1. Create an issue. -1. Fix the typo. -1. Submit a PR. +- For a simple typo or fix, please send directly a PR (no need to create an issue) +- If you are not sure about the proper solution, please describe here your finding... Thanks! diff --git a/.github/ISSUE_TEMPLATE/how-to-question.md b/.github/ISSUE_TEMPLATE/how-to-question.md deleted file mode 100644 index bf9a22817..000000000 --- a/.github/ISSUE_TEMPLATE/how-to-question.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: How to question -about: Asking how-to questions -title: '' -labels: question -assignees: '' ---- - -## ❓ Questions and Help - -### Before asking: - -1. search the issues. -1. search the docs. - - - -#### What is your question? - -#### Code - - - -#### What have you tried? - -#### What's your environment? - -- OS: \[e.g. iOS, Linux, Win\] -- Packaging \[e.g. pip, conda\] -- Version \[e.g. 0.5.2.1\] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 54def0787..f5b7ff2e8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,16 @@ +
+ Before submitting + +- [ ] Was this **discussed/approved** via a Github issue? (no need for typos and docs improvements) +- [ ] Did you read the [contributor guideline](https://github.com/PyTorchLightning/lightning-bolts/blob/master/.github/CONTRIBUTING.md), Pull Request section? +- [ ] Did you make sure your PR does **only one thing**, instead of bundling different changes together? +- [ ] Did you make sure to **update the documentation** with your changes? +- [ ] Did you write any **new necessary tests**? \[not needed for typos/docs\] +- [ ] Did you verify new and **existing tests** pass locally with your changes? +- [ ] If you made a notable change (that affects users), did you update the [CHANGELOG](https://github.com/PyTorchLightning/lightning-bolts/blob/master/CHANGELOG.md)? + +
+ ## What does this PR do? ## PR review From eddf8c42c84b93cdbe93f4d5ce23f56efb2b957a Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 16 Sep 2024 13:43:03 +0200 Subject: [PATCH 4/6] ROM --- .github/actions/download-ROM/action.yml | 33 +++++++++++++++++++++++++ .github/labeler.yml | 11 --------- .github/labeling-config.yml | 19 ++++++++++++++ .github/workflows/ci-tests.yml | 22 +---------------- .github/workflows/labeler.yml | 23 ++++++++++------- 5 files changed, 67 insertions(+), 41 deletions(-) create mode 100644 .github/actions/download-ROM/action.yml delete mode 100644 .github/labeler.yml create mode 100644 .github/labeling-config.yml diff --git a/.github/actions/download-ROM/action.yml b/.github/actions/download-ROM/action.yml new file mode 100644 index 000000000..76f2b3602 --- /dev/null +++ b/.github/actions/download-ROM/action.yml @@ -0,0 +1,33 @@ +name: Prepare env. / restore caches +description: some more complex download-ROM - pip & hf + +runs: + using: "composite" + steps: + + - name: Setup macOS + if: runner.os == 'macOS' + run: | + brew update + brew install rar + shell: bash + - name: Setup Ubuntu + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y unrar + shell: bash + - name: Setup Windows + if: runner.os == 'Windows' + run: | + choco install unrar + shell: bash + + - name: Download ROMs + run: | + mkdir -p _datasets + cd _datasets + curl http://www.atarimania.com/roms/Roms.rar -o Roms.rar + unrar x -y Roms.rar + rm Roms.rar + shell: bash diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index a1b7bddb4..000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,11 +0,0 @@ -documentation: - - docs/**/* - -callback: - - pl_bolts/callbacks/**/* - -datamodule: - - pl_bolts/datamodules/**/* - -model: - - pl_bolts/models/**/* diff --git a/.github/labeling-config.yml b/.github/labeling-config.yml new file mode 100644 index 000000000..7085320fc --- /dev/null +++ b/.github/labeling-config.yml @@ -0,0 +1,19 @@ +documentation: + - changed-files: + - any-glob-to-any-file: + - docs/**/* + +callback: + - changed-files: + - any-glob-to-any-file: + - pl_bolts/callbacks/**/* + +datamodule: + - changed-files: + - any-glob-to-any-file: + - pl_bolts/datamodules/**/* + +model: + - changed-files: + - any-glob-to-any-file: + - pl_bolts/models/**/* diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 12dbfd9c6..9291dd625 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -100,29 +100,9 @@ jobs: # bump this date if you need update cache key: datasets-20230630 - - name: Setup macOS - if: runner.os == 'macOS' && steps.cache-datasets.outputs.cache-hit != 'true' - run: | - brew update - brew install rar - - name: Setup Ubuntu - if: runner.os == 'Linux'&& steps.cache-datasets.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install -y unrar - - name: Setup Windows - if: runner.os == 'Windows'&& steps.cache-datasets.outputs.cache-hit != 'true' - run: | - choco install unrar - - name: Download ROMs if: steps.cache-datasets.outputs.cache-hit != 'true' - run: | - mkdir -p _datasets - cd _datasets - curl http://www.atarimania.com/roms/Roms.rar -o Roms.rar - unrar x -y Roms.rar - rm Roms.rar + uses: ./.github/actions/download-ROM - name: Init ROMs working-directory: _datasets/ diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index dcb9b5f4f..ae7cc9a77 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,13 +1,18 @@ -name: Labeler - -on: - pull_request_target: - types: [opened, reopened] +name: "Pull Request Labeler" +on: [pull_request_target] jobs: - triage: + triage-prs: + permissions: + contents: read + pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@main - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + # Uploads repository content to the runner + - uses: actions/checkout@v4 + - uses: actions/labeler@v5 + with: + # The path to the label configuration file. + configuration-path: .github/labeling-config.yml + # Whether removing labels when matching files are reverted or no longer changed by the PR + sync-labels: true From d2c3f6db12a632267a6247c4defb4157d4bbde6f Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 16 Sep 2024 14:07:13 +0200 Subject: [PATCH 5/6] continue-on-error --- .github/workflows/ci-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 9291dd625..642137473 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -102,9 +102,11 @@ jobs: - name: Download ROMs if: steps.cache-datasets.outputs.cache-hit != 'true' + continue-on-error: true uses: ./.github/actions/download-ROM - name: Init ROMs + continue-on-error: true working-directory: _datasets/ run: python -m atari_py.import_roms ROMS From 12aec307784b6773e73e2e7b76747da6fb03a194 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 16 Sep 2024 14:16:08 +0200 Subject: [PATCH 6/6] swig --- .github/workflows/ci-tests.yml | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 642137473..aa19f928e 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -42,6 +42,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: "pip" - name: Set min. dependencies if: matrix.requires == 'oldest' @@ -53,15 +54,11 @@ jobs: open(fpath, 'w').write(req) shell: python - - name: Get pip cache dir - id: pip-cache - run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - - name: Restore pip cache - uses: actions/cache/restore@v4 - id: restore-cache - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: pip-dependencies + - name: Setup macOS + if: runner.os == 'macOS' + run: | + brew update + brew install swig - name: Install package run: | @@ -84,13 +81,6 @@ jobs: pip install -r requirements/devel.txt -U -q -f ${TORCH_URL} pip list - - name: Save pip cache - if: github.ref == 'refs/heads/master' - uses: actions/cache/save@v4 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: pip-dependencies - - name: Cache datasets id: cache-datasets uses: actions/cache@v4 @@ -110,8 +100,8 @@ jobs: working-directory: _datasets/ run: python -m atari_py.import_roms ROMS - - name: Restore HF cache - uses: actions/cache/restore@v4 + - name: HF cache + uses: actions/cache@v4 with: path: ${{ env.TRANSFORMERS_CACHE }} key: cache-transformers @@ -119,15 +109,7 @@ jobs: - name: Testing run: python -m pytest tests -v --cov=pl_bolts --timeout=200 - - name: Save HF cache - if: github.ref == 'refs/heads/master' - uses: actions/cache/save@v4 - with: - path: ${{ env.TRANSFORMERS_CACHE }} - key: cache-transformers - - name: Statistics - if: success() run: | coverage report coverage xml