From eb327e198d491c66e51657677a2d395321696738 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 11:55:34 +0200 Subject: [PATCH 01/19] feat: add disk space usage reporting and cleanup steps in local testing workflow --- .github/workflows/test-local.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index 1e650ec75e..a06fdf1f7a 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -288,4 +288,43 @@ jobs: with: name: ${{ inputs.file-name }}.xml path: ./${{ inputs.file-name }}.xml + + - name: "Show space consumption" + shell: bash + run: | + echo "Disk space:" + df -h + echo "" + echo "Disk usage" + echo "==========" + echo "Disk usage in current directory:" + du -sh * + + echo "Disk usage in /home:" + du -sh /home/* + + echo "Disk usage root /:" + du -sh /* + echo "Disk usage in /usr:" + du -sh /usr/* + + echo "Disk usage in /tmp:" + du -sh /tmp/* + + echo "Disk usage in /var/tmp:" + du -sh /var/tmp/* + + - name: Free Disk Space Before Build + run: | + echo "Disk space before cleanup:" + df -h + sudo rm -rf /usr/local/.ghcup + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo rm -rf /usr/local/lib/android/sdk/ndk + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/share/boost + sudo apt-get clean + echo "Disk space after cleanup:" + df -h \ No newline at end of file From a7bafbfc621c29addee9568ca7978936269c257c Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 11:55:59 +0200 Subject: [PATCH 02/19] feat: add disk space cleanup step before build in local testing workflow --- .github/workflows/test-local.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index a06fdf1f7a..d30b77b468 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -132,6 +132,20 @@ jobs: password: ${{ secrets.token }} steps: + - name: Free Disk Space Before Build + run: | + echo "Disk space before cleanup:" + df -h + sudo rm -rf /usr/local/.ghcup + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo rm -rf /usr/local/lib/android/sdk/ndk + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/share/boost + sudo apt-get clean + echo "Disk space after cleanup:" + df -h + - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 with: From 1c9746d3e196cc7182b2911cf25546f5ccb41987 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 7 May 2025 10:01:36 +0000 Subject: [PATCH 03/19] chore: adding changelog file 3900.fixed.md [dependabot-skip] --- doc/changelog.d/3900.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/3900.fixed.md diff --git a/doc/changelog.d/3900.fixed.md b/doc/changelog.d/3900.fixed.md new file mode 100644 index 0000000000..86e886f685 --- /dev/null +++ b/doc/changelog.d/3900.fixed.md @@ -0,0 +1 @@ +fix: reducing space consumption in github runners \ No newline at end of file From 7e6c2ba66eeb75368cc590a844026c7a5cc2d09a Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 12:10:51 +0200 Subject: [PATCH 04/19] feat: enhance disk space reporting in local testing workflow --- .github/workflows/test-local.yml | 54 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index d30b77b468..18323f6dba 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -132,19 +132,31 @@ jobs: password: ${{ secrets.token }} steps: - - name: Free Disk Space Before Build + - name: "Show space consumption" + shell: bash run: | - echo "Disk space before cleanup:" - df -h - sudo rm -rf /usr/local/.ghcup - sudo rm -rf /opt/hostedtoolcache/CodeQL - sudo rm -rf /usr/local/lib/android/sdk/ndk - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf /usr/local/share/boost - sudo apt-get clean - echo "Disk space after cleanup:" + echo "Disk space:" df -h + echo "" + echo "Disk usage" + echo "==========" + echo "Disk usage in current directory:" + du -sh * + + echo "Disk usage in /home:" + du -sh /home/* + + echo "Disk usage root /:" + du -sh /* + + echo "Disk usage in /usr:" + du -sh /usr/* + + echo "Disk usage in /tmp:" + du -sh /tmp/* + + echo "Disk usage in /var/tmp:" + du -sh /var/tmp/* - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 @@ -176,13 +188,13 @@ jobs: shell: bash if: inputs.testing-minimal == true run: | - apt-get update && apt install -y libgomp1 graphviz + apt-get update && apt install -y libgomp1 graphviz && apt-get clean - name: "Installing OS packages" shell: bash if: inputs.testing-minimal == false run: | - apt-get update && apt install -y libgl1-mesa-glx xvfb libgomp1 graphviz + apt-get update && apt install -y libgl1-mesa-glx xvfb libgomp1 graphviz && apt-get clean - name: "Setup Python" uses: actions/setup-python@v5 @@ -302,7 +314,7 @@ jobs: with: name: ${{ inputs.file-name }}.xml path: ./${{ inputs.file-name }}.xml - + - name: "Show space consumption" shell: bash run: | @@ -328,17 +340,3 @@ jobs: echo "Disk usage in /var/tmp:" du -sh /var/tmp/* - - - name: Free Disk Space Before Build - run: | - echo "Disk space before cleanup:" - df -h - sudo rm -rf /usr/local/.ghcup - sudo rm -rf /opt/hostedtoolcache/CodeQL - sudo rm -rf /usr/local/lib/android/sdk/ndk - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf /usr/local/share/boost - sudo apt-get clean - echo "Disk space after cleanup:" - df -h \ No newline at end of file From 7f52e41c9539ab0bf5b18d53e73ff65fe837de7d Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 12:18:25 +0200 Subject: [PATCH 05/19] fix: update disk usage reporting to show current directory size --- .github/workflows/test-local.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index 18323f6dba..28c1113e6f 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -137,11 +137,12 @@ jobs: run: | echo "Disk space:" df -h + echo "" echo "Disk usage" echo "==========" echo "Disk usage in current directory:" - du -sh * + du -sh . echo "Disk usage in /home:" du -sh /home/* From c052c99dbb3b3fea9747ca04e9434cb477cd0d93 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 12:31:02 +0200 Subject: [PATCH 06/19] fix: improve disk usage reporting with error handling in local testing workflow --- .github/workflows/test-local.yml | 61 +++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index 28c1113e6f..299ecb8258 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -142,22 +142,59 @@ jobs: echo "Disk usage" echo "==========" echo "Disk usage in current directory:" - du -sh . + du -shx . || echo "Failed to get disk usage" echo "Disk usage in /home:" - du -sh /home/* + du -shx /home/* || echo "Failed to get disk usage" echo "Disk usage root /:" - du -sh /* + du -shx /* || echo "Failed to get disk usage" echo "Disk usage in /usr:" - du -sh /usr/* + du -shx /usr/* || echo "Failed to get disk usage" echo "Disk usage in /tmp:" - du -sh /tmp/* + du -shx /tmp/* || echo "Failed to get disk usage" echo "Disk usage in /var/tmp:" - du -sh /var/tmp/* + du -shx /var/tmp/* || echo "Failed to get disk usage" + + - name: "uninstall" + shell: bash + run: | + apt-get remove --purge --auto-remove -y \ + azure-cli google-cloud-sdk dotnet-sdk-* \ + mono-devel mysql* php* android-sdk* \ + firefox google-chrome-stable && \ + apt-get clean && \ + (rm -rf /usr/local/lib/android || true ) + + - name: "Show space consumption" + shell: bash + run: | + echo "Disk space:" + df -h + + echo "" + echo "Disk usage" + echo "==========" + echo "Disk usage in current directory:" + du -shx . || echo "Failed to get disk usage" + + echo "Disk usage in /home:" + du -shx /home/* || echo "Failed to get disk usage"" + + echo "Disk usage root /:" + du -shx /* || echo "Failed to get disk usage"" + + echo "Disk usage in /usr:" + du -shx /usr/* || echo "Failed to get disk usage"" + + echo "Disk usage in /tmp:" + du -shx /tmp/* || echo "Failed to get disk usage"" + + echo "Disk usage in /var/tmp:" + du -shx /var/tmp/* || echo "Failed to get disk usage"" - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 @@ -325,19 +362,19 @@ jobs: echo "Disk usage" echo "==========" echo "Disk usage in current directory:" - du -sh * + du -shx * || echo "Failed to get disk usage" echo "Disk usage in /home:" - du -sh /home/* + du -shx /home/* || echo "Failed to get disk usage"" echo "Disk usage root /:" - du -sh /* + du -shx /* || echo "Failed to get disk usage"" echo "Disk usage in /usr:" - du -sh /usr/* + du -shx /usr/* || echo "Failed to get disk usage"" echo "Disk usage in /tmp:" - du -sh /tmp/* + du -shx /tmp/* || echo "Failed to get disk usage"" echo "Disk usage in /var/tmp:" - du -sh /var/tmp/* + du -shx /var/tmp/* || echo "Failed to get disk usage"" From e3a04ea1dce8d9736c57b89d92a0ab5b6a2f9ddc Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 12:50:08 +0200 Subject: [PATCH 07/19] fix: remove redundant disk usage checks and streamline reporting in local testing workflow --- .github/workflows/test-local.yml | 55 ++------------------------------ 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index 299ecb8258..340ff4d8d1 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -153,49 +153,6 @@ jobs: echo "Disk usage in /usr:" du -shx /usr/* || echo "Failed to get disk usage" - echo "Disk usage in /tmp:" - du -shx /tmp/* || echo "Failed to get disk usage" - - echo "Disk usage in /var/tmp:" - du -shx /var/tmp/* || echo "Failed to get disk usage" - - - name: "uninstall" - shell: bash - run: | - apt-get remove --purge --auto-remove -y \ - azure-cli google-cloud-sdk dotnet-sdk-* \ - mono-devel mysql* php* android-sdk* \ - firefox google-chrome-stable && \ - apt-get clean && \ - (rm -rf /usr/local/lib/android || true ) - - - name: "Show space consumption" - shell: bash - run: | - echo "Disk space:" - df -h - - echo "" - echo "Disk usage" - echo "==========" - echo "Disk usage in current directory:" - du -shx . || echo "Failed to get disk usage" - - echo "Disk usage in /home:" - du -shx /home/* || echo "Failed to get disk usage"" - - echo "Disk usage root /:" - du -shx /* || echo "Failed to get disk usage"" - - echo "Disk usage in /usr:" - du -shx /usr/* || echo "Failed to get disk usage"" - - echo "Disk usage in /tmp:" - du -shx /tmp/* || echo "Failed to get disk usage"" - - echo "Disk usage in /var/tmp:" - du -shx /var/tmp/* || echo "Failed to get disk usage"" - - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 with: @@ -365,16 +322,10 @@ jobs: du -shx * || echo "Failed to get disk usage" echo "Disk usage in /home:" - du -shx /home/* || echo "Failed to get disk usage"" + du -shx /home/* || echo "Failed to get disk usage" echo "Disk usage root /:" - du -shx /* || echo "Failed to get disk usage"" + du -shx /* || echo "Failed to get disk usage" echo "Disk usage in /usr:" - du -shx /usr/* || echo "Failed to get disk usage"" - - echo "Disk usage in /tmp:" - du -shx /tmp/* || echo "Failed to get disk usage"" - - echo "Disk usage in /var/tmp:" - du -shx /var/tmp/* || echo "Failed to get disk usage"" + du -shx /usr/* || echo "Failed to get disk usage" From b1944672fdd1749b9c6537ea84e11e077a05d700 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 13:28:51 +0200 Subject: [PATCH 08/19] fix: replace cp with mv for log file handling in local and remote scripts --- .ci/collect_mapdl_logs_locals.sh | 10 +++++----- .ci/collect_mapdl_logs_remote.sh | 27 ++++++++++++--------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.ci/collect_mapdl_logs_locals.sh b/.ci/collect_mapdl_logs_locals.sh index 9d9bf3f6e1..039185c5e5 100755 --- a/.ci/collect_mapdl_logs_locals.sh +++ b/.ci/collect_mapdl_logs_locals.sh @@ -2,15 +2,15 @@ mkdir "$LOG_NAMES" && echo "Successfully generated directory $LOG_NAMES" echo "Copying the log files..." -cp *.log ./"$LOG_NAMES"/ || echo "No log files could be found" -cp *apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found" -cp *pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found" +mv *.log ./"$LOG_NAMES"/ || echo "No log files could be found" +mv *apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found" +mv *pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found" echo "Copying the profiling files..." -cp -r prof ./"$LOG_NAMES"/prof || echo "No profile files could be found" +mv -r prof ./"$LOG_NAMES"/prof || echo "No profile files could be found" echo "Copying the JSONL files..." -cp *.jsonl ./"$LOG_NAMES"/ || echo "No JSONL files could be found" +mv *.jsonl ./"$LOG_NAMES"/ || echo "No JSONL files could be found" ls -la ./"$LOG_NAMES" diff --git a/.ci/collect_mapdl_logs_remote.sh b/.ci/collect_mapdl_logs_remote.sh index eaaa0accea..4dfce9188f 100755 --- a/.ci/collect_mapdl_logs_remote.sh +++ b/.ci/collect_mapdl_logs_remote.sh @@ -3,25 +3,22 @@ if [[ $MAPDL_VERSION == *"ubuntu"* ]] ; then echo "It is an ubuntu based image" export FILE=/jobs/file export WDIR='/jobs/' - else echo "It is a CentOS based image" export FILE=file export WDIR="" - fi; - mkdir "$LOG_NAMES" && echo "Successfully generated directory $LOG_NAMES" #### echo "Collecting MAPDL logs..." (docker exec "$MAPDL_INSTANCE" /bin/bash -c "mkdir -p /mapdl_logs && echo 'Successfully created directory inside docker container'") || echo "Failed to create a directory inside docker container for logs." -(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.out' > /dev/null ;then cp -f /file*.out /mapdl_logs && echo 'Successfully copied out files.'; fi") || echo "Failed to copy the 'out' files into a local file" -(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.err' > /dev/null ;then cp -f /file*.err /mapdl_logs && echo 'Successfully copied err files.'; fi") || echo "Failed to copy the 'err' files into a local file" -(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.log' > /dev/null ;then cp -f /file*.log /mapdl_logs && echo 'Successfully copied log files.'; fi") || echo "Failed to copy the 'log' files into a local file" -(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$WDIR*.crash' > /dev/null ;then cp -f /*.crash /mapdl_logs && echo 'Successfully copied crash files.'; fi") || echo "Failed to copy the 'crash' files into a local file" +(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.out' > /dev/null ;then mv -f /file*.out /mapdl_logs && echo 'Successfully moved out files.'; fi") || echo "Failed to move the 'out' files into a local file" +(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.err' > /dev/null ;then mv -f /file*.err /mapdl_logs && echo 'Successfully moved err files.'; fi") || echo "Failed to move the 'err' files into a local file" +(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.log' > /dev/null ;then mv -f /file*.log /mapdl_logs && echo 'Successfully moved log files.'; fi") || echo "Failed to move the 'log' files into a local file" +(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$WDIR*.crash' > /dev/null ;then mv -f /*.crash /mapdl_logs && echo 'Successfully moved crash files.'; fi") || echo "Failed to move the 'crash' files into a local file" docker cp "$MAPDL_INSTANCE":/mapdl_logs/. ./"$LOG_NAMES"/. || echo "Failed to copy the 'log-build-docs' files into a local directory" @@ -29,17 +26,17 @@ docker cp "$MAPDL_INSTANCE":/mapdl_logs/. ./"$LOG_NAMES"/. || echo "Failed to co echo "Collecting local build logs..." echo "Collecting docker run log..." -cp log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found." +mv log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found." -echo "Copying docker launch log..." -cp mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found." -cp mapdl_launch_1.log ./"$LOG_NAMES"/mapdl_launch_1.log || echo "MAPDL launch docker log not found." +echo "Moving docker launch log..." +mv mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found." +mv mapdl_launch_1.log ./"$LOG_NAMES"/mapdl_launch_1.log || echo "MAPDL launch docker log not found." -echo "Copying the profiling files..." -cp -r prof ./"$LOG_NAMES"/prof || echo "No profile files could be found" +echo "Moving the profiling files..." +mv -r prof ./"$LOG_NAMES"/prof || echo "No profile files could be found" -echo "Copying the JSONL files..." -cp *.jsonl ./"$LOG_NAMES"/ || echo "No JSONL files could be found" +echo "Moving the JSONL files..." +mv *.jsonl ./"$LOG_NAMES"/ || echo "No JSONL files could be found" echo "Collecting file structure..." ls -R > ./"$LOG_NAMES"/files_structure.txt || echo "Failed to copy file structure to a file" From c88cb4608cce87ea9cdc0b988eacfdfafeedcf44 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 7 May 2025 17:27:52 +0200 Subject: [PATCH 09/19] fix: update log file handling to create directories before moving files in local and remote scripts --- .ci/collect_mapdl_logs_locals.sh | 3 ++- .ci/collect_mapdl_logs_remote.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/collect_mapdl_logs_locals.sh b/.ci/collect_mapdl_logs_locals.sh index 039185c5e5..40615bfae0 100755 --- a/.ci/collect_mapdl_logs_locals.sh +++ b/.ci/collect_mapdl_logs_locals.sh @@ -7,7 +7,8 @@ mv *apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found" mv *pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found" echo "Copying the profiling files..." -mv -r prof ./"$LOG_NAMES"/prof || echo "No profile files could be found" +mkdir -p ./"$LOG_NAMES"/prof +mv prof/* ./"$LOG_NAMES"/prof || echo "No profile files could be found" echo "Copying the JSONL files..." mv *.jsonl ./"$LOG_NAMES"/ || echo "No JSONL files could be found" diff --git a/.ci/collect_mapdl_logs_remote.sh b/.ci/collect_mapdl_logs_remote.sh index 4dfce9188f..7e676adc8f 100755 --- a/.ci/collect_mapdl_logs_remote.sh +++ b/.ci/collect_mapdl_logs_remote.sh @@ -33,7 +33,8 @@ mv mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch do mv mapdl_launch_1.log ./"$LOG_NAMES"/mapdl_launch_1.log || echo "MAPDL launch docker log not found." echo "Moving the profiling files..." -mv -r prof ./"$LOG_NAMES"/prof || echo "No profile files could be found" +mkdir -p ./"$LOG_NAMES"/prof +mv prof/* ./"$LOG_NAMES"/prof || echo "No profile files could be found" echo "Moving the JSONL files..." mv *.jsonl ./"$LOG_NAMES"/ || echo "No JSONL files could be found" From 23323c4192966f3cf236944dd6f50bd7791de178 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 11:39:48 +0200 Subject: [PATCH 10/19] fix: update tar command to remove files after compression in log collection scripts --- .ci/collect_mapdl_logs_locals.sh | 2 +- .ci/collect_mapdl_logs_remote.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/collect_mapdl_logs_locals.sh b/.ci/collect_mapdl_logs_locals.sh index 40615bfae0..a97332c967 100755 --- a/.ci/collect_mapdl_logs_locals.sh +++ b/.ci/collect_mapdl_logs_locals.sh @@ -16,4 +16,4 @@ mv *.jsonl ./"$LOG_NAMES"/ || echo "No JSONL files could be found" ls -la ./"$LOG_NAMES" echo "Tar files..." -tar cvzf ./"$LOG_NAMES".tgz ./"$LOG_NAMES" || echo "Failed to compress" \ No newline at end of file +tar --remove-files -cvzf ./"$LOG_NAMES".tgz ./"$LOG_NAMES" || echo "Failed to compress" \ No newline at end of file diff --git a/.ci/collect_mapdl_logs_remote.sh b/.ci/collect_mapdl_logs_remote.sh index 7e676adc8f..20108a5ecd 100755 --- a/.ci/collect_mapdl_logs_remote.sh +++ b/.ci/collect_mapdl_logs_remote.sh @@ -46,4 +46,4 @@ echo "Collecting docker file structure..." docker exec "$MAPDL_INSTANCE" /bin/bash -c "ls -R" > ./"$LOG_NAMES"/docker_files_structure.txt || echo "Failed to copy the docker structure into a local file" echo "Tar files..." -tar cvzf ./"$LOG_NAMES".tgz ./"$LOG_NAMES" || echo "Failed to compress" \ No newline at end of file +tar --remove-files -cvzf ./"$LOG_NAMES".tgz ./"$LOG_NAMES" || echo "Failed to compress" \ No newline at end of file From 14ffaddb8929d83d9e726f25672805e56b51d2e7 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 11:55:37 +0200 Subject: [PATCH 11/19] fix: update pytest arguments to exclude logs on passed tests in local and remote workflows --- .github/workflows/test-local.yml | 2 +- .github/workflows/test-remote.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index 340ff4d8d1..279c1eb6a6 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -120,7 +120,7 @@ jobs: TESTING_MINIMAL: ${{ inputs.testing-minimal }} P_SCHEMA: "/ansys_inc/v241/ansys/ac4/schema" PYTEST_TIMEOUT: 120 # seconds. Limit the duration for each unit test - PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile' + PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests' OMPI_ALLOW_RUN_AS_ROOT: 1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 diff --git a/.github/workflows/test-remote.yml b/.github/workflows/test-remote.yml index 4981883947..0ba2f081e8 100644 --- a/.github/workflows/test-remote.yml +++ b/.github/workflows/test-remote.yml @@ -63,7 +63,7 @@ jobs: PYMAPDL_DB_PORT2: 21003 # default won't work on GitHub runners DPF_PORT: 21004 DPF_START_SERVER: False - PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile' + PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests' MAPDL_PACKAGE: ghcr.io/ansys/mapdl steps: From 34ed6fdd847f4d849ef3bbac18fcf03ee2052457 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 12:23:54 +0200 Subject: [PATCH 12/19] fix: add disk usage checks for runner directories in local testing workflow --- .github/workflows/test-local.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index 279c1eb6a6..f0d809abef 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -153,6 +153,11 @@ jobs: echo "Disk usage in /usr:" du -shx /usr/* || echo "Failed to get disk usage" + echo "Disk usage for the runner:" + du -shx /__e/* || echo "Failed to get disk usage" + du -shx /__w/* || echo "Failed to get disk usage" + du -shx /__t/* || echo "Failed to get disk usage" + - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 with: @@ -329,3 +334,8 @@ jobs: echo "Disk usage in /usr:" du -shx /usr/* || echo "Failed to get disk usage" + + echo "Disk usage for the runner:" + du -shx /__e/* || echo "Failed to get disk usage" + du -shx /__w/* || echo "Failed to get disk usage" + du -shx /__t/* || echo "Failed to get disk usage" From 1731c67055d4ebd93014f42565333cce00972831 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 12:50:52 +0200 Subject: [PATCH 13/19] fix: add disk usage check for CodeQL directory in local testing workflow --- .github/workflows/test-local.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index f0d809abef..cc10c16d97 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -157,6 +157,7 @@ jobs: du -shx /__e/* || echo "Failed to get disk usage" du -shx /__w/* || echo "Failed to get disk usage" du -shx /__t/* || echo "Failed to get disk usage" + du -shx /__t/CodeQL/* || echo "Failed to get disk usage" - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 @@ -339,3 +340,4 @@ jobs: du -shx /__e/* || echo "Failed to get disk usage" du -shx /__w/* || echo "Failed to get disk usage" du -shx /__t/* || echo "Failed to get disk usage" + du -shx /__t/CodeQL/* || echo "Failed to get disk usage" From 28ccacc37ac8e5d416ce41e4bb25b0fcbffc5112 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 13:09:02 +0200 Subject: [PATCH 14/19] fix: remove CodeQL directory after disk usage check in local testing workflow --- .github/workflows/test-local.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index cc10c16d97..abcd1f4ad5 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -159,6 +159,9 @@ jobs: du -shx /__t/* || echo "Failed to get disk usage" du -shx /__t/CodeQL/* || echo "Failed to get disk usage" + echo "Deleting CodeQL" + rm -rf /__t/CodeQL + - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 with: From a943ba6c5adf0a149d831dd37dd9418225f813be Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 13:09:56 +0200 Subject: [PATCH 15/19] fix: enhance disk usage reporting and cleanup for CodeQL directory in local testing workflow --- .github/workflows/test-local.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index abcd1f4ad5..f40f4aa63a 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -159,8 +159,11 @@ jobs: du -shx /__t/* || echo "Failed to get disk usage" du -shx /__t/CodeQL/* || echo "Failed to get disk usage" - echo "Deleting CodeQL" + echo "Deleting CodeQL..." rm -rf /__t/CodeQL + + echo "Disk space:" + df -h - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 From cfa510d31a8c1062f8b078ed762f49341814bc4b Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 13:30:42 +0200 Subject: [PATCH 16/19] fix: streamline disk usage reporting and cleanup for CodeQL directory in local testing workflow --- .github/workflows/test-local.yml | 53 +++----------------------------- 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index f40f4aa63a..15a3ae275c 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -132,36 +132,12 @@ jobs: password: ${{ secrets.token }} steps: - - name: "Show space consumption" + - name: "Freeing some space and show space consumption (pre-test)" shell: bash run: | - echo "Disk space:" - df -h - - echo "" - echo "Disk usage" - echo "==========" - echo "Disk usage in current directory:" - du -shx . || echo "Failed to get disk usage" - - echo "Disk usage in /home:" - du -shx /home/* || echo "Failed to get disk usage" - - echo "Disk usage root /:" - du -shx /* || echo "Failed to get disk usage" - - echo "Disk usage in /usr:" - du -shx /usr/* || echo "Failed to get disk usage" - - echo "Disk usage for the runner:" - du -shx /__e/* || echo "Failed to get disk usage" - du -shx /__w/* || echo "Failed to get disk usage" - du -shx /__t/* || echo "Failed to get disk usage" - du -shx /__t/CodeQL/* || echo "Failed to get disk usage" - echo "Deleting CodeQL..." - rm -rf /__t/CodeQL - + rm -rf /__t/CodeQL || echo "CodeQL not found" + echo "Disk space:" df -h @@ -322,28 +298,9 @@ jobs: name: ${{ inputs.file-name }}.xml path: ./${{ inputs.file-name }}.xml - - name: "Show space consumption" + - name: "Show space consumption (post-test)" + if: always() shell: bash run: | echo "Disk space:" df -h - echo "" - echo "Disk usage" - echo "==========" - echo "Disk usage in current directory:" - du -shx * || echo "Failed to get disk usage" - - echo "Disk usage in /home:" - du -shx /home/* || echo "Failed to get disk usage" - - echo "Disk usage root /:" - du -shx /* || echo "Failed to get disk usage" - - echo "Disk usage in /usr:" - du -shx /usr/* || echo "Failed to get disk usage" - - echo "Disk usage for the runner:" - du -shx /__e/* || echo "Failed to get disk usage" - du -shx /__w/* || echo "Failed to get disk usage" - du -shx /__t/* || echo "Failed to get disk usage" - du -shx /__t/CodeQL/* || echo "Failed to get disk usage" From e5a848d693405fc1c401c7ba317ff0d978c3db15 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 13:40:10 +0200 Subject: [PATCH 17/19] chore: Update .ci/collect_mapdl_logs_remote.sh Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .ci/collect_mapdl_logs_remote.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/collect_mapdl_logs_remote.sh b/.ci/collect_mapdl_logs_remote.sh index 20108a5ecd..238ce78ea7 100755 --- a/.ci/collect_mapdl_logs_remote.sh +++ b/.ci/collect_mapdl_logs_remote.sh @@ -18,7 +18,7 @@ echo "Collecting MAPDL logs..." (docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.out' > /dev/null ;then mv -f /file*.out /mapdl_logs && echo 'Successfully moved out files.'; fi") || echo "Failed to move the 'out' files into a local file" (docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.err' > /dev/null ;then mv -f /file*.err /mapdl_logs && echo 'Successfully moved err files.'; fi") || echo "Failed to move the 'err' files into a local file" (docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.log' > /dev/null ;then mv -f /file*.log /mapdl_logs && echo 'Successfully moved log files.'; fi") || echo "Failed to move the 'log' files into a local file" -(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$WDIR*.crash' > /dev/null ;then mv -f /*.crash /mapdl_logs && echo 'Successfully moved crash files.'; fi") || echo "Failed to move the 'crash' files into a local file" +(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$WDIR*.crash' > /dev/null ;then mv -f $WDIR*.crash /mapdl_logs && echo 'Successfully moved crash files.'; fi") || echo "Failed to move the 'crash' files into a local file" docker cp "$MAPDL_INSTANCE":/mapdl_logs/. ./"$LOG_NAMES"/. || echo "Failed to copy the 'log-build-docs' files into a local directory" From 42cbf76f1095262875c90b2bf4f22d5365028438 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Thu, 8 May 2025 11:41:02 +0000 Subject: [PATCH 18/19] chore: adding changelog file 3900.fixed.md [dependabot-skip] --- doc/changelog.d/3900.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/3900.fixed.md b/doc/changelog.d/3900.fixed.md index 86e886f685..2484ed8b50 100644 --- a/doc/changelog.d/3900.fixed.md +++ b/doc/changelog.d/3900.fixed.md @@ -1 +1 @@ -fix: reducing space consumption in github runners \ No newline at end of file +fix: reducing space consumption in GitHub runners \ No newline at end of file From d92ab8d2d5f2eeef4c6484cf28fc0c6191b997b7 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 8 May 2025 13:41:41 +0200 Subject: [PATCH 19/19] fix: add pre-test and post-test disk space reporting and cleanup for CodeQL directory --- .github/workflows/test-remote.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-remote.yml b/.github/workflows/test-remote.yml index 0ba2f081e8..af91700358 100644 --- a/.github/workflows/test-remote.yml +++ b/.github/workflows/test-remote.yml @@ -67,6 +67,15 @@ jobs: MAPDL_PACKAGE: ghcr.io/ansys/mapdl steps: + - name: "Freeing some space and show space consumption (pre-test)" + shell: bash + run: | + echo "Deleting CodeQL..." + rm -rf /__t/CodeQL || echo "CodeQL not found" + + echo "Disk space:" + df -h + - name: "Install Git and checkout project" uses: actions/checkout@v4.2.2 @@ -263,4 +272,11 @@ jobs: LOG_NAMES: logs-${{ inputs.file-name }} shell: bash run: | - .ci/display_logs_remote.sh \ No newline at end of file + .ci/display_logs_remote.sh + + - name: "Show space consumption (post-test)" + if: always() + shell: bash + run: | + echo "Disk space:" + df -h