From ee1b3afd0bfeb23d5603e88d59404434e512db16 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Wed, 24 Sep 2025 11:38:48 -0400 Subject: [PATCH 1/4] Automatically upload CSV files as artifacts during CI runs --- .github/workflows/run_batch_script.yml | 6 ++++++ .github/workflows/run_script_and_create_release.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/run_batch_script.yml b/.github/workflows/run_batch_script.yml index 4553393..f258e9e 100644 --- a/.github/workflows/run_batch_script.yml +++ b/.github/workflows/run_batch_script.yml @@ -50,6 +50,12 @@ jobs: cd "${{ github.event.repository.name }}/multi_subject" sct_run_batch -script process_data.sh -config config.yml + - name: "Upload CSV files for easier tutorial updating" + uses: actions/upload-artifact@v4 + with: + name: Multi Subject CSV Files + path: multi_subject/output/**/*.csv + - name: Output full log for sanity checking run: | cd "${{ github.event.repository.name }}/multi_subject/output/log" diff --git a/.github/workflows/run_script_and_create_release.yml b/.github/workflows/run_script_and_create_release.yml index 5633e6c..a48bab3 100644 --- a/.github/workflows/run_script_and_create_release.yml +++ b/.github/workflows/run_script_and_create_release.yml @@ -60,6 +60,12 @@ jobs: cd "${{ github.event.repository.name }}/single_subject" ./batch_single_subject.sh + - name: "Upload CSV files for easier tutorial updating" + uses: actions/upload-artifact@v4 + with: + name: Single Subject CSV Files + path: single_subject/data/**/*.csv + - name: "Package data into tutorial-specific .zip files" run: | cd ${{ github.event.repository.name }} From 47a5f886fefb2987d44fe32b461f94d2cb0415ac Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Wed, 24 Sep 2025 12:15:59 -0400 Subject: [PATCH 2/4] Turn on logging outputs for multi-subject by default --- .github/workflows/run_batch_script.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run_batch_script.yml b/.github/workflows/run_batch_script.yml index f258e9e..9911fde 100644 --- a/.github/workflows/run_batch_script.yml +++ b/.github/workflows/run_batch_script.yml @@ -57,16 +57,20 @@ jobs: path: multi_subject/output/**/*.csv - name: Output full log for sanity checking + if: always() run: | cd "${{ github.event.repository.name }}/multi_subject/output/log" - for logfile in process_data_sub-01.log err.process_data_sub-01.log; do - if [[ -e "${logfile}" ]]; then - echo "=== Contents of ${logfile} ===" - cat "${logfile}" - else - echo "=== No file ${logfile} ===" - fi - done + for subxx in sub-01 sub-03 sub-05; do + for logfile in process_data_${subxx}.log err.process_data_${subxx}.log; do + if [[ -e "${logfile}" ]]; then + echo "=== Contents of ${logfile} ===" + cat "${logfile}" + else + echo "=== No file ${logfile} ===" + fi + done + done + - name: Check results (no error logs) if: always() From 5ca3ca7fcfc8a2577b803c2dc01960c97a60a3b9 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Thu, 25 Sep 2025 11:23:21 -0400 Subject: [PATCH 3/4] =?UTF-8?q?`run=5Fbatch=5Fscript.yml`:=20Predownload?= =?UTF-8?q?=20`spinalcord`=20model=20`#=20=E2=86=91=20--------------------?= =?UTF-8?q?---------------------------------------=2070=20=E2=86=92=20?= =?UTF-8?q?=E2=96=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should hopefully avoid `PyTorchStreamReader` errors. --- .github/workflows/run_batch_script.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/run_batch_script.yml b/.github/workflows/run_batch_script.yml index 9911fde..ce845f7 100644 --- a/.github/workflows/run_batch_script.yml +++ b/.github/workflows/run_batch_script.yml @@ -40,6 +40,10 @@ jobs: cat ~/.bashrc | grep "export SCT_DIR" | cut -d " " -f 2 >> $GITHUB_ENV cat ~/.bashrc | grep "export PATH" | grep -o "/.*" | cut -d ':' -f 1 >> $GITHUB_PATH + - name: Pre-download necessary models + run: | + sct_deepseg spinalcord -install + - name: "Checkout '${{ github.event.repository.name }}'" uses: actions/checkout@v4 with: From fa94ef01a995a421d5f93d0e68dfc6b3ed67e4de Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Wed, 29 Oct 2025 11:17:14 -0400 Subject: [PATCH 4/4] Fix paths to CSV files for updating --- .github/workflows/run_batch_script.yml | 2 +- .github/workflows/run_script_and_create_release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_batch_script.yml b/.github/workflows/run_batch_script.yml index ce845f7..5182ac3 100644 --- a/.github/workflows/run_batch_script.yml +++ b/.github/workflows/run_batch_script.yml @@ -58,7 +58,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Multi Subject CSV Files - path: multi_subject/output/**/*.csv + path: ${{ github.event.repository.name }}/multi_subject/output/**/*.csv - name: Output full log for sanity checking if: always() diff --git a/.github/workflows/run_script_and_create_release.yml b/.github/workflows/run_script_and_create_release.yml index a48bab3..2851ad2 100644 --- a/.github/workflows/run_script_and_create_release.yml +++ b/.github/workflows/run_script_and_create_release.yml @@ -64,7 +64,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Single Subject CSV Files - path: single_subject/data/**/*.csv + path: ${{ github.event.repository.name }}/single_subject/data/**/*.csv - name: "Package data into tutorial-specific .zip files" run: |