From d02da26f975c3d0d10570a0f8fc4b4392cf8bca4 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Thu, 11 Dec 2025 10:32:46 +0200 Subject: [PATCH 1/6] Configure UV_CACHE_DIR in workflow Set UV_CACHE_DIR for both installation and trial imports, unset HTTP proxies for the turso environment. --- .github/workflows/test_python_turso.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index 779bacbfb..51093864e 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -27,6 +27,9 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | + export UV_CACHE_DIR=../.cache/uv + export HTTP_PROXY= + export HTTPS_PROXY= export TMPDIR=$RUNNER_TEMP uv venv CI_env . CI_env/bin/activate @@ -34,6 +37,7 @@ jobs: - name: Trial imports run: | export TMPDIR=$RUNNER_TEMP + export UV_CACHE_DIR=../.cache . CI_env/bin/activate python -c 'import analysator as pt' python -c 'import analysator as pt;pt.plot.__dict__' From ef49a57e2beb02715d38357a62f57cd3ea04f93f Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Thu, 11 Dec 2025 10:47:13 +0200 Subject: [PATCH 2/6] Refactor cache setting to proper top-level env ... and remove proxy unsets, since those are already in use by the runner. --- .github/workflows/test_python_turso.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index 51093864e..b22f508f1 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -15,6 +15,8 @@ on: jobs: turso_system: + env: + UV_CACHE_DIR: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv if: github.repository_owner == 'fmihpc' runs-on: carrington strategy: @@ -25,11 +27,11 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Install dependencies run: | - export UV_CACHE_DIR=../.cache/uv - export HTTP_PROXY= - export HTTPS_PROXY= export TMPDIR=$RUNNER_TEMP uv venv CI_env . CI_env/bin/activate @@ -37,7 +39,6 @@ jobs: - name: Trial imports run: | export TMPDIR=$RUNNER_TEMP - export UV_CACHE_DIR=../.cache . CI_env/bin/activate python -c 'import analysator as pt' python -c 'import analysator as pt;pt.plot.__dict__' From cf58faa3fcf416a0d0763a8f7a53df2ab0b020f6 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Thu, 11 Dec 2025 10:54:13 +0200 Subject: [PATCH 3/6] Add uv cache restore step to workflow UV keeps resetting cache folder. More manual approach: Added step to restore uv cache in GitHub Actions workflow. --- .github/workflows/test_python_turso.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index b22f508f1..8a34a6f02 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -27,8 +27,13 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 + - name: Restore uv cache with: - enable-cache: true + path: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv + key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + restore-keys: | + uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + uv-${{ runner.os }} - name: Install dependencies run: | From b061a18c1cf4dc755065eb94f7aff7a87ba63ae9 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Thu, 11 Dec 2025 11:11:36 +0200 Subject: [PATCH 4/6] Add missing uses: to workflow --- .github/workflows/test_python_turso.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index 8a34a6f02..f1ccb4550 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -28,6 +28,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - name: Restore uv cache + uses: actions/cache@v4 with: path: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} From d16459c5e529ecf8f07f96d6c682270ccadb7ead Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Wed, 17 Dec 2025 14:22:10 +0200 Subject: [PATCH 5/6] Update UV_CACHE_DIR and cache key in workflow uv pip mode compliance, another, more focused cache dir --- .github/workflows/test_python_turso.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index f1ccb4550..b90d0c458 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -16,7 +16,8 @@ jobs: turso_system: env: - UV_CACHE_DIR: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv + UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv + # UV_CACHE_DIR: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv if: github.repository_owner == 'fmihpc' runs-on: carrington strategy: @@ -31,9 +32,9 @@ jobs: uses: actions/cache@v4 with: path: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + key: uv-${{ runner.os }}-${{ hashFiles('requirements.txt') }} restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + uv-${{ runner.os }}-${{ hashFiles('requirements.txt') }} uv-${{ runner.os }} - name: Install dependencies From 13207cbc82d4c74f8ee62be62af257752aaef344 Mon Sep 17 00:00:00 2001 From: Markku Alho Date: Wed, 17 Dec 2025 14:39:40 +0200 Subject: [PATCH 6/6] Comment out UV_CACHE_DIR and cache restoration Comment out environment variable and cache restoration steps in the workflow, as they keep on pointing under user home. Trying out a symlink to the CI dir definitely on the same filesystem. --- .github/workflows/test_python_turso.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test_python_turso.yml b/.github/workflows/test_python_turso.yml index b90d0c458..cae40b872 100644 --- a/.github/workflows/test_python_turso.yml +++ b/.github/workflows/test_python_turso.yml @@ -15,8 +15,8 @@ on: jobs: turso_system: - env: - UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv + # env: + # UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv # UV_CACHE_DIR: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv if: github.repository_owner == 'fmihpc' runs-on: carrington @@ -28,14 +28,14 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv - key: uv-${{ runner.os }}-${{ hashFiles('requirements.txt') }} - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('requirements.txt') }} - uv-${{ runner.os }} + # - name: Restore uv cache + # uses: actions/cache@v4 + # with: + # path: /wrk-kappa/group/spacephysics/analysator/CI/.cache/uv + # key: uv-${{ runner.os }}-${{ hashFiles('requirements.txt') }} + # restore-keys: | + # uv-${{ runner.os }}-${{ hashFiles('requirements.txt') }} + # uv-${{ runner.os }} - name: Install dependencies run: |