From 6ae116f5c6cda9e2ab3b30af3771557a44645309 Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 13:43:32 -0400 Subject: [PATCH 1/9] Switch to miniforge from miniconda, no default channel --- .github/workflows/lint.yml | 5 ++++- .github/workflows/unit-test.yml | 3 +++ .pylintrc | 2 +- Dockerfile | 8 ++++---- environment.yml | 2 +- environment_dev.yml | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c7ff0a7b..b3fa0d52 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,9 +20,12 @@ jobs: environment-file: environment_dev.yml python-version: ${{ matrix.python-version }} auto-activate-base: false + miniforge-version: latest - name: Lint Project shell: bash -l {0} run: pylint onair plugins test - name: Check Formatting shell: bash -l {0} - run: black --check . \ No newline at end of file + run: black --check . + - name: Confirm no defaults + run: conda config --show channels diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 9c6d65dd..9839bc9a 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -20,6 +20,7 @@ jobs: environment-file: environment_dev.yml python-version: ${{ matrix.python-version }} auto-activate-base: false + miniforge-version: latest - name: Install dependencies shell: bash -l {0} run: | @@ -33,3 +34,5 @@ jobs: run: coverage report --skip-empty - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 + - name: Confirm no defaults + run: conda config --show channels diff --git a/.pylintrc b/.pylintrc index 5a02a7e1..0c9f9d93 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,3 +1,3 @@ [MAIN] -exit-zero=True \ No newline at end of file +exit-zero=True diff --git a/Dockerfile b/Dockerfile index be69a0ca..1a154e89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,13 +57,13 @@ USER onair_dev ENV CONDA_DIR /home/onair_dev/conda RUN \ mkdir -p $CONDA_DIR && \ - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ - bash ~/miniconda.sh -b -u -p $CONDA_DIR && \ - rm -rf ~/miniconda.sh + wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O ~/miniforge.sh && \ + bash ~/miniforge.sh -b -u -p $CONDA_DIR && \ + rm -rf ~/miniforge.sh ENV PATH=$CONDA_DIR/bin:$PATH # Make OnAir requirements file accessible by onair_dev user -COPY environment.yml /home/onair_dev/environment.yml +COPY environment_dev.yml /home/onair_dev/environment.yml RUN \ . $CONDA_DIR/etc/profile.d/conda.sh && \ conda init bash && \ diff --git a/environment.yml b/environment.yml index cc70880e..05afba62 100644 --- a/environment.yml +++ b/environment.yml @@ -1,7 +1,7 @@ name: onair channels: - - default - conda-forge + - nodefaults dependencies: - python>=3.8,<3.13 - numpy diff --git a/environment_dev.yml b/environment_dev.yml index 889df2a4..e145b592 100644 --- a/environment_dev.yml +++ b/environment_dev.yml @@ -1,7 +1,7 @@ name: onair channels: - - default - conda-forge + - nodefaults dependencies: - python>=3.8,<3.13 - numpy From 616313e30031bf354adf8191c09c92b6f98d597a Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 13:58:08 -0400 Subject: [PATCH 2/9] Try custom installer --- .github/workflows/lint.yml | 2 +- .github/workflows/unit-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b3fa0d52..5a7af5ed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,11 +16,11 @@ jobs: - name: Set up OnAIR conda environment uses: conda-incubator/setup-miniconda@v3 with: + installer-url: https://github.com/conda-forge/miniforge/releases/download/4.8.3-2/Miniforge-pypy3-4.8.3-2-Linux-x86_64.sh activate-environment: onair environment-file: environment_dev.yml python-version: ${{ matrix.python-version }} auto-activate-base: false - miniforge-version: latest - name: Lint Project shell: bash -l {0} run: pylint onair plugins test diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 9839bc9a..d238efd1 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -16,11 +16,11 @@ jobs: - name: Set up OnAIR test environment uses: conda-incubator/setup-miniconda@v3 with: + installer-url: https://github.com/conda-forge/miniforge/releases/download/4.8.3-2/Miniforge-pypy3-4.8.3-2-Linux-x86_64.sh activate-environment: onair environment-file: environment_dev.yml python-version: ${{ matrix.python-version }} auto-activate-base: false - miniforge-version: latest - name: Install dependencies shell: bash -l {0} run: | From f994bb38b56797d0d2d70ec9233a1afe74d5fbb4 Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 14:35:17 -0400 Subject: [PATCH 3/9] Try with miniforge install step --- .github/workflows/lint.yml | 7 ++++++- .github/workflows/unit-test.yml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a7af5ed..578be39b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,11 +16,16 @@ jobs: - name: Set up OnAIR conda environment uses: conda-incubator/setup-miniconda@v3 with: - installer-url: https://github.com/conda-forge/miniforge/releases/download/4.8.3-2/Miniforge-pypy3-4.8.3-2-Linux-x86_64.sh activate-environment: onair environment-file: environment_dev.yml python-version: ${{ matrix.python-version }} auto-activate-base: false + - name: Install miniforge + run: | + curl -fsSL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -o miniforge.sh + bash miniforge.sh -b -p $HOME/.miniforge + + export PATH="$HOME/.miniforge/bin:$PATH" - name: Lint Project shell: bash -l {0} run: pylint onair plugins test diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index d238efd1..b5a5be39 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -16,11 +16,16 @@ jobs: - name: Set up OnAIR test environment uses: conda-incubator/setup-miniconda@v3 with: - installer-url: https://github.com/conda-forge/miniforge/releases/download/4.8.3-2/Miniforge-pypy3-4.8.3-2-Linux-x86_64.sh activate-environment: onair environment-file: environment_dev.yml python-version: ${{ matrix.python-version }} auto-activate-base: false + - name: Install miniforge + run: | + curl -fsSL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -o miniforge.sh + bash miniforge.sh -b -p $HOME/.miniforge + + export PATH="$HOME/.miniforge/bin:$PATH" - name: Install dependencies shell: bash -l {0} run: | From e4446f1e2a125324b87a943412cc28745716f947 Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 15:04:57 -0400 Subject: [PATCH 4/9] Make channels explicit --- .github/workflows/lint.yml | 9 +++------ .github/workflows/unit-test.yml | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 578be39b..699c3b7c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,14 +18,11 @@ jobs: with: activate-environment: onair environment-file: environment_dev.yml + channels: conda-forge, nodefaults python-version: ${{ matrix.python-version }} auto-activate-base: false - - name: Install miniforge - run: | - curl -fsSL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -o miniforge.sh - bash miniforge.sh -b -p $HOME/.miniforge - - export PATH="$HOME/.miniforge/bin:$PATH" + miniforge-version: latest + run: conda config --show channels - name: Lint Project shell: bash -l {0} run: pylint onair plugins test diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index b5a5be39..277f8245 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -18,14 +18,11 @@ jobs: with: activate-environment: onair environment-file: environment_dev.yml + channels: conda-forge, nodefaults python-version: ${{ matrix.python-version }} auto-activate-base: false - - name: Install miniforge - run: | - curl -fsSL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -o miniforge.sh - bash miniforge.sh -b -p $HOME/.miniforge - - export PATH="$HOME/.miniforge/bin:$PATH" + miniforge-version: latest + run: conda config --show channels - name: Install dependencies shell: bash -l {0} run: | From 883cc3af5eaceaa23e8bf8b3770eead222845c6e Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 15:07:02 -0400 Subject: [PATCH 5/9] Fix flow, add new task --- .github/workflows/lint.yml | 1 + .github/workflows/unit-test.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 699c3b7c..2c6f7e96 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,6 +22,7 @@ jobs: python-version: ${{ matrix.python-version }} auto-activate-base: false miniforge-version: latest + - name: Confirm no defaults post install run: conda config --show channels - name: Lint Project shell: bash -l {0} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 277f8245..d62ebdf9 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -22,6 +22,7 @@ jobs: python-version: ${{ matrix.python-version }} auto-activate-base: false miniforge-version: latest + - name: Confirm no defaults post install run: conda config --show channels - name: Install dependencies shell: bash -l {0} From b7250c5362773e74b087d4b5a6f69cf88be50702 Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 15:18:40 -0400 Subject: [PATCH 6/9] Try excluding the channel, running env update --- .github/workflows/lint.yml | 4 +++- .github/workflows/unit-test.yml | 1 + environment.yml | 2 ++ environment_dev.yml | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2c6f7e96..68c05737 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,9 @@ jobs: run: conda config --show channels - name: Lint Project shell: bash -l {0} - run: pylint onair plugins test + run: | + conda env update + pylint onair plugins test - name: Check Formatting shell: bash -l {0} run: black --check . diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index d62ebdf9..9cd6e270 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -28,6 +28,7 @@ jobs: shell: bash -l {0} run: | conda info + conda env update conda list - name: Test with pytest shell: bash -l {0} diff --git a/environment.yml b/environment.yml index 05afba62..c53dedc7 100644 --- a/environment.yml +++ b/environment.yml @@ -2,6 +2,8 @@ name: onair channels: - conda-forge - nodefaults +exclude: + - defaults dependencies: - python>=3.8,<3.13 - numpy diff --git a/environment_dev.yml b/environment_dev.yml index e145b592..0aec63e8 100644 --- a/environment_dev.yml +++ b/environment_dev.yml @@ -2,6 +2,8 @@ name: onair channels: - conda-forge - nodefaults +exclude: + - defaults dependencies: - python>=3.8,<3.13 - numpy From a0803dcf601551142cc766eb83511d2ac39d65bb Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 15:22:42 -0400 Subject: [PATCH 7/9] I don't think exclude works like that --- environment.yml | 2 -- environment_dev.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/environment.yml b/environment.yml index c53dedc7..05afba62 100644 --- a/environment.yml +++ b/environment.yml @@ -2,8 +2,6 @@ name: onair channels: - conda-forge - nodefaults -exclude: - - defaults dependencies: - python>=3.8,<3.13 - numpy diff --git a/environment_dev.yml b/environment_dev.yml index 0aec63e8..e145b592 100644 --- a/environment_dev.yml +++ b/environment_dev.yml @@ -2,8 +2,6 @@ name: onair channels: - conda-forge - nodefaults -exclude: - - defaults dependencies: - python>=3.8,<3.13 - numpy From 9c37423b663bcbc1b54b09aa5cad4680b4e8efbd Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 15:25:12 -0400 Subject: [PATCH 8/9] Remove the channel explictly --- .github/workflows/lint.yml | 2 +- .github/workflows/unit-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 68c05737..3eb4b949 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,7 +27,7 @@ jobs: - name: Lint Project shell: bash -l {0} run: | - conda env update + conda config --remove channels defaults pylint onair plugins test - name: Check Formatting shell: bash -l {0} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 9cd6e270..7fc9b0e2 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -28,7 +28,7 @@ jobs: shell: bash -l {0} run: | conda info - conda env update + conda config --remove channels defaults conda list - name: Test with pytest shell: bash -l {0} From bdeae7e493aeadb50493478b81c1dbb3e62b0c71 Mon Sep 17 00:00:00 2001 From: "Marshall, James C 459937851" Date: Mon, 23 Sep 2024 15:35:41 -0400 Subject: [PATCH 9/9] Remove extra channels check --- .github/workflows/lint.yml | 2 -- .github/workflows/unit-test.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3eb4b949..b553359f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,8 +22,6 @@ jobs: python-version: ${{ matrix.python-version }} auto-activate-base: false miniforge-version: latest - - name: Confirm no defaults post install - run: conda config --show channels - name: Lint Project shell: bash -l {0} run: | diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 7fc9b0e2..49e684f0 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -22,8 +22,6 @@ jobs: python-version: ${{ matrix.python-version }} auto-activate-base: false miniforge-version: latest - - name: Confirm no defaults post install - run: conda config --show channels - name: Install dependencies shell: bash -l {0} run: |