Skip to content

Commit a712c1d

Browse files
europaulOhmSpectator
authored andcommitted
tar the whole of /persist/eve-info
When an Eden CI workflow fails, we run collect-info.sh and include the tar ball in the CI artifacts. However, there might be many relevant collect-info archives in /persist/eve-info, so we need to tar the whole directory instead. Signed-off-by: Paul Gaiduk <paulg@zededa.com>
1 parent 4ff06a1 commit a712c1d

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

.github/actions/publish-logs/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ runs:
4848
with:
4949
name: ${{ inputs.report_name }}
5050
path: |
51+
${{ github.workspace }}/eden/eve-info.tar
5152
${{ github.workspace }}/eden/eve-info.tar.gz
5253
${{ github.workspace }}/eden/trace.log
5354
${{ github.workspace }}/eden/info.log

.github/workflows/eden_gcp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ jobs:
167167
with:
168168
name: eden-report-${{ matrix.hv }}-${{ matrix.fs }}
169169
path: |
170+
${{ github.workspace }}/eve-info.tar
170171
${{ github.workspace }}/eve-info.tar.gz
171172
${{ github.workspace }}/trace.log
172173
${{ github.workspace }}/info.log

shell-scripts/collect-info-console.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# is unable to do the same via SSH tunnel.
77

88
# Use output filename without colon, otherwise Github action "upload-artifact" complains.
9-
OUTPUT="eve-info.tar.gz"
9+
OUTPUT="eve-info.tar"
1010

1111
# 20 seconds should be enough for collect-info.sh to prepare tarball with debug info
1212
# if run locally on a solid machine. However, on Github runners, it can take up to 2 minutes
@@ -38,22 +38,20 @@ done
3838

3939
for i in $(seq 3); do
4040
{
41-
echo "rm -rf /persist/eve-info*"; echo "/usr/bin/collect-info.sh";
41+
echo "/usr/bin/collect-info.sh";
4242
sleep $((WAIT_TIME+60*(i-1)))
4343
} | telnet 127.1 "${CONSOLE_PORT}" | tee telnet.stdout
44-
TGZNAME="$(sed -n "s/EVE info is collected '\(.*\)'/\1/p" telnet.stdout)"
45-
[ -n "${TGZNAME}" ] && break
44+
grep -q "EVE info is collected" telnet.stdout && break
4645
done
4746

48-
if [ -z "${TGZNAME}" ]; then
49-
echo "Failed to run collect-info.sh script"
50-
exit 1
51-
fi
52-
47+
# We stream the tarball content to stdout, so we can read it
48+
# and decode it in one go.
49+
# The tarball is base64 encoded to avoid issues with binary data.
50+
# The streaming can take a while, so we retry a few times.
51+
# If that still doesn't help we need to consider a different approach.
5352
for i in $(seq 3); do
5453
{
55-
echo "TGZNAME=$TGZNAME";
56-
echo "base64 -w 0 \$TGZNAME > /persist/eve-info.base64"
54+
echo "tar -C /persist -cf - eve-info | base64 -w 0 > /persist/eve-info.base64";
5755
echo "echo \>\>\>\$(cat /persist/eve-info.base64)\<\<\<";
5856
sleep $((WAIT_TIME+60*(i-1)))
5957
} | telnet 127.1 "${CONSOLE_PORT}" | sed -n "s/>>>\(.*\)<<</\1/p" | base64 -id > "${OUTPUT}"

shell-scripts/collect-info-ssh.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#/bin/sh
1+
#!/bin/sh
22

33
# Use output filename without colon, otherwise Github action "upload-artifact" complains.
4-
OUTPUT="eve-info.tar.gz"
4+
OUTPUT="eve-info.tar"
55

66
ssh() {
77
./eden sdn fwd eth0 22 --\
@@ -45,17 +45,11 @@ if [ $? -ne 0 ]; then
4545
exit 1
4646
fi
4747

48-
TGZNAME="$(cat ssh.stdout | sed -n "s/EVE info is collected '\(.*\)'/\1/p")"
49-
if [ -z "${TGZNAME}" ]; then
50-
echo "Failed to parse eve-info tarball filename"
51-
exit 1
52-
fi
53-
54-
scp "${TGZNAME}" ${OUTPUT}
48+
ssh "tar -C /persist -cf - eve-info" > "${OUTPUT}"
5549
if [ $? -ne 0 ]; then
5650
echo "Failed to receive eve-info"
5751
exit 1
5852
fi
5953

6054
FILESIZE="$(stat -c%s "$OUTPUT")"
61-
echo "Received ${OUTPUT} with size ${FILESIZE}"
55+
echo "Received ${OUTPUT} with size ${FILESIZE}"

0 commit comments

Comments
 (0)