Skip to content
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

Conversation

wking
Copy link
Member

@wking wking commented Nov 4, 2020

Using exec and Bash's process substitution to redirect both stdout and stderr into tee. 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.

…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
@wking
Copy link
Member Author

wking commented Nov 4, 2020

/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.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2020
@wking wking force-pushed the include-gather-script-logs-in-gather-tarball branch from fc1da0c to ca3e038 Compare November 4, 2020 23:56
@wking
Copy link
Member Author

wking commented Nov 4, 2020

e2e-aws:

$ 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

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2020
Copy link
Contributor

@staebler staebler left a 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")
Copy link
Contributor

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?

Copy link
Member Author

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 ;).

@staebler
Copy link
Contributor

staebler commented Nov 5, 2020

/approve

@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 5, 2020
@patrickdillon
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

openshift-merge-robot commented Nov 5, 2020

@wking: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-crc ca3e038 link /test e2e-crc
ci/prow/e2e-ovirt ca3e038 link /test e2e-ovirt

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.

@openshift-merge-robot openshift-merge-robot merged commit c078307 into openshift:master Nov 5, 2020
@wking wking deleted the include-gather-script-logs-in-gather-tarball branch November 6, 2020 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants