Skip to content

Commit

Permalink
ci-operator/step-registry/gather/aws-console: UTF-8 for output
Browse files Browse the repository at this point in the history
In recent CI, we have failed console gathers like [1]:

  Gathering console logs for i-026ba0637214cd027
  'ascii' codec can't encode character '\u2026' in position 14093: ordinal not in range(128)
  Failed to gather console logs

This is descended from d060927 (gather/aws-console: Make log
gathering non-fatal, 2021-04-14, openshift#17735).  But we want to gather these
logs, not silently fail to gather the logs.  This commit restores our
old "fail the step when we fail to gather" behavior, and sets
PYTHONIOENCODING [2] to ask for UTF-8 instead of ASCII output.

[1]: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/periodic-ci-openshift-[…]e2e-aws-serial/gather-aws-console/build-log.txt
[2]: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONIOENCODING
  • Loading branch information
wking committed Jun 29, 2021
1 parent 7384a78 commit 24b834c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ REGION="$(jq -r .aws.region "${SHARED_DIR}/metadata.json")"
cat "${TMPDIR}/node-provider-IDs.txt" | sort | uniq | while read -r INSTANCE_ID
do
echo "Gathering console logs for ${INSTANCE_ID}"
aws --region "${REGION}" ec2 get-console-output --instance-id "${INSTANCE_ID}" --output text > "${ARTIFACT_DIR}/${INSTANCE_ID}" || echo "Failed to gather console logs"
PYTHONIOENCODING=UTF-8:backslashreplace aws --region "${REGION}" ec2 get-console-output --instance-id "${INSTANCE_ID}" --output text > "${ARTIFACT_DIR}/${INSTANCE_ID}" &
wait "$!"
done

0 comments on commit 24b834c

Please sign in to comment.