kou commented on code in PR #36948:
URL: https://github.com/apache/arrow/pull/36948#discussion_r1279841194


##########
dev/tasks/macros.jinja:
##########
@@ -72,6 +72,58 @@ on:
     run: pip install -e arrow/dev/archery[all]
 {% endmacro %}
 
+{%- macro github_free_space() -%}
+  - name: Free up disk space
+    if: runner.os == 'Linux' && runner.arch == 'X64'
+    shell: bash
+    run: |
+      df -h
+      echo "::group::/usr/local/*"
+      du -hsc /usr/local/*
+      echo "::endgroup::"
+      echo "::group::/usr/local/bin/*"
+      du -hsc /usr/local/bin/*
+      echo "::endgroup::"
+      # ~1GB (From 1.2GB to 214MB)
+      sudo rm -rf \
+        /usr/local/bin/aliyun \
+        /usr/local/bin/azcopy \
+        /usr/local/bin/bicep \
+        /usr/local/bin/cmake-gui \
+        /usr/local/bin/cpack \
+        /usr/local/bin/helm \
+        /usr/local/bin/hub \
+        /usr/local/bin/kubectl \
+        /usr/local/bin/minikube \
+        /usr/local/bin/node \
+        /usr/local/bin/packer \
+        /usr/local/bin/pulumi* \
+        /usr/local/bin/stack \
+        /usr/local/bin/terraform || :
+      echo "::group::/usr/local/share/*"
+      du -hsc /usr/local/share/*
+      echo "::endgroup::"
+      # 1.3GB
+      sudo rm -rf /usr/local/share/powershell || :
+      echo "::group::/opt/*"
+      du -hsc /opt/*
+      echo "::endgroup::"
+      echo "::group::/opt/hostedtoolcache/*"
+      du -hsc /opt/hostedtoolcache/*
+      echo "::endgroup::"
+      # 5.3GB
+      sudo rm -rf /opt/hostedtoolcache/CodeQL || :
+      # 1.4GB
+      sudo rm -rf /opt/hostedtoolcache/go || :
+      # 489MB
+      sudo rm -rf /opt/hostedtoolcache/PyPy || :
+      # 1.2GB
+      sudo rm -rf /opt/hostedtoolcache/Python || :

Review Comment:
   We may want to remove this because we may use Python.
   If we remove this, `actions/setup-python` in `github_install_archery()` 
installs Python again: 
https://github.com/ursacomputing/crossbow/actions/runs/5712991537/job/15477525540#step:12:19
   
   ```text
     Version 3.8 was not found in the local cache
     Version 3.8 is available for downloading
     ...
   ```
   
   Not removed version: 
https://github.com/ursacomputing/crossbow/actions/runs/5709205224/job/15467716582#step:3:11
   
   ```text
   Installed versions
     Successfully set up CPython (3.8.17)
   ```
   
   Instead, we may want to remove Web browser packages like conda jobs did: 
https://github.com/apache/arrow/commit/8503c869fa80090bc849bae0b4e68a84605ea82e#diff-9372dd702cbd1bef1675f96403f530f0bef824a367b7debb68fd6db6c10e0cbdR30-R32
   
   ```text
           sudo apt-get purge -y -f firefox \
                                     google-chrome-stable \
                                     microsoft-edge-stable
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to