From 773734c5b8c4f8b35d954952c309c85f1f41edee Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Mon, 23 Dec 2024 12:16:49 +0100 Subject: [PATCH 01/13] #133: ci: properly source before activating environments --- ci/setup_conda.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/setup_conda.sh b/ci/setup_conda.sh index abb528457..d281de09e 100644 --- a/ci/setup_conda.sh +++ b/ci/setup_conda.sh @@ -39,7 +39,9 @@ do echo "::group::Create conda environment (py${python_version})" conda create -y -n py${python_version} python=${python_version} - . $CONDA_PATH/etc/profile.d/conda.sh && conda activate py${python_version} + source $CONDA_PATH/etc/profile.d/conda.sh + conda activate py${python_version} + echo "Python version: $(python --version)" pip install PyYAML pip install Brotli From 070d6b56172bacaf95cf9dfe8fc5d37670efdb17 Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Mon, 23 Dec 2024 12:29:18 +0100 Subject: [PATCH 02/13] #133: ci: disable conda cache --- .github/workflows/build-and-test-macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 1d9cf0366..b0db61de3 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -77,14 +77,13 @@ jobs: path: | ${{ env.VTK_SRC_DIR }} ${{ env.VTK_BUILD_DIR }} - ${{ env.CONDA_PATH }} ~/.zshrc ~/.bash_profile key: ${{ env.CACHE_KEY }} save-always: true - name: Setup Conda - if: ${{steps.base-cache.outputs.cache-hit != 'true'}} + # if: ${{steps.base-cache.outputs.cache-hit != 'true'}} run: | sudo CONDA_PATH=${{ env.CONDA_PATH }} bash ./ci/setup_conda.sh ${{ join(matrix.host.python) }} From 87114c8f09bdf0a413f5e0de802f1432c12fdcfc Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Mon, 23 Dec 2024 12:58:45 +0100 Subject: [PATCH 03/13] #133: ci: try different conda calls --- ci/setup_conda.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/setup_conda.sh b/ci/setup_conda.sh index d281de09e..406f11dca 100644 --- a/ci/setup_conda.sh +++ b/ci/setup_conda.sh @@ -38,8 +38,9 @@ for python_version in "${versions[@]}" do echo "::group::Create conda environment (py${python_version})" conda create -y -n py${python_version} python=${python_version} + conda env list - source $CONDA_PATH/etc/profile.d/conda.sh + # source $CONDA_PATH/etc/profile.d/conda.sh conda activate py${python_version} echo "Python version: $(python --version)" From 9e1d80b4f206e069bdcb677f01d8c9cae266f3db Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Mon, 23 Dec 2024 13:14:36 +0100 Subject: [PATCH 04/13] #133: ci: add debug prints --- ci/setup_conda.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/setup_conda.sh b/ci/setup_conda.sh index 406f11dca..16bb6ed85 100644 --- a/ci/setup_conda.sh +++ b/ci/setup_conda.sh @@ -32,7 +32,7 @@ echo "Conda path: $(which conda)" echo "Conda version: $(conda --version)" echo "::endgroup::" - +ß versions=(`echo $PYTHON_VERSIONS | sed 's/,/\n/g'`) for python_version in "${versions[@]}" do @@ -43,7 +43,9 @@ do # source $CONDA_PATH/etc/profile.d/conda.sh conda activate py${python_version} + echo "Python: $(which python)" echo "Python version: $(python --version)" + echo "pip: $(which pip)" pip install PyYAML pip install Brotli pip install schema From d5515ae3c4adac107306596bae7a1b26ba6147dc Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Mon, 23 Dec 2024 13:42:01 +0100 Subject: [PATCH 05/13] #133: ci: try conda run instead of activate --- ci/setup_conda.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ci/setup_conda.sh b/ci/setup_conda.sh index 16bb6ed85..e6538f0c2 100644 --- a/ci/setup_conda.sh +++ b/ci/setup_conda.sh @@ -40,16 +40,13 @@ do conda create -y -n py${python_version} python=${python_version} conda env list - # source $CONDA_PATH/etc/profile.d/conda.sh - conda activate py${python_version} - - echo "Python: $(which python)" - echo "Python version: $(python --version)" - echo "pip: $(which pip)" - pip install PyYAML - pip install Brotli - pip install schema - pip install nanobind - conda deactivate + echo "Python version: $(conda run -n py${python_version} python --version)" + echo "Python:$(conda run -n py${python_version} which python)" + echo "pip: $(conda run -n py${python_version} which pip)" + conda run -n py${python_version} pip install PyYAML + conda run -n py${python_version} pip install Brotli + conda run -n py${python_version} pip install schema + conda run -n py${python_version} pip install nanobind + echo "::endgroup::" done From 8981665932eb369e9bfa8b39046d499369992d1c Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Tue, 24 Dec 2024 15:12:55 +0100 Subject: [PATCH 06/13] #133: ci: add debugging --- .github/workflows/build-and-test-macos.yml | 4 ++++ ci/setup_conda.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index b0db61de3..1e6f7e1dd 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -54,6 +54,10 @@ jobs: GCOV: ~ steps: - uses: actions/checkout@v4 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + with: + detached: true - name: Set folder permissions run: | diff --git a/ci/setup_conda.sh b/ci/setup_conda.sh index e6538f0c2..5960d1de2 100644 --- a/ci/setup_conda.sh +++ b/ci/setup_conda.sh @@ -32,7 +32,7 @@ echo "Conda path: $(which conda)" echo "Conda version: $(conda --version)" echo "::endgroup::" -ß + versions=(`echo $PYTHON_VERSIONS | sed 's/,/\n/g'`) for python_version in "${versions[@]}" do From d38371e8eafb3225df7cb4a7389b1e6b81a23069 Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Tue, 24 Dec 2024 15:19:34 +0100 Subject: [PATCH 07/13] #133: ci: change where to load debug session --- .github/workflows/build-and-test-macos.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 1e6f7e1dd..15fa09a8a 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -54,10 +54,6 @@ jobs: GCOV: ~ steps: - uses: actions/checkout@v4 - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - with: - detached: true - name: Set folder permissions run: | @@ -91,6 +87,9 @@ jobs: run: | sudo CONDA_PATH=${{ env.CONDA_PATH }} bash ./ci/setup_conda.sh ${{ join(matrix.host.python) }} + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Reload shell variables run: | if [ -f ~/.zshrc ]; then . ~/.zshrc; fi From a1c666eb9cd0c4fdf98d1e5e348bbcf729080c94 Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Tue, 24 Dec 2024 15:56:37 +0100 Subject: [PATCH 08/13] #133: ci: deactivate base environment before looping through environments --- ci/setup_conda.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/setup_conda.sh b/ci/setup_conda.sh index 5960d1de2..3e827e981 100644 --- a/ci/setup_conda.sh +++ b/ci/setup_conda.sh @@ -30,6 +30,7 @@ if [ -f ~/.bashrc ]; then . ~/.bashrc; fi echo "Conda path: $(which conda)" echo "Conda version: $(conda --version)" +conda deactivate echo "::endgroup::" From 215b0b4340856cc78a09b10fe9360fa51944627f Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Mon, 30 Dec 2024 22:38:32 +0100 Subject: [PATCH 09/13] #133: ci: Fix conda env grep regex for MacOS --- .github/workflows/build-and-test-macos.yml | 3 --- ci/python_build.sh | 4 ++-- ci/python_test.sh | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 15fa09a8a..b0db61de3 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -87,9 +87,6 @@ jobs: run: | sudo CONDA_PATH=${{ env.CONDA_PATH }} bash ./ci/setup_conda.sh ${{ join(matrix.host.python) }} - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - name: Reload shell variables run: | if [ -f ~/.zshrc ]; then . ~/.zshrc; fi diff --git a/ci/python_build.sh b/ci/python_build.sh index 71b8022de..f880e8901 100644 --- a/ci/python_build.sh +++ b/ci/python_build.sh @@ -11,8 +11,8 @@ VTK_DIR="${VTK_DIR:-$PARENT_DIR/vtk/build}" VT_TV_SRC_DIR=${VT_TV_SRC_DIR:-$PARENT_DIR} -for env in $(conda env list | grep ^py | perl -lane 'print $F[-1]' | xargs ls -lrt1d | perl -lane 'print $F[-1]' | sed -r 's/^.*\/(.*)$/\1/'); do - echo "::group::Build Python Bindings (${python_version})" +for env in $(conda env list | grep -E '^py' | perl -lane 'print $F[-1]' | xargs ls -ld | perl -lane 'print $F[-1]' | sed -E 's|^.*/(.*)$|\1|'); do + echo "::group::Build Python Bindings (${env})" # Activate conda environment . $CONDA_PATH/etc/profile.d/conda.sh && conda activate $env diff --git a/ci/python_test.sh b/ci/python_test.sh index b2a294363..40a5caa04 100644 --- a/ci/python_test.sh +++ b/ci/python_test.sh @@ -15,11 +15,11 @@ pushd $VT_TV_SRC_DIR # Create vizualization output directory (required). mkdir -p $VT_TV_OUTPUT_DIR/python_tests -for env in $(conda env list | grep ^py | perl -lane 'print $F[-1]' | xargs ls -lrt1d | perl -lane 'print $F[-1]' | sed -r 's/^.*\/(.*)$/\1/'); do +for env in $(conda env list | grep -E '^py' | perl -lane 'print $F[-1]' | xargs ls -ld | perl -lane 'print $F[-1]' | sed -E 's|^.*/(.*)$|\1|'); do # Clear vizualization output directory rm -rf $VT_TV_OUTPUT_DIR/python_tests/* - echo "::group::Test Python Bindings (${python_version})" + echo "::group::Test Python Bindings (${env})" # Activate conda environment . $CONDA_PATH/etc/profile.d/conda.sh && conda activate $env From 5c33af754e41a5c079c2433d1a3ffef9e73b3ca7 Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Tue, 14 Jan 2025 17:24:59 +0100 Subject: [PATCH 10/13] #133: ci: Install necessary pip packages for JSON validation on MacOS --- .github/workflows/build-and-test-macos.yml | 4 ++++ ci/python_build.sh | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index b0db61de3..8735ca28e 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -70,6 +70,10 @@ jobs: run: | brew update && brew install coreutils lcov xquartz + - name: Setup python requirements for JSON datafile validation + run: | + pip install PyYAML && pip install Brotli && pip install schema && pip install nanobind + - name: Load cache (VTK, Miniconda3) id: base-cache uses: actions/cache@v4 diff --git a/ci/python_build.sh b/ci/python_build.sh index f880e8901..de09bf574 100644 --- a/ci/python_build.sh +++ b/ci/python_build.sh @@ -11,6 +11,16 @@ VTK_DIR="${VTK_DIR:-$PARENT_DIR/vtk/build}" VT_TV_SRC_DIR=${VT_TV_SRC_DIR:-$PARENT_DIR} +$CONDA_PATH/bin/conda init bash +$CONDA_PATH/bin/conda init zsh +if [ -f ~/.zshrc ]; then . ~/.zshrc; fi +if [ -f ~/.profile ]; then . ~/.profile; fi +if [ -f ~/.bashrc ]; then . ~/.bashrc; fi + +echo "Conda path: $(which conda)" +echo "Conda version: $(conda --version)" +conda deactivate + for env in $(conda env list | grep -E '^py' | perl -lane 'print $F[-1]' | xargs ls -ld | perl -lane 'print $F[-1]' | sed -E 's|^.*/(.*)$|\1|'); do echo "::group::Build Python Bindings (${env})" From 0b11dc769964b25c5e11cb47b25edd7ca2256c03 Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Tue, 14 Jan 2025 18:33:00 +0100 Subject: [PATCH 11/13] #133: ci: Remove deprecated MacOS version and fix test script --- .github/workflows/build-and-test-macos.yml | 7 ------- ci/python_test.sh | 10 ++++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 8735ca28e..2ca9f3712 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -14,13 +14,6 @@ jobs: fail-fast: false matrix: host: [ - { - base: macos-12, - compiler: { cc: clang, cxx: clang++ }, - gcov: llvm-gcov, - python: ['3.8', '3.9', '3.10', '3.11', '3.12'], - vtk: '9.3.1' - }, { base: macos-13, compiler: { cc: clang, cxx: clang++ }, diff --git a/ci/python_test.sh b/ci/python_test.sh index 40a5caa04..404fb0188 100644 --- a/ci/python_test.sh +++ b/ci/python_test.sh @@ -15,6 +15,16 @@ pushd $VT_TV_SRC_DIR # Create vizualization output directory (required). mkdir -p $VT_TV_OUTPUT_DIR/python_tests +$CONDA_PATH/bin/conda init bash +$CONDA_PATH/bin/conda init zsh +if [ -f ~/.zshrc ]; then . ~/.zshrc; fi +if [ -f ~/.profile ]; then . ~/.profile; fi +if [ -f ~/.bashrc ]; then . ~/.bashrc; fi + +echo "Conda path: $(which conda)" +echo "Conda version: $(conda --version)" +conda deactivate + for env in $(conda env list | grep -E '^py' | perl -lane 'print $F[-1]' | xargs ls -ld | perl -lane 'print $F[-1]' | sed -E 's|^.*/(.*)$|\1|'); do # Clear vizualization output directory rm -rf $VT_TV_OUTPUT_DIR/python_tests/* From c76e8758cad508769fef458543dc14c9b6ff6288 Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Tue, 14 Jan 2025 19:03:34 +0100 Subject: [PATCH 12/13] #133: ci: Re-enable conda caching --- .github/workflows/build-and-test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 2ca9f3712..879cc31b6 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -80,7 +80,7 @@ jobs: save-always: true - name: Setup Conda - # if: ${{steps.base-cache.outputs.cache-hit != 'true'}} + if: ${{steps.base-cache.outputs.cache-hit != 'true'}} run: | sudo CONDA_PATH=${{ env.CONDA_PATH }} bash ./ci/setup_conda.sh ${{ join(matrix.host.python) }} From edb25118a9769f2bd87d2c0143ff3b47b2ea4e12 Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Tue, 14 Jan 2025 19:04:09 +0100 Subject: [PATCH 13/13] #133: ci: Re-enable conda caching --- .github/workflows/build-and-test-macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 879cc31b6..ab0a2f103 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -74,6 +74,7 @@ jobs: path: | ${{ env.VTK_SRC_DIR }} ${{ env.VTK_BUILD_DIR }} + ${{ env.CONDA_PATH }} ~/.zshrc ~/.bash_profile key: ${{ env.CACHE_KEY }}