Skip to content

Commit 800fcbe

Browse files
CI: add optional coredumps collection (#29233)
1 parent 2f387b8 commit 800fcbe

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/actions/build_and_test_ya/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ inputs:
5959
type: boolean
6060
default: false
6161
description: "add ya make vars with git info"
62+
collect_coredumps:
63+
type: boolean
64+
default: false
65+
description: "Collect coredumps via enabling ulimit -c unlimited"
6266
defaults:
6367
run:
6468
shell: bash
@@ -119,3 +123,4 @@ runs:
119123
telegram_ydbot_token: ${{ fromJSON( inputs.secs ).TELEGRAM_YDBOT_TOKEN || '' }}
120124
telegram_alert_logins: ${{ fromJSON( inputs.vars ).GH_ALERTS_TG_LOGINS || '' }}
121125
telegram_alert_chat: ${{ fromJSON( inputs.vars ).GH_ALERTS_TG_CHAT || '' }}
126+
collect_coredumps: ${{ inputs.collect_coredumps }}

.github/actions/test_ya/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ inputs:
7171
type: string
7272
required: false
7373
description: "Telegram alert chat"
74+
collect_coredumps:
75+
type: boolean
76+
default: false
77+
description: "Collect coredumps via enabling ulimit -c unlimited"
7478

7579
outputs:
7680
success:
@@ -145,11 +149,22 @@ runs:
145149
id: build
146150
shell: bash
147151
env:
152+
COLLECT_COREDUMPS: ${{ inputs.collect_coredumps }}
148153
TELEGRAM_BOT_TOKEN: ${{ inputs.telegram_ydbot_token }}
149154
GH_ALERTS_TG_LOGINS: ${{ inputs.telegram_alert_logins }}
150155
GH_ALERTS_TG_CHAT: ${{ inputs.telegram_alert_chat }}
151156
run: |
152157
set -ex
158+
159+
if [ "$COLLECT_COREDUMPS" = "true" ]; then
160+
sudo mkdir -p /coredumps
161+
sudo chmod 1777 /coredumps
162+
echo "/coredumps/%p.%s" | sudo tee /proc/sys/kernel/core_pattern
163+
ulimit -c unlimited
164+
else
165+
ulimit -c 0
166+
fi
167+
153168
echo "Artifacts will be uploaded [here](${PUBLIC_DIR_URL}/index.html)" | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py
154169
155170
# Save original HEAD before any git operations (checkout scripts, graph_compare, etc.)
@@ -387,6 +402,7 @@ runs:
387402
388403
monitor_memory() {
389404
set +x
405+
rm -f ram_usage.txt
390406
while true; do
391407
used_kb=$(grep -E 'MemTotal|MemAvailable' /proc/meminfo |
392408
awk 'NR==1{t=$2} NR==2{a=$2} END{print t - a}')

.github/workflows/run_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ on:
7777
- release-msan
7878
- release-tsan
7979
default: relwithdebinfo
80+
collect_coredumps:
81+
type: boolean
82+
default: false
83+
description: "Collect coredumps via ulimit -c unlimited"
8084

8185
jobs:
8286
prepare:
@@ -214,6 +218,7 @@ jobs:
214218
test_threads: ${{ fromJson(env.threads_count) }}
215219
custom_branch_name: ${{ matrix.branch }}
216220
put_build_results_to_cache: true
221+
collect_coredumps: ${{ inputs.collect_coredumps }}
217222
additional_ya_make_args: -DDEBUGINFO_LINES_ONLY ${{ inputs.additional_ya_make_args }}
218223
secs: ${{ format('{{"AWS_KEY_ID":"{0}","AWS_KEY_VALUE":"{1}","REMOTE_CACHE_USERNAME":"{2}","REMOTE_CACHE_PASSWORD":"{3}","TELEGRAM_YDBOT_TOKEN":"{4}"}}',
219224
secrets.AWS_KEY_ID, secrets.AWS_KEY_VALUE, secrets.REMOTE_CACHE_USERNAME, secrets.REMOTE_CACHE_PASSWORD, secrets.TELEGRAM_YDBOT_TOKEN ) }}

0 commit comments

Comments
 (0)