From f528b5aad5d505f5be88a314cb8018e69eaec9a6 Mon Sep 17 00:00:00 2001 From: tlpss Date: Tue, 24 Jan 2023 23:30:16 +0100 Subject: [PATCH 1/6] try micromamba --- .github/workflows/pytest.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 251ba87..f932b68 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,25 +10,14 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v2 - - name: Cache conda - uses: actions/cache@v2 - env: - # Increase this value to reset cache if etc/example-environment.yml has not changed - CACHE_NUMBER: 1 + - name: install conda env with micromamba + uses: mamba-org/provision-with-micromamba@main with: - path: ~/conda_pkgs_dir - key: - ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yaml') }} - - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: keypoint-detection # name of env channel-priority: strict - auto-activate-base: false environment-file: environment.yaml - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + cache-env: true - name: Conda list shell: bash -l {0} - run: conda list - name: pytest shell: bash -l {0} From 659d7688e64380838104fc1113c708b52b725361 Mon Sep 17 00:00:00 2001 From: tlpss Date: Tue, 24 Jan 2023 23:34:36 +0100 Subject: [PATCH 2/6] trigger ci again --- environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yaml b/environment.yaml index e3fd1f1..45951eb 100644 --- a/environment.yaml +++ b/environment.yaml @@ -1,4 +1,4 @@ -name: keypoint-detection # to update an existing environment: conda env update -n --file +name: keypoint-detection # to update an existing environment: conda env update -n --file channels: - pytorch - conda-forge From 16e39597ac46be7e71fb0fcf8ecaf542b05c0f1d Mon Sep 17 00:00:00 2001 From: tlpss Date: Tue, 24 Jan 2023 23:42:59 +0100 Subject: [PATCH 3/6] trigger once more --- environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yaml b/environment.yaml index 45951eb..e3fd1f1 100644 --- a/environment.yaml +++ b/environment.yaml @@ -1,4 +1,4 @@ -name: keypoint-detection # to update an existing environment: conda env update -n --file +name: keypoint-detection # to update an existing environment: conda env update -n --file channels: - pytorch - conda-forge From 0acca236411814866c8a0eadc262cd391686706f Mon Sep 17 00:00:00 2001 From: tlpss Date: Wed, 25 Oct 2023 14:02:43 +0200 Subject: [PATCH 4/6] try to fix --- .github/workflows/pytest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f932b68..302acb0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,6 +10,9 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v2 + - name: install fonts for Pillow + run: | + sudo apt-get install fonts-freefont-ttf - name: install conda env with micromamba uses: mamba-org/provision-with-micromamba@main with: From a39cd64bf33d974b5180ee4660e4b04ec815456d Mon Sep 17 00:00:00 2001 From: tlpss Date: Wed, 25 Oct 2023 14:08:33 +0200 Subject: [PATCH 5/6] undo skip for gh actions --- test/test_detector.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_detector.py b/test/test_detector.py index 8512b0d..b9b722f 100644 --- a/test/test_detector.py +++ b/test/test_detector.py @@ -1,7 +1,6 @@ import os import unittest -import pytest import torch from pytorch_lightning.loggers import WandbLogger from torch import nn @@ -104,7 +103,7 @@ def test_model_init_heatmaps(self): # TODO: chcek if we can run it on gh actions as well. IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" - @pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Test doesn't work in Github Actions atm") + # @pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Test doesn't work in Github Actions atm") def test_checkpoint_loading(self): wandb_logger = WandbLogger(dir=get_wandb_log_dir_path(), mode="offline") From 8265d16f745f030659897d26b84fb028885f65e2 Mon Sep 17 00:00:00 2001 From: tlpss Date: Wed, 25 Oct 2023 14:13:55 +0200 Subject: [PATCH 6/6] remove gh action check --- test/test_detector.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/test_detector.py b/test/test_detector.py index b9b722f..a09c5b4 100644 --- a/test/test_detector.py +++ b/test/test_detector.py @@ -100,10 +100,6 @@ def test_model_init_heatmaps(self): self.assertTrue(torch.mean(heatmap).item() < 0.1) self.assertTrue(torch.var(heatmap).item() < 0.1) - # TODO: chcek if we can run it on gh actions as well. - IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" - - # @pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Test doesn't work in Github Actions atm") def test_checkpoint_loading(self): wandb_logger = WandbLogger(dir=get_wandb_log_dir_path(), mode="offline")