From c914f22c40a94a918a3956bc652bf8549ec7e8da Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Mon, 24 Apr 2023 15:50:06 -0400 Subject: [PATCH 01/13] First version I'd be comfortable merging --- .github/workflows/fbf-test.yaml | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/fbf-test.yaml diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml new file mode 100644 index 000000000..32c0deb1a --- /dev/null +++ b/.github/workflows/fbf-test.yaml @@ -0,0 +1,70 @@ +on: + pull_request: + workflow_dispatch: +env: + CONDA_TYPE: Mambaforge + CONDA_VERSION: 23.1.0-1 + CONDA_PATH: /opt/conda + CONDA_CACHEBUST: 1 + FBF_ENV_CACHEBUST: 1 +jobs: + test: + name: fbf-test + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: restore miniconda cache + id: restore-miniconda + uses: actions/cache/restore@v3 + with: + path: ${{env.CONDA_PATH}} + key: miniconda-${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-${{env.CONDA_CACHEBUST}} + + # I tried and rejected the existing setup-miniconda action, + # because it wipes out a bunch of files like ~/.profile, + # ~/.bashrc, ~/.bash_profile in a way that (a) won't interact + # well with other actions that also need to modify the shell + # environment, and (b) doesn't play well with caching (you can't + # cache the deletion of a file). Also this way seems to take + # about half the time (though that might just be random + # variation). + - name: download miniconda + run: curl -L --no-progress-meter -o miniconda-installer.sh "https://github.com/conda-forge/miniforge/releases/download/${{env.CONDA_VERSION}}/${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-Linux-x86_64.sh" + if: steps.restore-miniconda.outputs.cache-hit != 'true' + + - name: run miniconda installer + run: bash miniconda-installer.sh -b -p ${{env.CONDA_PATH}} + if: steps.restore-miniconda.outputs.cache-hit != 'true' + + - name: clean up miniconda to reduce cache size + run: rm miniconda-installer.sh && source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda clean -afy + if: steps.restore-miniconda.outputs.cache-hit != 'true' + + - name: save miniconda cache + uses: actions/cache/save@v3 + with: + path: ${{env.CONDA_PATH}} + key: miniconda-${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-${{env.CONDA_CACHEBUST}} + if: steps.restore-miniconda.outputs.cache-hit != 'true' + + - name: restore fbfmaproom conda environment cache + id: restore-fbfmaproom-env + uses: actions/cache/restore@v3 + with: + path: ${{env.CONDA_PATH}}/envs/fbfmaproom + key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.CONDA_CACHEBUST}}-${{env.FBF_ENV_CACHEBUST}} + + - name: install fbfmaproom dependencies + run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && mamba create -n fbfmaproom --file fbfmaproom/conda-linux-64.lock + if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' + + - name: save fbfmaproom conda environment cache + uses: actions/cache/save@v3 + with: + path: ${{env.CONDA_PATH}}/envs/fbfmaproom + key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.CONDA_CACHEBUST}}-${{env.FBF_ENV_CACHEBUST}} + if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' + + - name: run fbf tests + run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From 731715e169afa210c60749658064b4bcf31df1f8 Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:05:58 -0400 Subject: [PATCH 02/13] Run in container --- .github/workflows/fbf-test.yaml | 49 +++++---------------------------- 1 file changed, 7 insertions(+), 42 deletions(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 32c0deb1a..c59b87fcb 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -2,69 +2,34 @@ on: pull_request: workflow_dispatch: env: - CONDA_TYPE: Mambaforge - CONDA_VERSION: 23.1.0-1 CONDA_PATH: /opt/conda - CONDA_CACHEBUST: 1 - FBF_ENV_CACHEBUST: 1 + FBF_CACHEBUST: 2 jobs: test: name: fbf-test runs-on: ubuntu-22.04 + container: + image: condaforge/mambaforge:23.1.0-1 steps: - uses: actions/checkout@v3 - - name: restore miniconda cache - id: restore-miniconda - uses: actions/cache/restore@v3 - with: - path: ${{env.CONDA_PATH}} - key: miniconda-${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-${{env.CONDA_CACHEBUST}} - - # I tried and rejected the existing setup-miniconda action, - # because it wipes out a bunch of files like ~/.profile, - # ~/.bashrc, ~/.bash_profile in a way that (a) won't interact - # well with other actions that also need to modify the shell - # environment, and (b) doesn't play well with caching (you can't - # cache the deletion of a file). Also this way seems to take - # about half the time (though that might just be random - # variation). - - name: download miniconda - run: curl -L --no-progress-meter -o miniconda-installer.sh "https://github.com/conda-forge/miniforge/releases/download/${{env.CONDA_VERSION}}/${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-Linux-x86_64.sh" - if: steps.restore-miniconda.outputs.cache-hit != 'true' - - - name: run miniconda installer - run: bash miniconda-installer.sh -b -p ${{env.CONDA_PATH}} - if: steps.restore-miniconda.outputs.cache-hit != 'true' - - - name: clean up miniconda to reduce cache size - run: rm miniconda-installer.sh && source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda clean -afy - if: steps.restore-miniconda.outputs.cache-hit != 'true' - - - name: save miniconda cache - uses: actions/cache/save@v3 - with: - path: ${{env.CONDA_PATH}} - key: miniconda-${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-${{env.CONDA_CACHEBUST}} - if: steps.restore-miniconda.outputs.cache-hit != 'true' - - name: restore fbfmaproom conda environment cache id: restore-fbfmaproom-env uses: actions/cache/restore@v3 with: path: ${{env.CONDA_PATH}}/envs/fbfmaproom - key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.CONDA_CACHEBUST}}-${{env.FBF_ENV_CACHEBUST}} + key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.FBF_CACHEBUST}} - name: install fbfmaproom dependencies - run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && mamba create -n fbfmaproom --file fbfmaproom/conda-linux-64.lock + run: mamba create -n fbfmaproom --file fbfmaproom/conda-linux-64.lock if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: save fbfmaproom conda environment cache uses: actions/cache/save@v3 with: path: ${{env.CONDA_PATH}}/envs/fbfmaproom - key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.CONDA_CACHEBUST}}-${{env.FBF_ENV_CACHEBUST}} + key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.FBF_CACHEBUST}} if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: run fbf tests - run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py + run: conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From 9745ba353d693fea8c75c72b4412ae65ea58408e Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:15:41 -0400 Subject: [PATCH 03/13] default shell --- .github/workflows/fbf-test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index c59b87fcb..df4852a12 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -10,6 +10,9 @@ jobs: runs-on: ubuntu-22.04 container: image: condaforge/mambaforge:23.1.0-1 + defaults: + run: + shell: bash -leo pipefail {0} steps: - uses: actions/checkout@v3 From a52c59b52a104406143d67b054f130a0dd139f7c Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:19:06 -0400 Subject: [PATCH 04/13] y --- .github/workflows/fbf-test.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index df4852a12..28919072d 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-22.04 container: image: condaforge/mambaforge:23.1.0-1 - defaults: - run: - shell: bash -leo pipefail {0} steps: - uses: actions/checkout@v3 @@ -35,4 +32,4 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: run fbf tests - run: conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py + run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From 19a49993d08f2bab05413cf77e656fe1de84d6a9 Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:20:21 -0400 Subject: [PATCH 05/13] y --- .github/workflows/fbf-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 28919072d..13cfcb971 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -32,4 +32,4 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: run fbf tests - run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py + run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From a9ec98f8366ee535e36e61d2b46756808b49c113 Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:24:49 -0400 Subject: [PATCH 06/13] y --- .github/workflows/fbf-test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 13cfcb971..344669594 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -8,6 +8,9 @@ jobs: test: name: fbf-test runs-on: ubuntu-22.04 + defaults: + run: + shell: bash container: image: condaforge/mambaforge:23.1.0-1 steps: @@ -32,4 +35,4 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: run fbf tests - run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py + run: conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From 870bcf28efe5dd81a5929515377b538716fd3cbd Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:27:36 -0400 Subject: [PATCH 07/13] y --- .github/workflows/fbf-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 344669594..f279f705e 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -35,4 +35,4 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: run fbf tests - run: conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py + run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From 1bfd7eee6bc746da9e501c4c7258fac5a9ab9863 Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:45:29 -0400 Subject: [PATCH 08/13] y --- .github/workflows/fbf-test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index f279f705e..018e45f3b 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-22.04 defaults: run: - shell: bash + shell: bash -leo pipefail container: image: condaforge/mambaforge:23.1.0-1 steps: @@ -34,5 +34,8 @@ jobs: key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.FBF_CACHEBUST}} if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' + - name: install libgl (dependency of opencv, not packaged with conda) + run: sudo apt install libglapi-mesa + - name: run fbf tests run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From d4f12bdac10a2eb788a4061e5d045e913a184d5c Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:46:47 -0400 Subject: [PATCH 09/13] y --- .github/workflows/fbf-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 018e45f3b..463dcc946 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-22.04 defaults: run: - shell: bash -leo pipefail + shell: bash container: image: condaforge/mambaforge:23.1.0-1 steps: From 5ca7ccf878fb8d043a2f535bb786676c6d58bc69 Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:48:16 -0400 Subject: [PATCH 10/13] y --- .github/workflows/fbf-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 463dcc946..2b3b415f5 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -35,7 +35,7 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: install libgl (dependency of opencv, not packaged with conda) - run: sudo apt install libglapi-mesa + run: apt install libglapi-mesa - name: run fbf tests run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From c9293a68f0f62d7fda3aae136eab06aa2f80e623 Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 16:49:42 -0400 Subject: [PATCH 11/13] y --- .github/workflows/fbf-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 2b3b415f5..024e7dad9 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -35,7 +35,7 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: install libgl (dependency of opencv, not packaged with conda) - run: apt install libglapi-mesa + run: apt update && apt install libglapi-mesa - name: run fbf tests run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From 64aee9d69fc944b4caf4074131c4a3743d7d1a99 Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Tue, 25 Apr 2023 17:00:06 -0400 Subject: [PATCH 12/13] y --- .github/workflows/fbf-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 024e7dad9..41c5ef210 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -35,7 +35,7 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: install libgl (dependency of opencv, not packaged with conda) - run: apt update && apt install libglapi-mesa + run: apt-get update && apt install libgl1-mesa-glx - name: run fbf tests run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py From 082e8f124c7afbbb644994c9ee390534600c142d Mon Sep 17 00:00:00 2001 From: Aaron Kaplan Date: Wed, 26 Apr 2023 10:54:43 -0400 Subject: [PATCH 13/13] y --- .github/workflows/fbf-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fbf-test.yaml b/.github/workflows/fbf-test.yaml index 41c5ef210..d5e936d7a 100644 --- a/.github/workflows/fbf-test.yaml +++ b/.github/workflows/fbf-test.yaml @@ -35,7 +35,7 @@ jobs: if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true' - name: install libgl (dependency of opencv, not packaged with conda) - run: apt-get update && apt install libgl1-mesa-glx + run: apt-get update && apt install -y libgl1-mesa-glx - name: run fbf tests run: . ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py