-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
data/bootstrap/files/usr/local/bin/installer-gather: Tee logs into tarball #4345
data/bootstrap/files/usr/local/bin/installer-gather: Tee logs into tarball #4345
Conversation
…rball Using exec [1] and Bash's process substitution [2] to redirect both stdout and stderr into tee [3]. 'tee' will copy them to the original stdout, and will also write them to a file in the artifacts directory. The artifacts directory is subsequently tarred up, and the tarball will contain the tee-written copy of the script's logs. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#exec [2]: https://www.gnu.org/software/bash/manual/html_node/Process-Substitution.html#Process-Substitution [3]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/tee.html
/hold I've added a debugging commit to kill the install so we collect a log tarball and can confirm this is working. We don't want it to land until we have confirmed success and dropped the debug commit. |
fc1da0c
to
ca3e038
Compare
$ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_installer/4345/pull-ci-openshift-installer-master-e2e-aws/1324096540758773760/artifacts/e2e-aws/ipi-install-install/log-bundle-20201104213542.tar >log-bundle.tar.gz
$ tar tz <log-bundle.tar.gz | grep gather.log
log-bundle-20201104213542/gather.log
$ tar xOz log-bundle-20201104213542/gather.log <log-bundle.tar.gz
Gathering bootstrap systemd summary ...
Gathering bootstrap failed systemd unit status ...
Gathering bootstrap journals ...
Gathering bootstrap containers ...
Gathering rendered assets...
rm: cannot remove '/tmp/artifacts-20201104213542/rendered-assets/openshift/etcd-bootstrap/bootstrap-manifests/secrets': Is a directory
Gathering cluster resources ...
Waiting for logs ...
Gather remote logs
Collecting info from 10.0.157.235
Warning: Permanently added '10.0.157.235' (ECDSA) to the list of known hosts.
Gathering master systemd summary ...
Gathering master failed systemd unit status ...
Gathering master journals ...
Gathering master containers ...
Waiting for logs ...
Collecting info from 10.0.252.152
Warning: Permanently added '10.0.252.152' (ECDSA) to the list of known hosts.
Gathering master systemd summary ...
Gathering master failed systemd unit status ...
Gathering master journals ...
Gathering master containers ...
Waiting for logs ...
Collecting info from 10.0.170.169
Warning: Permanently added '10.0.170.169' (ECDSA) to the list of known hosts.
Gathering master systemd summary ...
Gathering master failed systemd unit status ...
Gathering master journals ...
Gathering master containers ...
Waiting for logs ... Which looks like the gather portion of the installer's logs. I've dropped the debugging commit with fc1da0c -> ca3e038. /hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@@ -9,6 +9,8 @@ fi | |||
ARTIFACTS="/tmp/artifacts-${GATHER_ID}" | |||
mkdir -p "${ARTIFACTS}" | |||
|
|||
exec &> >(tee "${ARTIFACTS}/gather.log") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this esoteric enough to warrant a comment explaining what it is doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly, but the comment is in the commit message where git blame
will find it and everyone else can skim over it ;).
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: staebler The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
@wking: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Using
exec
and Bash's process substitution to redirect both stdout and stderr intotee
.tee
will copy them to the original stdout, and will also write them to a file in the artifacts directory. The artifacts directory is subsequently tarred up, and the tarball will contain the tee-written copy of the script's logs.