From a4b8b3f605c100d9b221c12f0115fe75b24b0be3 Mon Sep 17 00:00:00 2001 From: chrisholder Date: Sat, 21 Dec 2024 18:00:53 +0000 Subject: [PATCH] [MNT] Swapped tensorflow and pytorch to install only CPU version (#2416) * fix * added periodic to test workflow * swapped files * run all ubuntu versions * remove test file --- .github/actions/cpu_all_extras/action.yml | 35 +++++++++++++++++++++++ .github/workflows/periodic_tests.yml | 21 ++++---------- .github/workflows/pr_examples.yml | 7 ++--- .github/workflows/pr_pytest.yml | 14 +++------ 4 files changed, 47 insertions(+), 30 deletions(-) create mode 100644 .github/actions/cpu_all_extras/action.yml diff --git a/.github/actions/cpu_all_extras/action.yml b/.github/actions/cpu_all_extras/action.yml new file mode 100644 index 0000000000..ff75cd354f --- /dev/null +++ b/.github/actions/cpu_all_extras/action.yml @@ -0,0 +1,35 @@ +name: Pip install all_extras with CPU versions +description: "For CI testing install the CPU version of dependencies with all extras if on ubuntu" + +inputs: + additional_extras: + description: "Comma-separated list of additional extras to install" + required: false + default: "" + +runs: + using: "composite" + steps: + - name: Install CPU TensorFlow + if: runner.os == 'Linux' + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 3 + command: python -m pip install tensorflow-cpu + + - name: Install CPU PyTorch + if: runner.os == 'Linux' + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 3 + command: python -m pip install torch --index-url https://download.pytorch.org/whl/cpu + + - name: Install dependencies + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 3 + command: > + python -m pip install .[all_extras${{ inputs.additional_extras != '' && ',' || '' }}${{ inputs.additional_extras }}] diff --git a/.github/workflows/periodic_tests.yml b/.github/workflows/periodic_tests.yml index 998ec1c887..64e297d68f 100644 --- a/.github/workflows/periodic_tests.yml +++ b/.github/workflows/periodic_tests.yml @@ -65,12 +65,9 @@ jobs: python_version: "3.10" restore_cache: "false" - - name: Install dependencies - uses: nick-fields/retry@v3 + - uses: ./.github/actions/cpu_all_extras with: - timeout_minutes: 30 - max_attempts: 3 - command: python -m pip install .[all_extras,binder,dev] + additional_extras: "dev,binder" - name: Run example notebooks run: .github/utilities/run_examples.sh false @@ -180,12 +177,9 @@ jobs: python_version: ${{ matrix.python-version }} restore_cache: "false" - - name: Install aeon and dependencies - uses: nick-fields/retry@v3 + - uses: ./.github/actions/cpu_all_extras with: - timeout_minutes: 30 - max_attempts: 3 - command: python -m pip install .[all_extras,dev] + additional_extras: "dev" - name: Show dependencies run: python -m pip list @@ -215,12 +209,9 @@ jobs: - name: Disable Numba JIT run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV - - name: Install aeon and dependencies - uses: nick-fields/retry@v3 + - uses: ./.github/actions/cpu_all_extras with: - timeout_minutes: 30 - max_attempts: 3 - command: python -m pip install .[all_extras,unstable_extras,dev] + additional_extras: "unstable_extras,dev" - name: Show dependencies run: python -m pip list diff --git a/.github/workflows/pr_examples.yml b/.github/workflows/pr_examples.yml index 5679830cf9..adc266319d 100644 --- a/.github/workflows/pr_examples.yml +++ b/.github/workflows/pr_examples.yml @@ -38,12 +38,9 @@ jobs: runner_os: ${{ runner.os }} python_version: "3.10" - - name: Install aeon and dependencies - uses: nick-fields/retry@v3 + - uses: ./.github/actions/cpu_all_extras with: - timeout_minutes: 30 - max_attempts: 3 - command: python -m pip install .[all_extras,binder,dev] + additional_extras: "dev,binder" - name: Run example notebooks run: .github/utilities/run_examples.sh ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'full examples run') }} diff --git a/.github/workflows/pr_pytest.yml b/.github/workflows/pr_pytest.yml index 4370bf7221..ae1c792243 100644 --- a/.github/workflows/pr_pytest.yml +++ b/.github/workflows/pr_pytest.yml @@ -88,12 +88,9 @@ jobs: runner_os: ${{ runner.os }} python_version: ${{ matrix.python-version }} - - name: Install aeon and dependencies - uses: nick-fields/retry@v3 + - uses: ./.github/actions/cpu_all_extras with: - timeout_minutes: 30 - max_attempts: 3 - command: python -m pip install .[all_extras,dev] + additional_extras: "dev" - name: Show dependencies run: python -m pip list @@ -120,12 +117,9 @@ jobs: - name: Disable Numba JIT run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV - - name: Install aeon and dependencies - uses: nick-fields/retry@v3 + - uses: ./.github/actions/cpu_all_extras with: - timeout_minutes: 30 - max_attempts: 3 - command: python -m pip install .[all_extras,unstable_extras,dev] + additional_extras: "unstable_extras,dev" - name: Show dependencies run: python -m pip list