From 189568dfd70dc506fcbca3d87587dc18accfaaf7 Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:43:06 +0100 Subject: [PATCH 1/7] As per docs of setup-miniconda GH action, conda 23.10 and above uses conda-libmamba-solver by default, which provides comparable performance to mamba --- .github/workflows/build_and_test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 97baaa576..64e4bab37 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -68,14 +68,13 @@ jobs: - uses: actions/checkout@v4 - - name: Setup conda environment using mamba - # This step sets up a conda environment using mamba, a faster alternative to conda. It creates an empty conda environment with the name 'tudat' and activates it. The environment is created using the latest version of Mambaforge, a conda distribution that includes mamba. + - name: Setup conda environment + # This step creates an empty conda environment with the name 'tudat' and activates it. Use latest conda version. uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: tudat - use-mamba: true + activate-environment: tudat + conda-version: 'latest' + - name: Get date From d60f48527befe1594b328c02cd04b21eccfe7670 Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:53:00 +0100 Subject: [PATCH 2/7] do not activate base upon creation of conda env --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 64e4bab37..65a65719a 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -73,10 +73,10 @@ jobs: uses: conda-incubator/setup-miniconda@v3 with: activate-environment: tudat + auto-activate-base: false conda-version: 'latest' - - name: Get date # Get the current date and time in UTC format. This step is used to create a unique cache key for the conda environment cache by appending the date to the cache key. # GitHub cache action doucmentation recommends refreshing the cache every 24 hours to avoid inconsistencies of package versions between the CI pipeline and local installations. This is ensured by appending the date to the cache key.See https://github.com/marketplace/actions/setup-miniconda#caching-environments for more detail. From c0afb5b259dc7ff723f540e86dc42c9130555b88 Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:50:56 +0100 Subject: [PATCH 3/7] use default conda version --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 65a65719a..1507f804b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -74,7 +74,7 @@ jobs: with: activate-environment: tudat auto-activate-base: false - conda-version: 'latest' + - name: Get date From 6942f480aeaad1dd5d757d7fc4258136a9debc92 Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:52:52 +0100 Subject: [PATCH 4/7] replace mamba with conda --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 1507f804b..15da5af5d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -96,7 +96,7 @@ jobs: - name: Create conda environment from environment.yml # Update the tudat conda environment created using the environment.yml file if the cache is not restored - run: mamba env update -n tudat -f environment.yml + run: conda env update -n tudat -f environment.yml if: steps.cache.outputs.cache-hit != 'true' From 55f9f85190f47986fa47e6e18201a011b99ad4ca Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:58:48 +0100 Subject: [PATCH 5/7] Debug conda cache step: print cond env location on the runner --- .github/workflows/build_and_test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 15da5af5d..dd8d74475 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -75,7 +75,8 @@ jobs: activate-environment: tudat auto-activate-base: false - + - name: Print conda environment information + run: conda info --envs - name: Get date # Get the current date and time in UTC format. This step is used to create a unique cache key for the conda environment cache by appending the date to the cache key. @@ -84,6 +85,8 @@ jobs: run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT shell: bash + - name: Debug conda environment path + run: ls -la ${{ matrix.path_conda_env }} - name: Cache conda environment # Cache the conda environment to avoid re-installing the same packages every time the workflow runs. The cache key is based on the environment.yml file, the operating system, and the date. The cache is restored if the cache key matches the cache key of the previous run. From 9e52467caa0dbeac0853b0f74ab25d189c243032 Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:02:26 +0100 Subject: [PATCH 6/7] conda env location on the runner must be updated after changes to the setup conda environment step --- .github/workflows/build_and_test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index dd8d74475..5227f6cb4 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -39,12 +39,12 @@ jobs: c_compiler: cl cpp_compiler: cl label: win-64 - path_conda_env: C:\Miniconda3\envs\tudat + path_conda_env: C:\Miniconda\envs\tudat - os: ubuntu-latest c_compiler: gcc cpp_compiler: g++ label: linux-64 - path_conda_env: /usr/share/miniconda3/envs/tudat + path_conda_env: /usr/share/miniconda/envs/tudat - os: macos-latest c_compiler: clang cpp_compiler: clang++ @@ -85,8 +85,6 @@ jobs: run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT shell: bash - - name: Debug conda environment path - run: ls -la ${{ matrix.path_conda_env }} - name: Cache conda environment # Cache the conda environment to avoid re-installing the same packages every time the workflow runs. The cache key is based on the environment.yml file, the operating system, and the date. The cache is restored if the cache key matches the cache key of the previous run. From 28b30093ddaef879575f98f12b9975851d39a383 Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:02:48 +0100 Subject: [PATCH 7/7] Conda cache step failure issue fixed. Remove debug print --- .github/workflows/build_and_test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 5227f6cb4..fa28f4e95 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -75,8 +75,6 @@ jobs: activate-environment: tudat auto-activate-base: false - - name: Print conda environment information - run: conda info --envs - name: Get date # Get the current date and time in UTC format. This step is used to create a unique cache key for the conda environment cache by appending the date to the cache key.