Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get additional workflow information about diskspace #29705

Merged
5 changes: 5 additions & 0 deletions .github/actions/checkout-submodules-and-bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ inputs:
runs:
using: "composite"
steps:
- name: Dump disk info
uses: ./.github/actions/dump-disk-info
- name: Checkout submodules
uses: ./.github/actions/checkout-submodules
with:
Expand All @@ -26,6 +28,9 @@ runs:
uses: ./.github/actions/bootstrap
with:
platform: ${{ inputs.platform }}
- name: Dump disk info after checkout submodule & Bootstrap
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
run: scripts/dump_diskspace_info.sh
- name: Upload Bootstrap Logs
uses: ./.github/actions/upload-bootstrap-logs
with:
Expand Down
20 changes: 20 additions & 0 deletions .github/actions/dump-disk-info/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Dump disk space info
description: Help debug running out of disk space on github CI
runs:
using: "composite"
tehampson marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Collect disk info
# Unfortunately current syntax for github wrapper actions only work for
# Javascript actions, and Docker container actions, which doesn't make it
# possible to wrap a shell script like the one below. The action below
# essentially wraps the shell commands we want to run into a Javascript
# wrapped action. This allow us to get the disk info usage before a job
# is run and after the job is run regardless if the job succeeds or
# fails.
uses: pyTooling/Actions/[email protected]
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ runner.os == 'Linux' }}
with:
main: |-
exec ./scripts/dump_diskspace_info.sh
post: |-
exec ./scripts/dump_diskspace_info.sh
42 changes: 42 additions & 0 deletions scripts/dump_diskspace_info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
#
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This script is meant to run in github CI to dump information related to
# disk space usage. Currently there is a heisenbug related to running out
# of disk space. Dumping information below might help us get a better
# understanding of how disk space is used in github CI.

echo "Disk Space Usage:"
df -h

listOfDirectories=("third_party/" ".environment/" "out/")

pipCacheDir=$(python -m pip cache dir)
exitcode=$?

if [ "$exitcode" -eq 0 ]; then
listOfDirectories+=("$pipCacheDir")
fi

echo
echo "Storage Space Used By Key Directories:"
for directory in "${listOfDirectories[@]}"; do
if [ -d "$directory" ]; then
du -d1 -h "$directory" | sort -h
echo
fi
done
Loading