Skip to content

Commit

Permalink
Get additional workflow information about diskspace (#29705)
Browse files Browse the repository at this point in the history
* Get additional workflow information about diskspace

* Get even more diskspace usage info

* Initial attempt at collecting info on disk space within checkout submodule

* Fix CI issue

* Another attempt to get CI running workflow grabbing diskspace usage

* Couple other fixes

* Another attempt to get CI running

* Try this new approach

* quick fix

* Dump more info

* Few more touch ups

* quick fix

* Restyle

* Restyle

* quick fix

* quick fix
  • Loading branch information
tehampson authored and pull[bot] committed Oct 28, 2023
1 parent 577b477 commit 5585641
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
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
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"
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]
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

0 comments on commit 5585641

Please sign in to comment.